Record Actions

Record Actions automate behind-the-scenes processes that occur when users interact with forms and grid elements in your Knack app. By configuring these powerful rules, you can create sophisticated workflows that update records, track changes, and maintain data relationships.

What You'll Learn

In this guide, you'll discover how Record Actions can transform your app by automating background processes when users submit forms or edit data. You'll learn how to set up rules that can update records, maintain connections between tables, and build powerful workflows—all without requiring manual intervention. Mastering Record Actions will help you create a more efficient, user-friendly application that maintains data integrity and reduces repetitive tasks.

What are Record Actions?

Record Actions are specialized rules that automate precise actions in the background when users submit a form or edit a grid inline in the Live App.

These actions can:

  • Update the record the element is using
  • Update connected records
  • Insert new connected records

Some typical use cases for Record Actions include:

  • Tracking which user created or last updated a record
  • Recording the date and time a record was created or last updated
  • Creating a new receipt record when an order is submitted
  • Changing a record status when a field value is changed

Tip: Record Actions are a part of form elements, so it's helpful to be familiar with how to use this type of element. You can find a refresher on using form elements in our Form Elements documentation.

Note: Similar actions can also be triggered using Action Links. See details in the Using Action Links article.

Managing Record Actions

Record Actions are available on form elements and grid elements with inline editing. To add, edit, or delete Record Actions, you must first add a new form or grid, edit an existing form element, or enable inline editing on a grid.

Adding a Record Action

To add a Record Action to your app, navigate to the "Pages" section of your Knack Builder, and select the form or grid element to open the element editor.

Adding a Record Action to a Form

After opening the element editor, navigate to the left toolbar and select "Actions & Rules". Then, choose the "Record Actions" section.

After navigating to the "Record Actions" tab in the element editor, simply click on "Add Rule" to add your first Record Action.

Once you've added a Record Action, you can define its functionality by specifying:

  • The action that will be triggered
  • When it will run
  • The values that the action will update

Adding a Record Action to a Grid

Inline editing must be enabled before Record Actions can be added to a grid element. You can enable inline editing from the settings section of the element editor:

After enabling inline editing, you can add Record Actions to specific grid columns by modifying the column properties:

Note: At this time, Record Actions configured in Grid elements to send a custom email will not have an email delivery history available.

Editing a Record Action

To edit an existing Record Action, locate the form that the action is on in your Builder and open the element editor. From there, select "Actions & Rules" and then select "Record Actions".

Any Record Action settings can be edited for existing actions.

Deleting a Record Action

To remove existing Record Actions when editing a form element, click on the trashcan icon located in the top right corner of the rule.

Copying a Record Action

To make a copy of existing Record Actions while editing a form element, click on the copy icon located in the top right corner of the action.

Moving a Record Action

When editing Record Actions, you can rearrange them to manage multiple rules efficiently. Simply click the drag handle icon, and you can drag and drop the Record Action to your preferred position.

Note: Moving Record Actions does not change their order of execution.

Record Actions Settings

Actions: What can Record Actions do?

The first setting in a Record Action is called an "Action." This defines what Knack will do behind the scenes once the form has been submitted.

There are three action options:

  • Update this record
  • Insert a connected record
  • Update a connected record

Update This Record

This option updates the primary record the form is working with. This is useful for setting status or workflow fields on submission.

You can also assign logged-in users so that you can track who submitted a comment, rating, or ranking form.

Examples:

  • Assign the logged-in user to the table's "Created by" field (a connection to a user role) so that you have a record of which user added the form
  • Assign the "Submitted late?" Yes/No field the value of "Yes" when the form was submitted after a Due date field value

Note: If your Record Action is configured to retrieve data from a connected record, but the rule appears to be ineffective, verify whether the record you are working on is indeed connected by examining the connection field of the record. If the field is empty, the record is not connected.

Update Connected Records

This option allows you to update records connected to the form's record. When adding this Record Action type, you will be able to select which connected table to update.

Note: Your form's table must be connected to at least one other table for this option to be available.

For example, when a Line Item in an Order is changed, a Record Action on the "Update Line Item" form can update the connected Order record's "Last Updated" field.

Insert a Connected Record

This option adds a new record connected to the form's record. When adding this Record Action type, you will be able to select which connected table to insert a record into.

Note: Your form's table must be connected to at least one other table for this option to be available.

This feature is particularly useful for seamlessly adding new notes to a project or creating a comprehensive version history of records that can be easily accessed within the Live App.

For example, upon submitting a form that edits a record, insert a new connected record of the same table with all of the same data, where the connection is called "Record History Entry". This way, you can track each change to the parent record with a separate record.

When: When will a Record Action run?

The "When" section of the Record Action defines the condition that needs to be met to trigger the action. When a form is submitted and all the conditions are met, the action will run.

By default, the action is set to run for every form submission. However, you can add criteria based on one or more specific form values.

You can trigger the Record Action "When" with different filters:

FilterDescription
containsTriggers when the field contains the set value
does not containTriggers when the field does not contain the set value
isTriggers when the field is a specific value
is notTriggers when the field is not a specific value
starts withTriggers when the field starts with a specific value
ends withTriggers when the field ends with a specific value
is blankTriggers when the field is blank
is not blankTriggers when the field is not blank and contains any value
has changedTriggers when the field has been changed from its previous value
has changed toTriggers when the field has been changed from its previous value to a new specific value
has changed fromTriggers when the field has been changed from a specific previous value to a new value

Note: If you add multiple conditions, all conditions must be met for the action to be performed.

For example, with a Task record, you may want to indicate whether it was completed on time. You can add When qualifiers to assign the "Submitted late?" Yes/No field the value of "Yes" when:

  • The status is Complete
  • The current date is after the Due Date on the Task

Values: What will a Record Action update?

The "Values" section of the Record Actions is where you set the field values that the action will apply. Here you can add multiple value settings by selecting the "+" button, or remove the settings by selecting the "-" button.

Values can be set to:

  • A connected value: Choose a field from a record connected to the form record. Connection fields can only be set based on another connection value, not to a name or auto-increment (ID) field.
  • A custom value: This allows you to either:
    • Enter a value manually
    • Append or remove values for multiple choice fields or connection fields without overwriting existing values
  • A form value: Choose one of the form inputs
  • To the logged-in user: Only available when the form is behind a login restricted to a specific user role
  • To the current date: (For Date fields only) Sets the Date/Time field to the current date
  • To the user's current location: For Address fields only, when the user is logged in, and when they have location services enabled in their browser

Append/Remove Multiple Values

When using multiple choice fields or "many-to-many" connection fields with Record Actions, you can use the custom value option to either replace, append, or remove values from the field.

To use this option, select the "to a custom value" option in the "Values" section while building your Record Action. This will give you three options:

  • By replacing with: Replaces the current field value with the values selected in the action
  • By adding: Appends the value(s) selected in the action to any existing values in the field
  • By removing: Removes the value selected in the action if it exists in the field

Order of Execution

Record Actions follow a specific order of execution when a form is submitted. It's important to note that all actions, including updating a record, inserting a connected record, and updating a connected record, run simultaneously on a form.

They do not execute in a top-to-bottom manner.

However, there are some exceptions:

  • Update this record actions are calculated before any record formulas or equations in fields. Therefore, if a Record Action depends on a formula or an equation, the Record Action will be calculated based on the previous value of that field.

  • Record Actions for Insert connected record or Update connected record are processed after any formulas or equations in fields. This means that if a Record Action depends on a formula or an equation, the Record Action will be calculated based on the updated value of that field.

  • Emails will not be sent until all relevant Record Actions have been triggered. If you are experiencing issues with emails not being sent despite appearing to meet the necessary conditions, ensure that Record Actions are not blocking the fulfillment of their field-specific requirements.

For example, an email will not be sent if it needs a Yes/No field's value to be "No", but a Record Action changes that value to "Yes".

Notes & Troubleshooting

  • When setting a connection field using a Record Action, you can only assign its value to another field connected to the record. Attempting to set it with a name or auto-increment (ID) field will not be successful.

  • If you are attempting to assign the logged-in user role but cannot find it as an option, ensure that the login restriction allows the specific user role to access the page.

  • Equation fields' values can be used to set the values of other fields when inserting a connected record, but Record Actions that update the form's record cannot currently use that record's equation fields' values to set the values of other fields on the same record.

  • Currently, Record Actions that are set up to send custom emails do not have access to an email delivery history.