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

Sri Harsha3
Tera Expert

How did you display true/false field in a dropdown?

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 

Micaela Alberti
ServiceNow Employee
ServiceNow Employee

Thank you Sandeep! I was trying to avoid doing a choice list just for a boolean value and would have rather used a true/false field. That's why I tried to do it in this way.

 

Hi Sri! I went in the dictionary entry of the field and selected it in the "choice list specification" tab. I supposed it was working also for the "true/false" field since it is available on the form (see attachment). 

Hey Micaela ,

Sorry but I dont think i understood your question then.

Another way I am getting in my mind is that you can make this field dependent and use on change client script to dynamically set value and populate them. 

Please mark correct if this gave you correct answer.

Regards

Sandeep