UI Policy action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2025 09:07 AM
I have a catalog and form, where I have to implement the requirement:
if engagement id : 1234, then private checkbox should be auto checked means true. Private checkbox is true/false type field on table.
How to implement in form view and workspace view?
In catalog view, there is catalog UI Policy action created with value action : Set value and value true.
but in form view, UI policy action I dont see value action, I can see only clear the field value.
Please Help me with form view and workspace view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 02:10 AM
So by condition, you want to set the value if I understood correctly. So this can follow below or another way is to the Client script.
function onLoad(){
g_form.setValue('variable', name);
}
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 01:50 AM
Since you want to set the value, please use onChange client script which applies on both the view
onChange on Engagement id
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (newValue == '1234')
g_form.setValue('privateCheckboxVariable', true);
else
g_form.clearValue('privateCheckboxVariable');
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 02:06 AM
Here, engagement id is reference field, so I wasnot able to use this code, it is referring to another opportunity table with opportunity id field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 02:26 AM
Hi @KiranmaiP,
Since Engagement ID is reference field, you need add the sys_id of the '1234' record in the if Condition.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (newValue == 'SYSID_OF_1234')
g_form.setValue('privateCheckboxVar', true);
else
g_form.clearValue('privateCheckboxVar');
}
If you found my response helpful, please mark it as Solution and Helpful.
Thanks and Regards,
Ehab