<?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>How to copy values of a filled editable grid into another grid in an interface</title><link>https://community.appian.com/discussions/f/user-interface/29803/how-to-copy-values-of-a-filled-editable-grid-into-another-grid-in-an-interface</link><description>Hi! I have an editable grid which is filled by the user (possible to add new rows), like in this example: 
 
 The editable grid values are saved in a Record, and they all have a common field for each grid created (for example, Employee Set 1, even though</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to copy values of a filled editable grid into another grid in an interface</title><link>https://community.appian.com/thread/118325?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2023 11:30:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9f5e5662-53cc-4811-935d-f208429b52d5</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Well, an empty grid without an option to add any rows is a bit boring and hard to test. That&amp;#39;s what the fake data is for.&lt;/p&gt;
&lt;p&gt;Once things work, use a!queryRecordType to load the data into that local, replacing the fake data.&lt;/p&gt;
&lt;p&gt;BTW, I am not sure what exactly you mean with &amp;quot;data from the last grid&amp;quot;. My assumption is that you store this data to the database as the user submits that form.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to copy values of a filled editable grid into another grid in an interface</title><link>https://community.appian.com/thread/118323?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2023 11:17:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:39079902-199e-42f6-a9b9-abd7bea8499e</guid><dc:creator>carlosp5114</dc:creator><description>&lt;p&gt;Alright, step by step:&lt;/p&gt;
&lt;p&gt;1) Record Type Constructor: I still don&amp;acute;t know why I should create fake data by this way. Until now, for my editable grids filled by hand for the user, I directly created my local variable (empty) and then replaced it with the data introduced by the user&lt;/p&gt;
&lt;p&gt;2) Editable grid: I removed the addrowlink correctly&lt;/p&gt;
&lt;p&gt;Now, I&amp;acute;m still not sure how to manage to &amp;quot;replace the fake data with real data&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1. Grid I want to &amp;quot;copy&amp;quot; / &amp;quot;query&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/pastedimage1693394243819v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;2. Editable grid I want to replace with data of the last grid&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/pastedimage1693394335668v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;My first trial of new code (not working)&lt;/p&gt;
&lt;p&gt;Any help with the code would be useful! Thanks again&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!grid,
  {
    a!sectionLayout(
      label: &amp;quot;L&amp;#237;neas Factura&amp;quot;,
      labelIcon: &amp;quot;list-alt-solid&amp;quot;,
      contents: {
        a!gridLayout(
          label: &amp;quot;A continuaci&amp;#243;n, incorpore las l&amp;#237;neas de factura correspondientes y pulse el bot&amp;#243;n de creaci&amp;#243;n&amp;quot;,
          headerCells: {
            a!gridLayoutHeaderCell(label: &amp;quot;Linea Pedido&amp;quot;),
            a!gridLayoutHeaderCell(label: &amp;quot;Pedido&amp;quot;),
            a!gridLayoutHeaderCell(label: &amp;quot;Proveedor&amp;quot;),
            a!gridLayoutHeaderCell(label: &amp;quot;Material&amp;quot;),
            a!gridLayoutHeaderCell(label: &amp;quot;Precio Unitario&amp;quot;),
            a!gridLayoutHeaderCell(label: &amp;quot;Cantidad&amp;quot;),
            a!gridLayoutHeaderCell(label: &amp;quot;Importe Total&amp;quot;),
            a!gridLayoutHeaderCell()
          },
          columnConfigs: {
            a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;),
            a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;),
            a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;),
            a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;),
            a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;),
            a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;),
            a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;),
            a!gridLayoutColumnConfig(width: &amp;quot;ICON&amp;quot;)
          },
          rows: a!forEach(
            items: ri!recordLineasPedido,
            expression: a!gridRowLayout(
              contents: {
                a!textField(
                  value: fv!index,
                  saveInto: fv!item[&amp;#39;recordType!{6e637180-b344-49d2-a1f7-f87eed0041ba}CPF Lineas Factura.fields.{181742a7-4305-4134-b05e-4eebc9c56292}idLineaFactura&amp;#39;]
                ),
                a!textField(
                  value: fv!index,
                  saveInto: fv!item[&amp;#39;recordType!{6e637180-b344-49d2-a1f7-f87eed0041ba}CPF Lineas Factura.fields.{60774c8e-9b47-486f-9fea-b32c525c05fd}idPedido&amp;#39;]
                ),
                a!textField(
                  value: fv!index,
                  saveInto: fv!item[&amp;#39;recordType!{6e637180-b344-49d2-a1f7-f87eed0041ba}CPF Lineas Factura.fields.{844be35b-6de5-434e-9c69-e7c7b8a148dd}proveedor&amp;#39;]
                ),
                a!textField(
                  value: fv!index,
                  saveInto: fv!item[&amp;#39;recordType!{6e637180-b344-49d2-a1f7-f87eed0041ba}CPF Lineas Factura.fields.{019eb28b-727b-4e2c-8160-1bcf8a747ef1}material&amp;#39;]
                ),
                a!integerField(
                  value: fv!index,
                  saveInto: fv!item[&amp;#39;recordType!{6e637180-b344-49d2-a1f7-f87eed0041ba}CPF Lineas Factura.fields.{eda9bda7-ae57-44e7-a651-d097c8581021}precioUnit&amp;#39;]
                ),
                a!floatingPointField(
                  value: fv!index,
                  saveInto: fv!item[&amp;#39;recordType!{6e637180-b344-49d2-a1f7-f87eed0041ba}CPF Lineas Factura.fields.{53f231a2-9bf7-40a1-af07-74373fa7bd9f}importe&amp;#39;]
                )
              }
            )
          )
        )
      }
    ),
    a!buttonLayout(
      primaryButtons: {
        a!buttonWidget(
          label: &amp;quot;Completar Creaci&amp;#243;n Factura&amp;quot;,
          saveInto: a!save(ri!recordLineasFact, local!grid),
          submit: true,
          style: &amp;quot;PRIMARY&amp;quot;,
          validate: true
        )
      },
      secondaryButtons: {
        a!buttonWidget(
          label: &amp;quot;Cancelar&amp;quot;,
          value: true,
          saveInto: ri!cancel2,
          submit: true,
          style: &amp;quot;NORMAL&amp;quot;,
          validate: false
        )
      }
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to copy values of a filled editable grid into another grid in an interface</title><link>https://community.appian.com/thread/118268?ContentTypeID=1</link><pubDate>Tue, 29 Aug 2023 15:38:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:511f5d66-3ddd-4f0a-a013-faba35b8f26c</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;We are talking three different things here. You need to isolate and understand each of&amp;nbsp;them before finally solving that larger challenge.&lt;/p&gt;
&lt;p&gt;Record Type constructor: As Mike pointed out, this is just to create some fake data. Again, split a problem into smaller pieces and solve each piece.&lt;/p&gt;
&lt;p&gt;Editable grid: If you remove/hide the &lt;span&gt;addRowLink, no user can add any new item.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Query: Once all of the above works, add the last piece to the puzzle and replace the fake data with real data. And yes, that requires&amp;nbsp;a local.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Some tips on problem solving:&amp;nbsp;&lt;a href="https://www.freecodecamp.org/news/how-to-think-like-a-programmer-lessons-in-problem-solving-d1d8bf1de7d2"&gt;www.freecodecamp.org/.../how-to-think-like-a-programmer-lessons-in-problem-solving-d1d8bf1de7d2&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to copy values of a filled editable grid into another grid in an interface</title><link>https://community.appian.com/thread/118266?ContentTypeID=1</link><pubDate>Tue, 29 Aug 2023 15:10:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d7510b4b-e60c-4bec-abf4-e81f4c76620c</guid><dc:creator>carlosp5114</dc:creator><description>&lt;p&gt;Thanks for your answer Mike! First of all, you are absolutely right, the post was about&amp;nbsp;the structure of a Read-Only Grid with the a!GridField function, but I thought maybe I could catch some similarities for my purpose. It&amp;acute;s my mistake.&lt;/p&gt;
&lt;p&gt;On the other hand, wouldn&amp;acute;t be enough to use the a!query function to set up my local variable (array)? Like in this example:&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/pastedimage1693321715908v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In this case, I don&amp;acute;t want the user to add new rows or delete them, just to set up the values of the initial array in my editable grid. Where should I include the record type constructor? Is it really necesary to set up the local variable? Any explanation would be helpful&lt;/p&gt;
&lt;p&gt;Thanks again for your response&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to copy values of a filled editable grid into another grid in an interface</title><link>https://community.appian.com/thread/118262?ContentTypeID=1</link><pubDate>Tue, 29 Aug 2023 14:39:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b67a70c9-dde6-4d45-bfcd-bcba6d32e15c</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="251169" url="~/discussions/f/user-interface/29803/how-to-copy-values-of-a-filled-editable-grid-into-another-grid-in-an-interface/118261#118261"]I have seen another post in the appian community forum, and they propose this way for each column of the editable grid having the local variable (array)[/quote]
&lt;p&gt;Given that it&amp;#39;s my comment you screenshotted here - I feel the need to point out that the post in question is &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;not&lt;/strong&gt;&lt;/span&gt; about &lt;em&gt;editable grids&lt;/em&gt; at all, but is in fact about the old-style Paging Grid (currently called Read-Only Grid, but still referenced via &lt;em&gt;a!gridField()&lt;/em&gt;).&amp;nbsp; The construct for the different types of grids is completely dissimilar.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="251169" url="~/discussions/f/user-interface/29803/how-to-copy-values-of-a-filled-editable-grid-into-another-grid-in-an-interface/118261#118261"]I still can´t view in a clear way how to toy with the record type constructor in the editable grid, and where should I use it in the editable grid structure[/quote]
&lt;p&gt;I&amp;#39;m assuming this just means that you&amp;#39;d use the Record Type Constructor to manually set up a local variable to contain a few rows of record type data (aka &amp;quot;fake data&amp;quot; but in a real structure), and/or use the constructor in the &amp;quot;add row&amp;quot; link (if you&amp;#39;re using it) to force certain default values into the new row you&amp;#39;re adding.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to copy values of a filled editable grid into another grid in an interface</title><link>https://community.appian.com/thread/118261?ContentTypeID=1</link><pubDate>Tue, 29 Aug 2023 14:12:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:981118b8-6287-4562-9d20-bd7b2345fd32</guid><dc:creator>carlosp5114</dc:creator><description>&lt;p&gt;I understand the fact that I have to query my database in order to obtain my local variable (array from the editable grid)&lt;/p&gt;
&lt;p&gt;I still can&amp;acute;t view in a clear way how to toy with the record type constructor in the editable grid, and where should I use it in the editable grid structure&lt;/p&gt;
&lt;p&gt;I have seen another post in the appian community forum, and they propose this way for each column of the editable grid having the local variable (array)&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/pastedimage1693318273191v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The link is:&lt;/p&gt;
&lt;p&gt;&lt;a href="/discussions/f/rules/18985/indexing-array-in-the-grid"&gt;https://community.appian.com/discussions/f/rules/18985/indexing-array-in-the-grid&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;What do you think? Thanks a lot again&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to copy values of a filled editable grid into another grid in an interface</title><link>https://community.appian.com/thread/118259?ContentTypeID=1</link><pubDate>Tue, 29 Aug 2023 13:55:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:575ba6f0-42f6-43d5-b7e5-eacc31e3110c</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Quote from docs: &amp;quot;You can use a record type constructor to create a single record in your expression. The record type constructor allows you to map each value to a particular field reference or relationship reference in the record type.&amp;quot;&lt;/p&gt;
&lt;p&gt;This does not query any data from the database. But allows you to toy around with the grid and make it work.&lt;/p&gt;
&lt;p&gt;To accomplish your real use case, you use a!queryRecordType to fetch data from the DB.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to copy values of a filled editable grid into another grid in an interface</title><link>https://community.appian.com/thread/118257?ContentTypeID=1</link><pubDate>Tue, 29 Aug 2023 13:48:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7998ccaf-8412-4169-a3e8-3a97b6136133</guid><dc:creator>carlosp5114</dc:creator><description>&lt;p&gt;Thanks Stefan! I have been working in my first editable grid, I read again the documentation and examples and understood how it works.&lt;/p&gt;
&lt;p&gt;I have already seen the second link (record type constructors). But here I don&amp;acute;t really understand the difference between using a query or using the record type constructor. Can I use the record type constructor inside the query? Or are they different concepts?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to copy values of a filled editable grid into another grid in an interface</title><link>https://community.appian.com/thread/118236?ContentTypeID=1</link><pubDate>Tue, 29 Aug 2023 10:42:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:43014389-f023-40bd-8bbf-173719ad410e</guid><dc:creator>Dhananjay Kumar</dc:creator><description>&lt;p&gt;I am not sure If I got your point or not. However, there is a way to disable add row link. Moreover, you can set columns as per business condition.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to copy values of a filled editable grid into another grid in an interface</title><link>https://community.appian.com/thread/118235?ContentTypeID=1</link><pubDate>Tue, 29 Aug 2023 10:11:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e584e591-d5a6-42ca-b7e2-a1106b907506</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;The documentation has some good examples on editable grids.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/23.3/Editable_Grid_Component.html#editable-grid-with-two-rows-using-looping"&gt;https://docs.appian.com/suite/help/23.3/Editable_Grid_Component.html#editable-grid-with-two-rows-using-looping&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Once you understand how it works, adjust it to work with a static list of your record items. Then use a!queryRecordType to load dynamic&amp;nbsp;data into that local variable.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/23.3/reference-records.html#use-a-record-type-constructor"&gt;docs.appian.com/.../reference-records.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to copy values of a filled editable grid into another grid in an interface</title><link>https://community.appian.com/thread/118234?ContentTypeID=1</link><pubDate>Tue, 29 Aug 2023 10:01:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9a678714-5a6f-43b5-ad86-16d2be87fba0</guid><dc:creator>carlosp5114</dc:creator><description>&lt;p&gt;Sure, I was thinking about querying the data to make the grid. I know I can do this directly with a read-only grid (from a Record Type), but in this case I would prefer to use an editable grid (to be able to add new columns)&lt;/p&gt;
&lt;p&gt;So I have the following questions:&lt;/p&gt;
&lt;p&gt;1. &amp;iquest;Do you recommend me to query the database for each column of the grid? &amp;iquest;Or is there a way to query all the&amp;nbsp;record list (like in the read-only grids) and being able to add new columns?&lt;/p&gt;
&lt;p&gt;2. After executing the query and having the editable grid with the values, &amp;iquest;could it be possible for the user to change the value manually and apply validations rules over the first value?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#0000ff;"&gt;f.e. I&amp;nbsp;my value for first row and first column is &amp;quot;20&amp;quot;. &amp;iquest;Can I change it to &amp;quot;10&amp;quot; manually and put a validation rule so that I can only change with values &amp;lt;= 20?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to copy values of a filled editable grid into another grid in an interface</title><link>https://community.appian.com/thread/118232?ContentTypeID=1</link><pubDate>Tue, 29 Aug 2023 09:46:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3abe578b-2a00-478e-9fd1-bc3174b21dd0</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Can you explain what exactly you mean with &amp;quot;copy&amp;quot;? Why not just query the data and feed it into the grid?&lt;/p&gt;
&lt;p&gt;On the UI, you would just have to hide the add-item-link and the remove column.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>