Validate view (portal view or native ui view) in User Criteria for Catalog Item

Fin Nguyen
Tera Guru

Hi Community!

 

Is there any way to check if users are in Portal view or Native UI view in the User Criteria script? I would like to make an UC which allows users access catalog item from Native UI view (Service Catalog > Catalogue) only.

 

For example: Member of "Service Desk" group is able to access the "Leave request" catalog item in the Native UI view only, they will not be allowed to see this catalog item in the Service Portal view. So the condition in the UC should be: if (isMemberOf("Service Desk") && view == native UI view) => answer = true;. But I have no idea how to validate the view here.

 

The "Hide on Service Portal" option in Catalog item does not help here, because the catalog item is still need to be visible in Portal for the other users.

 

Thanks

Regards,
Fin Nguyen
1 REPLY 1

Amit Verma
Kilo Patron
Kilo Patron

Hi @Fin Nguyen 

 

Check if below post is helpful :

https://www.servicenow.com/community/developer-blog/community-code-snippets-getting-the-user-s-view/...

 

Thanks & Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.