AmritTandon_0-1676340100267.png

How to use SFDC Custom Objects associated with SFDC Accounts in Velocity Scripts

AmritTandon
Marketo Employee
Marketo Employee

Many would think, is it possible to use Account related custom objects in velocity scripting? Yes, it is provided it is created and lookup field is mapped correctly.

 

When the SFDC Custom Object (linked with a SFDC Account) is the child object where SFDC Account Object as a Parent, then only we can use the custom object data in Velocity Scripting.

 

Let me show an example:

 

  • Have the SFDC Admin create the custom object associated with an Account with a Lookup field to the Account Object
    1. This ensures the custom object is the child object and Account object is the Parent

Eg:

AmritTandon_0-1676340100267.png

AmritTandon_1-1676340100270.png

 

 

  • Create other fields on this custom object and save
  • Enter the data for this custom object
  • Ensure the Sync user has access to all the fields of this custom object as well as this object

Eg.

AmritTandon_2-1676340100274.png

 

 

  • Sync the custom object with Marketo
    1. Refresh the schema
    2. Identify the newly created custom object
    3. AmritTandon_3-1676340100286.png
    4. Click Enable Sync
    5. Remember, you can sync any custom object upto 2-level deep
  • Once the data is synced, create a velocity script
    1. Sample Script:

AmritTandon_4-1676340100300.png

 

  • Use this data in email personalization:

AmritTandon_5-1676340100303.png

 

Custom Object value for that Account:

AmritTandon_6-1676340100304.png

 

 

Please let me know if you have any questions as I am always happy to help!

1175
0