You have a Notion formula property that needs to pull data from a different database, but the formula editor only lets you reference properties from the current database. This restriction exists because Notion formulas operate on a single row and cannot directly query other databases or tables. This article explains why the limitation exists and provides three practical workarounds: using rollups, relations, and template variables.
Key Takeaways: Workarounds for Cross-Database Formula Access
- Relation + Rollup: Link two databases with a relation property, then use a rollup to bring the target value into the formula database.
- Rollup Property Only: If you only need the value without transformations, use a rollup directly instead of a formula.
- Template Variables: For page titles and simple text, use
{{variable}}syntax in database templates to pull data from related pages.
Why Notion Formula Cannot Reference Another Database
Notion formulas are evaluated per row in a single database. The formula editor displays a list of properties from the current database only. This design keeps formulas fast and predictable because they never need to query other tables. The formula property has no built-in function like lookup() or query() that can reach into another database. This is not a bug; it is an intentional limitation of the formula engine.
What the Formula Editor Actually Sees
When you open the formula editor, Notion shows you a property picker that lists every property in the current database. You cannot type a database name or a relation path. The only way to bring external data into a formula is to first bring that data into the current database using a relation and a rollup property. The formula can then reference the rollup property.
Why Rollups Exist for This Purpose
Notion created the rollup property specifically to solve cross-database data access. A rollup property sits inside a database and pulls values from a related database through a relation. Once the rollup exists, you can use it inside a formula just like any other property. The rollup acts as the bridge between the two databases.
Workaround 1: Use a Relation and a Rollup
This is the most reliable method for bringing data from another database into a formula. You create a relation property that links the two databases, then create a rollup property that pulls the specific value you need. The formula can then reference the rollup.
- Open the database where the formula lives
Go to the database that contains the formula property. This is your current database. - Add a Relation property
Click the + button in the table header or open Database Properties. Select Relation. Choose the target database you want to pull data from. Name the relation something clear like “Related Tasks” or “Linked Project”. - Link the rows
In each row of your current database, click the relation cell and select the related row from the target database. Every row that needs the formula must have a relation set. - Add a Rollup property
Click the + button again and select Rollup. Name it something like “Project Budget” or “Client Email”. In the rollup configuration, set the Relation to the one you just created. Set the Property to the exact field you want to pull from the other database. Set the Calculate option to Show Original or the aggregation you need (Sum, Average, etc.). - Reference the Rollup in your formula
Open the formula property editor. You will now see the rollup property in the property picker. Use it like any other property. For example:prop("Project Budget") 1.1to add a 10% markup.
Workaround 2: Use a Rollup Directly Without a Formula
If you only need to display a value from another database without performing calculations, a rollup property alone may be enough. You do not need to wrap it in a formula. This reduces complexity and avoids formula errors.
- Add a Relation property to the current database
Same as workaround 1, create a relation to the target database and link the rows. - Add a Rollup property
Create a rollup property. Select the relation. Select the property you want to display. Choose Show Original. - Use the rollup in views and filters
The rollup value appears in table cells, kanban cards, and gallery views. You can also filter and sort by the rollup property.
Workaround 3: Use Template Variables
Template variables work inside database templates. They let you pull a property value from a related page into the page title or body text. This is not a formula, but it solves the same problem for text-based fields.
- Create a Relation property
Add a relation to the database that contains the data you want to reference. - Open the database template
Go to the current database, click the … menu in the top right, select Templates, and open the template you use for new pages. - Insert a template variable
Type{{relation property name}}where you want the value to appear. For example, if your relation is called “Client” and the client database has a property called “Company Name”, type{{Client.Company Name}}. Notion will replace this with the actual value when you create a new page. - Create a new page to test
Add a new page to the database. Set the relation. The template variable will populate with the related data.
Common Mistakes When Using Rollups in Formulas
Rollup Returns an Array Instead of a Single Value
If the relation links to multiple rows, the rollup may return a list. Formulas cannot process lists directly. To fix this, change the rollup Calculate option to Sum, Average, Count, or another aggregation that returns a single number. For text, use Show Original only if the relation links to a single row.
Formula Shows “NaN” or “Undefined”
This happens when the rollup value is empty or the relation is not set. Check that every row has a relation value. Use an if() statement in the formula to handle empty values: if(empty(prop("Rollup Name")), 0, prop("Rollup Name") 1.1).
Rollup Property Does Not Appear in Formula Editor
Notion formulas only show properties of the current database. Make sure the rollup property is in the same database as the formula. If you created the rollup in a different database, it will not appear. The rollup must be a property of the same database where you are writing the formula.
| Method | Use Case | Limitation |
|---|---|---|
| Relation + Rollup | Bring a value into a formula for calculations | Requires a relation link per row |
| Rollup Only | Display a value without calculations | Cannot transform the value |
| Template Variables | Insert related text into page titles or body | Only works at page creation time, not dynamically |
You now have three ways to bring data from another database into your Notion formula or page. The relation and rollup method is the most flexible for formulas that need to perform math or text transformations. If you only need to display a value, use a rollup property alone. For page templates, use template variables. Try using the formatDate() function inside your formula to display the rollup date in a custom format.