SOLVED

Velocity script listing custom objects with a specific field value

Go to solution
Erik_Heldebro2
Level 8

Velocity script listing custom objects with a specific field value

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?

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity script listing custom objects with a specific field value

Remember to #end your #if.

View solution in original post

2 REPLIES 2
SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity script listing custom objects with a specific field value

Remember to #end your #if.

Erik_Heldebro2
Level 8

Re: Velocity script listing custom objects with a specific field value

Thank you for the help Sanford, works like a charm now