List collector variable if i select A country then have A and B to be set in the same variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2023 12:07 AM
Hi All,
I have a scenario there is a list collector variable in catalog item referring to country table if i select US then US and united arab should populated in the same variable how do i do this can any one guide me on this.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2023 02:50 AM
Hi !
This must help !
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2023 02:22 AM
Hello @srikriti ,
Please use an onchange client script on your country field.
Use the below codes in both of the scripts
Client Script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (newValue.indexOf('sys_id of USA')>-1){
g_form.setValue('your field name',newValue+',sys_id_of_uae');
}
//Type appropriate comment here, and begin script below
}
}
Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2023 02:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2023 02:34 AM - edited 08-08-2023 02:35 AM
Hello @srikriti ,
Could you just put the newValue in alert and see what are you getting when you add multiple values. The no match found error might be mostly the sys_id did not match the value.
Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2023 03:02 AM
i donot want to use sys_id's can we replace with names ?