- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 07:47 AM
Hi Connections,
I'm working on catalog item, I have two Reference variables.
Business table has name and description field.
and u_orgid_list table has values same as business_unit_list.description.
my requirement is to show only values on the Org ID variable as shown in the above image (description =ORGID)
let me know if any other information required.
Appreciate any help.
Best Regards,
Rafmine.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 08:13 AM
Hi @Community Alums
You can use reference qualifier here, you just need to go to the variable and update the reference qualifier as:
javascript: "entity_suscope_id="+ current.variables.bussiness_id.description;
JUST ENSURE TO USE THE CORRECT BACKEND NAME OF THE FIELD FOR Enttity subscope_id.
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 08:13 AM
Hi @Community Alums
You can use reference qualifier here, you just need to go to the variable and update the reference qualifier as:
javascript: "entity_suscope_id="+ current.variables.bussiness_id.description;
JUST ENSURE TO USE THE CORRECT BACKEND NAME OF THE FIELD FOR Enttity subscope_id.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 10:33 AM
Hello @Community Alums ,
Hope you are doing well!
Here is the step-by-step solution to accomplish this using an onChange client script:
- Create a client script on the Catalog Item form
- Set the script to execute the onChange of the Business ID field. You can refer to this script:
function onChange(control, oldValue, newValue, isLoading) { if (isLoading || newValue == '') { return; } //Type appropriate comment here, and begin script below var ga = new GlideAjax('ScratchpadAjax'); ga.addParam('sysparm_name', 'getOrgIDs'); ga.addParam('sysparm_business_id', g_form.getValue('business_id')); ga.getXML(getOrgIDsResponse); function getOrgIDsResponse(response) { var org_ids = response.responseText; g_form.setDisplayValue('org_id', ''); org_ids.split(",").forEach(function(id) { g_form.setValue('org_id', id); }); } }
- Create a ScratchpadAjax script-include that accepts the business ID, queries the tables, and returns the matching org IDs. You can refer to this script:
var ScratchpadAjax = Class.create(); ScratchpadAjax.prototype = Object.extendsObject(AbstractAjaxProcessor, { getOrgIDs: function() { var businessId = this.getParameter('sysparm_business_id'); var buGr = new GlideRecord('business_unit'); buGr.get(businessId); var orgGr = new GlideRecord('u_orgid_list'); orgGr.addQuery('entity_subscopeid', buGr.getValue('description')); orgGr.query(); var orgIDs = []; while (orgGr.next()) { orgIDs.push(orgGr.getValue('orgid') + ''); } return orgIDs.join(); }, type: 'ScratchpadAjax' });
If you found this helpful, a 'like' is the secret handshake of appreciation!
- Prasad 😉