How to Hide catalog item on service portal based on users country

Sanket Pawar
Tera Contributor

Hi All,

I have an requrement where the catalog item should be hidden on portal if the currently logged in user's country is Finland . Any guidance will be helpful.

 

Thanks!

16 REPLIES 16

Can you please check the user record of this user you are trying with?

and confirm the value present in field backend named 'Country'.

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

Dhruv Chandan
Giga Guru

Hi Saket,

 

The most efficient way to implement this would be to use "User Criteria". Please follow the below URL for details :-

 

https://docs.servicenow.com/en-US/bundle/utah-servicenow-platform/page/product/service-catalog-manag...

 

Hope this helps.

 

Regards,
Dhruv 

Ankur Bawiskar
Tera Patron
Tera Patron

@Sanket Pawar 

Share your user criteria script here

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

var country = 'Finland';
usr.get(gs.getUserID());
if (usr.country == country) {
retVal = true;
} else {
retVal = false;
}

@Sanket Pawar 

can you share complete script?

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader