UI Policy not working displaying question with choices

Gemma4
Mega Sage

Hi everyone,

I have an odd issue I was hoping to get your expertise on. I created 2 UI Policies exactly as I've created other UI Policies that are working correctly. The first UI policy is to hide a variable, the 2nd is to display the variable if yes is selected. Attached are the details. As a result the question is being displayed in the drop down list of choices for the 2nd question. I've never seen that before. 

Both variables were select boxes and I tried to change one of them to yes/no in case "type" was the issue. Unfortunately that didn't work. I've also tested by marking each one inactive and the issue remains unless both are inactive. 

thanks in advance for any advice you have!

Gemma

2 ACCEPTED SOLUTIONS

Hi everyone,

I appreciate all the feedback. I marked inactive the "hide" ui policy and set the variable to hidden instead. Still have the same issue. I then renamed the variable to "team" and the 2nd variable to "name" to try to determine what is going and still the same issue. See attached. On a good note the 2nd variable is hidden but the drop down is still displaying with the original 2nd variable name. Is there a way I can trace to see what is causing that or any suggestions? 

thanks

Gemma

View solution in original post

Hello everyone, 

Just wanted to provide a quick update. I believe there must of been an issue with the UI Policies or the variables. I deleted them all and created new variables with a slightly changed name and then created the ui policies again. Finally everything is working as expected. Not exactly the solution I hoped for but glad all is working. Just wanted to share in case anyone else ran into the same problem. Thanks for all the feedback and guidance! 

thanks

Gemma

View solution in original post

5 REPLIES 5

Tony Chatfield1
Kilo Patron

Hi, looking at your screenshots the 'hide variable' policy has no conditions and would always be valid, also I think that the use of multiple policies to show hide a single field is unnecessary and likely to result in erratic behavior.
I would expect the 'If yes' policy to function correctly by itself, unless you are showing\hiding the field (or making it mandatory) elsewhere - UI policy or Client script.

Hi everyone,

I appreciate all the feedback. I marked inactive the "hide" ui policy and set the variable to hidden instead. Still have the same issue. I then renamed the variable to "team" and the 2nd variable to "name" to try to determine what is going and still the same issue. See attached. On a good note the 2nd variable is hidden but the drop down is still displaying with the original 2nd variable name. Is there a way I can trace to see what is causing that or any suggestions? 

thanks

Gemma

Hello everyone, 

Just wanted to provide a quick update. I believe there must of been an issue with the UI Policies or the variables. I deleted them all and created new variables with a slightly changed name and then created the ui policies again. Finally everything is working as expected. Not exactly the solution I hoped for but glad all is working. Just wanted to share in case anyone else ran into the same problem. Thanks for all the feedback and guidance! 

thanks

Gemma

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

I would start simplifying the situation. For example already looking at "Hide veriable3", this looks like hiding a variable on load without any conditions etc. Why using a UI Policy here at all? Just use the hidden=true checkbox on the Variable.

 

When simplifying such, you will get a way cleaner situation to work on.

 

Kind regards,
Mark

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn