When you write a formula in a Notion database, the property may show “Undefined” instead of the expected result. This usually happens because the formula references a property that is empty, has no value, or contains incompatible data types. Notion formulas require every referenced property to have a defined value for the calculation to work. This article explains the root causes of the “Undefined” output and provides a clear debugging process to fix it.
Key Takeaways: Debugging a Notion Formula That Shows “Undefined”
- Formula bar > Check referenced properties: Ensure every property used in the formula has a value in the row you are testing.
- Formula bar > Use the
empty()function: Wrap optional properties inif(empty(prop("Property Name")), "fallback", prop("Property Name"))to handle missing values. - Property type compatibility: Verify that all referenced properties are the correct type (text, number, date, checkbox) expected by the formula.
Why Notion Formulas Return “Undefined”
Notion formulas evaluate each row independently. If a formula references a property that is empty, null, or has no value in that specific row, the formula engine cannot perform the calculation and outputs “Undefined.” This is not an error in the formula syntax itself but a data dependency problem. The most common causes are:
Empty or Missing Property Values
A formula that concatenates text from a property that has no value will show “Undefined.” For example, prop("Name") + " is a member" will return “Undefined” if the Name property is blank. Similarly, arithmetic on an empty number property produces the same result.
Incompatible Data Types
Notion formulas are strict about types. Adding a text string to a number, or comparing a date with a checkbox, will cause the formula to fail silently and show “Undefined.” The formula editor does not always flag type mismatches at the time of writing.
Rollup or Relation Properties That Are Empty
Rollups and relations are especially prone to returning “Undefined” if the related database has no rows or the linked property is empty. A rollup that calculates a sum over an empty set will return “Undefined” rather than zero.
Steps to Debug and Fix the “Undefined” Output
Follow these steps in order to identify and resolve the cause of the “Undefined” result.
- Click the formula property header in your database
Open the database view and click the column header of the formula property that shows “Undefined.” This opens the formula editor. - Identify every referenced property name
Look for every instance ofprop("Property Name")in your formula. Write down each property name exactly as it appears. Make sure the spelling matches the actual property name in the database. - Check each referenced property for values
Go to the row that is showing “Undefined.” Inspect each property from step 2. If any of those properties are empty, that is the cause. Fill in a test value or use a fallback in the formula. - Wrap optional properties with
empty()
If a property may legitimately be empty, wrap it in a conditional. For example, changeprop("Middle Name")toif(empty(prop("Middle Name")), "", prop("Middle Name")). This returns an empty string instead of “Undefined.” - Verify property types match the operation
Check the type of each property. A number property cannot be added to a text property. Useformat()to convert numbers to text, or usetoNumber()to convert text to a number. For dates, usedateAdd()ordateSubtract()rather than arithmetic operators. - Test with a simple formula in a new formula property
Create a temporary formula property with justprop("Suspected Property"). If that also shows “Undefined,” the problem is in the source property, not the original formula.
If Notion Still Shows “Undefined” After the Main Fix
Formula uses a rollup that has no linked rows
A rollup property that aggregates data from a relation will return “Undefined” if the relation has no linked pages. Add at least one linked page to the relation, or use the empty() function on the rollup property itself: if(empty(prop("Rollup Name")), 0, prop("Rollup Name")).
Formula contains a circular reference
A circular reference happens when a formula property references another formula property that eventually references back to the original property. Notion does not allow circular references and will show “Undefined.” Review the formula chain. Remove any formula property from the prop() call of another formula property.
Formula uses a function with incorrect arguments
Functions like slice(), replace(), or dateAdd() require specific argument counts and types. For example, slice("hello", 1, 3) works, but slice("hello", 1) returns “Undefined” because the end index is missing. Check the Notion formula documentation for the exact syntax of each function you use.
Formula references a property that has been renamed or deleted
If you rename a property, the formula still uses the old name and returns “Undefined.” Open the formula editor. Look for any property name in the formula that no longer exists in the database. Update the name to match the current property name.
Formula Debugging Approaches Compared
| Debugging Method | When to Use | Expected Outcome |
|---|---|---|
| Check each referenced property for empty values | Formula works on some rows but not others | Identifies which property is missing data in the failing row |
Use empty() function as a fallback |
Property can legitimately be empty in some rows | Returns a default value instead of “Undefined” |
| Test with a simple formula property | Unsure which property causes the issue | Isolates the problematic property |
| Verify property types | Formula involves arithmetic or date operations | Prevents type mismatch errors |
You now have a systematic method to debug any Notion formula that returns “Undefined.” Start by checking each referenced property for empty values, then apply the empty() function where needed. For advanced formulas, verify that every function argument is correct and that no circular references exist. As a next step, explore Notion’s ifs() function to handle multiple conditions in a single formula without nested if() statements.