Displaying Yes/No values on a True/False field

Micaela Alberti
ServiceNow Employee
ServiceNow Employee

Hi!

I created a "True/False" field and displayed it with a drop-down list with none, since the field will be a mandatory one.

I created related choices to the field in order to display:

No -> for "false" value

Yes -> for "true" value. 

The system is skipping it even though I put 0 and 1 as values and it is always displaying "true" and "false" as choices. Do you have any suggestions on how to do this without changing the type of the field?

 

Thank you

Micaela

1 ACCEPTED SOLUTION

Sandeep Kumar6
Giga Guru

Hi Micaela,

I understood your requirement.

What you can do is take one choice field and configure two choices in that like "True" --> Yes  and "False"--> No or vice versa

See the below diagram to do this.

find_real_file.png

In this case whenever you want to access the value of this choice field it will give you Yes or No. or configure vice versa you will get True or False.

 I wrote a on change client script to populate value and below is how I get answer exactly you needed.

 

find_real_file.png 

Please mark correct if this gave you correct answer.

Regards

Sandeep 

View solution in original post

7 REPLIES 7

Thank you Sandeep. 

I am just trying to have a drop down list with "yes" and "no" values, using a field type "true/false"

 

Micaela

Hey Micaela,

I have checked regarding this but this is not what ServiceNow provides.

There are different field types for respective purpose.

Please mark correct if this gave you correct answer.

Regards

Sandeep 

The best approach would hide the "True/False" field and create dropdown having None, True, False. Write a BR/Client Script on insert/submit set the field value using the script. So that if there are any existing scripts depending on the field and filters will not get affected.

 

Please mark correct if this gave you correct answer.