Custom object fields to be used as Token | Community
Skip to main content
Level 3
June 16, 2023
Solved

Custom object fields to be used as Token

  • June 16, 2023
  • 2 replies
  • 3664 views

Hi,

 

Hope you are doing great.

 

Can we use custom object fields in token and then can be used in emailer for personalization ? If so, please guide.

 

Thanks in advance.

 

Regards,

Neelam B.

 

 

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 Darshil_Shah1

Yes, you can use Marketo custom object data in the email using the email script token. Create a custom email script token at an apt place (program/campaign folder) so the email can reference it >> Under the Custom Object section in the object tree on the right of the email script token editor, select the apt. fields >> Once you have your script ready with the additional logic to display the correct CO data save it, add the custom my token in the email, and test. Make sure to sort you sort the custom object list before you use it in the script token so you always pick the correct custom object record if multiple CO records are associated with a person record. Check out Sandy's article on sorting objects and lists in velocity here.

 

2 replies

Level 6
June 16, 2023

Hi Neelam,

 

Because there is a one-to-many relationship between the person record and custom object records, it isn't possible to use a regular token (similar to {{lead.first name}} or {{my.event name}}) to populate the custom object data in an email. However, you can use Velocity script to accomplish this. Here's a community post that discusses this approach: How to reference Custom Objects in Velocity Script

 

Cheers,

Beth Massura

2022 Adobe Marketo Engage Champion

Level 3
July 2, 2023

@beth_massura 

 

Thank you. 

Darshil_Shah1
Community Advisor and Adobe Champion
Darshil_Shah1Community Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
June 16, 2023

Yes, you can use Marketo custom object data in the email using the email script token. Create a custom email script token at an apt place (program/campaign folder) so the email can reference it >> Under the Custom Object section in the object tree on the right of the email script token editor, select the apt. fields >> Once you have your script ready with the additional logic to display the correct CO data save it, add the custom my token in the email, and test. Make sure to sort you sort the custom object list before you use it in the script token so you always pick the correct custom object record if multiple CO records are associated with a person record. Check out Sandy's article on sorting objects and lists in velocity here.

 

Chris_Willis1
Adobe Champion
Adobe Champion
June 19, 2023