<?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>fv!selectedRows in a gridLayout</title><link>https://community.appian.com/discussions/f/rules/19180/fv-selectedrows-in-a-gridlayout</link><description>Hi, 
 
 Well I have and editable grindLayout and I&amp;#39;m trying to add to a grindField the selected rows, but in editable grid we can&amp;#39;t use fv!rowselected. 
 How can I do it? 
 Here&amp;#39;s my code. 
 
 Thank you</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: fv!selectedRows in a gridLayout</title><link>https://community.appian.com/thread/75241?ContentTypeID=1</link><pubDate>Tue, 07 Jul 2020 13:01:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8a69129d-a820-4d89-9f4c-059495b6ff16</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;Honestly it gets confusing for end users anyway if you are selecting rows on multiple pages - you might want to consider other ways about designing this that could work better. For instance, what if you had &amp;quot;ADD&amp;quot; and &amp;quot;REMOVE&amp;quot; buttons on the toolbar? Then, when you select a row, users can click the button to add / remove them to / from the array. Or, what if you had an icon on each row for add? Then you could still add with one click without needing the selection column.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fv!selectedRows in a gridLayout</title><link>https://community.appian.com/thread/75226?ContentTypeID=1</link><pubDate>Tue, 07 Jul 2020 06:53:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:414e61f6-4355-4691-a470-b75a0fda4202</guid><dc:creator>gdengrar</dc:creator><description>&lt;p&gt;It doesn&amp;#39;t work to me, I mean, when you select all in the first page and you go to the second and click select all again, all data selected in the 1st page desappeared.&lt;/p&gt;
&lt;p&gt;I have done 2 an append and an union to have all data but i cant remove selected options. Here&amp;#39;s the code.&lt;pre class="ui-code" data-mode="text"&gt;
        selectionSaveInto: {
          a!save(
            target: local!selection,
            value: append(local!selection, save!value)
          ),
                 
          a!save(target: local!selection,
          value: union(local!selection, local!selection)),
          
          
          a!save(
            target: local!selectedPersonas,
            value: if(
              length(
                local!selection
              ) = 0,
              null,
              index(
                local!items,
                local!selection,
                {}
              )
            )
          )
        },&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fv!selectedRows in a gridLayout</title><link>https://community.appian.com/thread/75211?ContentTypeID=1</link><pubDate>Mon, 06 Jul 2020 13:10:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9f9ca4a7-1c38-4482-a758-78b6866f309c</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;I got it to work by adding a null check on saving into selectedPersonas:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;selectionSaveInto: {
  a!save(
    target: local!selected, 
    value: a!flatten(save!value)
  ),
  a!save(
    local!selectedPersonas,
    if(
      or(
        isnull(local!selected),
        length(local!selected) &amp;lt; 1
      ),
      {},
      index(
        local!datasubset.data,
        local!selected,
        {}
      )
    )
  )
},&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fv!selectedRows in a gridLayout</title><link>https://community.appian.com/thread/75181?ContentTypeID=1</link><pubDate>Fri, 03 Jul 2020 08:49:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:810518ba-fbf7-4b5c-8e05-cc995f02be84</guid><dc:creator>gdengrar</dc:creator><description>&lt;p&gt;It works if check individuals checkboxes, but if I press the &amp;quot;select all&amp;quot; checkbox it overwrites all I have selected before&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fv!selectedRows in a gridLayout</title><link>https://community.appian.com/thread/75139?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2020 12:23:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:af70d857-6d39-4730-a9c0-db53d4ce53b2</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;The best way to manage that is to use an identifier from your data as the grid row identifier. Currently, you&amp;#39;re using the index of the a!forEach() function, which will always give you 1-5. However,&amp;nbsp;suppose you had another field in your items variable for id. Then, in your grid row layout would be something like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;rows: a!forEach(
  items: local!datasubset.data,
   expression: a!gridRowLayout(
      id: fv!item.id,
       contents: {
       ...&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fv!rowselected in a gridLayout</title><link>https://community.appian.com/thread/75136?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2020 11:06:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:909b8335-9efa-47d1-98cd-7c3c8e25c6d1</guid><dc:creator>gdengrar</dc:creator><description>&lt;p&gt;That works!! Thank you!! But when I go to the next page, the selection box doesnt come empty, so I can&amp;#39;t choose that values. The problem now is that i cant refresh selection vales, they always be between 1-5. How can I do that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fv!rowselected in a gridLayout</title><link>https://community.appian.com/thread/75114?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2020 15:38:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:953460ae-1260-4053-ae78-1ae02b0eaf07</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;I think the best way to achieve this is to use the value you have saved into your local variable to directly index into your source data. For example, you should be able to do something like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;selectionSaveInto: {
  a!save(
    target: local!selected, 
    value: a!flatten(save!value)
  ),
  a!save(
    local!selectedPersonas, 
    index(
      local!datasubset.data,
      local!selected,
      {}
    )
  )
},&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>