Conditional Rules
Conditional rules automatically set field values based on conditions you define. Each rule uses one of two trigger types that control when the rule runs and whether the field can still be edited.
What You'll Learn
This guide explains how conditional rules work, the two trigger types you can apply to each rule, and how each type affects whether the field can be edited on forms, inline, or through Record Actions.
What are Conditional Rules?
Conditional rules automatically set field values based on conditions you define at the field level. They let a field respond dynamically to changes in your data without requiring manual updates.
Common uses include:
- Setting a Student Rank field to "Honor Roll" when GPA is higher than 3.0
- Assigning a Commission Rate of 5% when Years of Experience is greater than 2
- Changing an Invoice Status to "Overdue" when Days Past Due is greater than 30
Conditional rules are different from validation rules. Validation rules verify data before saving. Conditional rules actively set values based on other data in your app.
How Conditional Rules Work
Each conditional rule has two parts:
- Trigger type — when the rule evaluates. Choose Run with every record or Custom conditions.
- Set — the value to apply. Choose a custom value or another field's value.
Rules are evaluated top to bottom. The first rule that fires sets the value, and no further rules are checked. Because a Run with every record rule always fires, any rules listed below it will never run.
Trigger Types
Every conditional rule runs in one of two modes. The trigger type you choose controls when the rule fires and whether the field stays editable elsewhere in your app.
Run with Every Record
The rule fires every time a record is created or updated, regardless of any field values.
When a field has a rule set to Run with every record, the field is locked to the rule's output:
- The field is not available to add to a form
- The field cannot be edited inline in a table element
- Record Actions targeting the field are overridden
- Manual edits in the Builder's records tab are overwritten on save
Use this trigger type when a field must always reflect a specific value or calculation with no exceptions.
Custom Conditions
The rule fires only when the conditions you define are met.
When a field has a rule set to Custom conditions, the field stays editable when the conditions are not met:
- The field is available to add to a form
- The field can be edited inline in a table element
- Record Actions targeting the field can set values, unless the conditions are met at save time
When the conditions are met at save time, the rule fires and overrides any manual input or Record Action value. When the conditions are not met, manual edits and Record Actions set the value as expected.
Use this trigger type when you need a default or fallback that applies only in specific cases, while still allowing manual edits or Record Actions to control the field the rest of the time.
Trigger Type Summary
| Run with Every Record | Custom Conditions | |
|---|---|---|
| When the rule fires | Every save | Only when conditions are met |
| Field available on forms? | No | Yes |
| Field editable inline? | No | Yes |
| Record Actions can set the value? | No | Yes, when conditions are not met |
| Manual edits persist? | No | Yes, when conditions are not met |
Conditional Rules vs. Record Actions
Both conditional rules and Record Actions can set field values automatically, but they work differently and suit different use cases.
| Conditional Rules | Record Actions on Forms | |
|---|---|---|
| Where configured | On the field in Tables and Data | On the form element |
| When it runs | Every save, or when conditions are met | Once, when the form submits |
| Scope | Every record change (Builder, Live App, API) | Only form submissions |
| Best for | Values that must follow a rule consistently | Setting a value tied to a specific form submission |
Choosing between themUse a conditional rule with Custom conditions when a field should update automatically whenever a condition becomes true, from any source.
Use a Record Action on a form when you only need to set the value at submission and manual edits afterward should stick.
When to Use Conditional Rules
Conditional rules are most useful when:
Automating Status Updates
- Changing order status based on payment received
- Updating task status based on completion date
- Setting account status based on subscription renewal
Calculating Values
- Determining pricing tiers based on quantity
- Setting tax rates based on location
- Applying discount levels based on customer type
Streamlining Workflows
- Assigning tasks based on department or expertise
- Routing applications based on criteria met
- Escalating issues based on priority or age
Ensuring Consistency
- Standardizing categorization across records
- Applying consistent naming conventions
- Enforcing business rules across the app
Next Steps
- Adding and Managing Conditional Rules — Step-by-step instructions for creating, editing, and organizing conditional rules on a field
- Order of Operations and Best Practices — How Knack evaluates conditional rules alongside equations, formulas, and other field logic
- Record Actions — Automated actions that run on form submission, including when to use them instead of conditional rules
Updated about 1 month ago
