- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2023 10:45 PM
Hello,
We have a software list collector variable on catalog item. If selected value is "Other", I would like a alert message popup. Could someone please help?. Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2023 10:50 PM
the list collector works on the sys_id, check the sys_id of your your other record and apply on change client script on your list collector field with below script:
if(g_form.getValue('list_collector_name').indexOf('sys_id_of_other')>-1)
{
alert('your alert message');
}
Please mark the answer correct/helpful accordingly.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2023 07:07 AM
here is the sample script
Ensure you replace correct sysId for the record which is named as Other
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading) {
return;
}
if(g_form.getValue('variableName').indexOf('sysId') > -1){
alert('Your Message Here');
}
}
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
10-11-2023 10:50 PM
the list collector works on the sys_id, check the sys_id of your your other record and apply on change client script on your list collector field with below script:
if(g_form.getValue('list_collector_name').indexOf('sys_id_of_other')>-1)
{
alert('your alert message');
}
Please mark the answer correct/helpful accordingly.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2023 11:14 PM
please share what script did you try? it should be an easy one.
are you saying only when 1 value is selected i.e. Other then alert should come?
OR
if Other is selected along with other value then also alert should come?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2023 07:03 AM
Good morning @Ankur Bawiskar
I have not tried any script yet because I don't know where to begin. You are correct; the alert should come up only when 'Other' value is selected. Alternatively, if the 'Other' value is selected along with other values, then the alert should come up as well. Please help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2023 07:07 AM
here is the sample script
Ensure you replace correct sysId for the record which is named as Other
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading) {
return;
}
if(g_form.getValue('variableName').indexOf('sysId') > -1){
alert('Your Message Here');
}
}
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