How do you change a field's value to the None choice in script?

stinky2nine
Tera Contributor

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

10 REPLIES 10

Marcus Roworth
Tera Contributor

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'