Use PDIs? Take our 5-minute survey to help shape the PDI roadmap.

How to set TO value dynamically in Email Client Template

Sathwik1
Tera Guru

I want to set the To value dynamically in a ServiceNow Email Client Template.

 

In the Email Client Template JavaScript, I am calling a Script Include function and passing current as a parameter. The Email Client Template is configured for the Incident Communication Task table.

 

I expected current to represent the GlideRecord of the Incident Communication Task, but it appears to represent the Email Client Template record instead.

 

Why does current behave this way in an Email Client Template?

 

What is the correct way to access or pass the Incident Communication Task GlideRecord to the Script Include so that I can use its fields to dynamically populate the To value?

 

@Ankur Bawiskar @Tanushree Maiti 

1 REPLY 1

Ankur Bawiskar
Tera Patron

@Sathwik1 

yes this is possible

check below

2 Ways to Leverage Scripting in Email Client Templates 

Scripting with Email Client Templates 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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