- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2025 02:22 AM
called below script in a reference qualfier while calling passed a parameter but the value not getting pass script include function
Reference qualifier: javascript:newCIvalueretrieve().getCis(current.variables.name_of_application_service_you_want_to_map):
Script Include: var Civalueretrieve = Class.create();
initialize: function() {},
getCis: function(parentId) {
var parentIdValue "parentId;
gs.log("parentId sai testing" parentIdValue);
var relations = new GlideRecord('cmdb_rel_ci');
relations.addQuery("parent", parentIdValue);
relations.query();
var ciData [];
while (relations.next()) {
var cis new GlideRecord(cmdb_ci");
cis.addQuery("sys_id', relations.child.sys_id);
cis.query();
if (cis.next()) {
ciData.push(cis-getuniqueValue());
}
}
var strQuery new ArrayUtil().unique(ciData);
return "sys_idIN” + strQuery;
},
type: 'CIvalueretrieve
};
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 04:07 AM
then in that list collector variable you should give variable attributes so that the ref qualifier works
ref_qual_elements=name_of_application_service_you_want_to_map
add that in variable attributes
Also don't use gs.log(). use gs.info()
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 01:37 AM
based on other reference value you can set comma separated sysIds in list collector
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 01:46 AM
function onLoad()
var selectedIDs= '53958ff0c0a801640171ec76aa0c8f86,5f8af237c0a8010001a932999458b83a';
g_form.addInfoMessage("right bucket testing" + selectedIDs);
g_form.setValue('ci_values', selectedIDs);
I tried by giving hard coded values but it is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 01:51 AM
seems due to reference qualifier it's not allowing
Try to set the sysIds as comma separated values in default value of that variable
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 02:13 AM
there is no reference qualifier at all and as you said If I give the sysids in the default field it's working as expected but actually as per my initial post whatever the values I'm getting from the above script include should be there in the right bucket of the list collector now I'm looking for the syntax how to configure in client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 02:19 AM
right side means you are looking to use native view and not portal
for that check this blog from me which I created some years ago
Dynamically set list collector on change of variable
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader