AnsweredAssumed Answered

Velocity script listing custom objects with a specific field value

Question asked by 93e67f9d54f48d129e1b378b25caa9cee6e16c29 Champion on Jan 3, 2017
Latest reply on Jan 3, 2017 by 93e67f9d54f48d129e1b378b25caa9cee6e16c29

Hi,

I created a loop in an Email Script token that is as follows:

 

<table>

#foreach($licenseSubscription in $licenseSubscription_cList)

  <tr><td>$foreach.count</td><td>${licenseSubscription.serviceName}</td></tr>    

#end

</table>

 

It works in listing all Custom Objects for the lead. What I want to do is to only list Custom Objects (Licenses) with License Type (licenseType) == Trial.

 

I tried something like this but it is not rendering in the template:

 

<table>

#foreach($licenseSubscription in $licenseSubscription_cList)

  #if ($licenseSubscription.licenseType == "Trial") {

  <tr><td>$foreach.count</td><td>${licenseSubscription.serviceName}</td></tr>    

  }

#end

</table>

 

Any feedback as to how I would structure the script to only apply for those with a specific value?

Outcomes