Hide container in portal based on user record

David Sloan
Giga Guru

I have a user-defined field on the sys_user table. Based on this field I would like to show/hide containers on the home page of our portal. As I understand it, you cannot OOB hide a container based on user criteria, so what is the best way to do this? Should I add a script to that portal page that checks this value and shows/hides the DOM element accordingly? As I understand it, this method is not advised. So what is advised? And if I am creating a script on the page, how do I check that value from the server?

10 REPLIES 10

Jaspal Singh
Mega Patron
Mega Patron

Hi David,

 

There exists an option of User criteria for Service Portal (a plugin) which can be used for restricting widgets. Not completely sure but you can give it a look by following link.

 

Thanks,

Jaspal Singh

I am familiar with this option, but it only works for widgets or pages, not for containers. I need entire containers to be hidden, so this will not work for me.

Namrata Khabale
Giga Guru

Hey David ,

Not sure about containers OOB, but you could introduce User criteria for the Service Portal:

For that refer the Link:

 

 https://docs.servicenow.com/bundle/london-servicenow-platform/page/build/service-portal/concept/user...

 

Kindly Mark Correct if this solves your issue and also mark  Helpful if you find my response worthy!

 

 

Best Regards,

Namrata

I have used user criteria elsewhere, but it only works for pages or widgets, not for containers, so this does not meet my need.