- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 01:23 AM
Hi Experts,
I want to create a UI policy to show few fields to users from particular groups. Please suggest how should I approach it.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 01:32 AM - edited 06-08-2023 01:33 AM
Hi @saint
UI policy would not be the right choice for what you are trying to achieve if they are not stored in some field of the form
Please create a read ACL for those fields and you can write script in ACL to only allow users of particular groups as done below
if(gs.getUser().isMemberOf(group_name/group_sysid) || gs.getUser().isMemberOf(group2_name/group2_sysid))
{
answer= true;
}
else
{
answer=false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 03:22 AM
No, Not possible in ACL
An alternate approach would be to write a on load client script and it can work for a particular view.
You can use GlideAjax and call a script include from client script to check if logged in user is member of certain group .Based on the result returned by Script Include, you can show or hide fields on the form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 01:32 AM - edited 06-08-2023 01:38 AM
Hi @saint ,
1. Create the field on the form as needed.
2. Create the UI policy as below
just create a UI policy according to below for the specified assignment group (I have utilized incident table):
Afterwards create a UI Policy Action to make the field visible:
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
best regards
Anders
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 01:32 AM - edited 06-08-2023 01:33 AM
Hi @saint
UI policy would not be the right choice for what you are trying to achieve if they are not stored in some field of the form
Please create a read ACL for those fields and you can write script in ACL to only allow users of particular groups as done below
if(gs.getUser().isMemberOf(group_name/group_sysid) || gs.getUser().isMemberOf(group2_name/group2_sysid))
{
answer= true;
}
else
{
answer=false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 03:00 AM
Hi Manmohan,
Thanks for the suggestion. Is there a way to apply ACLs for a particular form view??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 03:22 AM
No, Not possible in ACL
An alternate approach would be to write a on load client script and it can work for a particular view.
You can use GlideAjax and call a script include from client script to check if logged in user is member of certain group .Based on the result returned by Script Include, you can show or hide fields on the form