Forms Record Actions
Learn how to use Record Actions on forms to automatically update records, insert connected records, and trigger data changes when a form is submitted.
What You'll Learn
You'll discover how to set up Record Actions on form elements to automate data changes when a form is submitted. This includes updating the current record, updating connected records, and inserting new connected records, all without requiring any action from the user beyond submitting the form.
What are Record Actions?
Record Actions are rules that run automatically in the background when a user submits a form or saves an inline edit on a table element. Each action defines what Knack updates, under what conditions, and with what values.
Record Actions can:
- Update the record the form is working with
- Update records connected to the form's record
- Insert new records connected to the form's record
Common use cases include:
- Tracking which user created or last updated a record
- Recording the date and time of a submission
- Capturing a connected record's value into the current record at the time of submission (for example, pulling the current price of an item into a line item so historical pricing is preserved if the price changes later)
- Changing a record's status when a field value is updated
- Creating a log or history entry each time a record is edited
Record Actions vs. ActionsRecord Actions live on elements where users add or update data, which includes Forms and Tables with inline editing enabled. Display elements like Details, Tables, and Lists use a different feature called Actions. Actions run on row-level interactions such as clicking a button or link to edit, delete, redirect, or update values. The two features aren't interchangeable.
Which Form Should Your Record Action Live On?
Where you add a Record Action determines when it runs and whether users can override the value it sets. Record Actions are configured independently on each form element. Adding one to an Add form has no effect on the Edit form, and vice versa.
Record Action on the Add form only The action fires once when the record is first created. After that, the field it populates behaves like any other field. Users can edit it manually on subsequent visits. Use this when you want to set a default or calculated value at creation time that users can change later.
Record Action on both the Add and Edit form The action fires every time the record is saved. The field gets overwritten on every submit, so any manual change a user makes will be replaced the next time the record is edited. Use this when a field should always reflect a calculated or connected value and manual overrides should never persist.
If users can't keep their editsIf a field keeps resetting after users update it, check whether a Record Action on the Edit form is overwriting the value. Removing the Record Action from the Edit form will restore the ability to manually override.
Managing Record Actions
Record Actions are available on form elements and table elements with inline editing enabled.
Adding a Record Action to a Form
- Navigate to the Pages section of the Builder and select the form element
- In the settings panel, select Record Actions
- Click + Action to add a new Record Action
Adding a Record Action to a Table
Inline editing must be enabled before Record Actions can be added to a table element.
- Enable Edit records inline in the Table Element's General Settings
- Click a column in the table preview to select it
- Select the pen icon to open Column Properties
- Expand Inline Edit Options
- Select + Add action in the Record Actions section
NoteRecord Actions on table elements do not have email delivery history available.
Editing, Copying, and Deleting Record Actions
To edit an existing Record Action, locate the form in your Builder, open the element editor, select Record Actions, and click the action you'd like to edit.
Use the copy icon to duplicate an action and modify the copy without affecting the original.
Use the trashcan icon to delete an action.
Use the drag handle to reorder actions. Note that reordering does not change the order of execution. See Order of Execution below.
Configuring a Record Action
Each Record Action has three sections: On Submission, Update Field Values, and Conditions.
On Submission
Defines what Knack does when the action runs. There are three options:
Update this record updates the primary record the form is working with. Use this to set status fields, assign the logged-in user, or update any field on submission.
Update connected records updates records connected to the form's record. After selecting this option, choose which connected table to update. Your table must be connected to at least one other table for this option to be available.
Insert a connected record adds a new record to a connected table. After selecting this option, choose which connected table to insert into. Useful for creating log entries, receipts, or version history records on submission.
NoteYour table must be connected to at least one other table for Update connected records and Insert a connected record to be available.
Update Field Values
Defines which fields get updated and what values they're set to. Select + to add additional field/value pairs.
For each field, choose a value type:
- To a custom value. Enter a value manually. For multiple choice fields and many-to-many connection fields, you can also choose how the value is applied: By replacing with (replaces current value), By adding (appends to existing values), or By removing (removes the value if it exists).
- To a field value. Use the value of another field on the same record or a form input.
- To a connected value. Use a value from a connected record. Connection fields can only be set from another connection value, not from a name or auto-increment field.
- 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 field to today's date.
- To the user's current location. For Address fields only, when the user is logged in and has location services enabled.
Conditions
Controls when the action runs. By default, the action runs on every form submission.
Select + Condition to add one or more conditions. The action only runs when all conditions are met.
Available condition filters:
| Filter | Description |
|---|---|
| contains | Triggers when the field contains the set value |
| does not contain | Triggers when the field does not contain the set value |
| is | Triggers when the field equals a specific value |
| is not | Triggers when the field does not equal a specific value |
| starts with | Triggers when the field starts with a specific value |
| ends with | Triggers when the field ends with a specific value |
| is blank | Triggers when the field is empty |
| is not blank | Triggers when the field contains any value |
| has changed | Triggers when the field has changed from its previous value |
| has changed to | Triggers when the field has changed to a specific new value |
| has changed from | Triggers when the field has changed from a specific previous value |
Order of Execution
All Record Actions on a form run simultaneously on submission, not top to bottom. There are some exceptions:
- Update this record actions run before formula and equation fields are recalculated. If the action depends on a formula or equation, it uses the field's previous value.
- Insert connected record and Update connected record actions run after formulas and equations are recalculated, so they use updated field values.
- Emails are not sent until all Record Actions have completed. If an email isn't sending, check whether a Record Action is changing a field value that the email condition depends on.
Notes and Troubleshooting
- Connection fields can only be set to another connection value. Setting one to a name or auto-increment field won't work.
- If you can't assign the logged-in user as a value, confirm that the login restriction for the page allows that user role.
- Equation fields on the form's own record can't be used to set values on that same record in an "Update this record" action. They can be used in "Insert connected record" actions.
- If a Record Action configured to retrieve data from a connected record isn't working, check that the record is actually connected. If the connection field is empty, the action has nothing to pull from.
- Conditional rules can override Record Actions targeting the same field. A rule set to Run with every record always overrides the Record Action. A rule set to Custom conditions overrides only when the conditions are met at save time. See Conditional Rules for details.
Next Steps
- Forms Email Actions. Set up automated emails that send when a form is submitted.
- Form Submit Actions. Control where users go and what message they see after submitting.
- Display Rules. Show and hide form fields based on conditions.
Updated 10 days ago
