<?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>Select countries based on Regions</title><link>https://community.appian.com/discussions/f/user-interface/25935/select-countries-based-on-regions</link><description>Hi folks, 
 
 New to Appian! 
 I need to create an interface which will allow a user to select/unselect the countries based on regions. 
 
 Description: 
 1. An Interface is having 2 dropdown lists first Region List and second is Countries list. (created</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Select countries based on Regions</title><link>https://community.appian.com/thread/101412?ContentTypeID=1</link><pubDate>Mon, 19 Sep 2022 10:11:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ab7134b8-a5d0-47fe-92b4-1bd2eb465626</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;I have updated the code. Let me know if it works.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Select countries based on Regions</title><link>https://community.appian.com/thread/101406?ContentTypeID=1</link><pubDate>Mon, 19 Sep 2022 09:49:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f9a2c99e-3d31-4cd8-8bc2-29934f4fef54</guid><dc:creator>Shubham Kumar</dc:creator><description>&lt;p&gt;Hi Harshit,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for your quick reply!&lt;/p&gt;
&lt;p&gt;User can select multiple regions at a time, and countries belongs to regions must be auto selected in countries dropdwon list&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Select countries based on Regions</title><link>https://community.appian.com/thread/101397?ContentTypeID=1</link><pubDate>Mon, 19 Sep 2022 09:34:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ae12c130-dc34-40ef-ac8a-d0c7f26324be</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;This code snippet should help&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!regions: {
    { id: 1, name: &amp;quot;Region 1&amp;quot;,  },
    { id: 2, name: &amp;quot;Region 2&amp;quot;,  },
    { id: 3, name: &amp;quot;Region 3&amp;quot;,  }
  },
  local!countries: {
    { id: 1, name: &amp;quot;Country 1&amp;quot;, regionId: 1 },
    { id: 2, name: &amp;quot;Country 2&amp;quot;, regionId: 1 },
    { id: 3, name: &amp;quot;Country 3&amp;quot;, regionId: 1 },
    { id: 4, name: &amp;quot;Country 4&amp;quot;, regionId: 2 },
    { id: 5, name: &amp;quot;Country 5&amp;quot;, regionId: 2 },
    { id: 6, name: &amp;quot;Country 6&amp;quot;, regionId: 2 }
  },
  local!selectedRegion,
  local!selectedCountries,
  {
    a!multipleDropdownField(
      label: &amp;quot;Region&amp;quot;,
      choiceLabels: local!regions.name,
      choiceValues: local!regions.id,
      value: local!selectedRegion,
      saveInto: {
        local!selectedRegion,
        a!save(
          local!selectedCountries,
          a!flatten(
            index(
              local!countries.id,
              wherecontains(
                tointeger(local!selectedRegion),
                tointeger(local!countries.regionId)
              ),
              {}
            )
          )
        )
      },
      placeholder: &amp;quot;---Country---&amp;quot;
    ),
    a!multipleDropdownField(
      label: &amp;quot;Country&amp;quot;,
      choiceLabels: a!flatten(
        index(
          local!countries.name,
          wherecontains(
            tointeger(local!selectedRegion),
            tointeger(local!countries.regionId)
          ),
          {}
        )
      ),
      choiceValues: a!flatten(
        index(
          local!countries.id,
          wherecontains(
            tointeger(local!selectedRegion),
            tointeger(local!countries.regionId)
          ),
          {}
        )
      ),
      value: local!selectedCountries,
      saveInto: local!selectedCountries,
      placeholder: &amp;quot;---Country---&amp;quot;
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>