Duplicate Table Record Block in Functions and Action in triggers

I find myself creating triggers to duplicate table records for various reasons. When I do this I have to a length trigger or logic block copying one table record to the next. Not only is this tedious and easy to make a mistake, but if you add a field to the table, you need to make sure you update the trigger or logic block to now include this table field, which can easily lead to bugs.

A duplicate table record logic block would solve these issues. I would prioritize this in functions if I had to choose.

Hope this is a quick win!

WhatsApp What do you mean with duplikate?
Into variables? Into another Table record?
Into another Place holder?

Hey @Simon_Lipsky - copying a record field by field is tedious, and it quietly breaks when someone adds a field to the table later, so a block that copies every field in one step makes sense to me.

Building on @thorsten.langner’s question so I have it right: do you mostly want to create a new record in the same table with every field copied and a new ID, or copy one existing record’s values onto another existing record? And would you want to override a few fields during the copy, like a status or a timestamp?

Once I know which you mean, I’ll pass the details along to the team!

Hey Aiden,

I almost always want to duplicate it into a new record with a new ID.

I can think of two reasonable ways currently:

  • You can do it with data manipulation field by field, which is tedious if its a lot and needs adjustment whenever the fields change.

  • You can use the tables API to get the record, change the id and use it to create the new record.

Good to know, thanks @Simon_Lipsky! I’ve got a ticket open for this and will get it scoped with the team.

In the meantime, @thorsten.langner’s two approaches are the right way to do it today.

To be upfront, the team’s pretty stretched right now, but seeing more interest helps a lot with prioritizing, especially for something that should be a smaller lift. If you’re coming across this thread and need the same thing, please give it an upvote!