Table of Contents

Approve New Records Before Displaying Them

Lesley Updated by Lesley

Scenario

You want users to be able to create new records in your app, but you want to review and approve each new record before it will be displayed.

Example: A "Community Events" app displays a list of community events. There's a form for the community to submit a new event for the app to display.

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 is 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

This example will use a "status" field to limit which records a view can display. New records added by users will not be approved by default, and they can only view records that have been approved.

A new administrative page is then added to review records and update the "Approved" to "Yes".

Add a Field to Store a "Status"

Find the table that stores your records in the Data section of the Builder. In this example, this is the "Events" table.

Add a new "Yes/No" field type using the "Add Field" button in the top navigation. In this example, we will name the field “Approved”:

This field will default new records to "No". If you have existing records, make sure to update to the new Approved value for those. Use a batch update to update them all at once.

Add a Form for Submitting a New Record

Next, navigate to the form where your users submit the record that needs to be approved. If you don't have one yet, add a form for your users to submit a new Event. In this case, we will add a new form to submit an Event record.

From the Pages section of the Builder, select the page where you want to add your form. Then, click "Add View" and select the form view type.

After adding your form, open the view editor to access the view settings. Make sure the "Approved" field is deleted from the group of form inputs. Otherwise, the submitter would be able to set that Approved value.

Add a Page to View and Approve Records

Next, we need to add a page where you can view new records submitted from the form and approve them.

From the Pages section of the Builder, click on the green "+" button to add a new page that requires a login. The login should be restricted to a higher-level role that not all users have access to. In this example, this is a user role called “Admin”.

After selecting the user role, you will be prompted to choose a view to add to your new page. In this example we will add a grid view displaying event records.

Next, we need this page to only display records with an "Approved" value of No. Since that’s the default for new records, this grid will now show any records that haven't been approved yet.

In order to filter out records with an "Approved" value of Yes, we need to edit the source of our new grid. In the view editor open the "Source" section of the grid settings.

Then click on the "Add rules to filter records" link and add a filter that says “Approved” “is” “No”:

Update Your View to Show Approved Records Only

In the Pages section of the Builder, locate the page with the public grid or calendar that displays the “Event” records. If you don’t have one, you can follow the previous step again without applying the login restriction.

Edit the calendar by clicking on it in the page preview, then access the Source" tab in the view settings

This time, add a filter that says "Approved" “is” “Yes”. Now the view will only display records that have been approved by someone with higher access.

You can read more about using the source in views here.

Notes

  • If you need more complex workflows, you could use a Multiple Choice field instead of a Yes/No field. Include at least two options: "Pending Approval" and "Approved".
  • If you have existing records, make sure to update the new "Approved" value for those. Use a batch update to update them all at once.
  • Track who made updates by adding a form rule to connect the record to the logged-in user. You could also update a "Date Approved" field with a form rule to track when it was approved.

How did we do?

Using Mailchimp

Workflow Tools

Contact