Record Rules
Learn how to make the most of Knack's record actions in form views and grid views.
In this article you will learn:
- How record actions automate background tasks in forms
- Ways to configure and manage record actions
- Methods for setting up different action triggers
- Techniques for updating records and values
- Best practices for record action execution
Understanding Record Actions
What Are Record Actions?
Record actions automatically perform background tasks when users submit forms or edit grids in the Live App. They can:
- Update the current record
- Update connected records
- Insert new connected records
Common uses include:
- Tracking who created/updated records
- Recording timestamps for changes
- Creating receipts from orders
- Updating record status based on field changes
Setting Up Record Actions
Adding Actions to Forms
- Navigate to the Pages section in Builder
- Open the form view editor
- Select "Actions & Rules" in the left toolbar
- Choose "Record Actions"
- Click "Add Rule" to create a new action
Adding Actions to Grids
- Enable inline editing in grid settings
- Modify column properties to add record actions
- Configure action settings for specific columns
Note: Grid view record actions that send custom emails will not have delivery history available.
Configuring Record Actions
Action Types
Update This Record
Updates the primary record the form affects:
- Set status or workflow fields
- Track user submissions
- Update timestamps
Update Connected Records
Modifies records connected to the form's record:
- Must have table connections established
- Updates fields in linked records
Insert Connected Records
Creates new records linked to the form's record:
- Perfect for tracking changes
- Creates version history
- Adds notes or related entries
Trigger Conditions ("When")
Actions run when specified conditions are met:
- Contains/does not contain values
- Exact matches (is/is not)
- Text patterns (starts/ends with)
- Field changes (has changed/changed to/changed from)
- Blank field status
Important: When using multiple conditions, ALL must be met for the action to run.
Value Updates
Configure what values get updated:
- Connected values from related records
- Custom entered values
- Form input values
- System values (logged-in user, current date)
- User location data
Advanced Features
Multiple Value Operations
Append/Remove Multiple Values
When using multiple choice fields or ""many-to-many"" connection fields with record rules, 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: This option will replace the current field value with the values that are selected in the action when the action is triggered.
- By adding: This option will append the value(s) selected in the action to any existing values in the field when the action is triggered.
- By removing: This option will remove the value selected in the action if it exists in the field when the action is triggered.
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, please 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"".
Troubleshooting
- Connection fields must use connected record values
- User role assignments require proper login restrictions
- Equation field values have usage limitations
- Check color settings if menus don't display on mobile
Updated 8 days ago