Table of Contents

Create a Button or Link that Updates a Field to a Custom Value

Danielle Kellogg Updated by Danielle Kellogg

Scenario

You would like to have a single button or link that updates a field to a custom value when clicked. This creates a one-click process that allows users to make quick updates and prevents them from inputting the wrong information.

Some example use cases of this would be:

  • A button that approves a project or event
  • A link that updates the status of a contact in a sales pipeline
  • A link that marks an invoice as paid

To do this, you'll use a form with a record rule to set the value but remove all fields or use action links in views.

Requirements

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

Other good resources can be found in our designing the database and building pages sections of the knowledge base.

Steps

In this example, you will create a button and link that approves a project. 

Create a Project Object

In the Schema section of the Builder, create an object to store your projects.

For this example, you'll need at least one field for the project's name, but you can feel free to include any other fields you'd like:

Add a Status Field

In the Projects object, add a multiple choice field and call it "Status." This field will track whether a project has been approved or not.

Include the following options:

  • Pending Approval
  • Approved
  • Rejected

Set the Default Option to "Pending Approval" so all new projects created are automatically set to that status:

Create a Projects Page & Table

In the Pages section of the Builder, create a page with the following settings:

1. Using the Projects object.

2. A table and links to view more details for each project.

3. Call the page "Projects":

Button: Update the Record With Record Rules on a Form

1. Go to the Project Details page you created.

2. Add a new form for editing that page's project.

3. Click on the new form to open the view editor and access the form settings.

4. From the settings section of the view editor rename it to "Approve Project."

5. Remove all fields from the form by clicking on the trash can icon for the group.

Add a Record Rule

1. Go to the Form Rules section.

2. Click on the Record Rules tab.

3. Click the Add Rule button.

4. Set up the record rule as follows:

  • Action: Update this record (the default option)
  • When: Every form submission (the default option)
  • Values: Set "Status" to a custom value "Approved"

You can read more about using and managing record rules here.

It's also possible to use action links to add a link to views to trigger an action. In this case we want to trigger an action that approves the Project record.

For the table view in your app displaying Project records, open the view editor and select "Add Columns" and then "Actions".

There you can choose to add a link to "Trigger an action".

Once your action link is added you can then define what action your trigger will execute. In this case we want to set the status field to "Approved". This will add a new column to your table with the link to approve the record.

You can read more about using and managing action links here.

How did we do?

Add a Pipeline to Your App

Add Notification & Reminder Emails to Your App

Contact