Conflicting UI policies - variable set vs. Catalog Item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2022 01:27 PM
I think I'm running into some conflicts with UI policies, not sure how to resolve...
I created a variable set for shipping/delivery information. The first variable there asks if the end-user is in our home office campus. The yes/no there drives what questions they see, either building/floor/department, or shipping address. There's also a tracking number field that has UI policy to only make it visible on the requested items, don't want it to show up on the Portal.
This all works fine and dandy, the right fields are showing up at the right time, util...
There's a few requests that we have that conditionally hide/show the whole shipping variable set (example, delivery method: hard copy or digital, don't need to ship anything of digital). When the UI Policy on the Catalog Item runs to un-hide the shipping address fields, it un-hides all the fields, seemingly overriding the UI Policy set at the Variable Set level. Not quite sure how to troubleshoot this one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2022 01:35 PM
Hi Matt,
Have you tried the variable action logger? That shows the order of the UI policy and client scripts as they are executed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 04:49 AM
Oh, that's super handy. Didn't know that even existed.
From looking at that, it looks like the UI policy within the variable set isn't even being triggered. So, that's helpful to know.
I can see that the UI Policy on the variable set is being run when the form is loaded. I can see the UI policy that's hiding the shipping field variable set is "cascading" down and applying to all the individual fields in the variable set. Same with when the shipping fields variable set is being made visible, that's also "cascading" down to all the fields in the variable set, making them all visible and mandatory, though that's not what I wanted...
Is there a way to "force" re-running the policies at the variable set level afterwards? Or as Hitoshi said below do this UI policies all need to be set at the Item level, and don't really do a lot of good at the Variable Set level?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2022 04:35 PM
The cause is mentioned in the Now Support page below.
Set system property glide.sc.ui_policiy.variable_set_run_first will run the Catalog Item variable set first and would resolve the problem but it would affect all the catalog item forms.
Otherwise, it would be necessary to add the policies in the Variable Sets UI policies to the Catalog Item UI policy to make them take effect.
UI Policies on Catalog Item take precedence over UI Policies on Variable Sets. UI Policies on the Variable Sets runs first and then the UI Policies of the Catalog Item. Hence, if there are conflicting UI Policies, UI Policies on Catalog Item will always takes precedence over UI Policies on Variable Sets.
NOTE: There is one exception to the above rule. If the glide.sc.ui_policiy.variable_set_run_first property is set to false, then UI Policies on Variable Sets will run second and therefore take precedence over UI Policies on Catalog Items.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0551679