- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2022 08:49 AM
Hi Team,
* I have created a variable for a record producer which is referring to "sys_choice" table and populating it in the front end
* I have created a onChange Catalog Client Script to remove couple of choices based what I select from the drop down, for the previous variable
Unfortunately the g_form.removeOption() method which I am using is not working at all!
Can someone please guide me as to what is the issue? I have also tried with g_sc_form.removeOption() but isn't working.
Attached is the screen shot for your reference.
Thanks and Regards
Saurabh
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2022 03:26 AM
Glad! You can mark an answer as correct and helpful if it solved your query. So that it benefits future visitors as well.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2022 03:10 AM
Hey Sumanth,
Worked! I just had to select the "Type" as "Select Box" for the variable field instead of "Reference". It's working as expected. Thank you!
Regards
Saurabh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2022 03:26 AM
Glad! You can mark an answer as correct and helpful if it solved your query. So that it benefits future visitors as well.
Regards,
Sumanth

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2022 09:14 AM
Hello,
If you're trying to filter values from a reference field, you'd need to use a reference qualifier to do so.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2022 03:12 AM
Hey Allen,
Thank you for your guidance. I just changed the type to "Select Box" and it worked.
Regards,
Saurabh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2022 12:54 AM
Hi g_removeOption() will not work for reference fields. You need to use reference qualifier to restrict the values. You need a script include to filter the records and call the Script include using reference qual
example here
https://community.servicenow.com/community?id=community_article&sys_id=8ffacb6ddb18f010414eeeb5ca9619aa
Harish