<?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>Need to understand the Cascading of Drop down concept when data is from DB tables.</title><link>https://community.appian.com/discussions/f/user-interface/21189/need-to-understand-the-cascading-of-drop-down-concept-when-data-is-from-db-tables</link><description>Hi, Could someone help me understand the concept and solve my below problem? 
 I have a Two tables 
 1. VehicleTypes Field Id category 1 Cars 2 Buses 3 Trains 
 2nd table SubVehicleTypes 
 SubID Id SubCategory 1 1 Sedan 2 1 Suv 3 2 Luxury 4 2 Semi luxury</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Need to understand the Cascading of Drop down concept when data is from DB tables.</title><link>https://community.appian.com/thread/82622?ContentTypeID=1</link><pubDate>Tue, 15 Jun 2021 09:11:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a603a298-ba00-4176-99ec-abb5e4bc96c6</guid><dc:creator>faisalf0003</dc:creator><description>&lt;p&gt;Hi Acacio,&lt;/p&gt;
&lt;p&gt;Thank you..I will follow what u and Peter have suggested.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need to understand the Cascading of Drop down concept when data is from DB tables.</title><link>https://community.appian.com/thread/82574?ContentTypeID=1</link><pubDate>Sun, 13 Jun 2021 00:50:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2279a9ce-493f-4ca0-8c6e-5f70883896e9</guid><dc:creator>Acacio Barrado</dc:creator><description>&lt;p&gt;Hi Faisal,&lt;/p&gt;
&lt;p&gt;The code below is just a reference for help you to implement your final solution. It is a working code, but the values in the locals are map instead queries.&amp;nbsp; As Peter explained, you just need to replace the value in the local variables for your queries an use the selected vehicle id as a filter in the second query(subcategory).&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!selectedVehicleId,
  local!vehicle: 
    {
      a!map( id:1, value:&amp;quot;Cars&amp;quot; ),
      a!map( id:2, value: &amp;quot;Buses&amp;quot; ),
      a!map( id:3, value: &amp;quot;Trains&amp;quot;   )
  },  
  local!subCategory: {
    a!map( subTypeId:1, vehicleTypeId: 1, value: &amp;quot;Sedan&amp;quot; ),
    a!map( subTypeId:2, vehicleTypeId: 1, value: &amp;quot;Suv&amp;quot; ),
    a!map( subTypeId:3, vehicleTypeId: 2, value: &amp;quot;Luxury&amp;quot; ),
    a!map( subTypeId:4, vehicleTypeId: 2, value: &amp;quot;Semi Luxury&amp;quot; ),
    a!map(subTypeId:5, vehicleTypeId: 3, value: &amp;quot;Ac Trains&amp;quot; ),
    a!map( subTypeId:6, vehicleTypeId: 3, value: &amp;quot;Non Ac Trains&amp;quot; ),
  },  
  local!subType: if(
    isnull(local!selectedVehicleId),
    null,    
    index(local!subCategory,wherecontains(local!selectedVehicleId,tointeger(local!subCategory.vehicleTypeId)),null)
  ),
  local!selectedSubType,
  {    
    a!dropdownField(
      label: &amp;quot;Vehicle Type&amp;quot;,
      labelPosition: &amp;quot;ABOVE&amp;quot;,
      value: local!selectedVehicleId,
      placeholder: &amp;quot;Please select a vehicle&amp;quot;,
      choiceLabels: local!vehicle.value,
      choiceValues: local!vehicle.id,
      saveInto: {
        a!save(local!selectedVehicleId,save!value),
        a!save(local!selectedSubType,null)
      }
    ),
    a!dropdownField(
      label: &amp;quot;Vehicle Sub Category&amp;quot;,
      labelPosition: &amp;quot;ABOVE&amp;quot;,
      value: local!selectedSubType,
      placeholder: &amp;quot;Please Vehicle Sub Category&amp;quot;,
      choiceLabels: local!subType.value,
      choiceValues: local!subType.subTypeId,
      saveInto: {
        a!save(local!selectedSubType,save!value)
      }
    )
  }  
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Hope it help you to achieve your goal,&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Acacio B.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need to understand the Cascading of Drop down concept when data is from DB tables.</title><link>https://community.appian.com/thread/82567?ContentTypeID=1</link><pubDate>Fri, 11 Jun 2021 22:40:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6b98910b-226d-46b2-9eeb-970d6e8d194f</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;I&amp;#39;d suggest looking at the docs page for &lt;a href="https://docs.appian.com/suite/help/latest/recipe-configure-cascading-dropdowns.html"&gt;cascading dropdowns&lt;/a&gt;. Basically you will need to filter the results of your second list based on the selection from your first list, so you&amp;#39;ll need a query that filters your sub-category by the category provided.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need to understand the Cascading of Drop down concept when data is from DB tables.</title><link>https://community.appian.com/thread/82556?ContentTypeID=1</link><pubDate>Fri, 11 Jun 2021 16:10:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:000a7500-f56c-47a5-8492-c4067e74fb9d</guid><dc:creator>faisalf0003</dc:creator><description>&lt;p&gt;This is my Raw code&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;a!localVariables(&lt;br /&gt; local!vehicleTypeData:rule!FF_Exp_VehiclesTypes(VehicleId:null),&lt;br /&gt; local!vehicleSubTypeData:rule!FF_Exp_VehiclesSubTypes(subId:null),&lt;br /&gt; local!vehicleType,&lt;br /&gt; local!vehicleSubType,&lt;br /&gt;{&lt;br /&gt; a!dropdownField(&lt;br /&gt; label: &amp;quot;Dropdown&amp;quot;,&lt;br /&gt; labelPosition: &amp;quot;ABOVE&amp;quot;,&lt;br /&gt; placeholder: &amp;quot;--- Select a Value ---&amp;quot;,&lt;br /&gt; choiceLabels: local!vehicleTypeData.category,&lt;br /&gt; choiceValues: local!vehicleTypeData.id,&lt;br /&gt; saveInto: {},&lt;br /&gt; searchDisplay: &amp;quot;AUTO&amp;quot;,&lt;br /&gt; validations: {}&lt;br /&gt; ),&lt;br /&gt; a!dropdownField(&lt;br /&gt; label: &amp;quot;Dropdown&amp;quot;,&lt;br /&gt; labelPosition: &amp;quot;ABOVE&amp;quot;,&lt;br /&gt; placeholder: &amp;quot;--- Select a Value ---&amp;quot;,&lt;br /&gt; choiceLabels: local!vehicleSubType,&lt;br /&gt; choiceValues: local!vehicleSubType,&lt;br /&gt; saveInto: {},&lt;br /&gt; searchDisplay: &amp;quot;AUTO&amp;quot;,&lt;br /&gt; validations: {}&lt;br /&gt; )&lt;br /&gt;})&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>