Velocity Scripting for Contact Records with Multiple Opportunities | Community
Skip to main content
New Participant
May 8, 2023
Solved

Velocity Scripting for Contact Records with Multiple Opportunities

  • May 8, 2023
  • 1 reply
  • 1151 views

Hi Marketo Nation! 

 

I have use case where my business has multiple MIDs tied to a single contact record- this affects the trigger automated campaigns that we've created. If there's a contact record with multiple active opportunities at once, Marketo will pull the latest opportunity info tied to that contact record. Is there a way to use velocity scripting that can help Marketo select the correct opportunity for a specific trigger campaign?

 

 

Thank you!!

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

If there's a contact record with multiple active opportunities at once, Marketo will pull the latest opportunity info tied to that contact record.


“Will pull” isn’t really the best term. All Opportunities are present in Marketo. When you output Opportunity fields in an email, you always have a choice of which Oppty to target, whether it be the $TriggerObject (for trigger campaigns) or another one in the list (for any campaign).

 

If you want to filter by only the latest updated Opportunity (or earliest updated, or one matching another field) you can sort the list and/or #foreach over the list and filter matching items into a separate list.

 

There are lots of examples of Velocity logic in past posts — Oppties are no different from Custom Objects in this regard.

 

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
May 8, 2023

If there's a contact record with multiple active opportunities at once, Marketo will pull the latest opportunity info tied to that contact record.


“Will pull” isn’t really the best term. All Opportunities are present in Marketo. When you output Opportunity fields in an email, you always have a choice of which Oppty to target, whether it be the $TriggerObject (for trigger campaigns) or another one in the list (for any campaign).

 

If you want to filter by only the latest updated Opportunity (or earliest updated, or one matching another field) you can sort the list and/or #foreach over the list and filter matching items into a separate list.

 

There are lots of examples of Velocity logic in past posts — Oppties are no different from Custom Objects in this regard.