AnsweredAssumed Answered

Extracting Values from a Custom Object Field - Velocity Token

Question asked by Ed Rayyis on Mar 13, 2017
Latest reply on Aug 18, 2017 by Sanford Whiteman



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}



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' )




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' ) factsheet EMD_II.jpg

#else factsheet.jpg