Custom Data Rules | BEGINNER
Custom Data Rules
Quick Base introduced custom data rules for app builders to create logic that can be applied anytime a user adds or updates data in a Quick Base table.
By using Quick Base formula language, you can set custom conditions and custom error messages in a table. So whether a user is updating rows via grid edit, updating fields in a form, or uploading new records from a spreadsheet, implementing custom data rules allows app admins to automatically validate data changes and ensure that everything is in the appropriate format.
Here are some instances where the custom data rule feature is available:
✓ Moving cards on a Kanban report
✓ Moving events on a calendar report
✓ Importing records
✓ Grid edit
✓ Adding or editing records using a form or API
EDITORS NOTE: Please note, when you copy a table, your custom data rules are also copied.
Where to Build Custom Data Rules for a Table
- Select a table where you would like to apply the custom data rule(s)
- Go into the table the settings
- Select Advanced Settings
- Under Advanced Table Settings, look for a section titled – Build custom data rules for this table:
Things to remember when creating custom data rules in Quick Base are:
✓ Formulas used for custom data rules are editable and toggle-able on the Table Advanced Settings page
✓ Error messages must be text enclosed in quotes
✓ By Default, one message will be returned per record, but using variables, you can provide multiple errors for a single record
✓ Custom Data rules can only reference fields within a single table within your app, not a summary or lookup fields or any formula fields referencing summary or lookup fields.
✓ Changes made on a record could affect a related record and may cause your custom data rule(s) to not work as intended.
✓ Lastly, custom data rules may not work properly when there are embed, editable reports with validation on lookup and summary fields.
We have an application that tracks apartment buildings, leases and tenants and we want to create some rules around our leases table. Specifically, whenever one of our leasing agents forgets to input the status on the lease agreement. Our formula would look something like this:
Here is the result of what the error message would like if the changes were made via grid edit:
In addition to the above rule, say we also have a special promotion running on a particular unit and building where rent cannot exceed $2,500 per month. Our sample formula will combine both the original rule from above and our a new rule to look something like this:
Here is the result of what the error message would like if the changes were made in a form:
✓ Custom data rules are applied only to added or modified data. If you add a custom data rule and there are existing records that may misinterpret this new rule, then these records do not change. You will have to edit these records first before they can meet the custom data rules.
✓ Custom data rules errors only come after all other errors. An error message will be returned for each record that fails, rows will be highlighted in red (via grid edit), and the first column will have a tool tip with the error message that the record failed custom data rules.
To learn more ways to customize your app in Quick Base, check out more articles here: Quick Base Knowledge Center
- Author: Alex Skudrovskis (firstname.lastname@example.org))
- Date Submitted: 4/3/2019