Skip to main content
Level 2
Nov 2, 2022 7:37 PM UTC
Question

Marketo VTL Token Script Returns SFDC Field name not field value

Hello, I am running into an odd issue. I just synced a new field from Salesforce to Marketo called "Premises_Number__c" this field is a text field. When creating a token script to get that field displayed in an email, the token returns the field name and not the field value

 

Field Name: $Facility_Allocation__cList.get(0).Premises_Number__c 

Token Script: ${Facility_Allocation__cList.get(0).Premises_Number__c}

Value Returned: ${Facility_Allocation__cList.get(0).Premises_Number__c}

Value supposed to return: 123456789

 

This is the first time I encounter an issue like this, the field is checked on the left side field view list on the "Edit Token Script" window.

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

5 replies

SanfordWhiteman
User Group Leader
User Group Leader
Nov 2, 2022 7:58 PM UTC

Unless your app is specifically coded to never create more than one CO record of this type per person, you shouldn’t just be using the first (0-th) item in the list. You should be sorting and deliberately accessing the first created, last created, or using some other criteria to filter.

 

If you dump the entire list you should see quickly why this is happening. 

Translate
Level 2
Nov 2, 2022 8:18 PM UTC

This I 100% agree with, I was just testing quickly that a record I know only has 1 item in the list would just show the info before scripting something longer, but it just shows me that field name instead of value.

 

Translate
SanfordWhiteman
User Group Leader
User Group Leader
Nov 2, 2022 8:24 PM UTC

Then you should print the entire list (the ArrayList) to see what’s in it.

Translate