- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I need to have the Email client attribute to show only for logged in users with a certain role. can someone please help?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Then please inform customer that this requirement is not feasible.
š” If my response helped, please mark it as correct ā and close the thread šā this helps future readers find the solution faster! š
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Gary Larsen ,
To show the Email client attribute field only to logged-in users with a specific role in ServiceNow, you can control field visibility using an Access Control Rule (ACL) or via UI policies with role checks.
Here are two main approaches:
1. Using Field-Level ACL
Create a read and/or write ACL on the Email client attribute field for the table where it exists.
Go to System Security > Access Control (ACL).
Create a new ACL of type field for the Email client attribute field on the respective table.
In the Requires role section, add the role(s) allowed to see (read) or edit (write) this field.
Users without the role wonāt be able to see or interact with the field when logged in.
This ensures the field is securely hidden from all users not in the required role, independent of UI customizations.
2. Using UI Policy with Role Condition
If you want to hide/show based on role on the client side:
Create a UI Policy for the form where Email client attribute exists.
Set the UI Policy to be active for all users.
Add a UI Policy Condition or in the UI Policy script, check if gs.hasRole('your.role.name').
If the user has the role, set the field visible; otherwise hide it.
(function executeUIActionRule() {
var userHasRole = g_user.hasRole('your.role.name'); // Use g_user for client scripts
g_form.setDisplay('email_client_attribute_field_name', userHasRole);
}
)
();
Recommended Approach
For strict security and data protection, use ACLs.
For UI-only visibility toggling without strong security enforcement, UI Policies suffice.
You can combine both for best security and user experience.
If it is helpful, please hit the thumbs button please mark the answer as correct based on the impact!!
Kind Regards,
Shaik Mohammed Mustaq
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Gary Larsen,
the response above is clearly copied from gen AI client and is not much helpful.
Regarding the Email icon, I will try to search around in my PDI.
However, as it is in backend, it requires ITIL for minimum - meaning that without itil you don't see that incident at all :)))
It might be difficult or impossible to modify it as it is a part of the menu bar which is present in all views š so it can be some macro or other thing...
What's the business justification for this? ServiceNow designed it to give the chance to all who can see the incident and you want to revoke this feature, why?
/* If my response wasnāt a total disaster āļø ā drop a Kudos or Accept as Solution ā āļø Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @Gary Larsen again,
I found this article, not the same but similar:
How do I disable the 'Toggle Template Bar' from the 'more options' menu.
That is just how to hide it for all, but you can add there some role validation with g_user.hasRole() or hasRoleExactly()
And the Email is mentioned here:
KB0712446 | How to add or remove the Email option on a form header menu
Let me know if that helped you, I have not tested myself so it's with no guarantee but I guess it cost you nothing to try š
EDIT: I was curious so I tried in my end anyways:
System dictionary > incident table > Email client: true x false:
TRUE
FALSE
This can give you idea on how to hide it for none or all, if you want to do it as per specific role(s), then it will have to be modifying this values upon loading... is that really worthy developing??? :)))
let me know what do you think about it?
@Me Being Mustaq or you had some other approach? please share with us
/* If my response wasnāt a total disaster āļø ā drop a Kudos or Accept as Solution ā āļø Cheers! */
