Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

how to set choice values ?

Kiddy1
Tera Contributor

explorenow Developer Community

i am having choice field as yes/no how to set it

current.u_is_rolledback='Yes';

i have done this but not taking the value

4 REPLIES 4

Khozema Attar1
Tera Guru

Hi ,



You can use current.setValue('u_is_rolledback','Yes');



Thanks,



Mark correct if it solves your issue


Chuck Tomasi
Tera Patron

Where are you setting this? A business rule? A UI Action? Can you include all of the code?



Also verify the VALUEs of the choice list (not to be confused with the LABELs) by right clicking on the field label and choosing Show Choice List. You will get a list of what those values are. That's what you want to use in the script. It might be (and I say this without looking at your system) that you need something like:



current.u_is_rolledback = 'yes'; // not 'Yes'


or


current.u_rolledback = 'false';


or


current.u_rolledback = '1'; //who knows... you'll have to look



find_real_file.png



http://wiki.servicenow.com/index.php?title=Customizing_Choice_Lists


i am using it in ui action


Sorry if I was unclear.



Please paste a screenshot of what you get when you se the "Show Choice List" option on that form's field. That will tell me what the actual value is on that field that needs to be used in the UI action.