<?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>gridLayout: Unable to save selected row in gridRowLayout to a local variable</title><link>https://community.appian.com/discussions/f/user-interface/37484/gridlayout-unable-to-save-selected-row-in-gridrowlayout-to-a-local-variable</link><description>Hi everyone, 
 I&amp;#39;m having this issue not sure if it is something wrong with my code or Appian issue itself, please help. 
 I&amp;#39;m having an editable grid, the data for it is a data subset type local variable, and in rows I use forEach of its data. I already</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: gridLayout: Unable to save selected row in gridRowLayout to a local variable</title><link>https://community.appian.com/thread/140668?ContentTypeID=1</link><pubDate>Tue, 17 Sep 2024 05:09:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e233b536-1d03-4c6a-a4f4-cae290c0b52b</guid><dc:creator>sarathkumar13</dc:creator><description>&lt;p&gt;Try using append function instead of flatten function in the saveinto parameter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gridLayout: Unable to save selected row in gridRowLayout to a local variable</title><link>https://community.appian.com/thread/140621?ContentTypeID=1</link><pubDate>Mon, 16 Sep 2024 05:57:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:96aaf3c8-0d5b-4cbc-b552-90ff5fe8aa7e</guid><dc:creator>Guduri Durga Pavan SriHari Raju</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;a href="/members/mollyn6512"&gt;mollyn126&lt;/a&gt;&amp;nbsp; &lt;span class="ui-provider a b c d e f g h i j k l m n o p q r s t u v w x y z ab ac ae af ag ah ai aj ak" dir="ltr"&gt;Could you please provide the full details of the Data subset local variable? Specifically, I&amp;#39;d like to know the exact field values it contains and how you&amp;#39;ve defined Local!selectedAzureIds. Before proceeding, we need to verify everything on our end. For your reference, I&amp;#39;ve included a sample code snippet below.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="ui-provider a b c d e f g h i j k l m n o p q r s t u v w x y z ab ac ae af ag ah ai aj ak" dir="ltr"&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!items: {
    { id: 1, item: &amp;quot;Item 1&amp;quot;, qty: 1, unitPrice: 10 },
    { id: 2, item: &amp;quot;Item 2&amp;quot;, qty: 2, unitPrice: 20 }
  },
  local!dataSubset: a!dataSubset(
    data: local!items,
    startIndex: 1,
    batchSize: 10,
    
  ),
  local!storedSelection,
  a!gridLayout(
    label: &amp;quot;Data Products&amp;quot;,
    instructions: &amp;quot;Sample Data&amp;quot;,
    headerCells: {
      a!gridLayoutHeaderCell(label: &amp;quot;Item&amp;quot;),
      a!gridLayoutHeaderCell(label: &amp;quot;Qty&amp;quot;),
      a!gridLayoutHeaderCell(label: &amp;quot;Unit Price&amp;quot;),
      a!gridLayoutHeaderCell(label: &amp;quot;Total&amp;quot;, align: &amp;quot;RIGHT&amp;quot;),
      a!gridLayoutHeaderCell(label: &amp;quot; &amp;quot;),
      
    },
    rows: a!forEach(
      items: local!dataSubset.data,
      expression: a!gridRowLayout(
        id: fv!item.id,
        contents: {
          a!textField(
            value: fv!item.item,
            saveInto: fv!item.item
          ),
          a!integerField(value: fv!item.qty, saveInto: fv!item.qty),
          a!floatingPointField(
            value: fv!item.unitPrice,
            saveInto: fv!item.unitPrice
          ),
          a!textField(
            value: a!currency(
              isoCode: &amp;quot;USD&amp;quot;,
              value: tointeger(fv!item.qty) * todecimal(fv!item.unitPrice)
            ),
            readOnly: true,
            align: &amp;quot;RIGHT&amp;quot;
          ),
          a!richTextDisplayField(
            value: {
              a!richTextIcon(
                icon: &amp;quot;arrow-circle-down&amp;quot;,
                showWhen: not(fv!isLast),
                link: a!dynamicLink(
                  saveInto: {
                    a!save(
                      local!items,
                      a!update(
                        local!items,
                        { fv!index, fv!index + 1 },
                        {
                          index(local!items, (fv!index + 1), null()),
                          fv!item
                        }
                      )
                    )
                  }
                )
              ),
              a!richTextIcon(icon: &amp;quot;arrow-circle-up&amp;quot;)
            }
          )
        }
      )
    ),
    selectable: true(),
    selectionValue: local!storedSelection,
    selectionSaveInto: local!storedSelection,
    rowHeader: 1
  ),
  
)&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="ui-provider a b c d e f g h i j k l m n o p q r s t u v w x y z ab ac ae af ag ah ai aj ak" dir="ltr"&gt;Output &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="ui-provider a b c d e f g h i j k l m n o p q r s t u v w x y z ab ac ae af ag ah ai aj ak" dir="ltr"&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/13/pastedimage1726466211054v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gridLayout: Unable to save selected row in gridRowLayout to a local variable</title><link>https://community.appian.com/thread/140615?ContentTypeID=1</link><pubDate>Sun, 15 Sep 2024 14:36:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b11eb343-df59-46f6-a1e2-bb7e1195c23f</guid><dc:creator>Soma</dc:creator><description>&lt;p&gt;Couple of questions&lt;/p&gt;
&lt;p&gt;1. Why have you used flatten(save!value) when just passing the same local!selectedAzureIds&amp;nbsp;used in the selectionValue parameter is enough to capture the selected Ids.&lt;/p&gt;
&lt;p&gt;2. Did you check if the local!selectedAzureIds is accidentally getting reset somewhere else in the code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gridLayout: Unable to save selected row in gridRowLayout to a local variable</title><link>https://community.appian.com/thread/140610?ContentTypeID=1</link><pubDate>Sat, 14 Sep 2024 19:10:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8da8eeec-f49e-4df7-ba5e-9f25366970e9</guid><dc:creator>Julita Wilczek</dc:creator><description>&lt;p&gt;Can you show data from the subset type? And what is stored in contents parameter? I think id is used for something else here, based on the documentation.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>