You can add a button to your application that users can click to copy or import records and the relationships between them. Use the Copy parent & child records option to add a Formula-URL field that displays as a button in a specified table that either:
-
Copies a parent record and its child records. For example, add a copy button in a project management application so that users can create a new Project by copying an existing Project parent record and its child Task records. (Read how to create a copy button.)
-
Imports specific child records to a parent record. For example, add an import button so that users can import the same group of child Task records to different Project parent records. (Read how to create an import button.)
When you create a copy or import button, you specify the parent table in which the new Formula-URL field appears, and decide whether all or a subset of child records are copied, and whether Quickbase should recursively copy all child records. You also specify the text that appears on the button. Make sure you use descriptive text so that users understand what will happen when they click the button.
To access the Copy parent & child records option:
-
Open the application that you want to work with, select App settings from the sidebar, then click App management.
-
Click the Copy parent & child records link.
Creating a copy or import button involves the following topics covered in this article:
-
Understand how application users use the copy or import button
-
Understand the limitations and restrictions for copying and importing records
-
How Quickbase maps predecessor relationships when it copies or imports records
-
Add the copy or import button to reports and additional forms
Understand how application users use the copy or import button
Before you create a copy or import button, it's helpful to understand how the button appears on your forms and what happens when a user clicks it.
This section contains examples for:
Using a copy button
In this example, a Copy this record button has been added to a form, shown below.
When a user clicks the Copy this record button, a confirmation message opens. The user clicks Go to record on the confirmation message, and the form for the new record opens, as shown below. The name of the new record is prefaced with "Copy of" and the copied child records have the icon, if your app displays it.
Using an import button
In this example, an import button has been added to a Project form, shown below.
When a user clicks the Import child records button, a confirmation message opens, indicating how many records were created. The user clicks Go to Project on the confirmation message, and can see that project's child records list now contains seven imported child records.
Understand the limitations and restrictions for copying and importing records
You should understand the following limitations and restrictions before creating a copy or import button:
-
An application user must have these permissions to use the button successfully:
-
For copying records, create permission for both the parent and child records
-
For importing records, create permissions for the child records
-
The parent table must contain a Report Link field as part of the relationship with each child table. If the report link field does not exist for a relationship with a child table, child records for that table are not copied. The application user must have permission to view the report link fields. To confirm that the report link field exists, view the relationship and check that the parent table has a report link field whose target field is the reference field listed under the child table.
-
Quickbase will not copy or import any records if any of the records to be copied or imported contain unique fields, such as custom key fields. The key field for each table from which records will be copied or imported must be Record ID#.
-
Quickbase copies or imports every field in selected records, regardless of the field's permission and Auto-Fill settings. (When Auto-Fill is enabled, a field's value is copied when a user clicks the Copy this record button to add a new Project.)
-
Quickbase does not copy or import file attachments.
-
Quickbase copies or imports up to ten levels of child records. If you try to copy more than ten levels, Quickbase won't copy any records.
If you have more than ten levels, you can use the Advanced Options settings in Copy parent & child records to specify which relationships to copy or import and disable recursion, reducing the number of levels copied. -
Quickbase will not copy or import any records if it detects looping relationships. Loops occur when tables have reciprocal relationships. Because conditional reference fields can be configured with looping relationships, the API will not copy child records from any relationship where the report link field points to a conditional reference field. (Read more about conditional reference fields.)
The image below illustrates a looping relationship; the application contains three tables (Countries, Employees, and Cities), and has three one-to-many relationships linking each table to the other two tables:
If you receive a looping error, you can use the Advanced Options settings in Copy parent & child records to specify which relationships to copy or import and disable recursion, reducing the number of levels copied. -
After adding the copy or edit button to a form, you must edit the form so that the button displays when the form is used only for "view".
How Quickbase maps predecessor relationships when it copies or imports records
Records in Quickbase may have predecessor relationships. For example, tasks in a project usually occur in a specific order and one task cannot start until another task finishes. This means that one task depends on another one. A predecessor task is a task that must finish before another task can begin. When you specify a predecessor for a task, you set up a dependency between two tasks (which is why predecessors are sometimes also called dependencies). A successor task is a task that cannot start until another task finishes. (Read more about predecessors.)
If a child record contains a Predecessor field, Quickbase attempts to map predecessors as follows:
-
If the original child records map to each other as predecessors, Quickbase duplicates this predecessor relationship when the records are copied.
-
If the original child records map to predecessors that belong to a different parent record, Quickbase cannot map the predecessor relationship because there is no corresponding copy of those child records.
-
If the original child record maps to predecessor records that fall into both of these categories, Quickbase maps those predecessors that it can.
Consider this example of copying parent and child records in a Project Management application, illustrated below. A user copies a parent Project record, called "Software Release", with child Task records 1, 2, 3, 4. The new parent record is called "Copy of Software Release" and has child records 101, 102, 103, 104. The application has another parent Project record, called "Product Review", with child Task records 11 and 12. Quickbase maps predecessor relationships as follows:
-
2 has predecessor 1 and 11. When the records are copied, Quickbase sets the predecessor field for record 102 to 101, and ignores predecessor 11.
-
3 has predecessor 12. When the records are copied, Quickbase leaves the predecessor field for record 103 blank.
-
4 has predecessor 3. When the records are copied, Quickbase sets the predecessor field for record 104 to 103.