Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2021 10:10 PM
I already mentioned the another approach i.e. using Display BR and the UI Action
Did you try that?
Also you can use this if you want scratchpad variable
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var ritms = current.u_number.toString();
var arr = [];
var gr = new GlideRecord("sc_req_item");
gr.addQuery("sys_id", "IN", ritms);
gr.query();
while(gr.next()) {
arr.push(gr.request.requested_for.toString());
}
g_scratchpad.users = arr.toString();
})(current, previous);
Then use onLoad client script to set the value
function onLoad(){
if(g_scratchpad.users != ''){
g_form.setValue('u_to_whom', g_scratchpad.users.toString());
}
}
Regards
Ankur
Regards,
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader