Table of Contents

Connecting Records Together

Danielle Kellogg Updated by Danielle Kellogg

What Are Connections?

Connections are the relationships that tie your records to each other. Using connections, you can build complex applications that are easy to use and manage.

Connections are what allow you to associate:

  • Invoice #123 with customer Jamie Thompson
  • Student Maria Rodrigues with school Summer Heights High
  • Employee Jo Richards with department Sales

These connections will allow you to create dynamic pages that only show each user their related data, maintaining data privacy and relevancy.

For example, by connecting invoices to specific users, you can build a customer portal where each user logs in to only see and pay their own invoices.

 

There are two stages to connecting your records:

  1. Create a connection between two objects, this creates the opportunity to connect records.
  2. Connect individual records via the connection field.

The article About Connections covers the first stage of creating a connection between two objects in depth, along with many examples of how connections are used. In this article we will cover the second stage - using connection fields to manage relationships between records. We will explore the options available in Knack to connect records to each other.

Manage Record Connections

Once a connection is created between two objects, the connection field is where you will control the relationship between individual records. Depending on the Format set on the connection field, the connection field can look like a dropdown or a radio button in your Live Application:

How the connection field appears depends on the number of records in the connected object. When the connected object has fewer than 500 records, the connection field shows as a dropdown or radio button, depending on the Format set on the connection field. The dropdown option allows users to scroll through or search the connected records before selecting one.

When the connected object has 500 or more records, you will only have the option to search the connected records.

If you add a connection between two objects with existing records, the connection field that is created will be blank. You'll need to edit the connection field to connect the records. 

Connect Records Together

To create a connection between two records, you must select a record from the connected object using the connection field on a child record.

In the Builder, it can look like this:

There are many ways to create connections between records in Knack. You can connect records:

  • In the Records section of the Builder
    • Edit records individually in the Records tab
    • Import connections with file (.csv, .json, .txt formats)
    • Automatically connect records using scheduled tasks
  • In your Live App using form views
    • Edit the connection field in a form
    • Automatically connect records using record rules on form submit
  • In your Live App using table views
    • Inline edit connection fields
    • Automatically connect records using record rules when inline edits are made
  • Via an integration
    • Insert connected records using a third party service like Zapier or Integromat
    • Edit the connection field via the API

In the section below titled “Connecting Records in Your App,” you will see how to connect records using the above techniques.

Edit a Connection Between Records

Editing a connection between records is very similar to connecting records.

The following techniques are available for editing a connection between records:

  • In the Records section of the Builder
    • Edit records in the Records tab
    • Edit connections during import
    • Automatically update record connections using scheduled tasks (only some actions)
  • In your Live App using form views
    • Edit the connection field in a form
    • Automatically update record connections using record rules on form submit (only some actions)
  • In your Live App using table views
    • Inline edit connection fields
    • Automatically connect records using record rules when inline edits are made
  • Via an integration
    • Edit the connection field via the API

Disconnect Records

To disconnect records, edit the connection field so it is blank. When that field is blank, the record you’re viewing is not connected to another record.

Deleting a connection between records is very similar to editing record connections.

The following techniques are available for disconnecting records:

  • In the Records section of the Builder
    • Edit records in the Records tab
    • Edit connections during import
    • Automatically update record connections using scheduled tasks (only some actions)
  • In your Live App using form views
    • Edit the connection field in a form
    • Automatically update record connections using record rules on form submits (only some actions)
  • In your Live App using table views
    • Inline edit connection fields
    • Automatically connect records using record rules when inline edits are made
  • Via an integration
    • Edit the connection field via the API

As with editing connections, the same techniques are not available:

  • You cannot currently edit a connection field to disconnect records using Zapier

Display Field

The values that appear in the connection field represent a field in the connected object. This is what we call the display field. The display field can be changed in the object settings of the connected object.

It’s best to set the display field to an identifiable unique field.

For example, a connection between Contacts to Companies, you may choose the Company Name field from the Companies object as the display field. That way, when you’re viewing or editing the connection field of a Contacts record, you’ll see the Company Name of the Company records.

The display field is set in the object settings. To change an object’s display field, open the object's settings by clicking on the "..." more icon in the top menu when viewing the Schema, Records or Tasks tab.

You can read more on using connections fields and their settings here.

Connecting Records in Your App

In this section, we’ll explore the different methods available to connect records together.

For details on the different ways to use connections in your app, please see this article: Use Connections in Your App

In the Records Tab in the Builder

The Records section of the Builder you can view, edit, add, and delete the records in your database. You can view records for one object at a time.

To edit a connection field in the Builder, click on the connection field itself to edit that field directly inline. You can also expand to edit the whole record, by clicking the expand icon next to a specific record.

From here, you can select a record from the connection object to connect to:

This method can be used to:

  • Connect records for the first time
  • Edit the existing connection between records
  • Disconnect records

For more information on editing records in the Builder, click here: Edit Records in the Builder

During Import

You can use an import to create and edit connections to other records. When you import records into an existing object, you can choose which field from that object to match the column in your CSV to. Likewise, you can can also match a column in your CSV to a field in a connecting object. Knack will then use that match to find a record to connect to.

This method can be used to:

  • Connect records for the first time
  • Edit the existing connection between records
  • Disconnect records

For more information on importing connections, click here: Import Connections

Use Scheduled Tasks

Scheduled tasks are another method available to automatically update record connections. Tasks can update the selected in order to connect to another record, update connected records, and insert new connected records.

One scenario when you may use scheduled tasks to connect records is with daily evaluations. Some companies require Managers to evaluate their Employees on a regular basis. You can use a task to insert a new Evaluation record connected to each active Employee record on the first of every month. You can even set up the task to automatically connect the new Evaluation record to the Manager connected to each Employee.

This method can be used to:

  • Connect records for the first time
  • Edit the connection between records (not available when inserting connected records)
  • Disconnect records (not available when inserting connected records)

For more information on using tasks, click here: Scheduled Tasks

Directly in Form Views

In your Live App, you can create form views for your users to edit record connections. When the connection field is present on the form, the end user can select a record from the connected object to connect the form’s record to.

This is possible in forms for both adding and editing records.

This method can be used to:

  • Connect records for the first time
  • Edit the existing connection between records
  • Disconnect records

For more information on using forms in Knack, click here: Forms

Use a Form’s Source

Forms can be set up to automatically connect records together. On a form for creating a new record, you can automatically connect the new record to the page’s record or to the logged-in user. This option will be available if there is the opportunity to insert connected records on that page.

For example, you may have a contact directory with Contact records connected to their associated Company. You can add a form to the company details page to add new Contact records, automatically connecting the new Contact to the Company record you’re currently viewing.

Forms that automatically connect new records to the page’s record must be located on a details page. Forms that automatically connect new records to the logged-in user must be located behind a login view.

You can verify whether a form is automatically set up to connect a new record by checking the data source.

This method can be used to:

  • Connect records

For more information on using forms in Knack, click here: Forms

For more information on using the data source, click here: Source

Use Record Rules on a Form or Table

Record rules are another method used to automatically connect records using using a form or table view. Like tasks, record rules can update the form or table's record, update connected records, and insert connected records.

One common example is tracking what user last edited a record. You can set up a record rule to connect a record to the logged-in user when it’s edited using a form.

In this example, we add a record rule to an “Edit Invoice” form. The Invoice object is connected to the Manager user role, which allows us to connect the Invoice record to the last Manager user who edited it.

This method can be used to:

  • Connect records
  • Edit the connection between records (not available when inserting connected records)
  • Disconnect records (not available when inserting connected records)

For more information on using record rules in Knack, click here: Record Rules

For more information on using connections to track what user edits a record, click here: Track Which User Last Updated a Record

In Table Views

Records can also be edited inline on tables. If the connection field is present on a table, you can enable inline editing so users can edit the record connections. Inline editing on a table can also trigger record rules mentioned above.

This method can be used to:

  • Connect records
  • Edit the connection between records
  • Disconnect records

For more information on enabling inline editing, click this link: Table Settings

Use Zapier

Zapier is a service that allows you to connect third party software to your Knack account for the purpose of automating the transfer of records between these services.

With Zapier, you can automatically insert connected records into your database. For example, if you use accounting software, you can send paid invoice records over to your Knack app, automatically connecting the invoice to the associated customer.

This method can be used to:

  • Connect records
  • Edit the connection between records

For more information on using Zapier with Knack, click here: Use Zapier to Insert Connected Records

Use the API

Using our API, you can create custom integrations between the rest of your business tools and Knack.

The API is used to make requests to create, retrieve, update, or delete records that are stored in your Knack apps. So you can use our API to insert a new connected record and edit the connection field between existing records.

The functionality is similar to what you’ll get to Zapier, but much more robust and customizable.

This method can be used to:

  • Connect records
  • Edit the connection between records
  • Disconnect records

For more information on using Knack’s API, click here: Developer Documentation

Notes & Troubleshooting

For detailed troubleshooting tips and FAQs, click here: Connections: Troubleshooting & FAQs

How-To Guides

How did we do?

Special Objects

Use Connections in Your App

Contact