<?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 Re: Populate choices on a field based on choices from two other fields in ITSM forum</title>
    <link>https://www.servicenow.com/community/itsm-forum/populate-choices-on-a-field-based-on-choices-from-two-other/m-p/2753374#M508751</link>
    <description>&lt;P&gt;Hi &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/206007"&gt;@divyakosaraju&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you try the data lookup way, create a lookup table,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Match the choices and set the results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a look ootb priority lookup and try once.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Dec 2023 20:06:55 GMT</pubDate>
    <dc:creator>Dr Atul - LNG</dc:creator>
    <dc:date>2023-12-05T20:06:55Z</dc:date>
    <item>
      <title>Populate choices on a field based on choices from two other fields</title>
      <link>https://www.servicenow.com/community/itsm-forum/populate-choices-on-a-field-based-on-choices-from-two-other/m-p/2753322#M508747</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a field name solution which is dependent on two other choice fields . below is the scenario&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;field 1 - Choice 1, choice 2, choice 3&lt;/P&gt;&lt;P&gt;field 2 -choice a, choice b, choice c, choice d&lt;/P&gt;&lt;P&gt;solution - prod , dev, QA, training ,POC, sandbox etc.,.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now based on field 1 and field 2 , I need to populate solution choices&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if field 1 is choice 1 &amp;amp;&amp;amp; field 2 is &amp;nbsp;either choice a||choice b||choice d, then solution choices should be PROD, DEV and QA&lt;/P&gt;&lt;P&gt;if field 1 is choice 3 &amp;amp;&amp;amp; field 2 is &amp;nbsp;choice c||choice d, then solution choices should be PROD, DEV, sandbox, training and QA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried client script but is not working. I am not sure if decision table works as I cannot select my field choices of that table as a result&lt;/P&gt;&lt;P&gt;Please kindly help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My client script is Onchange on field 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;function&amp;nbsp;onChange(control, oldValue, newValue, isLoading, isTemplate) {&lt;/P&gt;&lt;P&gt;if&amp;nbsp;(isLoading || newValue ===&amp;nbsp;'') {&lt;/P&gt;&lt;P&gt;return;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var&amp;nbsp;f1 = g_form.getValue('field 1');&lt;/P&gt;&lt;P&gt;var&amp;nbsp;f2 = g_form.getValue('field 2');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if&amp;nbsp;(newValue ==&amp;nbsp;1&amp;nbsp;)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;if&amp;nbsp;(f2 ==&amp;nbsp;"choice a"&amp;nbsp;|| f2 ==&amp;nbsp;"choice b"&amp;nbsp;|| f2 =="choice d"&amp;nbsp;){&lt;/P&gt;&lt;P&gt;g_form.clearOptions('solution');&amp;nbsp;&lt;/P&gt;&lt;P&gt;g_form.removeOption('solution','3','Test');&lt;/P&gt;&lt;P&gt;g_form.removeOption('solution','5','Training');&lt;/P&gt;&lt;P&gt;g_form.removeOption('solution','13','POC');&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 18:57:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/populate-choices-on-a-field-based-on-choices-from-two-other/m-p/2753322#M508747</guid>
      <dc:creator>divyakosaraju</dc:creator>
      <dc:date>2023-12-05T18:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Populate choices on a field based on choices from two other fields</title>
      <link>https://www.servicenow.com/community/itsm-forum/populate-choices-on-a-field-based-on-choices-from-two-other/m-p/2753369#M508750</link>
      <description>&lt;P&gt;For your testing, just know that since you have a script that runs onChange of field 1 and depends on field 2, that field 2 must be populated before field 1.&amp;nbsp; Once you get this working add an exclusion to not run if field 2 is empty, or whatever fits your use case, then create a similar script onChange of field 2 so that no matter what order the 2 fields are populated in, the script will still run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as why it's not working, you'll have to add some alerts on f1 and f2 which will confirm that those field names are correct, and the value you are testing for (newValue/f1 and f2) is expected.&amp;nbsp; It doesn't make sense to clearOptions then removeOptions for individual choices, so do one or the other as clearOptions will remove all options.&amp;nbsp; If you take this line out, make sure 'Test' is the&amp;nbsp;&lt;EM&gt;value&lt;/EM&gt; of the choice record, not the label.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 20:00:26 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/populate-choices-on-a-field-based-on-choices-from-two-other/m-p/2753369#M508750</guid>
      <dc:creator>Brad Bowman</dc:creator>
      <dc:date>2023-12-05T20:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: Populate choices on a field based on choices from two other fields</title>
      <link>https://www.servicenow.com/community/itsm-forum/populate-choices-on-a-field-based-on-choices-from-two-other/m-p/2753374#M508751</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/206007"&gt;@divyakosaraju&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you try the data lookup way, create a lookup table,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Match the choices and set the results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a look ootb priority lookup and try once.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 20:06:55 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/populate-choices-on-a-field-based-on-choices-from-two-other/m-p/2753374#M508751</guid>
      <dc:creator>Dr Atul - LNG</dc:creator>
      <dc:date>2023-12-05T20:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Populate choices on a field based on choices from two other fields</title>
      <link>https://www.servicenow.com/community/itsm-forum/populate-choices-on-a-field-based-on-choices-from-two-other/m-p/2753671#M508776</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;you can make field dependent on others&lt;/P&gt;&lt;P&gt;please refer below video&lt;/P&gt;&lt;P&gt;&lt;A href="https://youtu.be/jiR4DjpmlRM?si=4i4sypOwNoC_Sgz3" target="_blank"&gt;https://youtu.be/jiR4DjpmlRM?si=4i4sypOwNoC_Sgz3&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 05:07:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/populate-choices-on-a-field-based-on-choices-from-two-other/m-p/2753671#M508776</guid>
      <dc:creator>Harish Bainsla</dc:creator>
      <dc:date>2023-12-06T05:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: Populate choices on a field based on choices from two other fields</title>
      <link>https://www.servicenow.com/community/itsm-forum/populate-choices-on-a-field-based-on-choices-from-two-other/m-p/2754733#M508884</link>
      <description>&lt;P&gt;Hi Brad, I tried this route and it is working .Thankyou very much&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 19:22:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/populate-choices-on-a-field-based-on-choices-from-two-other/m-p/2754733#M508884</guid>
      <dc:creator>divyakosaraju</dc:creator>
      <dc:date>2023-12-06T19:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Populate choices on a field based on choices from two other fields</title>
      <link>https://www.servicenow.com/community/itsm-forum/populate-choices-on-a-field-based-on-choices-from-two-other/m-p/2754741#M508885</link>
      <description>&lt;P&gt;You are welcome!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 19:29:32 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/populate-choices-on-a-field-based-on-choices-from-two-other/m-p/2754741#M508885</guid>
      <dc:creator>Brad Bowman</dc:creator>
      <dc:date>2023-12-06T19:29:32Z</dc:date>
    </item>
  </channel>
</rss>

