Catalog UI policy

MohdF
Tera Contributor

Hi all, I am creating a service catalog and in a variable set I have three variables of multiple choice named contact, manager and recruitment. And below these variables I have three reference field variables named manager's name, contact's name, and recruiter. 

I need when I select one of the multiple choice option, one of the reference field variable becomes mandatory and the other two becomes invisible or gone like for manager>>>manager's name should be mandatory and the other two gone.

 

 

When I am doing it by UI policies, things getting fumbled, sometimes it works some times it doesn't.

Attached is the screenshot of that variable set in service portal. Please help.

1 ACCEPTED SOLUTION

SN_Learn
Kilo Patron
Kilo Patron

Hi @MohdF ,

I have set this up in PDI and it is working as expected, please have a look at the below references:

 

Variable Set:

SN_Learn_2-1721497668515.png

 

 

Multi choice field having 3 choices as below:

SN_Learn_1-1721497620708.png

 

Now, created 3 more field as below:

SN_Learn_3-1721497760871.png

 

Now, we will setup the Catalog UI Policies and UI policy actions as below:

 

1. To Show the contact manager field when contact is selected

SN_Learn_4-1721497895590.png

 

Similarly for Manager and recruitment:

SN_Learn_5-1721498014203.png

 

For Manager:

 

SN_Learn_6-1721498051176.png

 

 

Result:

 

SN_Learn_7-1721498111326.pngSN_Learn_8-1721498123888.png

SN_Learn_9-1721498134317.png

Mark this as Helpful / Accept the Solution if this helps

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

View solution in original post

4 REPLIES 4

abirakundu23
Mega Sage

Hi @MohdF ,

In order to achieve this requirement please create UI policy in ServiceNow carefully & it should be consistent behavior.
1.Please create the following variables in your variable set:
Multiple Choice Variables: contact, manager, recruitment
Reference Field Variables: manager_name, contact_name, recruiter
2. Create Catalog UI Policy under variable sets.

a. Configure UI Policies Visibility for 'Manager Selection':
Display manager_name when manager is selected and hide 'contact_name' and 'recruiter' as per requirement.


Please select table as your Variable Set.

Conditions:

When: Active is true
Set: Multiple Choice -> Manager is selected
Actions: Manager name is Mandatory.

Set Order properly if you have multiple UI policy on same field.
Please create similar UI policies for others two variable selection like contact_name & recruiter.

Please mark helpful & correct answer if it's really worthy for you.

SN_Learn
Kilo Patron
Kilo Patron

Hi @MohdF ,

I have set this up in PDI and it is working as expected, please have a look at the below references:

 

Variable Set:

SN_Learn_2-1721497668515.png

 

 

Multi choice field having 3 choices as below:

SN_Learn_1-1721497620708.png

 

Now, created 3 more field as below:

SN_Learn_3-1721497760871.png

 

Now, we will setup the Catalog UI Policies and UI policy actions as below:

 

1. To Show the contact manager field when contact is selected

SN_Learn_4-1721497895590.png

 

Similarly for Manager and recruitment:

SN_Learn_5-1721498014203.png

 

For Manager:

 

SN_Learn_6-1721498051176.png

 

 

Result:

 

SN_Learn_7-1721498111326.pngSN_Learn_8-1721498123888.png

SN_Learn_9-1721498134317.png

Mark this as Helpful / Accept the Solution if this helps

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

MohdF
Tera Contributor

Thank you so much, it worked perfectly but I need to know why all other reference fields gets hidden when only UI policy action is selected for only field accordingly?

Due to the conditions of each UI policy, other are getting hidden as not executing true. Also, the onLoad checkbox is ticket which also runs as the form loads for all the 3 ui policies defined.

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.