How do I duplicate an invoice and line items within it?

Hello Glide Community,

I would like to duplicate an invoice and its line items using a Glide action.

I have a database of invoices and a database of line items (that go on the invoice).

I would like to create a copy of the invoice and a copy of the line items within the invoice using an action.

How is that setup in Glide?

I think you have to use a third-party option like Make to get this to work.

You would have to create a JSON structure in the Invoices table to represent the invoice columns, and an array of items that are related to that invoice.

Send that structure to Make using a webhook action, and then use a parse JSON module.

From the resulting JSON, first, use the Glide API to create an Invoice line with the invoice-level info. You will then get the rowID of the invoice.

Create an iterator to iterate through the list of “original line items” from the parse JSON module, and add them to Glide using the Glide API, and make sure you add the rowID of the invoice to create a relation between them.

Thank you @ThinhDinh for the custom resolution.

I would be curious to hear from Glide if they plan to incorporate this into their boxed action options and what the timeline for this feature would look like.

I would imagine the ability to duplicate a record and its related child records is a pretty common use case.

Can’t speak for everyone, but in my own building experience, it’s pretty uncommon.