Avoid duplicates in notion with webhook

Hi! I’ve tried reading through various threads in the forum but haven’t been able to solve this!

I’ve created a button in Notion that fetches data from an API. This works well, but I want the function to avoid pulling in duplicates the next time I press the button via a webhook.

That’s why I’m trying to filter this out by checking if the ID already exists in Notion. However, this doesn’t seem to work optimally. If I understand it correctly, Make is comparing the API ID with the wrong ID in Notion, as if everything is being matched incorrectly.

Can someone help me with this? Thanks!

Hi Jens,
One hypothesis is that the Iterator may be creating the mismatch in the ID comparison. A few questions:

  1. What does the Iterator iterate?
  2. What does the “Search objects” module search?
  3. Couldn’t you place the Iterator right after the HTTP module (assuming that’s what you’re iterating), and then using the “Search objects” module to match the ID? Then, you could filter for “Page ID” (from “Search objects”) doesn’t exist

Hi , thanks for the answer ! :slight_smile:

  1. Now its changed like this.

  2. I tested this one but got more then 1 dublicates, like a eco in the data-import. Do i miss something? :slight_smile:

In “Search objects”, can you try “equals” instead of “does not equal”?
After “Search objects”, filter by “Page ID” doesn’t exist

3 Likes

Thanks, this worked! You’ve saved me a lot of headache :slight_smile:

But I don’t understand the logic. Is what happens that by forcing the IDs to be equal in “Search objects,” they are then matched further down the flow? And that’s why the filter now works.
But what I don’t get is how Make.com knows that the “Page ID” doesn’t exist—isn’t this a random ID generated for each new row in Notion? :slight_smile:

I really appreciate your help!

1 Like

Nice!
“Search objects” searches through the Notion database to find matches based on your search query.

In your case, it searches through the database for pages where “Faktura-ID” equals “1234xyz” (whatever you input). If it finds a match, it returns those pages. If it doesn’t find any match, it returns nothing.

You want to avoid duplicates, so your scenario proceeds only if “Search objects” doesn’t find any match (hence why the filter “page id” doesn’t exist)

Thanks Simo! :slight_smile:
I’m thinking about two more things regarding my flow:

  1. What’s the smartest way to update the data in Notion when there are changes in HTTP data, and want to change the notiondatabase? I started creating a filter for each field that checks IF the iterator is NOT equal to the search object, then use the Router with filter to update value 1 — and the same logic for value 2, 3, 4, etc. But it feels like there’s a smarter way to handle this?

  2. My webhooks seem to end up in a queue every time I press the button in Notion. Why is this happening when I have the setting “Immediately as data arrives” enabled on the webhook?

No problem!

  1. Maybe you can achieve this with the new workspace webhooks - though you’d need to analyze if your use case is compatible with this
  2. Check if you have “sequential processing” turned on in the Scenario settings (gear icon at the bottom)