Common Formula Errors
Formulas are powerful — but they can fail in non-obvious ways, and the cause is not always where the error shows up.
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 or button 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 formula fails to save.
Why it happens: A formula has to return the type that the place using it expects. A button action that sets a date property needs a date, not text — if the formula returns something else, it can't be applied.
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 Relations and People
What happens: The formula returns an unexpected result.
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 formula can't resolve it and returns nothing useful.
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
5. Undefined Value
What happens: The formula encounters an empty value and stops evaluating.
Why it happens: Closot is 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, Closot treats this as an error 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." Either way the formula resolves cleanly.
Alternative approach: Create a filtered database view that only includes pages where the required property has a value, then work from that view.
6. 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.