email script in email template

Vedavalli
Tera Contributor

When I'm trying to use my email script in email template
I'm getting 

Following variables are not valid or defined: ${mail_script:missing_fields_data}
Error Message
Invalid update

can I know the reason for this 

Thank you
1 ACCEPTED SOLUTION

@Vedavalli 

Thank you for marking my response as helpful.

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

View solution in original post

12 REPLIES 12

can you please share the screen shot what you're getting in the  mail body?

can you please share the screenshot  what you're getting in the body?

@Vedavalli ,

 

Since the incident state in not "on hold", I am getting below email.

 

 

Shree_G_1-1746699358388.png

 

The script is correct. Re-check your configuration or share the screen shot of the notification you configured.


If this solution helped resolve your issue, please consider marking it as helpful or correct.
This will assist others in finding the solution faster and close the thread.

I might be wrong, but you are using an email template, based on your screenshot, Unsubscribe and Prefeerences. 

When using email template, the subject and message comes from the template. 

And your mail_script is in the body of the message, which will not be used. 
Try to put your mail_script in a blank message OR create a new template and add your script to the template.

Ankur Bawiskar
Tera Patron
Tera Patron

@Vedavalli 

It worked for me. I hope your email script is not breaking somewhere, you need to debug that.

Share that email script and how are you invoking from email client template

Output: Native

AnkurBawiskar_0-1746690843007.png

Output: Workspace

AnkurBawiskar_3-1746690958737.png

 

Email Script

AnkurBawiskar_1-1746690854189.png

 

Email client template: invoking email script

AnkurBawiskar_2-1746690884473.png

 

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