Displaying Records Shared Within User Groups

Set up group-based record sharing in Knack so multiple users within the same company, division, or team can view the same set of shared records.

What You'll Learn

  • How to connect users to groups
  • How to set up records shared within groups
  • How to create elements that respect group-based access

Overview

This guide demonstrates how to create group-based record sharing in your Knack app. Unlike showing records connected directly to a logged-in user, this approach allows multiple users within the same group (like a company division) to access the same set of shared records.

📘

Builds on user connection concepts

This article builds on concepts from displaying records connected to the logged-in user. Review that topic first if you're unfamiliar with user connections.

Prerequisites

  • Users must be enabled in your app
  • Understanding of table connections
  • Basic knowledge of page creation

Step 1: Creating Tables and Connections

In this example, we'll work with three elements: a Sales Rep user role, a Division table, and a Sales Leads table.

Setting Up the Connection Structure

First, connect Sales Reps to Divisions:

  1. Select the Sales Rep user role table.
  2. Click the + button to add a new field.
  3. Choose Connection.
  4. Select the Division table as the connection target.
  5. Choose Connect to one Division (one-to-many relationship).

Next, connect Sales Leads to Divisions:

  1. Select the Sales Leads table.
  2. Add a Connection field.
  3. Connect to the Division table.
  4. Choose Connect to one Division (one-to-many relationship).

These connections create a shared relationship: each Sales Rep belongs to one Division, each Sales Lead belongs to one Division, and a Division can have many Sales Reps and many Sales Leads.

Step 2: Updating Records

Assign divisions to your existing records:

  1. Navigate to the Sales Rep user role.
  2. Select the Records tab.
  3. Edit each record to assign the appropriate Division.

Repeat the process for Sales Leads:

  1. Navigate to the Sales Leads table.
  2. Select the Records tab.
  3. Assign the appropriate Division to each lead.

Step 3: Creating Restricted Access Pages

Create a page that will show only the leads from the user's division:

  1. Go to the Pages section of the Builder.
  2. Click the + button to add a new page.
  3. Select Login Page.
  4. Restrict access to the Sales Rep user role.

Step 4: Adding a Filtered Element

  1. Add a Table or List element to display Sales Leads.
  2. In the Source options, select Sales Leads.
  3. Under Filter, choose: Sales Leads > Division is Division connected to the logged-in user.

This filter is the key to group-based access. It ensures users only see leads that belong to the same division they're connected to.

Step 5: Testing Your Configuration

  1. Click Preview or Go to Live App in the Builder.
  2. Log in as a Sales Rep.
  3. Navigate to your new page.
  4. Verify that only leads from the user's division are visible.

Troubleshooting

Common Issues

Too many records showing: Check that your divisions are properly assigned to both users and records.

No records showing: Verify that the filter is correctly set to "Division connected to the logged-in user."

Access problems: Ensure the page is properly restricted to the Sales Rep user role.

Adding Elements to Existing Pages

If you already have login pages set up:

  1. Navigate to the page in the Builder.
  2. Click Add Element.
  3. Follow the same steps to configure the filtered element.
📘

Works for any group structure

This same approach can be used for any group-based sharing scenario, such as departments, teams, companies, or locations.

Next Steps