Regarding notification

spectura77
Tera Contributor

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).

1 ACCEPTED SOLUTION

SN_Learn
Kilo Patron
Kilo Patron

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.

View solution in original post

2 REPLIES 2

Yashsvi
Kilo Sage

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. 

SN_Learn
Kilo Patron
Kilo Patron

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.