How to make a field visible only to the groups starting 'XYZ Apps'
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â03-05-2025 02:38 AM - edited â03-05-2025 02:42 AM
I have created custom field 'Classification' created on incident table. This field should be visible only for the groups starting with 'XYZ Apps'
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â03-05-2025 02:41 AM
you can create field level READ ACL and check the logged in user group sysIds
then query Group table with filter condition as Name Starts with XYZ Apps
Ensure there is only 1 field level READ ACL on that field
Something like this in advanced script
var groups = new global.ArrayUtil().convertArray(gs.getUser().getMyGroups());
var gr = new GlideRecord("sys_user_group");
gr.addQuery("sys_id", "IN", groups);
gr.addEncodedQuery('nameSTARTSWITHXYZ Apps');
gr.setLimit(1);
gr.query();
answer = gr.hasNext();
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards,
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader