- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2020 01:39 AM
For example, I have 10 lookup select boxes (u_var1, u_var2, u_var3, u_var4,...,u_var10).
On load of the form, I only need to show the first lookup select box (u_var1). Let's say the choices for this field are: 2, 3, 4,...,10. If I select 2, then u_var2 should be visible and mandatory, if I select 3, then u_var3 should visible and mandatory, etc. Do I need to create 9 Catalog UI Policies in order to achieve this?
I've tried setting the display of the other 9 fields to false onload using a Catalog UI Policy and I've used an onchange Catalog Client Script to show the field and to set it to mandatory but I think I'm missing the "reverse" functionality of the UI Policy by using this approach. It's working as expected on the first selection but if I selected another option, the other one is not hiding and it's still showing as mandatory.
I know I can do this using UI Policy but I just wanted to know if there's a shorter way to do this because I might end up creating a lot of UI Policies since all of the succeeding fields depends on what the user will select on the top field/s.
Thank you so much!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2020 01:43 AM
Hi there,
As you mentioned, UI Policy with UI Policy Actions would be the correct way. Though, you could end-up having really a lot of UI Policies... that feels a bot strange if we are talking about maintainability, and costs some time to setup!
So you could go for a Client Script. One place, to handle everything, one place to see all logic instantly. Though, who is going to maintain that client script in the future, is it readable enough, etc..
Kind regards,
Mark
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2020 01:43 AM
Hi there,
As you mentioned, UI Policy with UI Policy Actions would be the correct way. Though, you could end-up having really a lot of UI Policies... that feels a bot strange if we are talking about maintainability, and costs some time to setup!
So you could go for a Client Script. One place, to handle everything, one place to see all logic instantly. Though, who is going to maintain that client script in the future, is it readable enough, etc..
Kind regards,
Mark
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2020 02:58 AM
Yea, if I use client script, I think that would cost me some time to setup too since I need to hide and set to mandatory false the other fields when another field is selected (because as I've said, my current script doesn't do that at the moment) and that's why I'm hoping that someone has an answer that I haven't thought of yet because I feel like I'm missing something. Currently, I'm leaning towards using UI Policy since they will be easier to maintain since they will be individually set up though it will take more time to create everything.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2020 11:55 AM
Hi there,
Did this solve your question? Or do we need to follow-up on this?
Please mark this answer as correct if it solves your question. This will help others who are looking for a similar solution. Also marking this answer as correct takes the post of the unsolved list.
Thanks.
Kind regards,
Mark
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 10:11 AM
Hey, can you please help me I have a similar issue like that, I have to show a single-line text variable in the form when I choose the others option in my select box variable?