SOLVED

Records Updated at Same Time with Same Information - Send Trigger Separately

Go to solution
nhabischWings
Level 5

Records Updated at Same Time with Same Information - Send Trigger Separately

I apologize if this is similar to previous questions - but running into an occasional problem:


I have a script setup to basically send a "Welcome" email if someone becomes a Member - this looks at their Membership Date, Member Status, etc.

 

One thing that happens occasionally is that it's possible for multiple Members to be approved on the same day with the same Email Address (a major flaw with our system data-wise).

This means that if I've got multiple records in the Lead with the same:
01) Membership Opening Date
02) Membership Status

then my "#foreach" loop will obviously pull in each record that meets those criteria. That means using a "Updated Customer Profile Object" will send multiple emails to the same address with the multiple records data.

Is there any efficient way to basically say "if multiple records meet the criteria, only print ONE RECORD per email when triggered"? Or am I better off trying to have our data team delay the records updating and do something with the "UpdatedAt" field?

1 ACCEPTED SOLUTION

Accepted Solutions
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Records Updated at Same Time with Same Information - Send Trigger Separately


@nhabischWings wrote:

I apologize if this is similar to previous questions - but running into an occasional problem:


I have a script setup to basically send a "Welcome" email if someone becomes a Member - this looks at their Membership Date, Member Status, etc.

 

One thing that happens occasionally is that it's possible for multiple Members to be approved on the same day with the same Email Address (a major flaw with our system data-wise).

This means that if I've got multiple records in the Lead with the same:
01) Membership Opening Date
02) Membership Status


Couple of questions:

- When you say multiple records, do you mean multiple custom object records tied to a single person record in Marketo? Or multiple person records itself, aka - do you create duplicate person records in Marketo by any chance?

- Are Membership Opening Date and Membership Status custom fields on the custom object?

 

It may be obvious, but I am not able to figure out whether you're reading data from a custom object or fields on the person object directly.

 

I'm suspecting you're referencing data from a CO, and if that is the case, you can use $TriggerObject to reference fields of the CO record in velocity that triggered the campaign's flow in the first place (e.g., $TriggerObject.field1 would reference data in the field1 of the CO record that triggered the campaign). This way you'd not come across the situation of picking up/referencing data of the CO record linked with the same person record previously. Hope this helps.

 

View solution in original post

5 REPLIES 5
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Records Updated at Same Time with Same Information - Send Trigger Separately


@nhabischWings wrote:

I apologize if this is similar to previous questions - but running into an occasional problem:


I have a script setup to basically send a "Welcome" email if someone becomes a Member - this looks at their Membership Date, Member Status, etc.

 

One thing that happens occasionally is that it's possible for multiple Members to be approved on the same day with the same Email Address (a major flaw with our system data-wise).

This means that if I've got multiple records in the Lead with the same:
01) Membership Opening Date
02) Membership Status


Couple of questions:

- When you say multiple records, do you mean multiple custom object records tied to a single person record in Marketo? Or multiple person records itself, aka - do you create duplicate person records in Marketo by any chance?

- Are Membership Opening Date and Membership Status custom fields on the custom object?

 

It may be obvious, but I am not able to figure out whether you're reading data from a custom object or fields on the person object directly.

 

I'm suspecting you're referencing data from a CO, and if that is the case, you can use $TriggerObject to reference fields of the CO record in velocity that triggered the campaign's flow in the first place (e.g., $TriggerObject.field1 would reference data in the field1 of the CO record that triggered the campaign). This way you'd not come across the situation of picking up/referencing data of the CO record linked with the same person record previously. Hope this helps.

 

nhabischWings
Level 5

Re: Records Updated at Same Time with Same Information - Send Trigger Separately

Hello,

Referencing Custom Object records within a single Lead record with Membership Opening Date and Status as fields, similar to:

Email Address Membership Opening Date Membership Status

Bob@gmail.com

2023-03-28 Member
Bob@gmail.com 2023-03-28 Member

 

Would the trigger reference work if there's multiple records triggering simultaneously? The issue is due to multiple records within a Lead getting updated on the same date and essentially having more than one record within the Lead triggering the email chain but needing to reference each one individually.

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Records Updated at Same Time with Same Information - Send Trigger Separately

Gotcha! Thank you for this. I think using TriggerObject as I explained in my previous comment would help resolve the issue of picking the incorrect records in case there are multiple records associated with the same person.

 

nhabischWings
Level 5

Re: Records Updated at Same Time with Same Information - Send Trigger Separately

Thank you! I'll give it a try!

SanfordWhiteman
Level 10 - Community Moderator

Re: Records Updated at Same Time with Same Information - Send Trigger Separately

If multiple events would fire a trigger campaign at the same time, you can set the campaign to only let people qualify 1x/day.

 

But of course that won’t let you prioritize one $TriggerObject over another — when the 1st one fires, it can’t know the 2nd, more interesting one is about to fire.

 

Alternately, you could set up a (quite complex) queue setup where the trigger deliberately waits N minutes for another one to come in, and then all but one are Removed From Flow. Honestly that’s a lot.