Unable to get mail script values into email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 07:19 PM
Hi All,
I wrote email script to pick the values from system property and display it in email notification. But I am unable to see the email script values in the email.
Attached are the email script and notification images. Kindly assist me here
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 09:15 PM
Hi, your script does not appear to return a value, maybe a simple "return DataImport" after setting the variable is what is needed?
Ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 09:32 PM
Hi @madhuravath
Add below line in your email script
var DataImport = gs.getProperty("name_of_your_proerty");
template.print(DataImport);
Hope this answers the query. If it does, please mark the response as correct.
Thanks!
Krishnamohan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 09:35 PM
this is a duplicate question.
You already raised question yesterday
Unable to get mail script values into email
I already responded there
you are just getting the value but not printing it
use this to print in email script and then it will show
template.print(DataImport);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader