Hide Icon Link in Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2018 12:38 AM
Hi All,
I have created a Icon Link "Test List" in Service Portal home page.
Now i need to make it visible only for specific group(ex. Hardware). How can we do that.
Below is the sceen shot for your reference.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2018 01:21 AM
You can have something like this in your server script:
var currUser = gs.GetUser();
data.currUserRole = currUser.getRoles();
And in your client script, you can hide that card using angularjs:
HTML
<div ng-show="showCard">
...
...
</div>
client script:
if(data.currUserRole.indexOf("hardware") <= -1){
$scope.showCard = true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2018 01:50 AM
Hi Ercel,
I do not find those fields in the form to write the scripts.
Can you please help me on where should i write the scripts.
Thanks,
Kiran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2018 03:06 AM
Try CTRL + right click anywhere near the your card then select Widget Editor.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2020 01:11 AM
Hi there,
We had the same question. There are since the last family release quite simple options to have Widgets visible for particular roles.You can clone for instance the "Icon link" widget and add a role to the cloned one to be used on your Portal. This is straight forward.
Another more advanced ability is to enable User Criteria for Service Portal (Widgets). For more check out:
https://docs.servicenow.com/bundle/paris-servicenow-platform/page/build/service-portal/task/activate-user-criteria.html
Please mark helpfull or answered if this helps you out 🙂
Regards, Peter