- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 04:55 AM
Hi all,
I need to populate a variable value from the catalog item in to body of notification ,the notification is in assessment instance table i have tried using the mail script but it is showing as undefined ,the name of the variable is u_summary.
Mail script i have used is:
var summary = current.variables.u_summary.getDisplayValue();
template.print(summary).
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 05:09 AM
Hi @spectura77 ,
Please try the below:
var summary = current.trigger_id.variables.u_summary.getDisplayValue();
template.print(summary)
Please Mark My Response as Correct/Helpful based on Impact
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 05:02 AM
Hi @spectura77,
use this script:
// Assuming 'current' is your GlideRecord object pointing to the assessment instance record
// Log current record sys_id for debugging
gs.info("Current record sys_id: " + current.sys_id);
// Check if u_summary is defined and get its value
var summary = current.variables.u_summary;
if (summary) {
gs.info("Summary value: " + summary); // Log summary value for debugging
template.print(summary); // Print the summary in your notification body
} else {
gs.info("u_summary is empty or undefined.");
}
Thank you, please make helpful if you accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 05:09 AM
Hi @spectura77 ,
Please try the below:
var summary = current.trigger_id.variables.u_summary.getDisplayValue();
template.print(summary)
Please Mark My Response as Correct/Helpful based on Impact
Mark this as Helpful / Accept the Solution if this helps.