SOLVED

Velocity script listing custom objects with a specific field value

Go to solution
Highlighted

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
Highlighted
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
Highlighted
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

Highlighted

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

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