How to dynamically call multiple Email Templates from a Email Scripts

Sharan Ellendul
Tera Contributor

Hi,

 

There is an OOB Approval Rejection notification and it gets triggered to all task tables. But I have two templates which I want to call dynamically based on a condition added in the template which is selected in Approval Rejected Notification. This is because we don't want to modify OOB notification. Can anyone help in this?

 

 

I have tried the below approach and ended up as below.

SharanEllendul_0-1723474373687.png

 

SharanEllendul_2-1723474430755.png

 

SharanEllendul_3-1723474459180.pngSharanEllendul_4-1723474480266.png

 

SharanEllendul_5-1723474505890.png

 

 

When I preview the notification, it not printing the actual values of the table. 

 

SharanEllendul_6-1723474552924.png

 

 

Thanks in Advance,

Sharan

 

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Sharan Ellendul 

can you try this in line 7

if(current.source_table == 'sc_request'){

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I have tried it, but it's not working. Actual values are not populated in the email body.

SharanEllendul_0-1723476329339.png

 

Community Alums
Not applicable

Hello @Sharan Ellendul , 

Have you got the solution?