Re: Marketo VTL Token Script Returns SFDC Field name not field value

ClearwayFrank
Level 2

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.

5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo VTL Token Script Returns SFDC Field name not field value

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. 

ClearwayFrank
Level 2

Re: Marketo VTL Token Script Returns SFDC Field name not field value

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.

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo VTL Token Script Returns SFDC Field name not field value

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

ClearwayFrank
Level 2

Re: Marketo VTL Token Script Returns SFDC Field name not field value

The problem might be with the syncing I think. When dumping the list I get a [null], but I know there is data there.

SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo VTL Token Script Returns SFDC Field name not field value


The problem might be with the syncing I think. When dumping the list I get a [null], but I know there is data there.

If the data isn’t in Marketo, that would definitely be a cause!