How to Disable Actions while Validations Are Running
Last updated: April 21, 2025
If you need to block access to sheet and workbook actions while data validation is still processing, you can enable the trackChanges setting on a workbook. This ensures that all actions are disabled until data hooks finish processing.
The trackChanges setting listens for a commit:completed event for each sheet to determine when validations have completed for the workbook.
Steps to Enable trackChanges
-
Run a RecordHooks Listener on Each Sheet:
-
Before enabling
trackChanges, you need to run a recordHook for each sheet in your workbook. Even if you do not plan to update anything with record hooks, running the listener ensures that all sheet commits are completed as the recordHooks process.
-
-
Enable
trackChangesfor the Workbook:-
Once the recordHooks are in place, you can enable the
trackChangessetting. This setting ensures that no actions can be performed on the workbook until all data hook processing is complete.
-
Use the following API request to enable
trackChangeson your workbook:curl --location "https://api.x.flatfile.com/v1/workbooks" \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer ${FLATFILE_SECRET_KEY}" \
--data '{
"name": "Your-Workbook-Name",
"labels": [...yourLabels],
"settings": {
"trackChanges": true
},
"sheets": [...yourSheets],
"actions": []
}' -
This request configures your workbook to track changes, thereby blocking actions until all data hooks have processed.
-
You can also enable this on your workbook config for new workbooks:
export const workbook = {
name: "Your Workbook",
labels: ["pinned"],
settings: { trackChanges: true },
sheets: [...yourSheets],
actions: [],
};
-