How do you change a field's value to the None choice in script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2013 12:32 PM
http://wiki.servicenow.com/index.php?title=Customizing_Choice_Lists#Values_Associated_with_.22None.22_option
says that the "None" option does not have a sys_choice record associated with it. I tried setting the field to following values but they all failed to become None.
- '' (empty string)
- '0'
- 0
- null
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2022 07:06 AM - edited ‎11-07-2022 07:08 AM
I had a similar query. After giving it some testing, using gr.<field name> = 0; or gr.setValue('<field name>', 0); both set the Value as "-- None --" in a Business Rule.
The person posing the question said that 0 and '0' didn't work for them, but it does for me (on Tokyo), so maybe this has been fixed.
For what it's worth, the following DO NOT work via this method:
-NULL
-sys_id of value
-'' (empty string)
-'none'
-'None'