Widget flow in service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
Hi,
Need information about widget restriction in service portal.
currently we are having 6 clients , in one of the client portal they requested to build the new widget which should be visible to only one client portal .
can we do this requirement in the client portal or is there any limitations.
Thanks,
Bhagya.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
Hi @BhagyasriCh ,
Yes, it is possible to restrict a widget to only one client’s portal in ServiceNow.
You can achieve this in one of the following ways:
1.Add the widget only to that portal’s page – the simplest method if each client has separate pages.
2.Use portal check inside the widget script – if using shared pages, check the portal ID using $sp.getPortal() and conditionally show the widget.
example server script-
(function() {
var portal = $sp.getPortal();
data.showWidget = (portal == 'client1_portal'); // Replace with your portal sys_id
})();
In Html validate like this-
<div ng-if="data.showWidget">
<!-- Widget content goes here -->
</div>
3.Use user roles or company-based logic – restrict visibility based on the logged-in user's role, group, or company.
If my response is helpful please mark as helpful and accept as solution
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi Nawal,
Thanks for your reply,
We tried the same the widget is not showing for all the clients.
in html what we need to mention the widget content?
thanks,
bhagya.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi @BhagyasriCh ,
Yes you need to write down the widget content or you can call the existing widget
for existing widget call refer below community link-
https://www.servicenow.com/community/itsm-forum/call-a-widget-from-another-widget/td-p/755962
Hope it will solve your issue let me know if you need any additional help!!
Please mark as helpful if my response help you @BhagyasriCh .
Thank you!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago - last edited 5 hours ago
@BhagyasriCh Widgets and portal pages do have user criteria.
Add user criteria to your widget (code should return answer true or false based on client condition)
Please mark the answer correct/helpful accordingly.