<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question UI Policy in Community Central forum</title>
    <link>https://www.servicenow.com/community/community-central-forum/ui-policy/m-p/3475986#M5927</link>
    <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I'm having trouble applying a simple display rule via Catalog UI Policy.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;&lt;BR /&gt;Rule: When selecting field A, a subsequent field is displayed with 4 items (which is the total number of items displayed by the field), but when selecting field B, the subsequent field should only show 3 items, hiding only 1.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;What I've tried so far:&lt;BR /&gt;1st. Create rules using best practices by adding AND and OR as field conditions, e.g.:&lt;BR /&gt;u_name &amp;gt; is &amp;gt; A&lt;BR /&gt;u_name_test &amp;gt; in one of &amp;gt; 1,2,3,4&lt;BR /&gt;+ action = u_name_test (action correctly declared for field display)&lt;BR /&gt;&lt;BR /&gt;u_name &amp;gt; is &amp;gt; B&lt;BR /&gt;u_name_test &amp;gt; in one of &amp;gt; 1,2,3&lt;BR /&gt;+ action = u_name_test (action correctly declared for field display)&lt;BR /&gt;2nd. Via the UI Policy script itself:&lt;BR /&gt;UI Policy condition -&lt;BR /&gt;u_name &amp;gt; is &amp;gt; A&lt;BR /&gt;Execute if true:&lt;BR /&gt;g_form.clearOptions('u_name_test');&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; g_form.addOption('');&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; g_form.removeOption(');&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; execute if false:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; g_form.clearOptions('u_name_test');&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; g_form.addOption('');&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; ...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;Could someone tell me if there have been any updates from the new version of the instance, Zurich version?&lt;/SPAN&gt;&lt;SPAN class=""&gt; Does anyone have a solution to help me?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Jan 2026 14:51:48 GMT</pubDate>
    <dc:creator>PolyannaS</dc:creator>
    <dc:date>2026-01-27T14:51:48Z</dc:date>
    <item>
      <title>UI Policy</title>
      <link>https://www.servicenow.com/community/community-central-forum/ui-policy/m-p/3475986#M5927</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I'm having trouble applying a simple display rule via Catalog UI Policy.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;&lt;BR /&gt;Rule: When selecting field A, a subsequent field is displayed with 4 items (which is the total number of items displayed by the field), but when selecting field B, the subsequent field should only show 3 items, hiding only 1.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;What I've tried so far:&lt;BR /&gt;1st. Create rules using best practices by adding AND and OR as field conditions, e.g.:&lt;BR /&gt;u_name &amp;gt; is &amp;gt; A&lt;BR /&gt;u_name_test &amp;gt; in one of &amp;gt; 1,2,3,4&lt;BR /&gt;+ action = u_name_test (action correctly declared for field display)&lt;BR /&gt;&lt;BR /&gt;u_name &amp;gt; is &amp;gt; B&lt;BR /&gt;u_name_test &amp;gt; in one of &amp;gt; 1,2,3&lt;BR /&gt;+ action = u_name_test (action correctly declared for field display)&lt;BR /&gt;2nd. Via the UI Policy script itself:&lt;BR /&gt;UI Policy condition -&lt;BR /&gt;u_name &amp;gt; is &amp;gt; A&lt;BR /&gt;Execute if true:&lt;BR /&gt;g_form.clearOptions('u_name_test');&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; g_form.addOption('');&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; g_form.removeOption(');&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; execute if false:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; g_form.clearOptions('u_name_test');&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; g_form.addOption('');&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; ...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;Could someone tell me if there have been any updates from the new version of the instance, Zurich version?&lt;/SPAN&gt;&lt;SPAN class=""&gt; Does anyone have a solution to help me?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jan 2026 14:51:48 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/ui-policy/m-p/3475986#M5927</guid>
      <dc:creator>PolyannaS</dc:creator>
      <dc:date>2026-01-27T14:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: UI Policy</title>
      <link>https://www.servicenow.com/community/community-central-forum/ui-policy/m-p/3475992#M5928</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/834323"&gt;@PolyannaS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="otQkpb" role="heading" aria-level="3" data-animation-nesting="" data-sfc-cp="" data-processed="true"&gt;Verify with Using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="o8j0Mc" dir="ltr" data-processed="true"&gt;g_form.clearOptions&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;+&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="o8j0Mc" dir="ltr" data-processed="true"&gt;g_form.addOption,&lt;/CODE&gt;&lt;SPAN class="uJ19be notranslate" data-wiz-uids="UzAz5e_l" data-processed="true"&gt;&lt;SPAN class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=UzAz5e_k/TKHnVd" data-processed="true"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;instead of trying to remove one item,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;re-add all necessary items&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;every time the condition changes. This is the most reliable way to handle dynamic choice lists in Catalog UI Policies.&lt;/DIV&gt;
&lt;UL class="KsbFXc U6u95" data-processed="true"&gt;
&lt;LI data-hveid="CAUQAA" data-processed="true"&gt;&lt;SPAN class="T286Pc" data-sfc-cp="" data-processed="true"&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;UI Policy 1 (Condition: u_name is A)&lt;/STRONG&gt;&lt;/SPAN&gt;
&lt;UL class="KsbFXc U6u95" data-processed="true"&gt;
&lt;LI data-hveid="CAUQAQ" data-processed="true"&gt;&lt;SPAN class="T286Pc" data-sfc-cp="" data-processed="true"&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;Execute if True Script:&lt;/STRONG&gt;&lt;/SPAN&gt;
&lt;DIV class="r1PmQe" data-wiz-uids="UzAz5e_z,UzAz5e_10,UzAz5e_11" data-hveid="CAUQAg" data-processed="true"&gt;
&lt;DIV data-processed="true"&gt;
&lt;DIV class="pHpOfb" data-animation-atomic="" data-processed="true"&gt;
&lt;DIV class="pCTyYe" dir="ltr" data-processed="true"&gt;
&lt;PRE data-processed="true"&gt;&lt;CODE data-processed="true"&gt;&lt;SPAN class="undefined" data-processed="true"&gt;g_form.clearOptions(&lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'u_name_test'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;);
g_form.addOption(&lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'u_name_test'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;, &lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'1'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;, &lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'Item 1'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;);
g_form.addOption(&lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'u_name_test'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;, &lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'2'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;, &lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'Item 2'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;);
g_form.addOption(&lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'u_name_test'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;, &lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'3'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;, &lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'Item 3'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;);
g_form.addOption(&lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'u_name_test'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;, &lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'4'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;, &lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'Item 4'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;);
&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI data-hveid="CAUQBA" data-processed="true"&gt;&lt;SPAN class="T286Pc" data-sfc-cp="" data-processed="true"&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;UI Policy 2 (Condition: u_name is B)&lt;/STRONG&gt;&lt;/SPAN&gt;
&lt;UL class="KsbFXc U6u95" data-processed="true"&gt;
&lt;LI data-hveid="CAUQBQ" data-processed="true"&gt;&lt;SPAN class="T286Pc" data-sfc-cp="" data-processed="true"&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;Execute if True Script:&lt;/STRONG&gt;&lt;/SPAN&gt;
&lt;DIV class="r1PmQe" data-wiz-uids="UzAz5e_1c,UzAz5e_1d,UzAz5e_1e" data-hveid="CAUQBg" data-processed="true"&gt;
&lt;DIV data-processed="true"&gt;
&lt;DIV class="pHpOfb" data-animation-atomic="" data-processed="true"&gt;
&lt;DIV class="pCTyYe" dir="ltr" data-processed="true"&gt;
&lt;PRE data-processed="true"&gt;&lt;CODE data-processed="true"&gt;&lt;SPAN class="undefined" data-processed="true"&gt;g_form.clearOptions(&lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'u_name_test'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;);
g_form.addOption(&lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'u_name_test'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;, &lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'1'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;, &lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'Item 1'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;);
g_form.addOption(&lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'u_name_test'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;, &lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'2'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;, &lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'Item 2'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;);
g_form.addOption(&lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'u_name_test'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;, &lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'3'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;, &lt;/SPAN&gt;&lt;SPAN class="CS0cqb" data-processed="true"&gt;'Item 3'&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;);&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 27 Jan 2026 14:59:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/ui-policy/m-p/3475992#M5928</guid>
      <dc:creator>Nilesh Pol</dc:creator>
      <dc:date>2026-01-27T14:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: UI Policy</title>
      <link>https://www.servicenow.com/community/community-central-forum/ui-policy/m-p/3475994#M5929</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/834323"&gt;@PolyannaS&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;you can try the below code :&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || !newValue) {
        return;
    }

    // Clear existing options
    g_form.clearOptions('u_name_test');

    // Optional: add empty option
    g_form.addOption('u_name_test', '', '-- Select --');

    if (newValue == 'A') {
        // Show all 4 options
        g_form.addOption('u_name_test', '1', 'Option 1');
        g_form.addOption('u_name_test', '2', 'Option 2');
        g_form.addOption('u_name_test', '3', 'Option 3');
        g_form.addOption('u_name_test', '4', 'Option 4');
    }

    if (newValue == 'B') {
        // Show only 3 options
        g_form.addOption('u_name_test', '1', 'Option 1');
        g_form.addOption('u_name_test', '2', 'Option 2');
        g_form.addOption('u_name_test', '3', 'Option 3');
    }
}
&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 27 Jan 2026 15:01:53 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/ui-policy/m-p/3475994#M5929</guid>
      <dc:creator>sandeepdutt</dc:creator>
      <dc:date>2026-01-27T15:01:53Z</dc:date>
    </item>
  </channel>
</rss>

