Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

If condition in binding variables

Yaswanth
Regular Contributor
Regular Contributor

Hello Team,

We are using few binding variables in the email templates like below

Username:${user.username}

Position:${user.positionDesc}

Here i am getting  'null' in the email if position does not contain any value, we are expecting 'NA' instead.

Van you help how to achieve it

4 REPLIES 4

Manu269
All-Star
All-Star

@Yaswanth Try adding this in your email templates to check the variables exposed :

${this.binding.variables.each {k,v -> println "$k = $v" + "<" + "br" + ">"}}

Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.

Yaswanth
Regular Contributor
Regular Contributor

Ca you guide me exactly where i should add the above query?

 

Amit_Malik
Valued Contributor II
Valued Contributor II

HI @Yaswanth 

<% if (user?.positionDesc != null) print "${user.positionDesc}" else print "NA" %>

Thanks,

Amit

If this answers your query, Please ACCEPT SOLUTION and give KUDOS.

Kind Regards,
Amit Malik
If this helped you move forward, please click on the "Kudos" button.
If this answers your query, please select "Accept As Solution".

You can add this in email template to verify the list of attributes used in the WF.

Refer sample example in case you are checking the empty value :

<% if (null!=user.email && user.email!='') print"${user.email}" else print"${user.secondaryEmail}" %>

Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.