<?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>How to display data dynamically based on previous selected data</title><link>https://community.appian.com/discussions/f/user-interface/19259/how-to-display-data-dynamically-based-on-previous-selected-data</link><description>Hi, 
 
 I have two dropdowns in my interface. Based on first selected dropdown second dropdown has to chaange. 
 
 like, First dropdown is &amp;#39;Country&amp;#39; . If i select the country it should display list of states for that country. 
 
 I have created multiple</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to display data dynamically based on previous selected data</title><link>https://community.appian.com/thread/75405?ContentTypeID=1</link><pubDate>Thu, 16 Jul 2020 11:18:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7deab2cb-6079-4bed-88cd-1b7e331d4706</guid><dc:creator>Jayapriya Muthu</dc:creator><description>&lt;p&gt;Please check the example&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!countryLabelConstant:{&amp;quot;IND&amp;quot;,&amp;quot;USA&amp;quot;,&amp;quot;UK&amp;quot;},
  local!countryValuesConstant:{1,2,3},
  local!indStatesConstant:{&amp;quot;TN&amp;quot;,&amp;quot;AP&amp;quot;},
  local!usaStatesConstant:{&amp;quot;AL&amp;quot;,&amp;quot;AK&amp;quot;},
  local!ukStatesConstant:{&amp;quot;JK&amp;quot;,&amp;quot;JL&amp;quot;},
  local!states,
  local!selectedCountry,
  local!selectedState,
  {
    a!dropdownField(
      label: &amp;quot;Country&amp;quot;,
      placeholderLabel: &amp;quot;Please select&amp;quot;,
      choiceLabels: local!countryLabelConstant,
      choiceValues: local!countryValuesConstant,
      value: local!selectedCountry,
      saveInto: {
        local!selectedCountry,
        a!save(
          local!selectedState,
          NULL
        ),
        a!save(
          local!states,
          choose(
            save!value,
            local!indStatesConstant,
            local!usaStatesConstant,
            local!ukStatesConstant
          )
        )
      }
    ),
    a!dropdownField(
      showWhen: not(
        rule!APN_isBlank(
          local!selectedCountry
        )
      ),
      label: &amp;quot;States&amp;quot;,
      placeholderLabel: &amp;quot;Please select&amp;quot;,
      choiceLabels: local!states,
      choiceValues: local!states,
      value: local!selectedState,
      saveInto: local!selectedState
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to display data dynamically based on previous selected data</title><link>https://community.appian.com/thread/75398?ContentTypeID=1</link><pubDate>Thu, 16 Jul 2020 07:00:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:39505951-7b73-470c-a430-cef39ed4d11e</guid><dc:creator>Timo</dc:creator><description>&lt;p&gt;Yes agree,&lt;br /&gt;Its possible with 2 but because you have a trimmed down second dropDown it will be though to do.&lt;br /&gt;&lt;br /&gt;If its only 2 you can have&lt;/p&gt;
&lt;p&gt;1 constant with countires&lt;br /&gt;1 with states&lt;br /&gt;&lt;br /&gt;STATE_CONSTANT[value of country constant]&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to display data dynamically based on previous selected data</title><link>https://community.appian.com/thread/75397?ContentTypeID=1</link><pubDate>Thu, 16 Jul 2020 06:44:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:dc5d0b9b-8ef5-48ff-95ba-c32ade972124</guid><dc:creator>Jayapriya Muthu</dc:creator><description>&lt;p&gt;In this case, you have to maintain States constant for each country. Based on selected country, you have to map the corresponding States constant to the variable of choiceLabels/ChoiceValues in Country dropdown SaveInto&lt;/p&gt;
&lt;p&gt;I suggest you to go for a table option if you are having many Countries&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to display data dynamically based on previous selected data</title><link>https://community.appian.com/thread/75396?ContentTypeID=1</link><pubDate>Thu, 16 Jul 2020 06:23:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:468d0052-e57a-47f1-8d21-9a48dd4b9cdf</guid><dc:creator>sirid</dc:creator><description>&lt;p&gt;Hi Priya,&lt;/p&gt;
&lt;p&gt;I tried but i can use this only when i have two lists in first dropdown. But i have more than 2. In this way it is not allowing more than one IF condition.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to display data dynamically based on previous selected data</title><link>https://community.appian.com/thread/75395?ContentTypeID=1</link><pubDate>Thu, 16 Jul 2020 06:17:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b92bd2ad-ad8c-4c14-ad72-190baa84284a</guid><dc:creator>sirid</dc:creator><description>&lt;p&gt;Hi Timo,&lt;/p&gt;
&lt;p&gt;Yes we can but i want to try using constants.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to display data dynamically based on previous selected data</title><link>https://community.appian.com/thread/75386?ContentTypeID=1</link><pubDate>Wed, 15 Jul 2020 07:42:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:384b3eb6-8fe6-4c34-8f0c-a220902d92d7</guid><dc:creator>Jayapriya Muthu</dc:creator><description>&lt;p&gt;&lt;br /&gt;Update the States drop-down choiceLabels / choiceValues array in Country drop-down saveInto. Set showWhen for States dropdown to display if a values is selected in Country&lt;/p&gt;
&lt;p&gt;Please refer for example : &lt;a href="https://community.appian.com/discussions/f/user-interface/17171/cascade-dropdown"&gt;community.appian.com/.../cascade-dropdown&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to display data dynamically based on previous selected data</title><link>https://community.appian.com/thread/75385?ContentTypeID=1</link><pubDate>Wed, 15 Jul 2020 07:40:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c9efe070-a0f2-4aaf-af7a-f60ec2fac6b5</guid><dc:creator>Timo</dc:creator><description>&lt;p&gt;Why not have a table&amp;nbsp;&lt;br /&gt;&lt;br /&gt;State / Country&lt;br /&gt;&lt;br /&gt;So you query the unique countries in the first dropdown, save that value.&lt;br /&gt;And based on the saved value you query the next dropdown.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>