AnsweredAssumed Answered

Email Script Token to Filter Salesforce Lookup Object

Question asked by ce61a7c517eed5242aa644b63576be7ba5a014fb on Jul 18, 2016
Latest reply on Jul 18, 2016 by Sanford Whiteman

We have a custom junction object in Salesforce, Clubs Volunteers, that links the Salesforce Contact object with custom object, Clubs.  We've created tokens for fields in the Clubs Volunteers object.  If there is only one Clubs Volunteer object for the contact record, the token resolves to the correct value.  If there is more than one club volunteer object for the contact record, the token does not resolve. I can understand why this happens, and see a possible workaround by using a Marketo Custom Object for the club volunteer object. 

 

Is there a why to filter the volunteer object in the Email Token Script without creating a Marketo custom object?  Adding a script filter doesn't help resolve the object if there's more than one.  When there's one record, the script below works.  More than one, it doesn't resolve. 

 

Thanks,

Irwin

#if(${Club_Volunteer__cList.get(0).Club_Year__c} == "2016-17")

  #set($Sponsor = "${Club_Volunteer__cList.get(0).Sponsor_Name__c}")

    In IF

    ${Club_Volunteer__cList.get(0).Sponsor_Name__c}

#end

$Sponsor

Outcomes