<?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>Editable grid view with dropdown</title><link>https://community.appian.com/discussions/f/user-interface/30412/editable-grid-view-with-dropdown</link><description>I have a grid layout consist of dropdown, If I select a value on the first drop down then if I add new row it will show new drop down on the second drop down I need to hide the value that is selected on the first drop down. Here is my initial code. I</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Editable grid view with dropdown</title><link>https://community.appian.com/thread/120883?ContentTypeID=1</link><pubDate>Wed, 25 Oct 2023 09:25:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fc273776-ecc1-4067-98d0-44894e7b48e7</guid><dc:creator>jeffrey Torres</dc:creator><description>&lt;p&gt;it works sir, but did not remove the selected value.&amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable grid view with dropdown</title><link>https://community.appian.com/thread/120880?ContentTypeID=1</link><pubDate>Wed, 25 Oct 2023 08:10:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d627f287-275f-4ee4-b6bc-66c8e36b00d3</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Yeah, I expected this to happen. I think the error message is pretty clear. You have to make sure that a drop down still shows the selected choice. You could add the id of the locally selected choice like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;wherecontains(
  {
    difference(
      tointeger(local!service.id),
      tointeger(fv!item.serviceId)
    ),
    tointeger(fv!item.serviceId) /* This keeps the locally selected item in the list */
  },
  local!service.id
),&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;BTW, your code only removes the locally selected choice from all choices. I think you should remove the selections from all drop downs. I did not change this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable grid view with dropdown</title><link>https://community.appian.com/thread/120862?ContentTypeID=1</link><pubDate>Wed, 25 Oct 2023 03:32:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a02bce64-3382-4e52-a816-bb968e78b1b3</guid><dc:creator>jeffrey Torres</dc:creator><description>&lt;p&gt;hello sir, this is what you mean to wrap down my drop down into a separate a!localvarariables? I&amp;#39;m encountering an error. I just need some recommendation. thank you&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;rows: a!forEach(
        items: ri!channelService,
        expression: a!gridRowLayout(
          id: fv!index,
          contents: {
            a!localVariables(
              local!choices: index(
                local!service,
                wherecontains(
                    difference(
                      tointeger(local!service.id),
                      tointeger(fv!item.serviceId)
                    ),
                  local!service.id
                ),
                null
              ),
              a!dropdownField(
                label: &amp;quot;Dropdown&amp;quot;,
                labelPosition: &amp;quot;ABOVE&amp;quot;,
                placeholder: &amp;quot;--- Select a Service ---&amp;quot;,
                choiceLabels: local!choices.name,
                choiceValues: local!choices.id,
                value: fv!item.serviceId,
                saveInto: fv!item.serviceId,
                searchDisplay: &amp;quot;ON&amp;quot;,
                required: true,
                requiredMessage: &amp;quot;Service is required&amp;quot;
              )
            ),
            /*Remove row*/
            a!richTextDisplayField(
              value: a!richTextIcon(
                icon: &amp;quot;close&amp;quot;,
                altText: &amp;quot;delete &amp;quot; &amp;amp; fv!index,
                caption: &amp;quot;Remove&amp;quot;,
                link: a!dynamicLink(
                  value: fv!index,
                  saveInto: {
                    if(
                      a!isNotNullOrEmpty(fv!item.id),
                      a!save(
                        ri!deletedChannelService,
                        append(
                          ri!deletedChannelService, 
                          a!update(
                            data: fv!item,
                            index: &amp;quot;status&amp;quot;, 
                            value: cons!IBM_SERVICE_STATUS_FOR_DELETION)
                        )
                      ),
                      null
                    ),
                    a!save(ri!channelService, remove(ri!channelService, save!value))
                  }
                ),
                linkStyle: &amp;quot;STANDALONE&amp;quot;,
                showWhen: length(ri!channelService) &amp;gt; 1,
                color: &amp;quot;NEGATIVE&amp;quot;
              )
            )
          }
        )
      ),&lt;/pre&gt;&lt;img src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/13/pastedimage1698204566655v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable grid view with dropdown</title><link>https://community.appian.com/thread/120826?ContentTypeID=1</link><pubDate>Tue, 24 Oct 2023 09:09:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6f1870ef-de07-45de-9d40-654c15fa8e37</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Next time please&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/pastedimage1698138432350v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;This code snippet returns the not selected items:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!services: {
    a!map(id: 1, name: &amp;quot;A&amp;quot;),
    a!map(id: 2, name: &amp;quot;B&amp;quot;),
    a!map(id: 3, name: &amp;quot;C&amp;quot;),
    a!map(id: 4, name: &amp;quot;D&amp;quot;),
    a!map(id: 5, name: &amp;quot;E&amp;quot;),
  },
  local!selectedServices: {2,4},
  index(
    local!services,
    wherecontains(difference(local!services.id, local!selectedServices), local!services.id),
    null
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;When you wrap your dropdown into a separate a!localVariables, you can do that evaluation separately for each dropdown.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>