This article provides an explanation on how to utilize Knack's import feature to establish connections with other records.
You can utilize the import feature to establish connections with other records. By importing records into an existing table, you have the flexibility to select which field from that table should match the corresponding column in the file you are importing.
Furthermore, it is also possible to match a column in your file with a field in a connecting table. Knack will then use that match to find a record to connect to.
The connection fields will have the symbol shown below to the left of "Client":
In the example above, we’re importing a file containing Contact records. We’re matching the data in the CSV file to the records that already exist in Knack using the "Phone" column.
This field was chosen because it contains a unique value for each record.
The import will use the value of that column to search for any Client records that have the same value. If Knack finds a match, it will connect the Contact record, created by the row in the imported file, to that specific Client record.
Importing to a Many-to-Many Connection Field
You can also import to a many-many connection field. To ensure a successful import for many-to-many connection fields, it is essential to first create the table and the associated many-to-many connection field before importing.
Creating the table and the connection field before importing is crucial to ensure that your data imports correctly as multiple connected records rather than being treated as a one-to-many connection. During the import process, you will not have the option to choose the connection type when mapping new fields to your data.
Additionally, ensure the data file is formatted such that the multiple records to be stored in the connection field are:
-
Comma-separated or row-separated,
-
WITHOUT a space before or after each comma, and
-
Contained within a single cell
Your data can look like this:
First child,second child,third child
Or, like this:
First child
Second child
Third child
Notes:
- If you're importing and setting connection values to multi-part fields, such as Name & Address fields, you'll get inconsistent results, or the values won't be set at all. We suggest you use other unique fields, such as email address or an ID field, as your display field in the connected table and map to that value in your import.
- This can even be done temporarily until after you have completed your import and the records have been indexed.
- If you are formatting your CSV in Excel, you do not need to add quotation marks. Excel will do this automatically.
- You can verify if the format is correct by opening your CSV in a text editor application.