UI policy

Rishabh_N
Tera Contributor

Hi everyone,
I have 3 UI Policies, and each of them contains around 8–9 UI Policy Actions (show/hide and mandatory conditions for variables). But the UI Policies are not working as expected.

I already checked the Order and also tried Reverse if false, but it’s still not working properly.

(It is for catalog item)

2 ACCEPTED SOLUTIONS

@Rishabh_N 

 

I can see your screenshots.

The issue happens because you are using the same variable in multiple UI Policies.

 

For example, the variable “department” is set to mandatory = true in one policy and mandatory = false in another. This is not correct, because when the request is created, the variable will always follow the first policy, and for other request types it will conflict.

 

Instead of creating separate UI Policies that contradict each other, you should create a single UI Policy with conditions combined using AND (and/or OR when needed).

This way the logic will be consistent, and the variable will only behave as expected based on the right conditions.

 

 

See  Allen explanation 

 

https://www.servicenow.com/community/developer-forum/catalog-ui-policies-and-multiple-choice-variabl...

View solution in original post

prerna_sh
Mega Sage

Hi @Rishabh_N 


As you are setting 3 Ui policies for the same variable. As per servicenow, "setting the same variable as mandatory in one UI Policy and not mandatory in another" creates a conflict, and ServiceNow will only allow one state at a time, usually whichever UI Policy runs last, or which one is at higher precedence takes effect.
It is recommended to use "AND/OR conditions" in a single UI Policy to define your requirement, as @Rafael Batistot mentioned.


Please go through:
https://www.servicenow.com/docs/bundle/zurich-servicenow-platform/page/product/service-catalog-manag...
https://www.linkedin.com/pulse/conflicting-ui-policies-dan-covic/
https://support.servicenow.com/kb?id=
kb_article_view&sysparm_article=KB0551679

---------------------------------------------------------------------------------------------------------------------------------------------------

If my response solves your query, please marked helpful by selecting Accept as Solution and Helpful. Let me know if anything else is required.

Thanks,

Prerna

View solution in original post

13 REPLIES 13

Hi @AndersBGS 

yes i have verified. There are no other UI policies or Client script are interfering 

Shashank_Jain
Kilo Sage

@Rishabh_N , 

 

I would recommend you to go through this support KB article.

Link - https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0547063

In this article, they’ve explained different ways to troubleshoot UI Policies.

 

From my understanding, the issue might be due to an order mismatch, since multiple UI Policy actions are being applied to the same fields.

 

Hope it helps!

 

If this works, please mark it as helpful/accepted — it keeps me motivated and helps others find solutions.
Shashank Jain

prerna_sh
Mega Sage

Hi @Rishabh_N 


As you are setting 3 Ui policies for the same variable. As per servicenow, "setting the same variable as mandatory in one UI Policy and not mandatory in another" creates a conflict, and ServiceNow will only allow one state at a time, usually whichever UI Policy runs last, or which one is at higher precedence takes effect.
It is recommended to use "AND/OR conditions" in a single UI Policy to define your requirement, as @Rafael Batistot mentioned.


Please go through:
https://www.servicenow.com/docs/bundle/zurich-servicenow-platform/page/product/service-catalog-manag...
https://www.linkedin.com/pulse/conflicting-ui-policies-dan-covic/
https://support.servicenow.com/kb?id=
kb_article_view&sysparm_article=KB0551679

---------------------------------------------------------------------------------------------------------------------------------------------------

If my response solves your query, please marked helpful by selecting Accept as Solution and Helpful. Let me know if anything else is required.

Thanks,

Prerna

@prerna_sh 

Actually  I was not able to achieve this requirement using a single UI policy. Could you please guide me on how to do it with one UI policy, or would using a client script be a better approach in this case?