Table of Contents

Add Assignments to Your App

Lesley Updated by Lesley

Scenario 

You want users to be assigned to individual records. Records assigned (connected) to a user can then be made viewable only to that user.

Users can also be assigned to user roles. Those roles can then be used to specify what information and functionality users have access to.

A common example of assignments is task management. This is where supervisors assign tasks to employees. Each needs to perform different actions and view different sets of information.

Requirements

You'll need to activate users in your app. You'll also need to set the user settings to have logins for different pages and user roles. This article will show you how: About Users.

If this your first time creating an app, you'll need to know some basics about adding tables, fields, pages, and views. You can start by reading our Builder Basics section

Other good resources can be found in our About Your Database and Working With Pages sections of the knowledge base.

Steps

In this example, you will be creating a workflow for staff to assign tasks to employees and for employees to view their assigned tasks.

Create a Tasks Table

In the Data section of the Builder, create a table to store all your tasks.

For this example, you'll need the following fields:

  1. The default "Task Name" field (which is automatically added)
  2. A date/time field called "Due Date"
  3. A multiple choice field called "Status" with the following options:
    1. In Progress (make this the default option)
    2. Completed

Create the User Roles

In the Schema section of the Builder, create two user roles

  1. Staff
  2. Employees

Connect Task to Employees

Select your Tasks table and add a connection to the Employees user role.

  1. A one-to-many connection field to the Employees table called "Employee"
    1. The connection field will allow you to assign each task to one employee and to assign multiple tasks to each employee.

Create a Staff Page

In the Pages section of the Builder, create a new page that allows only Staff users to access it. Then, select the Tasks table and add a grid view that includes:

  1. A link to view more details on each task
  2. A form for editing each task

Call the page "Assign Tasks":

Make it Easy for Staff to Assign Tasks

Now, you're going to make some changes to help make it easier for Staff users to assign tasks.

Display Only Unassigned Tasks

Since the Assign Tasks page is for assigning tasks, you're going to display only tasks that are unassigned.

  1. Click on the Tasks grid view on your new Staff page to open the view editor.
  2. Go to the Source section of the grid settings.
  3. Add a rule for only displaying tasks that don't have an Employee connected (assigned):
    1. "Employee" is blank

On the Assign Tasks page, your Tasks grid currently has a column called "Edit Task" with a link to the form for editing the task. We want to make it clear where Staff users need to click to assign a task.

To make it clear for Staff users, you're going to rename the Edit Tasks column.

  1. Click on the Tasks grid view to edit it.
  2. Hover over the Edit Task column and click the pencil icon to edit the column.
  3. Rename the Column Header to "Assign Tasks" and the Link Text to "Select Employee":
Prepare Form to Assign Tasks

The form on the Edit Task page currently includes all fields in the Tasks table. However, you only want Staff to assign employees to a task in that form so you're going to update that form.

  1. On the Edit Task page, click on the form view to edit it. 
  2. Change the title of the form to "Assign Task."
  3. Remove all fields except the Employee field:
Make Form Appear in Modal Pop Up

To access the form for assigning a task, users are currently being redirected to the Edit Task page with the form. If users need to assign multiple tasks, it can take time to go back and forth between pages. Instead, you can have the form appear in a modal pop up on the Assign Tasks page.

  1. On the Edit Task page, go to the Settings tab.
  2. Check the box next to "Display page in a modal popup":
Create an Employees Page 

In the Pages section of the Builder, create a new page. Enable login and restrict access to the Employee user role. Then select the Tasks table connected to the logged-in Employee and add a grid view that includes:

  • A link to view more details on each task

Call the page "My Tasks":

Make it Easy for Employees to Complete Tasks

Now, you're going to make some changes to help make it easier for Employee users to mark tasks as complete.

On the My Tasks page, add a new action link to the Tasks grid. We want to use this action link to allow Employees to mark a task as complete.

  1. Click on the Tasks grid view to edit it
  2. In the Add Columns section of the grid settings, select Actions
  3. Add a link to "Trigger an action"
  4. Set up the action link with the following settings:
    1. Link Text: Mark as Complete
    2. Criteria: Display this link for every record
    3. Action: Update this record
    4. Values: set Status as Complete
    5. Outcome: Show a confirmation message: "Task marked complete"

Your Results

Here's how your app will look now:

Extend This Workflow

How did we do?

Notify a User That an Item is Ready for Review

Using Mailchimp

Contact