January 17, 2024 by  Ashley Guberman

As much as I love Notion, there are some features that anybody with database experience will recognize are sorely missing, especially in regards to referential integrity. Chiefly, that although templates and filters will let you show related data from inside of a database row, there’s no (easy) way to enforce multiple relationships with your data for referential integrity.

Referential Integrity in Notion

So, if you’re making a note for a project, and the project is for a client, you can only enforce the first level relationship from the note to the project. Yes, you can manually edit filters on every project or note, but that defeats the point of having relationships enforced automatically to help with referential integrity.

If you extend the relationships, adding tasks for the note, the missing links get worse, even though there’s a clear business relationship that the tasks would be relevant for both the project, and the company.

Using Make.com to Enforce Notion Business Rules For Referential Integrity

The following goes into detail for enforcing one set of missing relationships for referential integrity, from the Notes perspective. There is another analogous scenario managing the same from the Tasks perspective.

  1. The process kicks off from a WebHook, using the process described in How to Fire WebHooks from Notion, though you could just as easily skip this and poll on step 2.
  2. We’re doing a search for all notes that satisfy the filter “Has X, but not Y” where X is the immediate parent relationship, and Y is the grandparent. For example, a note has a project link, but not a client/company link. We’re going to check for all such cases (using OR), and then respond to the particular case we’re dealing with after the router.
  3. We make sure we have at least one bundle of data to work with.
  4. The filter checks for the bundles where the note came from a task, but the task lacks a company record.
    • We open up the task (parent) that the note came from.
      The filter then confirms that the parent task has a company record.
    • We update the original note to put the company ID into the note that was missing it.
  5. The filter checks for bundles where the note has a Project, but no company.
    • We open up the Project (parent) that the note came from.
      The filter then confirms that the parent project has a company record.
    • We update the original note to put the company ID into the note that was missing it.
  6. We check that we just finished the very last bundle from the notes from step 2.
    • Now that we know we are finished, we can return a result to the WebHook response.
{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

COMPANY PROFILE

Primary Goals sits at the intersection of three core ideas about communication:
  • Leaders create vision by communicating a compelling future to their teams.
  • Teams create success based on how effectively the communicate and coordinate with each other.
  • Entrepreneurial ventures are successful only when they communicate value to people with a concern that the business can take care of
In all cases, it’s about Conversations for Committed Results.  That’s our Primary Goal.  

CONTENT TAGS

BLOG CATEGORIES

Copyright 2024 Primary Goals - Privacy Policy

>