SOLVED

Velocity Scripting for Contact Records with Multiple Opportunities

Go to solution
Lcornejo
Level 1

Velocity Scripting for Contact Records with Multiple Opportunities

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!!

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity Scripting for Contact Records with Multiple Opportunities


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.

 

View solution in original post

1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity Scripting for Contact Records with Multiple Opportunities


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.