- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2024 08:21 PM
I am setting a reference qualifier using script include, I have multiple values returning in the array but only shows one value in the reference field. when i print to logs I can see multiple sys_ids. Any idea how to fix?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2024 08:28 PM - edited 12-04-2024 08:29 PM
Hi @samadam ,
Can you update your script as belows:
var Filterofficespace = Class.create();
Filterofficespace.prototype = {
initialize: function() {
},
Filterofficespace:function(){
var gp = [];
var xyz = current.u_name;
if(!xyz)
return;
if(xyz){
var gr = new GlideRecord('cmdb_ci');
gr.addQuery('assigned_to', current.u_name);//replace with your query
gr.query();
while(gr.next()) {
gp.push(gr.sys_id.toString());
}
return 'sys_idIN' + gp;
}
},
type: 'Filterofficespace'
};
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2024 08:28 PM - edited 12-04-2024 08:29 PM
Hi @samadam ,
Can you update your script as belows:
var Filterofficespace = Class.create();
Filterofficespace.prototype = {
initialize: function() {
},
Filterofficespace:function(){
var gp = [];
var xyz = current.u_name;
if(!xyz)
return;
if(xyz){
var gr = new GlideRecord('cmdb_ci');
gr.addQuery('assigned_to', current.u_name);//replace with your query
gr.query();
while(gr.next()) {
gp.push(gr.sys_id.toString());
}
return 'sys_idIN' + gp;
}
},
type: 'Filterofficespace'
};
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2024 09:00 PM - edited 12-04-2024 09:02 PM
Hi @Sam
Try to replace this line 'OArray1.push(ga1.sys_id);' with 'OArray1.push(ga1.sys_id.toString());' and check. Also can add the log statement (gs.log(OArray1)) before the return.