Velocity script listing custom objects with a specific field value | Community
Skip to main content
New Participant
January 3, 2017
Solved

Velocity script listing custom objects with a specific field value

  • January 3, 2017
  • 1 reply
  • 2359 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Remember to #end your #if.

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
January 3, 2017

Remember to #end your #if.

ErikHe1Author
New Participant
January 3, 2017

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