Table clone rows

Is there a way to clone selected rows of a table and add them as new rows to the table? I tried adding the selectes rows to the changesetarray after removing their primary keys. But this didnt work. Is there any way i can add rows to a table with data prefilled based on another(selected) row?

Hi @Krishna_Priya_S,

I use this functionality a lot. The steps I follow are:

  • Add a row action which is "Clone row"
  • Create a query that uses GUI to add a new record to your table and you can use each of your row fields by using {{table1.selectedSourceRow.field_name }} and assign to it to each of your db table columns
  • Set up a successful trigger event so that it refresh your original data query rwhich will in turn refresh your table and add a new row with all the same information but a new id

Hope this helps, let me know if you need more guidance.

Hi @MiguelOrtiz ,

Thanks for the response! My table gets data from a rest api query, ideally i would want to copy the row and then add it to the changesetarray of the table. For your solution, would i have to call the rest api to add a row instead of using GUI?

Hi @Krishna_Priya_S,

This is what I mean:

You add a row action which triggers your query. Now, you mention you are doing this through an api, which I presume means you can't use GUI?

You can still build your API call dynamically by using the selectedRow variables as shown in the screenshot.

When your API runs, just add an event handler to that query to RErun the API that returns the data for your table so that it refreshes.

Hope this helps!