12 Replies Latest reply on Aug 18, 2017 1:36 PM by Sanford Whiteman

    Extracting Values from a Custom Object Field - Velocity Token

    Ed Rayyis

      Greetings,

       

      I have the following custom object called 'ProductInterest' in our CRM, this object includes a number of values, one of which is productName. A client can have multiple products (ProductName). If I drag and drop the field to the token script area, it shows as ${ProductInterestList.get(0).ProductName}

       

      productinterest.png

      I am trying to write a Velocity Script Token to display an image based on what Products (ProductName) they are a member of. Token name is {{my.image}} and in the email I am calling it something like this

       

      <img src="{{my.image}}" alt="">

       

      The Velocity Script Token:

      #if( $ProductInterest.ProductName == 'product1' || $ProductInterest.ProductName == 'product2' || $ProductInterest.ProductName == 'product3' )

      http://www.myurl.com/images/Banner1.jpg

      #else

      http://www.myurl.com/images/Banner2jpg

      #end

       

      This is not working, the result is always Banner2 (the #else image) when testing on a lead that has either product 1, 2 or 3 only... any idea's?

       

      (I even tried

       

      #if( $ProductInterest.ProductName == 'product1' )

      #elseif( $ProductInterest.ProductName == 'product2' )

      #elseif( $ProductInterest.ProductName == 'product3' )

      http://info.lazardnet.com/rs/211-JCD-267/images/Banner factsheet EMD_II.jpg

      #else

      http://info.lazardnet.com/rs/211-JCD-267/images/Banner factsheet.jpg

      #end)