Skip to main content
Released

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

Related products:CS Rules Engine
jean.nairon
logan_t
alizee
  • jean.nairon
    jean.nairon
  • logan_t
    logan_t
  • alizee
    alizee

logan_t
  • Contributor ⭐️⭐️⭐️
  • 12 replies
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.

7 replies

sundar
  • Expert ⭐️
  • 534 replies
  • June 2, 2016
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.

alison
  • Contributor ⭐️⭐️
  • 4 replies
  • June 3, 2016
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

alison
  • Contributor ⭐️⭐️
  • 4 replies
  • June 3, 2016
Probably should have put my clarifying questions here... I didn't follow your answer. How would I actually do this?

sundar
  • Expert ⭐️
  • 534 replies
  • June 3, 2016
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.

alison
  • Contributor ⭐️⭐️
  • 4 replies
  • June 3, 2016
Thanks... looking hopeful that this will work... thanks

alison
  • Contributor ⭐️⭐️
  • 4 replies
  • July 29, 2016
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?

sundar
  • Expert ⭐️
  • 534 replies
  • August 3, 2016
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?

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings