Service portal Widget visibility

k_jayanth
Tera Contributor

I have a requirement where i have to hide few widgets from end users according to their groups. Is there any way to achieve this without creating any role.

Thank You,

Jayanth

3 REPLIES 3

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Using the default ui for a widget you can only hide by role, but you could always edit the widget code. You could do something like using an ngIf in the opening div and have it check the user's groups.


Here is an example of show/hide of a widget based on logged in user's business phone. If user has a phone number saved in his profile, user should be able to view the widget else the widget won't appear.



Untitled.png



Thank you,


Sudipta


This also worked when using the Icon Link Widget, I just cloned and added the ng-if logic to show the Icon Link only when needed:

HTML:

find_real_file.png

Server Script: