<?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>Swap two rows in readable grid</title><link>https://community.appian.com/discussions/f/data/31195/swap-two-rows-in-readable-grid</link><description>Hi, I have readable grid in which i am using arrow icon, so if I click on that arrow so that row should go up and upper row should come down. I can get all data items from current row, but how I will get data from previous row, So I can apply swapping</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/148947?ContentTypeID=1</link><pubDate>Fri, 13 Jun 2025 13:15:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ed1ce7f4-f01a-4c1c-b03a-d1d9a6f7fc61</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="245526" url="~/discussions/f/data/31195/swap-two-rows-in-readable-grid/148945"]why using fv!item in the remove function ?[/quote]
&lt;p&gt;i agree, there are several things wrong here - it seems like &amp;quot;fv!row&amp;quot; has been incorrectly swapped out with &amp;quot;fv!item&amp;quot; in one specific instance in the screenshot, but even with all &amp;quot;fv!row&amp;quot; references, i&amp;#39;m not sure this will accomplish what AK is hoping to accomplish, since the save operation is being done on &amp;quot;fv!row&amp;quot; in general, which of course isn&amp;#39;t the original array at all but instead only represents a pointer to a particular row in the supplied &amp;quot;data&amp;quot; dataset.&amp;nbsp; So I&amp;#39;m not really sure what the screenshotted code is hoping to accomplish.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/148945?ContentTypeID=1</link><pubDate>Fri, 13 Jun 2025 10:15:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0f660c95-3ad1-4f12-896b-0b2b7d39795e</guid><dc:creator>EREN_YEAGER</dc:creator><description>&lt;p&gt;why using fv!item in the remove function ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/148944?ContentTypeID=1</link><pubDate>Fri, 13 Jun 2025 09:45:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4a2a779f-7ee9-4ea2-b3f8-c69b905efac1</guid><dc:creator>ak0642</dc:creator><description>&lt;p&gt;Hi, I am trying to implement the same logic with record type as a data for grid. Could you check the below and let me know here where am i making mistake&lt;/p&gt;
&lt;p&gt;and this reordering should save in db with different column&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/16/pastedimage1749807874830v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124712?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 17:45:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ed85a178-67a2-4019-9693-403dc23cc0dd</guid><dc:creator>EREN_YEAGER</dc:creator><description>&lt;p&gt;&lt;span&gt;I&amp;#39;ve just tested it, and it worked exactly as you explained. I wasn&amp;#39;t aware that &lt;/span&gt;&lt;code&gt;fv!identifier&lt;/code&gt;&lt;span&gt;&amp;nbsp;gives the primary key when we are querying only current page&amp;#39;s data . Thanks a lot,&amp;nbsp;&lt;a href="/members/harshitb6843"&gt;Harshit Bumb (Appyzie)&lt;/a&gt;&amp;nbsp;. I&amp;#39;ve learned something new.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124711?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 16:56:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8aedb7a5-549c-4ad8-a042-16f1f8d2c524</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>[quote userid="245526" url="~/discussions/f/data/31195/swap-two-rows-in-readable-grid/124702"]&lt;span&gt;As far as I understand, &lt;/span&gt;&lt;code&gt;fv!identifier&lt;/code&gt;&lt;span&gt; seems to align its own sequence (1, 2, 3, 4, ...) in the grid&lt;/span&gt;[/quote]
&lt;p&gt;GridField is designed to work in 2 ways.&amp;nbsp;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Get all the data in local variables and just show some of it in the grid. Here the paging happens on the interface level and fv!identifier&amp;#39;s output becomes uncertain. (like you have done in the screenshot you attached)&lt;/li&gt;
&lt;li&gt;Get only a page&amp;#39;s data from the DB and let the grid automatically query the next page, directly from the DB. In this approach, you pass directly the entire data subset in the grid. Once the grid displays data using the data subset, it will give primary keys when fv!identifier is referenced.&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So it depends on case to case but because fv!identifier&amp;#39;s behavior isn&amp;#39;t 100% same every time you pass just the Data and NOT Subset, I prefer passing the entire fv!row in the whereContains.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And anyway, using a read-only grid and rearranging the rows isn&amp;#39;t a good option. Because this grid isn&amp;#39;t made for that, even if somehow it supports that.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124708?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 14:26:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b9893b3f-538d-4949-96f4-a9034d314efd</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="259728" url="~/discussions/f/data/31195/swap-two-rows-in-readable-grid/124694"]If you play with the identifier, you will need to make sure that everything in the DB also gets updated instantly to reflect on the screen[/quote]
&lt;p&gt;i think this is an important factor that needs to be drilled down into WAY more with OP prior to recommending any particular approaches here, since we don&amp;#39;t really know what their desired end-effect is for the data in question.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124702?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 12:10:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:afd35c9e-13ad-41e8-beec-985ef58a634d</guid><dc:creator>EREN_YEAGER</dc:creator><description>&lt;p&gt;&lt;span&gt;I was wondering about the role of the primary key in this context. As far as I understand, &lt;/span&gt;&lt;code&gt;fv!identifier&lt;/code&gt;&lt;span&gt; seems to align its own sequence (1, 2, 3, 4, ...) in the grid. Please correct me if I&amp;#39;m mistaken. I appreciate your clarification on this matter.&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/16/pastedimage1705666210485v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124697?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 11:52:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f60fec98-4d8a-4bfb-8869-e3bf3e9fe7ee</guid><dc:creator>EREN_YEAGER</dc:creator><description>&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/16/pastedimage1705665137491v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124695?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 11:40:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ad8f1f59-acde-4c6f-81fc-852f1c68fadd</guid><dc:creator>shubhamsingh</dc:creator><description>&lt;p&gt;I solved the problem by own. This is the logic which I was required.&lt;/p&gt;
&lt;p&gt;a!gridColumn(&lt;br /&gt; label: &amp;quot;&amp;quot;,&lt;br /&gt; value: a!richTextDisplayField(&lt;br /&gt; value: a!richTextIcon(&lt;br /&gt; icon: &amp;quot;arrow-down&amp;quot;,&lt;br /&gt; caption: &amp;quot;Move down&amp;quot;,&lt;br /&gt; link: a!dynamicLink(&lt;br /&gt; saveInto: {&lt;br /&gt; a!save(fv!currentPage.data[fv!identifier],fv!currentPage.data[fv!identifier+1]),&lt;br /&gt; a!save(fv!currentPage.data[fv!identifier+1],fv!row),&lt;br /&gt; },&lt;/p&gt;
&lt;p&gt;),&lt;br /&gt; showWhen: fv!currentPage.startIndex&lt;br /&gt; )&lt;br /&gt; )&lt;br /&gt; )&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124694?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 11:38:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:701034dc-76a3-4a0d-91db-504aad2b93de</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;If you play with the identifier, you will need to make sure that everything in the DB also gets updated instantly to reflect on the screen. But this comes with its own challenge. What do you think will happen with the Primary keys? How will you change the order of these rows in the DB keeping the same primary keys?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124693?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 11:23:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:24ba93fe-1d3a-4a67-bb01-aa74736bffd0</guid><dc:creator>kraty Maheshwari</dc:creator><description>&lt;p&gt;HI &lt;a href="/members/shubhamc0905"&gt;shubhamsingh&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Use the below code in saveinto parameter of your dynamic link for moving up&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt; a!save(
                              local!data,
                              insert(local!data, fv!item, fv!index - 1)
                            ),
                            a!save(
                              local!data,
                              remove(local!data, fv!index + 1)
                            )&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Use the below code in saveinto parameter of your dynamic link for moving down&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!save(
                              local!data,
                              insert(local!data, fv!item, fv!index + 2)
                            ),
                            a!save(
                              local!data,
                              remove(local!data, fv!index)
                            )&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124691?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 11:13:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:54c51446-38c7-45c4-b463-935b625e0b09</guid><dc:creator>EREN_YEAGER</dc:creator><description>&lt;p&gt;yes it will not start with 1 on second page it will continue assigning unique identifier to each row. So my theory here is - as we don&amp;#39;t want the index of the item according to the current page but the index of the item according to the whole data right? so fv!identifer will provide the current index of the item according to the whole data, working in place of wherecontains in grid and this scenarios&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124690?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 10:59:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b609d02-3c44-43b9-8874-c5fc0e2d6080</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;It will break. fv!identifier gives you the primary key. So if you are in the second page, fv!identifier will not start with 1. Hence fv!identifier &amp;lt;&amp;gt; fv!index&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124689?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 10:58:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:087a80b0-1d64-4b10-9c2f-29c1295dc5f4</guid><dc:creator>EREN_YEAGER</dc:creator><description>&lt;p&gt;just for learning purpose, is it good to have 3 where contains per row in a grid where we can use fv!identfier? or it will break in any corner cases?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124688?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 10:55:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:435687ec-eb76-434e-8c1d-b269f2f6e5df</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Have been using it for ages. Did not find any issue :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124687?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 10:54:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5eb7d3b4-f607-4fe6-bcdf-c8cb2007f00f</guid><dc:creator>EREN_YEAGER</dc:creator><description>&lt;p&gt;I believe instead of using this&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;wherecontains(fv!row, ri!data)&lt;/pre&gt;&lt;br /&gt;we should go with this&amp;nbsp;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;fv!identfier&lt;/pre&gt;&lt;br /&gt;for finding the index of current item&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124680?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 10:36:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c6b0132b-b988-4c13-8308-b967effda78e</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Thanks. Done :-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124677?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 10:33:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:075ae66d-9f57-4709-9a82-c098796f627d</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;As Appian suggests, now you should replace it with a!update()&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/16/pastedimage1705660394122v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124675?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 10:31:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cf9c147a-ba6a-45fe-ba5c-12a94ab75620</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Find below my generic expression to swap two items in a list.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if(
  and(
    not(rule!PCO_IsVoid(ri!list)),
    ri!index1 &amp;gt; 0,
    ri!index1 &amp;lt;= count(ri!list),
    ri!index2 &amp;gt; 0,
    ri!index2 &amp;lt;= count(ri!list),
    ri!index1 &amp;lt;&amp;gt; ri!index2
  ),
  updatearray(
    ri!list,
    {ri!index1, ri!index2},
    {ri!list[ri!index2], ri!list[ri!index1]}
  ),
  ri!list
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124656?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 10:12:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:167bb48d-9eaf-4a68-9ce6-1fe0f285f2a3</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Here is a much more optimized version of what you are trying to do for the editable grid.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!save(
  ri!data,
  a!update(
    ri!data,
    { fv!index, fv!index + 1 },
    { ri!data[fv!index + 1], fv!item }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124655?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 10:08:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:53022c4a-f546-40c5-a289-bf0cfdb90028</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;You can us these code blocks in your&lt;/p&gt;
&lt;p&gt;Down Arrow&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!save(
  ri!data,
  a!update(
    ri!data,
    {
      wherecontains(fv!row, ri!data),
      wherecontains(fv!row, ri!data) + 1
    },
    {
      ri!data[wherecontains(fv!row, ri!data) + 1],
      fv!row
    }
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Up Arrow&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!save(
  ri!data,
  a!update(
    ri!data,
    {
      wherecontains(fv!row, ri!data),
      wherecontains(fv!row, ri!data) - 1
    },
    {
      ri!data[wherecontains(fv!row, ri!data) - 1],
      fv!row
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124654?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 10:08:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d50b54db-3fbd-4c1a-afa3-c9799fc169b8</guid><dc:creator>Rithani Vivekananthan</dc:creator><description>&lt;p&gt;Yes. I have worked on this logic already but for editable grid. I gave it for reference purpose just to move rows up and down.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124653?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 10:05:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8134d7ba-15c9-41c3-914d-79892366dbbf</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;The OP must be using a gridField() and not a gridLayout()&lt;/p&gt;
[quote userid="267241" url="~/discussions/f/data/31195/swap-two-rows-in-readable-grid"]I have readable grid[/quote]&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124647?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 09:44:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:dc52544f-c70e-4fca-83ac-71dd6b1bc401</guid><dc:creator>JayaPrakash Ravipati</dc:creator><description>&lt;p&gt;Hi ,&lt;/p&gt;
&lt;p&gt;use the below code it might help.&lt;/p&gt;
&lt;p&gt;What is the use case for this?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!data:{
    a!map(
      name:&amp;quot;Test&amp;quot;,
      city:&amp;quot;ABC&amp;quot;
    ),
    a!map(
      name:&amp;quot;Test1&amp;quot;,
      city:&amp;quot;QWE&amp;quot;
    ),
    a!map(
      name:&amp;quot;Test2&amp;quot;,
      city:&amp;quot;DFG&amp;quot;
    ),a!map(
      name:&amp;quot;Test3&amp;quot;,
      city:&amp;quot;ZXC&amp;quot;
    ),a!map(
      name:&amp;quot;Test4&amp;quot;,
      city:&amp;quot;YUI&amp;quot;
    )
  },
  local!temp,
  local!index,
  a!gridField(
    label: &amp;quot;Employee Data&amp;quot;,
    data: local!data,
    columns: {
      a!gridColumn(
        label: &amp;quot;Name&amp;quot;,
        value: fv!row.name
      ),
      a!gridColumn(
        label: &amp;quot;Name&amp;quot;,
        value: fv!row.city
      ),
      a!gridColumn(
        label: &amp;quot;Name&amp;quot;,
        value: a!richTextDisplayField(
          value: {
            a!richTextIcon(
              icon:&amp;quot;arrow-up&amp;quot;,
              link: a!dynamicLink(
                saveInto: {
                  a!save(local!data, remove(local!data, fv!identifier)),
                  a!save(
                    local!data,
                    insert(local!data, fv!row, fv!identifier - 1)
                  )
                }
              )
            )
          }
        )
      ),
      a!gridColumn(
        label: &amp;quot;Name&amp;quot;,
        value: a!richTextDisplayField(
          value: {
            a!richTextIcon(
              icon:&amp;quot;arrow-down&amp;quot;,
              link: a!dynamicLink(
                saveInto: {
                  a!save(local!data, remove(local!data, fv!identifier)),
                  a!save(
                    local!data,
                    insert(local!data, fv!row, fv!identifier + 1)
                  )
                }
              )
            )
          }
        )
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Swap two rows in readable grid</title><link>https://community.appian.com/thread/124645?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 09:42:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:84249711-56be-40a0-b5cf-b5f179c34432</guid><dc:creator>Rithani Vivekananthan</dc:creator><description>&lt;p&gt;Hello &lt;a href="/members/shubhamc0905"&gt;shubhamsingh&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;Below code contains logic to move rows up and down.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;{
  a!localVariables(
    local!duplicate,
    local!removed,
    local!change,
    local!data: index(
      a!queryRecordType(
        recordType: &amp;#39;recordType!{9e939d67-33c2-43f5-8030-51fe874a4980}PS Company&amp;#39;,
        filters: a!queryFilter(
          field: &amp;#39;recordType!{9e939d67-33c2-43f5-8030-51fe874a4980}PS Company.fields.{19721518-b5ee-4deb-b4b2-5b0d5603d6ba}isActive&amp;#39;,
          operator: &amp;quot;=&amp;quot;,
          value: true
        ),
        pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 100)
      ),
      &amp;quot;data&amp;quot;,
      null
    ),
    {
      a!gridLayout(
        label: &amp;quot;Editable Grid&amp;quot;,
        labelPosition: &amp;quot;ABOVE&amp;quot;,
        headerCells: {
          a!gridLayoutHeaderCell(label: &amp;quot;Company Name&amp;quot;),
          a!gridLayoutHeaderCell(label: &amp;quot;Postcode&amp;quot;),
          a!gridLayoutHeaderCell(label: &amp;quot;City&amp;quot;),
          a!gridLayoutHeaderCell(label: &amp;quot;State &amp;quot;),
          a!gridLayoutHeaderCell(label: &amp;quot;Remove&amp;quot;),
          a!gridLayoutHeaderCell(label: &amp;quot;Move Up&amp;quot;),
          a!gridLayoutHeaderCell(label: &amp;quot;Move Down&amp;quot;)
        },
        columnConfigs: {},
        rows: a!forEach(
          items: local!data,
          expression: a!gridRowLayout(
            contents: {
              a!textField(
                value: fv!item[&amp;#39;recordType!{9e939d67-33c2-43f5-8030-51fe874a4980}PS Company.fields.{c048e290-9f07-4fe7-a919-71b572004f35}companyName&amp;#39;],
                saveInto: fv!item[&amp;#39;recordType!{9e939d67-33c2-43f5-8030-51fe874a4980}PS Company.fields.{c048e290-9f07-4fe7-a919-71b572004f35}companyName&amp;#39;]
              ),
              a!textField(
                value: fv!item[&amp;#39;recordType!{9e939d67-33c2-43f5-8030-51fe874a4980}PS Company.fields.{07050c26-84c9-4749-8aa2-54675c403e0e}companyAddressPostCode&amp;#39;],
                saveInto: fv!item[&amp;#39;recordType!{9e939d67-33c2-43f5-8030-51fe874a4980}PS Company.fields.{07050c26-84c9-4749-8aa2-54675c403e0e}companyAddressPostCode&amp;#39;]
              ),
              a!textField(
                value: fv!item[&amp;#39;recordType!{9e939d67-33c2-43f5-8030-51fe874a4980}PS Company.fields.{9070d09a-ffd1-485b-9ac3-159cf5bed7ed}companyAddressCity&amp;#39;],
                saveInto: fv!item[&amp;#39;recordType!{9e939d67-33c2-43f5-8030-51fe874a4980}PS Company.fields.{9070d09a-ffd1-485b-9ac3-159cf5bed7ed}companyAddressCity&amp;#39;]
              ),
              a!textField(
                value: fv!item[&amp;#39;recordType!{9e939d67-33c2-43f5-8030-51fe874a4980}PS Company.fields.{80559642-a863-41e2-ad38-129e72546134}companyAddressState&amp;#39;],
                saveInto: fv!item[&amp;#39;recordType!{9e939d67-33c2-43f5-8030-51fe874a4980}PS Company.fields.{80559642-a863-41e2-ad38-129e72546134}companyAddressState&amp;#39;]
              ),
              a!richTextDisplayField(
                value: a!richTextIcon(
                  icon: if(
                    fv!item[&amp;#39;recordType!{9e939d67-33c2-43f5-8030-51fe874a4980}PS Company.fields.{19721518-b5ee-4deb-b4b2-5b0d5603d6ba}isActive&amp;#39;],
                    &amp;quot;times&amp;quot;,
                    &amp;quot;check&amp;quot;
                  ),
                  caption: &amp;quot;click to add or remove company&amp;quot;,
                  link: a!dynamicLink(
                    saveInto: if(
                      fv!item[&amp;#39;recordType!{9e939d67-33c2-43f5-8030-51fe874a4980}PS Company.fields.{19721518-b5ee-4deb-b4b2-5b0d5603d6ba}isActive&amp;#39;],
                      {
                        a!save(
                          fv!item[&amp;#39;recordType!{9e939d67-33c2-43f5-8030-51fe874a4980}PS Company.fields.{19721518-b5ee-4deb-b4b2-5b0d5603d6ba}isActive&amp;#39;],
                          false()
                        )
                      },
                      {
                        a!save(
                          fv!item[&amp;#39;recordType!{9e939d67-33c2-43f5-8030-51fe874a4980}PS Company.fields.{19721518-b5ee-4deb-b4b2-5b0d5603d6ba}isActive&amp;#39;],
                          true()
                        )
                      }
                    )
                  ),
                  color: if(
                    fv!item[&amp;#39;recordType!{9e939d67-33c2-43f5-8030-51fe874a4980}PS Company.fields.{19721518-b5ee-4deb-b4b2-5b0d5603d6ba}isActive&amp;#39;],
                    &amp;quot;NEGATIVE&amp;quot;,
                    &amp;quot;POSITIVE&amp;quot;
                  )
                )
              ),
              a!richTextDisplayField(
                value: a!richTextIcon(
                  showWhen: not(fv!isFirst),
                  icon: &amp;quot;arrow-up&amp;quot;,
                  link: a!dynamicLink(
                    value: fv!item,
                    saveInto: {
                      local!removed,
                      a!save(
                        local!change,
                        index(local!data, fv!index - 1, null)
                      ),
                      a!save(
                        local!data,
                        insert(local!data, fv!item, fv!index - 1)
                      ),
                      a!save(local!data, remove(local!data, fv!index)),
                      a!save(
                        local!data,
                        a!update(local!data, fv!index, local!change)
                      )
                    }
                  )
                )
              ),
              a!richTextDisplayField(
                value: a!richTextIcon(
                  showWhen: not(fv!isLast),
                  icon: &amp;quot;arrow-down&amp;quot;,
                  link: a!dynamicLink(
                    value: fv!item,
                    saveInto: {
                      local!removed,
                      a!save(local!data, remove(local!data, fv!index)),
                      a!save(
                        local!data,
                        insert(local!data, local!removed, fv!index + 1)
                      )
                    }
                  )
                )
              ),
              
            }
          )
        )
      ),
      a!linkField(
        links: a!dynamicLink(
          label: &amp;quot;Add New Company&amp;quot;,
          saveInto: {
            a!save(
              target: local!data,
              value: { append(local!data, &amp;quot;&amp;quot;) }
            )
          }
        )
      )
    }
  )
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>