Form Builder -> UI Policy based on if the usser looking at it is part of specific group.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2025 11:30 AM
Is this possible to do inside the UI policy builder from the form builder?
I see an "End User" option but I don't know if that means what I think it means. Trying to setup a policy on a field so that it is ONLY editable if the person looking at the form is in a specific group.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2025 10:59 PM
Hello @bigbacon,
You can control field editability based on user group membership, but UI Policies by themselves don't directly support checking if a user is in a specific group via the UI Policy Builder (like a dropdown or condition builder).
If my response helped please mark it as correct,
Best Regards,
Rohan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2025 06:51 AM
Is that done through business rule?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2025 07:09 AM
Sorry what's your requirement?
Are you saying a field should be readonly, editable or visible if logged in user is part of some particular group?
If yes then you can use display business rule on that table and use scratchpad variable, please enhance below
Display Business rule:
(function executeRule(current, previous /*null when async*/) {
// Replace 'sys_id_of_group' with the actual sys_id of your target group
g_scratchpad.isGroupMember = gs.getUser().isMemberOf('sys_id_of_group');
})(current, previous);
Client Script:
function onLoad() {
// Check if the scratchpad variable is true
if (g_scratchpad.isGroupMember === true) {
// Show the field (replace 'field_name' with your field's name)
g_form.setDisplay('field_name', true);
} else {
// Hide the field
g_form.setDisplay('field_name', false);
}
}
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
06-05-2025 03:18 AM
Hope you are doing good.
Did my reply answer your question?
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