The CreatorCon Call for Content is officially open! Get started here.

How to Set Widget Visibility... Service Portal

ashishgupta
Tera Expert

1. I have a requirement to have a particular widget for a special category of the Service Catalogs.

Please can you help me out in setting the visibility of particular widget over "sc_cat_item" page for a special category of the Service Catalogs.

2. Also, I want to hide the Submit Button on the "SC Catalog Item" widget for particular service Catalog.

ctomasi

pradeepksharma

b-rad

26 REPLIES 26

Is there a way where we could have it use User Criteria? This way if we set up criteria on catalog items, we can use the same logic on the widget itself.


fschuster
ServiceNow Employee
ServiceNow Employee

User Criteria for Service Portal was released in Jakarta (see docs portal).



For the above two questions: first of all sorry for the late reply. Regarding hiding an HTML element based on a group membership, you can basically use the GlideSystem isMemberOf() function. If that returns true, you know that the user is member of the specific group. On the server, define a visibility variable in the data object to make the content available to the view (HTML) - e.g. "data.isMemberOfGroup". Then in your HTML, leverage for instance an ng-if to check for the value, e.g.: "<div ng-if="c.data.isMemberOfGroup"> your content goes here </div>".