How to make a new Notion relation record?

Image two Notion databases, linked by Relation: “Opportunities” and “Companies”.

I am using Make to update records in “Opportunities” via the Notion module “Update a Database item”.

But I’m hitting a problem when it comes to updating the relational field…

  • When the record does not exist in “Companies”, Make.com reports: [400] body failed validation: body.properties.Company.relation[0].id should be a valid uuid, instead was “Acme Inc”.
  • It also fails when I pass a plain-text value of the title of a record which does exist.

This is because Notion is expecting the record ID.

If this were the Airtable integration for Make.com, I think there is a way of “upserting”/creating records where they don’t exist, conveniently. But I don’t see that option.

What rigmarole do I need to go through to…

a) Check whether the record exists and use that, or
b) Create it if it does not, then set that?

In my experience, you can implement this via a Router with 2 routes after a “Search objects” module where you would search whether the Company already exists in Notion:

  1. If the record exists
    → Update database item as you’re doing (and pass the pageID in the relation property)
  2. If the record doesn’t exist
    → Create database item (the company)
    → Update database item (opportunity) (and pass the pageID from the previous module in the relation property)
4 Likes

Thanks. I was afraid this was the answer. Totally makable - but not equivalent to the Airtable module’s very handy ability to create new records where they don’t yet exist. Understandable, perhaps - the Notion API is pretty tricky, compared with the Airtable API.

I have these cases a lot and tend to use a router with three modules

  1. if record exists
    → save id as variable
  2. if record does not exist
    → create record
    → save id as variable
  3. no filter
    → get variable
    → update item.

This way I am able to continue on one route and go on with more complex scenarios.

3 Likes