Setting up Notion relation on a record creation

Hello everyone, I’m new to n8n

I’m actually setting up a n8n x Notion automation by I’m facing an issue.

In Notion:

  • I have Blog Posts DB
  • Each record belongs to a Website (DB)

In n8n :

  1. n8n’s Form where i choose a file, and manually select a website dropdown list
  2. Run a search to Notion’s Websites DB to find the matching page as the dropdown list in n8n form is filled manually
  3. (some AI processes)
  4. Merge all datas
  5. Map the output fields with code
  6. Create a new record in Notion

For the relation, i have this in the code node:

const website_id = results.find(r => r.id)?.id || "";

The code actually finds the id of the Website but when creating a new record, the Website field is always empty.

Two way relation is already enabled.

Is there anything I have missed or did wrong?

Thank you all :slight_smile:

n8n Setup:

  • v 1.105.4
  • Running on Docker

Hey @nil hope all is good. Welcome to the community.

Would you mind sharing your workflow with us, so that we could take a look?

So far my understanding is that you upload a file via n8n form along with specifying the website from the dropdown list. Then you wish the file to be processed and the content added to the Post DB and linked to the Website DB? How did I do? Is this close to what you are trying to achieve?

Thanks for your reply.

What you have described is really what I wanted to achieve. I guess it wouldn’t be possible to fetch the Websites list from to Notion and append it to the initial dropdown so i filled it manually for now, I could be wrong but this is actually how I did.

Here’s the workflow I have :

Yes, dynamic options is not somethings that’s possible right now for the regular form I think, other than that, this is the most basic example:

1 Like

Thank you so much for you replies.

For the Notion part, I had to use the Get Many Databases, then Filter the result based on the selected value of my initial Select (n8n form). The relation is now well set up :folded_hands:t4:

1 Like

You are very welcome.

If any of ir was helpful, kindly mark one of my answers as Solution. Thank you!

Cheers

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.