Copy a Record Using Record Rules

Learn how to copy records from the Live App using Record Rules here in this article.

Use Case

This article will walk you through how to set up the option to copy records in your Live App using record rules on a form.

Requirements

If this is your first time creating an app, you'll need to know some basics about adding tables, fields, pages, and views. You can start by reading our Builder Basics section. 
Other good resources can be found in our About Your Database and Working With Pages article in our knowledge base.

Steps

Add a Self-Referencing Connection

We'll create a connection field that links the table containing the desired duplicate records to itself. This will establish a connection within the same table.

In this example, Employees are tracking their Hours, and we want them to have the option to copy previous Hours. We're adding the connection field on the Hours table to connect to itself. 

Add a Form

On a Details page that displays the specific record you want to copy, we'll add a form view for updating that page's record.

In this example, we're adding a new form for updating the Hours record on the Hours details page. We’re calling the form “Copy Record”.

 

We want this form to have no fields since we want to access the record rules only:

 
Tip: You can also update the submit button text to "Copy Record" and remove the form title.

Add a Record Rule

Now, we'll go to the Form Rules section of the view editor for that form and select the Record Rules tab.

We'll create a new record rule to insert a new record connected to this record. We'll assign the fields that we want to duplicate and set them to inherit the form value of the same field.

Congratulations! You can now duplicate your records. 🚀

Notes

Copy Records with Action Links

Action links have the option to trigger actions similar to record rules. These can also be used in other view types to insert a connected record and copy a record.

You can learn more about using action link triggers here.

Copy Records in Tables

Record rules are also available in grid views that have inline editing enabled. You can learn more about using record rules with grid views here.