We are delighted to share our new EIC Delivery Methodology for efficiently managing Saviynt Implementations and delivering quick time to value. CLICK HERE.

using "Contains()" in email template

Joon
Regular Contributor II
Regular Contributor II

Hello All,

I am trying to use "contains" in email template like below, but it seems wrong since i got no email when I use this function. can you give me an advice to improve ?

Below are what I have tried but not worked

<% if(${task?.taskdate}.contains('07:'))" print "hello" else print "Bye" %>

<% if((${task?.taskdate}).contains('07:'))" print "hello" else print "Bye" %>

13 REPLIES 13

rushikeshvartak
All-Star
All-Star

 

<% if(task?.taskdate.contains('07:')) print "Hello" else print "BYE" %>

 


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

Joon
Regular Contributor II
Regular Contributor II

Thanks for your response! but unfortunately, it doesn't work for me ..

<%if (task.taskdate.contains('07:')) print "HELLO" else print "BYE" %>

Which mail template are you testing 

below should work 

 

<%if (1=1) print "HELLO" else print "BYE" %>


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

Joon
Regular Contributor II
Regular Contributor II

I work on the template for endpoint level. doesn't it require "$" to use binding variables ?

 

What is email trigger point ? Task creation / Request Approval ?


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

Joon
Regular Contributor II
Regular Contributor II

it's triggered when task completed for remove access

Joon
Regular Contributor II
Regular Contributor II

<% if ("${task?.source}" == "CERTIFICATION") print "HELLO" else print "BYE" %>

This one works properly. but i'm not sure where to put "contains" in the statement

<% if ("${task?.source?.contains("CERTIFICATION")} print "HELLO" else print "BYE" %>


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

Joon
Regular Contributor II
Regular Contributor II

Thanks for the prompt answer! I really appreciate it.

but It still won't be working with "contains"...😢

Share screenshot on email Template and output 


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

Joon
Regular Contributor II
Regular Contributor II

Below is what i tried as per your suggestion but couldn't get an email.

12.png

${task?.taskdate}<br><% if ("${task?.taskdate?.contains('07:')}" print "HELLO" else print "BYE" %>

 

but I will get the output like below If I would go with only ${task?taskdate}

13.png

 

<%if(task.taskdate.toString().contains('07:')){print "Hello Joon"} else {print "Bye Joon"}%>

Hide Confidential Info


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

Joon
Regular Contributor II
Regular Contributor II

I really appreciate it. It finally works !!