Rules Engine: Allowing rules to sort by the newest entry in a table

Related products: CS Rules & Permissions

Clients would like to be able to take the newest entry in a table and export that data into further aggregation.





For example:


(12:30am) Jan15 25k


(2:30am)   Jan15 30k


(5:00pm)   Jan15 60k 





(12:30am) Jan16 29k


(2:30am)   Jan16 42k


(5:00pm)   Jan16 77k





Be able to grab only the latest entry (5:00PM) and use that data to update the field for that date. This is useful if clients have scripts updating certain fields multiple times per day, but only the last entry is needed to summarize the date's data.
This is possible by putting the date field as the first field in the show fields. The first show field is sorted by ascending order, so when it writes to the same destination, only the last value will remain, thereby leaving the latest record's values at destination.
Hi Sundar,





I'm the client Logan was helping - I didn't follow your answer - what did you mean by 'first field in the show fields'?


When is the sort happening?


What write are you referring too?





Thanks so much,





Alison
Probably should have put my clarifying questions here... I didn't follow your answer. How would I actually do this?
I have put opportunity close date as the first field under Show in Setup Rule screen.








When you do a test run you will see that it will return the results like this








Now when I have an action "Load to Customer", you will find that the latest value in each account will be the final data you see. 





Try this out and let me know if it works.
Thanks... looking hopeful that this will work... thanks
Using a date time field didn't work as the date times were detected as different entries needing different fields.


I am now trying with a date_only field and am finding its not working.... do I need to use upsert insert or update in the rule action?


are there any other tricks to this?
Alison - Are you looking at result in Rules preview result or from the test run's excel attachment? The sorting is not applied in the Rules preview result but in the attachment and actual rule execution it is applied. 





Can you put through a support ticket if you are not able to get this working?