is it possible to make a section of the catalog request form only available to certain groups?

JLeong
Mega Sage

Good day!

 

Is it possible to make a section of the catalog request form only available to certain group of users?

 

Example, a set of questions are only applicable and visible to users in Poland.

 

Thank you!

 

Regards,

Jocelyn

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@JLeong 

Yes why not.

You can use onLoad catalog client script and check logged in user's location.

if not Poland then use g_form.setDisplay('variable1', false); to hide

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

Bhimashankar H
Mega Sage

Hi @JLeong ,

 

You can do it using the UI policy. Keep onLoad checked and reverseIfFalse.

Add your specific condition then write the below script in execute if true

function onCondition() {

   g_form.setVisible('section_name', true); //setVisible true/false based on your condition

}

 

Thanks,
Bhimashankar H

 

-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@JLeong 

Yes why not.

You can use onLoad catalog client script and check logged in user's location.

if not Poland then use g_form.setDisplay('variable1', false); to hide

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@JLeong 

I believe I answered your question as well.

As per new community feature you can mark multiple responses as correct.

The answer marked as correct talks about using UI policy.
In UI policy you can't check logged in user's country in Condition field then how it's going to work?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @JLeong 

 

yes mate you can try with Catalog UI policy and hide it or use the client script.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Shruti D
Tera Guru

Hello @JLeong,

Yes, you can make a section of catalog request form visible only to certain group by applying UI Policies or Catalog Client Scripts.

You can use onLoad Catalog client Script with below logic:

function onLoad() {

    if (g_user.isMemberOf('Group name')) {
        g_form.setDisplay('variable_name', true);
    } else {
        g_form.setDisplay('variable_name', false);
    }
}


Please Mark Correct ✔️ if this solves your query and also mark Helpful 👍 if you find my response worthy based on the impact.


Regards,
Shruti