<?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>Conditional Dropdown</title><link>https://community.appian.com/discussions/f/user-interface/25620/conditional-dropdown</link><description>Hello Experts, 
 
 I have a requirement where user need to select multiple values for OrderType. There are different sets of values which needs to be populated under SearchBy on the selection of order type. 
 If Multiple Values are selected under the</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Conditional Dropdown</title><link>https://community.appian.com/thread/100256?ContentTypeID=1</link><pubDate>Mon, 29 Aug 2022 05:32:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3590d526-dd81-4ff1-95b6-c3a45a7fe638</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;Hello GauravSingh,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The below code will work if your requirement is exactly as mentioned in your question. But you might have to&amp;nbsp;try a different method incase you want to add more dropdown options in the multiple dropdown field.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!selectby,
  local!ordertype,
  local!options1:{&amp;quot;S1&amp;quot;,&amp;quot;S2&amp;quot;,&amp;quot;S3&amp;quot;},
  local!options2:{&amp;quot;S1&amp;quot;,&amp;quot;S2&amp;quot;,&amp;quot;S3&amp;quot;,&amp;quot;S4&amp;quot;,&amp;quot;S5&amp;quot;},
  local!options3: intersection({&amp;quot;S1&amp;quot;,&amp;quot;S2&amp;quot;,&amp;quot;S3&amp;quot;},{&amp;quot;S1&amp;quot;,&amp;quot;S2&amp;quot;,&amp;quot;S3&amp;quot;,&amp;quot;S4&amp;quot;,&amp;quot;S5&amp;quot;}),
  local!options4:{&amp;quot;S2&amp;quot;},
  local!dropdowncondition:{
    if(
      local!ordertype=&amp;quot;O1&amp;quot;,local!options1,if(
        local!ordertype=&amp;quot;O2&amp;quot;,local!options2,if(
          local!ordertype=&amp;quot;O2; O1&amp;quot;,local!options3,if(
            local!ordertype=&amp;quot;O3&amp;quot;,local!options4,if(
             local!ordertype=&amp;quot;O1; O2&amp;quot;,local!options3,local!options4
            )
          )
        )
      )
    )
  },
  {
    a!multipleDropdownField(
      label: &amp;quot;Order Type&amp;quot;,
      placeholder: &amp;quot;select&amp;quot;,
      choiceLabels: {&amp;quot;O1&amp;quot;,&amp;quot;O2&amp;quot;,&amp;quot;O3&amp;quot;},
      choiceValues: {&amp;quot;O1&amp;quot;,&amp;quot;O2&amp;quot;,&amp;quot;O3&amp;quot;},
      saveInto: local!ordertype,
      value: local!ordertype
    ),
    a!dropdownField(
      label: &amp;quot;Search By&amp;quot;,
      placeholder: &amp;quot;Select&amp;quot;,
      choiceLabels: local!dropdowncondition,
      choiceValues: local!dropdowncondition,
      value: local!selectby,
      saveInto: local!selectby,
    )
  }
  
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Conditional Dropdown</title><link>https://community.appian.com/thread/100120?ContentTypeID=1</link><pubDate>Thu, 25 Aug 2022 04:09:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a35b85de-ed7c-469e-8c45-230a6a7dc04c</guid><dc:creator>ujjwalr0002</dc:creator><description>&lt;p&gt;Hi Gaurav, Check the code below&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!orders: { &amp;quot;o1&amp;quot;, &amp;quot;o2&amp;quot;, &amp;quot;o3&amp;quot; },
  local!orderType: {
    a!map(orderType: &amp;quot;o1&amp;quot;, value: &amp;quot;s1&amp;quot;),
    a!map(orderType: &amp;quot;o1&amp;quot;, value: &amp;quot;s2&amp;quot;),
    a!map(orderType: &amp;quot;o1&amp;quot;, value: &amp;quot;s3&amp;quot;),
    a!map(orderType: &amp;quot;o2&amp;quot;, value: &amp;quot;s1&amp;quot;),
    a!map(orderType: &amp;quot;o2&amp;quot;, value: &amp;quot;s2&amp;quot;),
    a!map(orderType: &amp;quot;o3&amp;quot;, value: &amp;quot;s5&amp;quot;),
    a!map(orderType: &amp;quot;o3&amp;quot;, value: &amp;quot;s4&amp;quot;),
    
  },
  local!selectedValues,
  local!allSelectedValues: a!flatten(
    a!forEach(
      items: local!selectedValues,
      expression: index(
        local!orderType,
        wherecontains(
          fv!item,
          index(local!orderType, &amp;quot;orderType&amp;quot;, {})
        ),
        &amp;quot;value&amp;quot;,
        {}
      )
    )
  ),
  local!unionSelectedValues: union(
    local!allSelectedValues,
    local!allSelectedValues
  ),
  local!fetchingDuplicates: reject(
    fn!isnull,
    a!forEach(
      items: local!unionSelectedValues,
      expression: if(
        count(
          wherecontains(fv!item, local!allSelectedValues)
        ) = length(local!selectedValues),
        /* In case you need to have duplicate values which are even present in two of the selected values change the condition to local!selectedValues - 1*/
        fv!item,
        null
      )
    )
  ),
  {
    a!multipleDropdownField(
      label: &amp;quot;Select Order&amp;quot;,
      placeholder: &amp;quot;Select Order&amp;quot;,
      choiceLabels: local!orders,
      choiceValues: local!orders,
      value: local!selectedValues,
      saveInto: local!selectedValues
    ),
    a!richTextDisplayField(
      value: if(
        count(local!fetchingDuplicates),
        local!fetchingDuplicates,
        &amp;quot;No Values found which belongs to all selected values&amp;quot;,
        
      )
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Conditional Dropdown</title><link>https://community.appian.com/thread/100119?ContentTypeID=1</link><pubDate>Thu, 25 Aug 2022 03:38:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:00d0d3f7-4d77-4f06-b9d9-460ad617e83a</guid><dc:creator>deepakg681722</dc:creator><description>&lt;p&gt;Here you can create a table in the DB and on the basis of each selection you can query the data and use intersection function to get the expected result.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>