Nested rollups in Notion API returning null values

Hey everyone, I’m struggling with a Notion API issue. I’ve set up a chain of rollups across three databases. The first two work fine in the Notion UI, but I’m hitting a snag with the third one.

Here’s what I did:

  1. Created a rollup from Database A to Database B
  2. Made a formula in Database B that references the rollup
  3. Set up another rollup in Database C that points to the formula in Database B

The values show up correctly when I look at it in Notion. But when I fetch the page through the API, the property comes back as null. Here’s a snippet of what I’m seeing:

{
  "Rollup Property": {
    "type": "rollup",
    "rollup": {
      "type": "array",
      "array": [
        {
          "type": "formula",
          "formula": {
            "type": "number",
            "number": null
          }
        }
      ],
      "function": "show_original"
    }
  }
}

I’ve checked, and it’s not an access issue. Other rollups to different properties work fine. Any ideas on what might be causing this? Thanks in advance for your help!

I’ve dealt with similar Notion API quirks before. One thing that’s worked for me is to create a dummy property in Database C that directly references the original data in Database A. This seems to ‘wake up’ the API and often fixes the null value issue.

Another trick is to use Notion’s ‘Update page’ endpoint to manually push the correct values to Database C. It’s a bit of a hack, but it can be a lifesaver when the API is being stubborn.

If all else fails, you might want to consider flattening your database structure. I know it’s not ideal, but sometimes simpler setups are more reliable when working with the API.

Have you tried reaching out to Notion’s developer community? They might have some undocumented workarounds for this specific scenario.

I’ve encountered this issue as well. It appears that the Notion API has limitations when it comes to deeply nested rollups and formulas. One workaround I’ve found effective is to create a separate property in Database C that directly references the original data from Database A, bypassing the intermediate steps. This often resolves the null value problem.

Another approach worth trying is to use the ‘last edited time’ property as a trigger for syncing. By updating this property whenever the relevant data changes, you can ensure the API picks up the latest values.

If these solutions don’t work, you might need to consider restructuring your database relationships or reaching out to Notion support for further assistance. They may have insights into API behavior with complex rollups that aren’t widely documented.

hey there, i’ve run into similar issues before. it seems like the api sometimes struggles with complex nested rollups. have you tried simplifying your setup? maybe break it down into smaller steps and see where it starts failing. also, double-check your formula in database b - sometimes tiny syntax errors can cause weird null values. good luck!