Create a Change Log for Records
Learn how to build a change log in your Knack app that tracks who made changes to a record and when, using a Logs table and record actions.
What You'll Learn
This article shows you how to create a change log that tracks who made changes to a record and when. The log captures the user responsible, the date of the change, and an optional action type or comment. It does not capture what specific field values changed.
If you need to track the actual values that changed (before and after), see Creating a Version History for Records.
Use Case
You have records that multiple users can create or edit, and you need a record of who touched each record and when. Common examples include project updates, case notes, inventory checkouts, and approval workflows.
Requirements
- Users enabled in your app with at least one user role. See User Management Fundamentals.
- At least one table with records you want to track
- Familiarity with record actions. See Using Record Actions.
Steps
1. Create a Logs Table
Navigate to the Tables section of the Builder. Create a new table called "Logs" (or whatever name fits your app). Add the following fields:
- Connection field to the table you're tracking (e.g., "Item") — one item can connect to many logs
- Connection field to the user role table (e.g., "Updated By") — one user can connect to many logs
- Date/Time field (e.g., "Date") — to capture when the change happened
- Multiple Choice or Short Text field (e.g., "Action") — optional, to capture the type of change (e.g., Created, Updated, Returned, Approved)
- Paragraph Text field (e.g., "Comments") — optional, for notes about the change
2. Add a Record Action to the Add Form
Navigate to Pages in the Builder and open the page with the form that creates new records in the table you're tracking. Add a record action that inserts a connected record into the Logs table:
- Click into the form element
- Go to the Record Actions tab (under Submit Actions)
- Add a new action: "Insert a connected record"
- Select your Logs table
- Set the field values:
- Date — set to "Current Date"
- Updated By — set to "Logged-In User"
- Action — set to a custom value like "Created" (if using an Action field)
This creates the first log entry when a new record is added.
3. Add a Record Action to the Edit Form
Navigate to the page with the edit form for the same table and repeat the same steps:
- Click into the edit form element
- Go to the Record Actions tab
- Add a new action: "Insert a connected record"
- Select your Logs table
- Set the field values:
- Date — set to "Current Date"
- Updated By — set to "Logged-In User"
- Action — set to a custom value like "Updated" (if using an Action field)
Add this to every form that edits these records. If you have multiple edit forms across different pages, add the record action to each one. Otherwise, edits made through forms without the action won't be logged.
4. Display the Change Log in Your Live App
Navigate to Pages in the Builder and open the details page for the record you're tracking. Add a table element to show the change log. Source it from the Logs table and filter it to show logs connected to the current page's record.
This gives users a timeline showing every change made to that record, who made it, and when.
Sort by most recent first. Set the table element's default sort to show the most recent log entries at the top so users see the latest activity first.
What This Tracks vs. What It Doesn't
| Tracked | Not Tracked |
|---|---|
| Who made the change | What fields changed |
| When the change was made | Previous and new values |
| Type of action (optional) | Which specific data was modified |
| Comments (optional) |
If you need to capture the actual field values that changed, see Creating a Version History for Records.
Next Steps
- Creating a Version History for Records — Track what specific values changed on each edit
- Tracking Record Changes — A simpler approach using system fields and a "Last Modified By" connection
- Building Audit Trails in Knack — Overview of all audit trail options
Updated about 2 hours ago
