<?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>Hiding options from dropdown values</title><link>https://community.appian.com/discussions/f/user-interface/7798/hiding-options-from-dropdown-values</link><description>We have an editable grid, in the second column if the user selects &amp;quot;primary&amp;quot; on more than one row; the grid displays an error. Is there a way to hide the &amp;quot;Primary&amp;quot; option from the consequent dropdown values; if the user selects &amp;quot;Primary&amp;quot; on any of the</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Hiding options from dropdown values</title><link>https://community.appian.com/thread/85703?ContentTypeID=1</link><pubDate>Mon, 13 Sep 2021 13:51:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6ae0b2cb-078b-44ab-831c-108094abe08d</guid><dc:creator>vimalkumars</dc:creator><description>&lt;p&gt;Here is a sample code logic that can do the same. Ensure you refine the code as you want and apply necessary best practices&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!choiceValues: { &amp;quot;Primary&amp;quot;, &amp;quot;Choice 2&amp;quot;, &amp;quot;Choice 3&amp;quot; },
  local!selectedRoles: {},
  {
    a!gridLayout(
      label: &amp;quot;Editable Grid&amp;quot;,
      labelPosition: &amp;quot;ABOVE&amp;quot;,
      headerCells: {
        a!gridLayoutHeaderCell(label: &amp;quot;Header Cell&amp;quot;)
      },
      columnConfigs: {},
      rows: a!forEach(
        items: local!selectedRoles,
        expression: {
          a!gridRowLayout(
            contents: {
              a!dropdownField(
                label: &amp;quot;Ownership Role&amp;quot;,
                placeholder: &amp;quot;Select&amp;quot;,
                choiceLabels: difference(
                  local!choiceValues,
                  difference(local!selectedRoles, fv!item)
                ),
                choiceValues: difference(
                  local!choiceValues,
                  difference(local!selectedRoles, fv!item)
                ),
                value: fv!item,
                saveInto: fv!item
              )
            }
          )
        }
      ),
      selectionSaveInto: {},
      validations: {},
      addRowLink: a!dynamicLink(
        label: &amp;quot;Add Row&amp;quot;,
        saveInto: {
          a!save(
            local!selectedRoles,
            touniformstring(append(local!selectedRoles, null))
          )
        }
      ),
      shadeAlternateRows: true
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hiding options from dropdown values</title><link>https://community.appian.com/thread/85694?ContentTypeID=1</link><pubDate>Mon, 13 Sep 2021 07:17:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:df2d971a-443f-4ecd-9020-4692b7c9dad0</guid><dc:creator>vinayp0002</dc:creator><description>&lt;p&gt;Any specific solution which worked &lt;a href="/members/mohamedb"&gt;mohamedb&lt;/a&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hiding options from dropdown values</title><link>https://community.appian.com/thread/32190?ContentTypeID=1</link><pubDate>Sat, 11 Jun 2016 22:14:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6a1e9576-1bbf-4fa1-8320-8937a8ad4dcc</guid><dc:creator>ranveerr</dc:creator><description>You can also do like if Ownership Role has primary than use difference from dropdown choice value and choice label to take out the Primary.&lt;br /&gt;&lt;br /&gt;if(contains(ri!GridVariableSubset.ownershipRole, cons!choiceValue[index of primary]),&lt;br /&gt;difference(cons!choiceValue, cons!choiceValue[index of primary]),&lt;br /&gt;cons!choiceValue&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;If you want already selected value of grid should remove from drop down than directly use difference of union of selected value from choice value.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hiding options from dropdown values</title><link>https://community.appian.com/thread/32179?ContentTypeID=1</link><pubDate>Fri, 10 Jun 2016 22:19:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e25fc0df-30eb-4b57-9637-181ca0b7ee6e</guid><dc:creator>ankushj</dc:creator><description>You can remove the values already selected in previous drowdown by using remove in choice label and choice value&lt;br /&gt;remove(cons!ALLDropDownValues,wherecontains(&lt;br /&gt;  ri.selectedvalues,cons!ALLDropDownValues&lt;br /&gt;))&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hiding options from dropdown values</title><link>https://community.appian.com/thread/32149?ContentTypeID=1</link><pubDate>Fri, 10 Jun 2016 12:02:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:eb304110-2bbf-4eef-812d-e2df50c8559c</guid><dc:creator>Amit Mishra</dc:creator><description>Hi Mohamedb,&lt;br /&gt;Yes, as Matthew described, you can use conditions on choice list (for drop-down) in grid based on your business logic.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hiding options from dropdown values</title><link>https://community.appian.com/thread/32132?ContentTypeID=1</link><pubDate>Fri, 10 Jun 2016 00:15:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2b61ea57-0a8e-40e8-b400-32d546d18dd6</guid><dc:creator>Matthew Kornfield</dc:creator><description>I should have said OR conditional, sorry.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hiding options from dropdown values</title><link>https://community.appian.com/thread/32131?ContentTypeID=1</link><pubDate>Fri, 10 Jun 2016 00:14:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2eeb1321-5e5a-478a-a5a6-755c7df7b474</guid><dc:creator>Matthew Kornfield</dc:creator><description>The best way I can think of doing this is having a conditional and statement to change the choice labels and choice values.&lt;br /&gt;&lt;br /&gt;It would look something like:&lt;br /&gt;if( &lt;br /&gt;or(&lt;br /&gt;/*Condition to check that the primary choice is in the current row if selected*/&lt;br /&gt;tointeger(wherecontains(cons!PRIMARY_CHOICE, index(ri!cdt,&amp;quot;ownershipRole&amp;quot;,{})) = ri!index,&lt;br /&gt;/*Condition to check that none are selected*/&lt;br /&gt;rule!APN_isEmpty(wherecontains(cons!PRIMARY_CHOICE, index(ri!cdt,&amp;quot;ownershipRole&amp;quot;,{})))&lt;br /&gt;),&lt;br /&gt;rule!listOfAllChoices,&lt;br /&gt;rule!listOfAllChoicesSansPrimary)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>