How to clear options from a List field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 09:22 AM
Hi,
I have the field u_alon_test of type List with hard coded choices. Im trying to clear the choices using client script. I tried to use:
g_form.clearOptions('u_alon_test');
but its not working.
How can I clear the choices from a List field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 09:34 AM
Hi @Alon Grod
https://www.servicenow.com/community/itsm-forum/how-to-clear-value-for-list-type-field/m-p/2649687
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 09:39 AM
@Dr Atul G- LNG please stop comment on my posts this is not the way to get Likes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 10:06 AM
Hi @Alon Grod ,
If you are trying to change Type of a field from Choice to List and if you want to remove those choices you will have to select all three and from Actions on selected row you have to delete it, through client script you can not remove this as these are not added through addOption but added through dictionary.
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang