- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 11:15 PM
I have created true false function field . What to write in Funtion Defination . So I can set that true false ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 06:59 AM
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.
Kindly mark the answer ✔️ Correct or Helpful ✔️ If it addresses your concern.
Regards,
Siddhesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 10:57 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 11:00 PM
But How to set the value to true ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 06:26 AM
Hello @SachinPol
You can use
g_form.setValue('your_variable_backend_name',true);
OR
g_form.setValue('your_variable_backend_name',false);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 06:59 AM
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.
Kindly mark the answer ✔️ Correct or Helpful ✔️ If it addresses your concern.
Regards,
Siddhesh