Email script- get RITM variables

surajsironi
Kilo Sage

Hi,

some one help me how to show below details in email notification

find_real_file.png

 

how to show Owner name in Notification body

 

template.print("<b>Summary of Requested items:\n</b>");
var item = new GlideRecord("sc_req_item");
if (item.get(current.document_id)) {
template.print("<b>"+item.number + ": " + item.cat_item.getDisplayValue() + "</b><br/>");
var keys = new Array();
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(item.sys_id);
set.load();
var vs = set.getFlatQuestions();
for (var i = 0; i < vs.size(); i++) {
if (vs.get(i).getDisplayValue() != '') {
template.print("<b>"+vs.get(i).getLabel() +"</b>"+ " : " + vs.get(i).getDisplayValue() + "<br/>");
}
}
}

find_real_file.png

Pradeep Sharma
ServiceNow Employee

Hi Sironi - It looks like you want to get field column value of the referenced target table. If yes, then you have to GlideRecord to the target table based on the matching variable value.

 

- Pradeep Sharma

Hi Pradeep,

can you give some background steps ,how to query that particular variable ?

can i expect any updates / suggestions?

Sorry for the delay in my response. Give it a try with script shared and let us know if you have any additional question.