- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 05:30 PM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2024 10:56 AM
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:
Multi choice field having 3 choices as below:
Now, created 3 more field as below:
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
Similarly for Manager and recruitment:
For Manager:
Result:
Mark this as Helpful / Accept the Solution if this helps
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2024 09:18 AM - edited 07-20-2024 09:25 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2024 10:56 AM
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:
Multi choice field having 3 choices as below:
Now, created 3 more field as below:
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
Similarly for Manager and recruitment:
For Manager:
Result:
Mark this as Helpful / Accept the Solution if this helps
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2024 12:20 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2024 07:58 PM - edited 07-20-2024 08:08 PM
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.