Array of Sys ID's into Display Value

Aaviii
Tera Contributor

Hi All,

 

I have requirement to show Display Value of all Sys Id's getting from event parameter. Am using this event in email script of show values in Notification body. Currently all the sys id's are coming but want display value of all the users.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Aaviii 

then in email script query your table and get the display value like this

var arr = [];
var gr = new GlideRecord("table");
gr.addQuery("sys_id", "IN", event.parm1);
gr.query();
while (gr.next()) {
    arr.push(gr.getDisplayValue());
}

template.print(arr);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@Aaviii 

then in email script query your table and get the display value like this

var arr = [];
var gr = new GlideRecord("table");
gr.addQuery("sys_id", "IN", event.parm1);
gr.query();
while (gr.next()) {
    arr.push(gr.getDisplayValue());
}

template.print(arr);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader