<h2>How to change the execution order of Catalog UI Policies in Catalog Items and Variable Sets</h2><br/><div style="overflow-x:auto"><article><div ><h3 >Issue </h3><section><style type="text/css"><!-- div.margin{ padding: 10px 40px 40px 30px; } table.tocTable{ border: 1px solid; border-color:#E0E0E0; background-color: rgb(245, 245, 245); padding-top: .6em; padding-bottom: .6em; padding-left: .9em; padding-right: .6em; } <span id="CmCaReT"></span> table.noteTable{ border:1px solid; border-color:#E0E0E0; background-color: rgb(245, 245, 245); width: 100%; border-spacing:2; } table.internaltable { white-space:nowrap; text-align:left; border-width: 1px; border-collapse: collapse; font-size:14px; width: 85%; } table.internaltable th { border-width: 1px; padding: 5px; border-style: solid; border-color: rgb(245, 245, 245); background-color: rgb(245, 245, 245); } table.internaltable td { border-width: 1px; padding: 5px; border-style: solid; border-color: #E0E0E0; color: #000000; } .title { color: #D1232B; font-weight:normal; font-size:28px; } h1{ color: #D1232B; font-weight:normal; font-size:21px; margin-bottom:-5px } h2{ color: #646464; font-weight:bold; font-size:18px; } h3{ color: #000000; font-weight:BOLD; font-size:16px; text-decoration:underline; } h4{ color: #646464; font-weight:BOLD; font-size:15px; text-decoration:; } h5{ color: #000000; font-weight:BOLD; font-size:13px; text-decoration:; } h6{ color: #000000; font-weight:BOLD; font-size:14px; text-decoration:; } --></style> <div class="margin"> <p class="title">How to change the execution order of Catalog UI Policies in Catalog Items and Variable Sets</p> <br /><br /> <h1>Overview</h1> <hr style="border-top-width: 1px; border-top-style: solid; border-top-color: #cccccc;" /> <div> <div>This article helps to understand the order of execution of Catalog UI Policies, and the usage of the system property <strong>glide.sc.ui_policy.variable_set_run_first</strong>. These aspects are important when designing Catalog Items.</div> <div><br /></div> <div><br /></div> Catalog UI Policies can be found in a Catalog Item, or in a Variable Set. As described in the documentation below, out of the box, Catalog UI Policies on Variable Sets will run first, followed by Catalog UI Policies on Catalog Items.</div> <div><br /></div> <div>Ref.:</div> <div><a href="https://docs.servicenow.com/csh?topicname=r_ServiceCatalogProperties.html&version=latest" rel="nofollow">https://docs.servicenow.com/csh?topicname=r_ServiceCatalogProperties.html&version=latest</a></div> <div><a href="https://docs.servicenow.com/csh?topicname=c_ServiceCatalogUIPolicy.html&version=latest" rel="nofollow">https://docs.servicenow.com/csh?topicname=c_ServiceCatalogUIPolicy.html&version=latest</a></div> <div><br /></div> <div>A Variable Set contains common variables that will be used in many Catalog Items. Within in a Variable Set, you might want to make a variable mandatory. In order to do this, you will need to create a Catalog UI Policy within the Variable Set.</div> <div><br /></div> <div>However, for a particular Catalog Item, you might not want that variable to be mandatory or hidden. To avoid this, create a Catalog UI Policy on the Catalog Item. UI Policies for catalog items always take precedence over UI Policies for variable sets. Catalog UI Policies will run last, meaning the variable will not be mandatory.</div> <div><br /></div> <div>The mentioned property <strong>glide.sc.ui_policy.variable_set_run_first</strong> will reverse the order.</div> <div><br /></div> <div>The default value for this property is <strong>true</strong>. Variable Set UI Policies run first, Catalog Item UI Policies run last.</div> <div><br /></div> <div>If you notice that your UI Policies are running in an odd or unexpected order, check the value of this property an ensure that it is set to true.</div> <div><br /></div> <div>Setting this property to <strong>false</strong> is not recommended. Always design your Catalog UI Policies across Catalog Items and Variable Sets around the documented run order: Variable Sets first, Catalog Items last.</div> </div></section></div></article></div>