- 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 02:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2020 02:55 AM
Hi,
please verify mail script name is correct?
please update code as below;
1) I have used toString()
2) remove JSON.stringify()
(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); // give proper variable name here
template.print('Option is: ' + parser[i].add_remove); // give proper variable name here
}
})(current, template, email, email_action, event);
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:03 AM
I have checked each and every and again tried your new script but no luck it's still not showing the values on notification.
Thanks,
JRY
- 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:08 AM