Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

If condition in binding variables

Yaswanth
New Contributor III
New Contributor III

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
New Contributor III
New Contributor III

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

 

AmitM
Valued Contributor
Valued Contributor

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.

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
.