What is wrong with my token? | Community
Skip to main content
Travis_Schwartz
Level 4
October 17, 2019
Solved

What is wrong with my token?

  • October 17, 2019
  • 1 reply
  • 4991 views

So I'm trying to script a token based on a custom object... most importantly I want it to display text field 2 if someone has that custom object on their record.

I see this option in the coding, but am not sure how to tell Marketo which list to reference to display the text2 field.

${customList_cList.get(0).text2}

I think this should be relatively simple, but am not having any luck with it so I figured I would reach out.

Thanks in advance.

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 SanfordWhiteman

That code is outputting the text2 property of the 0th (i.e. first) item in the ArrayList of customList objects, in what you should consider an arbitrary sort order.

What is the “correct” customList object?

1 reply

SanfordWhiteman
Level 10
October 17, 2019

Please highlight your code using the Advanced Editor’s syntax highlighter (you can choose Java as the language as it’s closest to Velocity). Then we’ll continue.

Travis_Schwartz
Level 4
October 17, 2019

This is new to me, so let me know if I get it right.

${customList_cList.get(0).text2}

I need to know how to identify which list Marketo is referencing to get the correct text2 content to display.

Thanks.

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
October 17, 2019

That code is outputting the text2 property of the 0th (i.e. first) item in the ArrayList of customList objects, in what you should consider an arbitrary sort order.

What is the “correct” customList object?