Skip to main content
Nov 14, 2017 4:41 PM UTC
Question

Many-to-many Custom Objects in Tokens

Hi,

I have two Custom Objects defining articles I wish to email to each lead, structured as follows:

  • Library: a list of articles with unique IDs
  • Index: two link fields, one to Lead and one to Library

When I view the lead detail page, I can see the Library items associated with each Lead via Index. However, when I try to create a token to include the articles in an email, I can only see the Index object.

Is there a way for me to reference the Library records in the token?

Thanks in advance

James

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

13 replies

SanfordWhiteman
User Group Leader
User Group Leader
Nov 14, 2017 8:33 PM UTC

The second-level objects won't be accessible from Velocity, an unfortunate shortcoming that isn't well-publicized.

We engineer around this by replicating all the records in the auxiliary table (your Library items) into their own Velocity token as a HashMap.  Then we join the first-level objects to the HashMap. You can hold hundreds, maybe thousands, of Library records this way, though it's not unlimited.

Translate
Nov 15, 2017 3:30 PM UTC

Thanks Sanford. That's frustrating, I was hoping that this structure would help us get around the API, Batch Size, and Custom Object limits which we're currently coming up against. Back to the drawing board, I guess.

Translate
SanfordWhiteman
User Group Leader
User Group Leader
Nov 15, 2017 5:12 PM UTC

How big is your Library, how wide are the fields (data types and number of fields), and how often does it change?

Translate
Nate_Anderson-2
Level 2
Feb 15, 2019 6:04 PM UTC

This is pretty disappointing. So outside of the elaborate HashMap scheme you outlined above, we are forced to flatten any custom object data we'd like to inject into emails into contact-keyed structures?

Translate
SanfordWhiteman
User Group Leader
User Group Leader
Feb 15, 2019 7:14 PM UTC

Not any custom object data: 2nd-level relationships via Company/Account are fine (as are Oppties of course). 2nd-level via Lead/Contact, yes, the data needs to be flattened to the 1st level in order to be read from Velocity.

Translate
Stephen_Schmuhl
Level 2
Feb 15, 2019 6:53 PM UTC

I've run into this before and we were able to overcome the issue using Apex and sending the email out of Salesforce, rather than Marketo. Flattening the object into a custom object in Marketo might work as well, but if you have a good Salesforce Developer you've got another potential option.

Translate
Alex_Firtl
Level 2
Jul 15, 2019 8:26 PM UTC

Hey Stephen, do you have any more information on how you handled this via Apex? I would be interested in learning more, in case this could help us out with a similar situation.

Translate