Variable Set UI Policy Not triggering properly

ChrisLawer
Mega Guru

I have a catalog item where I have 4 variable sets in addition to the initial questions on the form. Each set pertains to a different section on the form.  In each set the 1st question is set as visible and mandatory. Based on input of the first question I turn on the remaining questions in the set. This works flawlessly in the first 3 variable sets, but on the last variable set when I answer the trigger question only one question displays.  The one that triggers is the one that has the lowest order. The rest won't display. They are all initially set to be hidden, and not mandatory. The UI policy is ideally turning them too mandatory and visible. 

Thoughts?

1 ACCEPTED SOLUTION

ChrisLawer
Mega Guru

Thank you to everyone for the suggestions. We found the culprit. For some reason having each variable set be surrounded by Containers was breaking the UI policy for the set. These particular UI policies are set on the Variable set themselves and not on the base catalog item, so I'm not sure why having containers start and end variables was causing a problem for one of the sets. 

I removed the containers and everything worked fine.

View solution in original post

6 REPLIES 6

vijaydodla
Giga Guru

 

Hi @ChrisLawer -

Can you try following to instantly see what is overriding your variables:

  1. Navigate to your Catalog Item in the Service Portal or standard UI.
  2. Open your browser's Developer Tools (F12) or use the built-in ServiceNow Variable Action Logger (if enabled in your instance).
  3. Trigger the 4th variable set. The logger will show you the exact sequence of UI Policies and Client Scripts firing. You will likely see your Variable Set UI Policy fire to show the fields, immediately followed by another Policy or Script hiding them again.

When I trigger them with the variable action logger or just in the try it version of screen, the variables show up. When I go to the actual employee center portal we use, they don't show up.

Hello @ChrisLawer 

Since the Catalog Client Scripts and UI Policies work as expected in the classic "Try It" view, the issue is likely related to their configuration set up. Please verify that the UI Type is set to All for all relevant Catalog Client Scripts, and also check any scripts within your UI Policies to ensure they're configured the same way.

 

I've also attached a screenshot for reference.

JuhiPoddar_0-1785378222001.png

JuhiPoddar_2-1785378524010.png

Hope this helps!

 

Thank You!

Juhi Poddar

Thank You!
Juhi Poddar

I don't have any client scripts.