<?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>add grid again when i click addrow an remove the grid</title><link>https://community.appian.com/discussions/f/user-interface/26073/add-grid-again-when-i-click-addrow-an-remove-the-grid</link><description>Hi i have written code like this to get a grid it&amp;#39;s a editable grid and for this now when i click add row then complete grid has to be added 
 how can i write logic for it can anyone help on this 
 this is the code for that grid.. even want to remove</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: add grid again when i click addrow an remove the grid</title><link>https://community.appian.com/thread/102093?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2022 12:05:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d6e0737d-258a-40e4-acef-98a8a39c3894</guid><dc:creator>Amaan Shekh</dc:creator><description>&lt;p&gt;check this out&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!contract:{a!map(name:&amp;quot;&amp;quot;,address:&amp;quot;&amp;quot;,price:&amp;quot;&amp;quot;)},
  {
    a!forEach(
      items: local!contract,
      expression:  {
        a!columnsLayout(
          columns: {
            a!columnLayout(
              contents: {
                a!columnsLayout(
                  columns: {
                    a!columnLayout(
                      contents: {
                         a!textField(
                           value: &amp;quot;Contract #&amp;quot;&amp;amp;fv!index,
                           readOnly: true()
                         )
                      }
                    ),
                    a!columnLayout(
                      contents: {
                        a!linkField(
                          align: &amp;quot;RIGHT&amp;quot;,
                          links: a!submitLink(
                            label: &amp;quot;remove&amp;quot;,
                            saveInto: {a!save(local!contract,remove(local!contract,fv!index))}
                          )
                        )
                      }
                    )
                  }
                ),
                a!gridLayout(
                  headerCells: {
                    a!gridLayoutHeaderCell(label: &amp;quot;name&amp;quot;),
                    a!gridLayoutHeaderCell(label: &amp;quot;address&amp;quot;),
                    a!gridLayoutHeaderCell(label: &amp;quot;price&amp;quot;)
                  },
                  rows: {
                    a!gridRowLayout(
                      contents: {
                        a!textField(
                          value: fv!item.name,
                          saveInto: {fv!item.name}
                        ),
                        a!textField(
                          value: fv!item.address,
                          saveInto: {fv!item.address}
                        ),
                        a!textField(
                          value: fv!item.price,
                          saveInto: {fv!item.price}
                        )

                      }
                    )

                  },
                  rowHeader: 1
                )
              }
            )
          }
        ),
      
      }
    ),
    a!linkField(
      label: &amp;quot;&amp;quot;,
      labelPosition: &amp;quot;ABOVE&amp;quot;,
      links: {
        a!submitLink(
          label: &amp;quot;Add Contract&amp;quot;,
          saveInto: a!save(local!contract,append(local!contract,a!map(name:&amp;quot;&amp;quot;,address:&amp;quot;&amp;quot;,price:&amp;quot;&amp;quot;)))
        )
      }
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: add grid again when i click addrow an remove the grid</title><link>https://community.appian.com/thread/102090?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2022 11:43:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f510ab8f-1b58-4070-9388-dab77206896f</guid><dc:creator>ujjwalr0002</dc:creator><description>&lt;p&gt;Check this&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;= a!localVariables(
  local!items: {
    a!map(item: null, qty: null, unitPrice: null),
    
  },
  {
    a!forEach(
      items: local!items,
      expression: {
        a!sideBySideLayout(
          items: {
            a!sideBySideItem(
              item: a!richTextDisplayField(label: &amp;quot;Products&amp;quot;, ),
              
            ),
            a!sideBySideItem(
              item: a!richTextDisplayField(
                align: &amp;quot;RIGHT&amp;quot;,
                value: a!richTextIcon(
                  icon: &amp;quot;times&amp;quot;,
                  color: &amp;quot;NEGATIVE&amp;quot;,
                  link: a!dynamicLink(
                    saveInto: a!save(
                      local!items,
                      remove(local!items, fv!index)
                    )
                  )
                )
              ),
              
            ),
            
          }
        ),
        a!gridLayout(
          instructions: &amp;quot;Update the item name, quantity, or unit price.&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;)
          },
          rows: {
            a!gridRowLayout(
              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: fv!item.qty,
                  readOnly: true,
                  align: &amp;quot;RIGHT&amp;quot;
                )
              }
            ),
            
          },
          rowHeader: 1
        ),
        
      }
    ),
    a!richTextDisplayField(
      value: a!richTextItem(
        text: &amp;quot;ADD GRID&amp;quot;,
        link: a!dynamicLink(
          label: &amp;quot;Add new Grid&amp;quot;,
          saveInto: a!save(
            local!items,
            append(
              local!items,
              a!map(item: null, qty: null, unitPrice: null)
            )
          )
        )
      )
    )
  }
)

&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: add grid again when i click addrow an remove the grid</title><link>https://community.appian.com/thread/102087?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2022 11:30:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:927dd988-87e0-4714-bdc3-876ff2f0f8cd</guid><dc:creator>KM</dc:creator><description>&lt;p&gt;yeah, am not sure how can i achieve that. am stuck with this task :( unable to progress on this.&lt;/p&gt;
&lt;p&gt;my use case when user wants to add more contract then hole grid has to be populated so they&amp;#39;ll add if they willing it remove then it should be able to delete it&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: add grid again when i click addrow an remove the grid</title><link>https://community.appian.com/thread/102085?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2022 11:27:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6ac4c1c2-558f-43ea-9365-cef7113594bc</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;That is a simple requirement, achievable with a simple loop. You can call your grid in the loop and the items of that loop should be an array that is increased or decreased based on of you add or remove.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also, you have to create custom dynamic links to add or remove the grid. But just out of curiosity, what is your usecase? Why do you want multiple grids?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>