SOLVED

Displaying Specific Custom Object Records

Go to solution
Liam_Colby1
Level 1

Displaying Specific Custom Object Records

Our team is working on sending personalized emails based on information stored in a custom object using travel itinerary information. Our problem, though, is that many leads in our database have multiple itineraries (i.e. multiple custom object records). We have set up some script tokens to display custom object information, but this will only display info from the most recent custom object record. How do we ensure the correct itinerary is displayed?

 

For example: If we are sending a pre-travel type email 7 days before a person's departure, and that person has 2 itineraries (A & B), but only Itinerary B's departure date is in 7 days, how can we ensure only Itinerary B's info is displayed instead of Itinerary A? In this example, we would want to display a "Departure Date" field and a "Booking Number" field.

 

I know we would need to utilize some velocity scripting, but any assistance here would be greatly appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Displaying Specific Custom Object Records

If your campaign triggers on the addition of a CO record, the triggering record is automatically available as$TriggerObject in Velocity.

 

View solution in original post

7 REPLIES 7
SanfordWhiteman
Level 10 - Community Moderator

Re: Displaying Specific Custom Object Records

Why do you say “this will only display info from the most recent custom object record”? That’s not so. You have access to the last 100 CO records in Velocity. It's an iterable List, $CustomObjectName_List.

Liam_Colby1
Level 1

Re: Displaying Specific Custom Object Records

The reason I say we are only able to display the most recent custom object record is because we have not implemented any velocity scripting. How would we be able to display only the CO record info that qualified a lead for a campaign?

SanfordWhiteman
Level 10 - Community Moderator

Re: Displaying Specific Custom Object Records

If your campaign triggers on the addition of a CO record, the triggering record is automatically available as$TriggerObject in Velocity.

 

Liam_Colby1
Level 1

Re: Displaying Specific Custom Object Records

Ok, that makes sense. What if the CO record is already created, but a field is later updated, which would qualify a lead for this particular smart campaign (in this instance, a "Status" field update)? How would we then be able to correctly display this in the email?

SanfordWhiteman
Level 10 - Community Moderator

Re: Displaying Specific Custom Object Records


Ok, that makes sense. What if the CO record is already created, but a field is later updated...


You would need to use a batch in this case, and filter the whole CO list using Velocity to find the record(s) that have fields that fall into your “interesting updates”.

 

We try to avoid such situations. For example, whenever an interesting update happens on a CO, we send a Custom Activity like Update Notification with the GUID of the record that just got interesting.

Liam_Colby1
Level 1

Re: Displaying Specific Custom Object Records

Ok, that makes sense. Thank you!

SanfordWhiteman
Level 10 - Community Moderator

Re: Displaying Specific Custom Object Records