UI policy to show fields to users of a particular group

saint
Tera Expert

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.

2 ACCEPTED SOLUTIONS

Manmohan K
Tera Sage

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;
}

 

  

View solution in original post

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

View solution in original post

5 REPLIES 5

AndersBGS
Tera Patron
Tera Patron

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):

AndersBGS_0-1686213433498.png

 

Afterwards create a UI Policy Action to make the field visible:

AndersBGS_1-1686213463469.png

 

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/

Manmohan K
Tera Sage

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;
}

 

  

Hi Manmohan,

Thanks for the suggestion. Is there a way to apply ACLs for a particular form view??

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