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

Like Condition Evalution in Email Template Address Field

chandu_k09
New Contributor III
New Contributor III

Hi All,

I am wondering what the syntax is or if it is possible to do a "like" evaluation in the email template where if the user's email contain a phrase like "_converted" then IGA shouldn't send the email, else send the email to e.g. the manager. For testing purposes I have included some other email addresses in CP64 and CP65 to see if the email goes through. So far it hasn't worked when I use "like" condition. 

Failing code in TO: <% if (user?.email like '%_converted%') print "${user?.customproperty65}" else print "${user?.customproperty64}"%> 

chandu_k09_0-1710972698676.png

Thank you,

Chandu K.

3 REPLIES 3

PremMahadikar
Regular Contributor III
Regular Contributor III

Hi @chandu_k09 ,

I am not sure if 'like' will work here.

But contains should work. Try below:

<% if(user.email.toString().contains('_converted')){print "${user?.customproperty65}"} else {print "${user?.customproperty64}"}%> 

 

If this reply answers your question, please consider selecting Accept As Solution and hit kudos.

rushikeshvartak
All-Star
All-Star

Email template uses java  functions and not mysql methods.

<% if(user?.email.contains('_converted')){print "${user?.customproperty65}"} else {print "${user?.customproperty64}"}%> 

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

chandu_k09
New Contributor III
New Contributor III

Hi Rushikesh and Prem,

Thanks for your suggestions and feedback. 

@PremMahadikar I didn't check the "tostring" method. But the .contains worked anyway and the issue is now resolved. 

Kind regards,

Chandu