Help adding data to Google Sheets with a duplicate check

Hi Community!

I’m very very new to the n8n ecosystem, and the learning curve has been quite challenging for me… Between authentication errors and other issues, I feel like my head is about to explode :sweat_smile:.

I’ve worked with Make.com before, but I really like n8n much better for its flexibility and capabilities. However, I’m stuck with a workflow and need your help.

What I need to do:

  1. I have two Google Sheets:
  • Sheet1: Contains new data. Specifically, column A has URLs that I want to add to a destination sheet.
  • Sheet2: Is my destination sheet. It already has data, with column A containing URLs.
  1. Objective:
  • I want to compare the URLs from column A of Sheet1 with the URLs already existing in column A of Sheet2.
  • If a URL from Sheet1 does NOT exist in Sheet2, I want that row to be added to Sheet2.
  • If the URL already exists in Sheet2, I want the workflow to skip that row from Sheet1 and move to the next one.

I really appreciate any help in advance. Since this is not an actual error but rather something I don’t know how to achieve, I don’t think it’s necessary to share screenshots of the interface, right?

THANK YOU!!! And I’m sorry if this is not the right place to ask, but I couldn’t find any information about this.

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hello @Shymitzk
You can do that with the Merge node or with the Compare Datasets node . But as you only have one case when the sheet should be populated, the Merge node is easier

2 Likes

@barn4k Thank you for responding so quickly :pray:t2:, I was just investigating Compare Datasets…

The solution you gave me might not work for me because I don’t want to modify the final sheet (the row with the repeated URL should keep its original content).

And while using Compare Datasets, I don’t know why the Input B, even though I configure it correctly, shows up in red and says “Path back to the node” is missing…

If you don’t want to modify it, you can change the logic as you want… The output of the compare datasets will be the same, but it has more options to handle different scenarios (like what to do with items only in the first sheet, or in the second sheet, or if they are mismatching partially)

In regard to the error, can’t say without seeing the workflow

1 Like


(dont know yet how to share the workflow and it is safe about apis?)

I think I got it with your flow!!! As I said, I’m very, very new to this, and it’s been hard for me to understand the nodes!!! Also, English is not my native language…

Thank you so Much!!! I think finnaly made it work! Thanks to you!

n8n has some short courses to be more familiar with it, which is quite usefull

1 Like

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