Populate values based on selection of options in list collector field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2023 01:41 PM
Hi,
I have a requirement, in catalog form there are 3 fields namely Select site name, Select Print groups and Printers included in group (FYI select print groups is dependent on select site name field) If any value is selected in select Print groups field, then printers' details need to populate in printers included in group field.
Select Print groups field is a list collector so multiple options can be selected...For example if i select "print group - tampa" in Select Print groups field then TAM-DV, TAM- SAT, Barcode these values need to be populate in Printers included in group field....likewiswe if i select more than 1 value in list collector field then respective printers details need to be populate in the field
Example
in this case 2 values selected so AM-DV, TAM- SAT, Barcode and zebra tear, zebra 00 zebra 10 these values need to be populate in printers included in group field
There are multiple options present in select print groups so based on selecting each option a set of printer details need to populate in printers field....I have list of printer details related to each group in excel.
How can we achieve this.....please help me with entire onchange script.
Thanks in advance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 12:58 AM
Hi @suuriya replace the below bolded line. Make sure the field name from select_print_groups table is correct in script include .
getApplication : function(){
var CI = [];
var sysId = this.getParameter('sysparm_sys_id'); // sysid of list collector values from client script
var almAssetGr = new GlideRecord("select_print_groups"); // glide the table which your using as list collector where the values stored
almAssetGr.addQuery('sys_id', "IN", sysId);
almAssetGr.query();
while (almAssetGr.next()) {
CI.push(almAssetGr.getValue('u_printer')); // here you need to get the printer value
}
return CI.join();
},
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 01:09 AM
Hi @Harish KM ,
I replace the line but it is showing as null

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 01:20 AM - edited 10-25-2023 01:21 AM
Hi @suuriya
Can you put logs here and check what value your getting? The below sys id should match the record in your printer table which you select on list collector variable and then in this table you need to get the value of the field which you want to auto populate
var sysId = this.getParameter('sysparm_sys_id'); // sysid of list collector values from client script
gs.info("sysID==>"+sysId);
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 02:29 AM
Hi @Harish KM ,
I add the infor part

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 02:37 AM
Hi @suuriya your table name is wrong here check bold line below
getApplication : function(){
var CI = [];
var sysId = this.getParameter('sysparm_sys_id'); // sysid of list collector values from client script
gs.info("sysID==>"+sysId);
var almAssetGr = new GlideRecord("select_print_groups");
replace to
var almAssetGr = new GlideRecord("u_kallik_sites_codes_and_access_groups"); // put correct table name
// glide the table which your using as list collector where the values stored
almAssetGr.addQuery('sys_id', "IN", sysId);
almAssetGr.query();
while (almAssetGr.next()) {
CI.push(almAssetGr.getValue('u_printer')); // pass the field name where you want to populate values on other field
}
return CI.join();
},
type: 'Printer'
});
Harish