Returning Most Recently Updated Custom Object | Community
Skip to main content
New Participant
July 2, 2018
Solved

Returning Most Recently Updated Custom Object

  • July 2, 2018
  • 1 reply
  • 2571 views

I briefly touched on this with @Sanford Whiteman​'s help onSorting a Marketo Custom Object with Velocity​ but we're now looking for a work-around due to Marketo not supporting $Trigger functionality on updated custom objects.

Trigger Campaign: Send email containing login details when an API call either adds the Contact to or Updates a Marketo custom object

Email Script: Only return the $Object.Username associated with the most recently updated row in the custom object

We can either reference the Last Modified Date (which is pull from the original data source) or the Marketo Updated At field. I'm assuming we would do a sort and pick the most recent value from either field.

Does anyone have any example scripts we could pull from? Appreciate the help in advance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Have you seen this older blog post, Wyatt? Velocitip: Find the interesting object in Trigger and Batch modes

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
July 2, 2018
WyattBaAuthor
New Participant
July 3, 2018

Thanks, @Sanford Whiteman​. I was able to get it to work great. You can ignore my response on your forum. If the user has cookies disabled on that site, responses don't play nice because you have to login.

#if( $context.contains("TriggerObject") )

#set( $focusedObject = $TriggerObject )

$focusedObject.loginfield

#elseif( $context.contains("CustomObject_cList") )

#set( $focusedObject = $sorter.sort($CustomObject_cList,"updatedAt:desc")[0] )

$focusedObject.loginfield

#end