<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Populate the choices of a dropdown based on the selection from another</title><link>https://community.appian.com/discussions/f/new-to-appian/31048/populate-the-choices-of-a-dropdown-based-on-the-selection-from-another</link><description>Hi, 
 I have two dropdowns on a form. Is it possible to populate the choices for the second dropdown based on the selection from the first? 
 In the first dropdown, I populated its choices from a record type using this example, Dropdown Component - Appian</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Populate the choices of a dropdown based on the selection from another</title><link>https://community.appian.com/thread/123750?ContentTypeID=1</link><pubDate>Fri, 05 Jan 2024 14:05:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f4c32607-37b7-4784-9daf-1628b9f363b5</guid><dc:creator>JWong</dc:creator><description>&lt;p&gt;Thanks,&amp;nbsp;&amp;nbsp;and , for the helpful tips!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Populate the choices of a dropdown based on the selection from another</title><link>https://community.appian.com/thread/123745?ContentTypeID=1</link><pubDate>Fri, 05 Jan 2024 11:20:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5a422435-da97-4a2a-a00f-5fff9bfdd42a</guid><dc:creator>kraty Maheshwari</dc:creator><description>&lt;p&gt;PFB the sample code for your use case&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!state: {
    a!map(id: 1, state: &amp;quot;UP&amp;quot;),
    a!map(id: 2, state: &amp;quot;Maharashtra&amp;quot;),
    a!map(id: 3, state: &amp;quot;Karnataka&amp;quot;),
    a!map(id: 4, state: &amp;quot;Goa&amp;quot;)
  },
  local!city: {
    a!map(id: 1, City: &amp;quot;Bangalore&amp;quot;, stateId: 3),
    a!map(id: 2, City: &amp;quot;Mumbai&amp;quot;, stateId: 2),
    a!map(id: 3, City: &amp;quot;Pune&amp;quot;, stateId: 2),
    a!map(id: 4, City: &amp;quot;Vasco da Gama&amp;quot;, stateId: 4),
    a!map(id: 5, City: &amp;quot;Lucknow&amp;quot;, stateId: 1),
    
  },
  local!selectedStateId,
  local!filterCityBasedOnStateSelected: if(
    a!isNullOrEmpty(local!selectedStateId),
    {},
    index(
      local!city,
      wherecontains(
        tointeger(local!selectedStateId),
        tointeger(index(local!city, &amp;quot;stateId&amp;quot;, {}))
      ),
      {}
    )
  ),
  local!selectedCity,
  {
    a!dropdownField(
      label: &amp;quot;State&amp;quot;,
      placeholder: &amp;quot;--Select--&amp;quot;,
      choiceValues: index(local!state, &amp;quot;id&amp;quot;, {}),
      choiceLabels: index(local!state, &amp;quot;state&amp;quot;, {}),
      saveInto: {
        local!selectedStateId,
        a!save(local!selectedCity, null)
      },
      value: local!selectedStateId
    ),
    a!dropdownField(
      label: &amp;quot;City&amp;quot;,
      placeholder: &amp;quot;--Select--&amp;quot;,
      choiceValues: index(
        local!filterCityBasedOnStateSelected,
        &amp;quot;id&amp;quot;,
        {}
      ),
      choiceLabels: index(
        local!filterCityBasedOnStateSelected,
        &amp;quot;City&amp;quot;,
        {}
      ),
      saveInto: local!selectedCity,
      value: local!selectedCity
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Populate the choices of a dropdown based on the selection from another</title><link>https://community.appian.com/thread/123740?ContentTypeID=1</link><pubDate>Fri, 05 Jan 2024 09:48:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:52107e4e-7b9e-4b65-a425-4ea66f531703</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;&lt;a id="" href="https://docs.appian.com/suite/help/23.4/recipe-configure-cascading-dropdowns.html"&gt;https://docs.appian.com/suite/help/23.4/recipe-configure-cascading-dropdowns.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>