<?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>Button in  Grid</title><link>https://community.appian.com/discussions/f/new-to-appian/34871/button-in-grid</link><description>Hi Everyone, 
 I have ha grid having four columns that have a button at the last column. 
 The button is record field action and the grid is selectable. I would like to display the button in that row only which is selected. Can anyone please help me how</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Button in  Grid</title><link>https://community.appian.com/thread/134672?ContentTypeID=1</link><pubDate>Fri, 03 May 2024 10:24:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ab9beb66-4ec6-49e7-b66d-9fdc338c2a36</guid><dc:creator>Dastagiri</dc:creator><description>&lt;p&gt;Please refer to this code. You can replace the button with Record action&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;{
  a!localVariables(
    local!employees: {
      {id: 1, name: &amp;quot;Elizabeth Ward&amp;quot;,  dept: &amp;quot;Engineering&amp;quot;,     role: &amp;quot;Senior Engineer&amp;quot;,      team: &amp;quot;Front-End Components&amp;quot;,     pto: 15, startDate: today()-500},
      {id: 2, name: &amp;quot;Michael Johnson&amp;quot;, dept: &amp;quot;Finance&amp;quot;,         role: &amp;quot;Payroll Manager&amp;quot;,      team: &amp;quot;Accounts Payable&amp;quot;,         pto: 2,  startDate: today()-100},
      {id: 3, name: &amp;quot;John Smith&amp;quot;,      dept: &amp;quot;Engineering&amp;quot;,     role: &amp;quot;Quality Engineer&amp;quot;,     team: &amp;quot;User Acceptance Testing&amp;quot;,  pto: 5,  startDate: today()-1000},
      {id: 4, name: &amp;quot;Diana Hellstrom&amp;quot;, dept: &amp;quot;Engineering&amp;quot;,     role: &amp;quot;UX Designer&amp;quot;,          team: &amp;quot;User Experience&amp;quot;,          pto: 49, startDate: today()-1200},
      {id: 5, name: &amp;quot;Francois Morin&amp;quot;,  dept: &amp;quot;Sales&amp;quot;,           role: &amp;quot;Account Executive&amp;quot;,    team: &amp;quot;Commercial North America&amp;quot;, pto: 15, startDate: today()-700},
      {id: 6, name: &amp;quot;Maya Kapoor&amp;quot;,     dept: &amp;quot;Sales&amp;quot;,           role: &amp;quot;Regional Director&amp;quot;,    team: &amp;quot;Front-End Components&amp;quot;,     pto: 15, startDate: today()-1400},
      {id: 7, name: &amp;quot;Anthony Wu&amp;quot;,      dept: &amp;quot;Human Resources&amp;quot;, role: &amp;quot;Benefits Coordinator&amp;quot;, team: &amp;quot;Accounts Payable&amp;quot;,         pto: 2,  startDate: today()-300}
    },
    local!selectedEmployee,
    local!selectedId,
    local!isButtonSelected,
    {
      a!columnsLayout(
        columns: {
          a!columnLayout(
            contents: {
              a!sectionLayout(
                label: &amp;quot;Employees&amp;quot;,
                contents: {
                  a!gridField(
                    data: todatasubset(
                      local!employees,
                      fv!pagingInfo
                    ),
                    columns: {
                      a!gridColumn(
                        label: &amp;quot;Name&amp;quot;,
                        value: fv!row.name
                      ),
                      a!gridColumn(
                        label: &amp;quot;Department&amp;quot;,
                        value: fv!row.dept
                      ),
                      /*Here you can replace this button with record action*/
                      a!gridColumn(
                        label: &amp;quot;Button&amp;quot;,
                        value: a!buttonArrayLayout(
                          buttons:a!buttonWidget(
                            label:&amp;quot;Take Action&amp;quot;,
                            style:&amp;quot;SOLID&amp;quot;,
                            confirmMessage:&amp;quot;Do you want to take action?&amp;quot;,
                            width:&amp;quot;MINIMIZE&amp;quot;,
                            value:true,
                            saveInto: local!isButtonSelected,
                            /*Logic to show the button. */
                            showWhen:contains(tointeger(local!selectedId),fv!identifier)
                          ))
                      )
                    },
                    pageSize: 7,
                    selectable: true,
                    selectionStyle: &amp;quot;CHECKBOX&amp;quot;,
                    selectionValue: index(local!selectedEmployee, &amp;quot;id&amp;quot;, {}),
                    selectionSaveInto: {
                      /*Storing id to enable the button*/
                      local!selectedId,
                      /*Below logic is for selecting only recently selected*/
                      /* This save replaces the value of the previously selected item with that of the newly selected item, ensuring only one item can be selected at once.*/
                      a!save(
                        local!selectedEmployee,
                        if(
                          length(fv!selectedRows) &amp;gt; 0,
                          fv!selectedRows[length(fv!selectedRows)],
                          null
                        )
                      ),
                      a!save(
                        local!selectedId,
                        if(
                          length(fv!selectedRows) &amp;gt; 0,
                          fv!selectedRows[length(fv!selectedRows)].id,
                          null
                        )
                      ),
                      
                    },
                    shadeAlternateRows: false,
                    rowHeader: 1
                  )
                }
              )
            }
          ),
          a!columnLayout(
            contents: {
              
            }
          )
        },
        stackWhen: {
          &amp;quot;PHONE&amp;quot;,
          &amp;quot;TABLET_PORTRAIT&amp;quot;
        }
      )
    }
  )
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button in  Grid</title><link>https://community.appian.com/thread/134669?ContentTypeID=1</link><pubDate>Fri, 03 May 2024 09:52:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:aacbacb9-0ea5-4d67-8bc0-d6f6a066909b</guid><dc:creator>Naina Kumari</dc:creator><description>&lt;p&gt;Hi Rahul,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I hope we are saving the selected rows locally. If yes, we can use a particular condition to do so. Take the reference from the below code, You can compare the unique column in the &amp;quot;contains&amp;quot; function.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/62/pastedimage1714729922055v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Let me know if you need more clarification on this.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>