SOLVED

Iterating over Custom Objects in an Email Script?

Go to solution
Anonymous
Not applicable

Iterating over Custom Objects in an Email Script?

This help doc shows an example of iterating over Custom Objects in an email script: 

http://developers.marketo.com/documentation/email-scripting/

They've got Custom Objects named "Events", and in the script reference `foreach( $event in $EventsList )`, but they never explain why the variable name for the list of Events is EventsList. 

Is it just always "NameOfCustomObjectList", or did they configure that variable to that data somewhere, and not mention it? 



Thanks!
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: Iterating over Custom Objects in an Email Script?

It is done as nameofcustomobjectlist, and is done automatically.

As an example we have Licenses as our custom object so ours would appear as LicensesList.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Re: Iterating over Custom Objects in an Email Script?

It is done as nameofcustomobjectlist, and is done automatically.

As an example we have Licenses as our custom object so ours would appear as LicensesList.
Anonymous
Not applicable

Re: Iterating over Custom Objects in an Email Script?

I have a custom object called "Product & Charge" ... how do I come up with the List name for this? I've tried $ProductChargeList and $ProductAndChargeList and $Product_ChargeList... I understand removing the spaces, but I can't use the ampersand character because it comments out the text after it and the email errors out.

If anyone has any idea it would be extremely helpful. Thanks.

Anonymous
Not applicable

Re: Iterating over Custom Objects in an Email Script?

Try dragging a field into the email script from your custom object and see what Marketo named it. 

Anonymous
Not applicable

Re: Iterating over Custom Objects in an Email Script?

The Custom Object name as it appears in the Custom Objects List is "Subscription Product & Charge."

The list name (as I figured out after playing with it) is $Zuora__SubscriptionProductCharge__cList

If you drag over a field from a custom object, the list name is populated prior to the .get(0) call.