7 Replies Latest reply on Feb 4, 2016 11:15 AM by Justin Cooperman

    Velocity Script - Custom Account Object

      Hello, I'm new to Velocity scripting and have a general question.

       

      We have a custom account object built in SFDC. This object is basically an extension of the account team where multiple product specialists are assigned to each account.  The object is sync'd to Marketo and I'm able to see the object and related fields. One of the fields on the object is 'Role'.  This field indicates the product specialty for each team member. 

       

      I was hoping to have 'select' functionality within the scripting that would allow me to segment the team members I want to utilize within tokens.  However, the if/then logic I have been trying is ignored.

       

      Is it possible to target specific records of the custom object and use their related attributes as tokens?

       

      For example:

      #if(${Account_Marketo_Team_Member__cList.get(0).Role__c} == "Sales Exec-ProductXX")

          #set (${Account_Marketo_Team_Member__cList.get(0).Basic_Name__c})

       

      Result:

      Returns the individuals name from the first row of the accounts custom object regardless of Role.

       

      Thanks

      Ryan