SOLVED

Re: Lead/Person with multiple Opportunities

Go to solution
Anonymous
Not applicable

Lead/Person with multiple Opportunities

Hello,

Can someone confirm this?

In our business, a Contact can have multiple Opportunities and we use Opportunity records extensively. However we found an issues for leads that have multiple Opps when sending email that has tokens.

Example: a lead has 2 opportunities. Opportunity: A & B, Opp B is qualify for a smart campaign, and flow step is to send out an email (email has token in it). When the email is sent out, it use Opp A as the reference, thus the token in the email is populating from Opp A data, not Opp B.

If this is the case, is there any workaround? Again we use Opp record extensively and email script token in our email is crucial.

I know my explanation is not perfect, but do let me know if you need more clarification.

1 ACCEPTED SOLUTION

Accepted Solutions
Grégoire_Miche2
Level 10

Re: Lead/Person with multiple Opportunities

Hi Billy,

Indeed, the way you script is developed is the problem (sorry for being blunt).

This line of code indeed retrieves the 1st opportunity. It should retreive them all, then browse them to filter and pick the appropriate one. It's a more sophisticated dev you need here to do what you want.

-Greg

View solution in original post

13 REPLIES 13
Grégoire_Miche2
Level 10

Re: Lead/Person with multiple Opportunities

Hi Billy,

The only way is to set up your script token with additional logic so that is can filter the right opportunity. The script can retrieve as much as 10 opportunities, which should hopefully be enough.

One of the trick is so set a value in a lead field, before sending the email. Then, in the script, you can use that field value as a filter to select the opportunity.

Also, vote here: , as if we could use programs tokens in scripts, it would make life easier.

-Greg

Anonymous
Not applicable

Re: Lead/Person with multiple Opportunities

it is filtering the right opportunity, that isn't the problem. Problem is when sending an email, it looks like Marketo will always look at the 1st Opp record attached to the Contact/Lead for reference.

Grégoire_Miche2
Level 10

Re: Lead/Person with multiple Opportunities

I do not understand what you are referring to here. Is you are talking about the velocity script token, it depends on how it is developed.

-Greg

Anonymous
Not applicable

Re: Lead/Person with multiple Opportunities

123.PNG

Does this answer your question? This sript token is included in several of our email. Again if a person has more than 1 Opp records, and when sending an email Marketo is using the first Opp attached as a reference, even though the second Opp is the one that qualify for the smart campaign.

Grégoire_Miche2
Level 10

Re: Lead/Person with multiple Opportunities

Hi Billy,

Indeed, the way you script is developed is the problem (sorry for being blunt).

This line of code indeed retrieves the 1st opportunity. It should retreive them all, then browse them to filter and pick the appropriate one. It's a more sophisticated dev you need here to do what you want.

-Greg

Anonymous
Not applicable

Re: Lead/Person with multiple Opportunities

Thanks Greg! I will reach out to our tech support consultant for assistance!

SanfordWhiteman
Level 10 - Community Moderator

Re: Lead/Person with multiple Opportunities

You should be referencing $TriggerObject. No need to iterate.

Grégoire_Miche2
Level 10

Re: Lead/Person with multiple Opportunities

Hi Sanford,

Only is the email is sent through a trigger

The use case described by Billy does not state whether or not this is the case.

-Greg

Anonymous
Not applicable

Re: Lead/Person with multiple Opportunities

it used in both trigger and batch campaigns. I will look into email script in trigger vs batch.

We just recently migrated to Marketo, thus i am not familiar with the limitation of Marketo just yet. Thanks for the input.