- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2020 08:20 AM
Hi all,
I want to Hide few fields in Incident form for certain groups accessing it in servicenow. how can i achieve this thorough UI policy or ACL or Business rule.
thanks
Siddharth
Solved! Go to Solution.
- Labels:
-
Application Portfolio Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2020 10:35 PM
Glad that it worked.
Would you mind marking my response as correct & helpful if I am able to resolve your query?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2020 08:31 AM
Hi Siddharth,
There are couple of approaches based on how many fields you want to hide
You cannot check group membership in UI Policy condition:
1) you need to create individual field level READ ACLs on those fields and in advanced script section use this
If logged in user is not member then it hides the field
answer = !gs.getUser().isMemberOf('GROUP ABC'); // pass group name here
OR
2) Another approach would be using Display BR and onLoad Client Script if you have more number of fields
Display BR:
g_scratchpad.isMember = gs.getUser().isMemberOf('GROUP ABC'); // pass group name here
Client Script:
function onLoad(){
if(g_scratchpad.isMember.toString() == 'false'){
// hide your fields one by one
g_form.setVisible('field1', false); // your field name here
g_form.setVisible('field2', false); // your field name here
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2020 08:53 AM
Hi Ankur,
Thanks for the information , in the client script were to we mention the group name please
Because i have tried this onload script ,can you please tell me where do i use group name.
Thanks
Siddharth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2020 09:41 AM
Hi Sidharth,
Along with onLoad client script you need to write display business rule as well on that table.
There is no function in client side to check group membership.
So please create display business rule on the table and apply the code
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2020 02:35 AM
Hello Ankur
How to include multiple groups those shouldn't be able to view a few set of form fields
Could you help me out on the approach?