Common Formula Errors
Formulas are powerful — but they can fail in non-obvious ways, especially when used inside automations where the consequences of an error are harder to debug. This article covers the eight most common errors you're likely to run into, what causes each one, and exactly how to fix it.
If you're not sure how to fix an error in your formula, Closot AI can diagnose and repair it for you — just describe the issue or paste the formula and ask it to fix the error.
1. Permissions
What happens: The formula fails to compute reliably.
Why it happens: Formulas that reference another database or page need access to that database's structure and property configurations. If you don't have permission to view the referenced source, the formula can't read the data it needs to calculate.
How to fix it: Make sure you have access to every page and database that your formula, button, or automation references. This applies to nested references too — if your formula references a relation property that points to a restricted database, you need access to that database as well.
2. Wrong Return Type
What happens: The automation fails to save or execute.
Why it happens: Unlike formula properties inside a database (which figure out their own output type), formulas used inside automations must return a specific type — date, text, number, or person — that matches the property they're writing to. If the return type is ambiguous or mismatched, the automation can't complete.
A common source of ambiguity: using different types for the "true" and "false" branches of an if() statement. For example:
if(Deadline, Deadline.dateAdd(1, "day"), "")
This is problematic because when the condition is false, the formula returns "" (text), but when true it returns a date. The two branches have different types, so Closot can't determine what type the formula produces.
How to fix it: Use empty() instead of "" or 0 when you want to return "nothing" in conditional branches. empty() is type-neutral and won't create ambiguity:
if(Deadline, Deadline.dateAdd(1, "day"), empty())
Also double-check that formulas feeding into a Person property return a person value — not a date or string — and that formulas used with Multi-select properties use .includes() rather than == in comparisons.
3. Formula Depth Limit Reached
What happens: The formula throws a depth limit error.
Why it happens: Closot formulas have a maximum depth of 15 layers. Each time a formula references another formula property or a rollup — even across different databases — it adds a layer to the chain. It's easy to hit this limit in complex setups without realizing it.
How to fix it: Audit your formula chains and look for opportunities to consolidate. If multiple formula properties are each doing a small piece of the same calculation, merge them into a single, more comprehensive formula property. Removing unnecessary intermediate steps is usually the fastest path to reducing depth.
4. Referencing Variables in Other Variables
What happens: The automation fails because one variable can't see another.
Why it happens: When you define multiple custom variables inside the same automation action, they exist in isolation from each other. A variable defined in the same action cannot reference another variable defined in that same action.
Example of what doesn't work:
Defining var1 and var2 in the same automation action, then trying to use var1 inside var2's formula — this will fail because var2 is evaluated at the same time as var1, not after.
How to fix it: Split your variable definitions into separate, sequential automation actions. Define var1 in Action 1, then add Action 2 and define var2 there. Because Action 2 runs after Action 1 is complete, var2 can safely reference var1.
5. Referencing Variables in Filters
What happens: The automation can't use your variable to filter which pages to act on.
Why it happens: Variables defined in an automation cannot currently be used in the filter condition of a database action (e.g., "Edit pages where [property] contains [variable]"). This is a current platform limitation.
How to fix it using a workaround:
- Create a custom variable in your automation with the formula set to
Trigger page— this captures the specific page that triggered the automation - In the Edit pages in action that follows, select the custom variable from Step 1 as the target instead of using a filter
This routes the action directly to the triggering page without needing a variable inside a filter.
6. Referencing Relations and People
What happens: The automation pauses unexpectedly.
Why it happens: Relation properties and Person properties don't return a single value — they return a list of pages or people. If your formula treats a list as if it were a single value (e.g., trying to access a property on it directly), the automation will pause and wait for a more specific reference.
For example, prop("Reviewer").email() will fail if "Reviewer" is a Person property that can hold multiple people, because you haven't specified which person in the list you want.
How to fix it: Be explicit about which item in the list you're targeting:
- Use
.first()or.at(0)to access the first item - Use
.map(),.filter(),.every(),.some(), or.find()to iterate over all items in the list
prop("Reviewer").first().email() → email of the first reviewer
prop("Linked Tasks").filter(current.prop("Status") != "Done") → all incomplete tasks
7. Undefined Value
What happens: The automation encounters an empty value and pauses automatically.
Why it happens: Automations are strict about unexpected emptiness. If a formula tries to operate on a date or person property that happens to be empty on a particular page, the automation treats this as an error and pauses rather than producing a bad output silently.
For example:
Deadline.dateAdd(1, "day")
If Deadline is empty on the page being processed, this formula fails — you can't add a day to nothing.
How to fix it: Wrap operations on potentially-empty values in a conditional check:
if(Deadline, Deadline.dateAdd(1, "day"), empty())
This tells the formula: "If Deadline has a value, add a day. If it's empty, return empty." The automation proceeds cleanly in either case.
Alternative approach: Create a filtered database view that only includes pages where the required property has a value, then configure your automation to run only on pages within that filtered view. This prevents the automation from ever encountering the empty case.
8. Common Syntax Errors
What happens: The formula doesn't work as expected, or shows an error immediately in the formula editor.
Why it happens: Syntax errors cover a broad range of issues — a missing closing parenthesis, a mismatched bracket, using the wrong comparison operator, referencing a function that doesn't exist, or using an unsupported construct for the current context.
How to fix it: The formula editor highlights errors inline as you type. Review the highlighted region and check for:
- Unclosed parentheses — every
(needs a matching) - Misquoted strings — text values must be wrapped in double quotes
"like this" - Incorrect operator usage — refer to the Formula syntax & functions article for the correct syntax of every operator and function
- Type mismatches — passing a number where a function expects text, or vice versa
For a complete breakdown of correct syntax for every function, see the Formula syntax & functions reference.