How to add options to existing field via client script

matthew_hughes
Kilo Sage

I'm wanting to add a "Not Applicable" as a dropdown option in two fields within a catalogue item. The two fields are:

matthew_hughes_0-1691074350273.png

The options for the two fields are specified in the following screenshots:

matthew_hughes_2-1691074444721.png

 

matthew_hughes_3-1691074483097.png

 

I've tried adding the 'Not Applicable' option in those two fields by using the below client script:

matthew_hughes_4-1691074665628.png

However, when I use this, it doesn't display the 'Not Applicable' option in both fields. If somebody could explain what I need to do to get that option field showing in both fields, that would be great.

 

 

1 REPLY 1

Brad Bowman
Kilo Patron
Kilo Patron

AddOption works only for select box variables or choice type fields

https://docs.servicenow.com/bundle/vancouver-api-reference/page/app-store/dev_portal/API_reference/G... 

Reference fields display records from a table, so your table(s) would need to have a record with the name 'Not Applicable' to be captured by a qualifier and shown with the other records from the table.