Table of Contents

Connect Related Data

Lesley Updated by Lesley

Think about the data you want to organize. Odds are that you’re thinking about more than just individual records. You’re also thinking about the relationships​ that tie those records together.

It’s those relationships that give your data meaning and make it useful.

In other words, customer data isn’t just about individual customers. It’s also about what each customer orders, and the items related to each order. Project data isn’t just about projects, but also about which employees work on each project, and their related project assignments. Inventory​ data isn’t just about inventory, but also about how shipping and receiving affect inventory levels.

We call these relationships connections​. When you define connections in Knack, you’re mapping your Knack data with how it works in the real world. Those relationships unlock powerful features that can tell the true story of your data.

For example, with connections you can:

  • View related data: You can create relationships between your data so that when you view information about a company, you can also view information about all of the contacts that are associated with that company as well.
  • Ensure users only have access to their own data: Limit the data that users see on a page so that they only see the data that is relevant to themselves. This way, customers only see the orders they have created once they login.
  • Run calculations and visually summarize your data: Create reports that show the total sales made in a given month and even how much each salesperson contributed to that total.

In this article, we’ll review different examples of how you can use connections in your applications and more about how to define and manage your connections.

How Do Connections Work In Knack?

In Knack, connections​ are represented as a special field type. Connection fields allow you to create relationships between tables storing different data types within your app. If you have used other database solutions, you may have used primary and foreign keys, links, or joins to create relationships. 

One common example is connecting Employee and Company data. When many Employees work at a single Company, this data is related. To show this relationship in your app, you can add a connection between the Employees table and the Company table. 

Here are some other examples of related data that use connections: 

  • Assigning Managers to specific Locations
  • Showing Orders related to a single Customer
  • Enrolling Students in specific Classes 

​Learn More​

What Can You Do With Connections?

View Related Data

You can visually show connected data when building your views and pages. This can show hierarchy by adding views to show connected data on a page displaying the details of a single record. Building in hierarchy allows users to drill down and view the details of a record alongside other related data. You can also visually reference connected data directly in a view by choosing which connected fields you want to share on a page.​

One common example is showing Contacts connected to an individual Company. By connecting your Contacts and Company records you can build a detailed record profile for a Company​.​

In this example, we will view the profile for the Company “BASCO” which shows the list of Contacts connected to that Company​.

From the detailed Company profile, we can then go a step further and view the profile for an individual Contact. When viewing the profile for a Contact, we can see any connected Notes​ that have been added.

Another example here is to show the connected Company data directly in a grid listing Contact​ records.

Other examples:

  • View a detailed profile for a Project record showing connected TasksMilestones and assigned Employees.
  • View a detailed profile for a Campaign to see connected Donations
  • View a detailed profile of an Event to see connected Registrations 

​Learn More

Ensure Users Only Have Access To Their Data 

Using connections you can ensure that users only see their data. This means users can login and only have access to records that they have permission to see.​

​Here are some common examples:

  • Assigning Project Managers to specific ProjectsThese Managers can then login and only see records for the Projects they are assigned to.
  • Enrolling Students in specific Classes. Students can then login and see their Connected classes.
2018-07-31_17-33-50.png

Add Workflow And Run Calculations 

Automatically connect or update records with forms.

Connections allow you to add automation to your app by creating or updating connected records when forms are submitted.

For example, if you have a form that updates a Job Application record as hired, you can automatically update the connected Job Posting record to show the job search is closed. 

2018-07-31_17-59-18.png
2018-07-31_18-01-58.png

​Learn More

Share and combine connected data in records 

​In Knack you can share and combine connected data directly in records. This is done using special field types like text formulas, equations, and formulas. 

For example, in the field connecting Contacts to Companies, you can display the name and phone number of each connected Company​ record.

Run calculations with connected data

You can also use connected values in calculations directly within a record. This can be done using equations and formula fields.

For example, in our Purchase Orders app, we use a formula field to calculate the "Order Total" based on the subtotals of all Line Items records connected to each Order record.

​Learn More

How Have Others Used Connections?

For many Knack customers, connections have allowed them to leave behind juggling spreadsheets, hours of manual data entry, and constant uncertainty around the accuracy of their data. Take RC Recycling for example.

Mike Richards was wasting 2 hours each day moving data around several spreadsheets to stay on top of his recycling projects, containers, drivers, and more. Using connections to create the necessary relationships, Mike built automated workflows that optimized operations.

Now, Mike always knows the state of his assets, drivers know exactly what they are working on, and customer management is a seamless process. In other words, Mike’s data is no longer working against him - it works for him.

You can read the full case study here.

How did we do?

Workflow

Users & Access

Contact