- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2020 02:13 AM
Hello Team,
I need help how to show variables which added on catalog form through email notification. As shown below all that variables has to show on email notification. I have tried by creating Script Include.
Thanks,
JRY
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2020 03:04 AM
Hi,
I have updated code as below and it worked for me
can you update these 2 lines
var value = current.variables.software_selection.toString(); // give proper variable name here
var parser = JSON.parse(value);
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2020 03:13 AM
Hi,
can you share the RITM screenshot?
Does that RITM have info in that variable set?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2020 03:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2020 03:21 AM
Hi,
for adding new line use this
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var value = current.variables.software_selection.toString(); // give proper variable name here
var parser = JSON.parse(value);
for(var i=0;i<parser.length;i++){
template.print('Software name is: ' + parser[i].software + ' Option is: ' + parser[i].add_remove); // give proper variable name here
template.print('<br/>')
}
})(current, template, email, email_action, event);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2020 03:27 AM
Thanks Ankur, it worked.
Thanks,
JRY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2020 03:37 AM
You are welcome
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader