How to create Function Field for true false type ? How to set that check box true or false .

SachinPol
Tera Contributor

I have created true false function field . What to write in Funtion Defination . So I can set that true false ?

1 ACCEPTED SOLUTION

Siddhesh Gawade
Mega Sage
Mega Sage

Hello @SachinPol ,

 

A function field can be only set from function definition. Open the dictionary of function field that you created. you will find the function definition option. 


Here you can write a code to use glidefunction operation, For example: glidefunction:concat(active).

 

Using this you should be able to set value of active field to you function field. you can dot-walk other reference fields as well from you table but can only set value from true/false type fields. As your function field is true/false type itself.

 

Explore below servicenow documentation to find out about other available operations as well.

https://www.servicenow.com/docs/bundle/yokohama-platform-administration/page/build/platform-function...

 

Kindly mark the answer ✔️ Correct or Helpful ✔️ If it addresses your concern.


Regards,

Siddhesh

 

View solution in original post

4 REPLIES 4

_Gaurav
Kilo Sage

Hi @SachinPol 
The true/false looks like a checkbox. The default value would be false, and when you set the value to true, the checkbox will get checked.

Please mark the answer as helpful if this resolves your query.
Thanks!

But How to  set the value to true ?

Hello @SachinPol 
You can use
g_form.setValue('your_variable_backend_name',true);

OR

g_form.setValue('your_variable_backend_name',false);

Siddhesh Gawade
Mega Sage
Mega Sage

Hello @SachinPol ,

 

A function field can be only set from function definition. Open the dictionary of function field that you created. you will find the function definition option. 


Here you can write a code to use glidefunction operation, For example: glidefunction:concat(active).

 

Using this you should be able to set value of active field to you function field. you can dot-walk other reference fields as well from you table but can only set value from true/false type fields. As your function field is true/false type itself.

 

Explore below servicenow documentation to find out about other available operations as well.

https://www.servicenow.com/docs/bundle/yokohama-platform-administration/page/build/platform-function...

 

Kindly mark the answer ✔️ Correct or Helpful ✔️ If it addresses your concern.


Regards,

Siddhesh