How to get an entire column of spreadsheets to do a comparison?

I have a variable (an ID number) that I want to check against specific columns in Google Sheets to ensure it isn’t saved multiple times. I’m currently using N8N to manage data between my application and Google Sheets, but I’m unsure how to set up this comparison.

Does anyone know how to accomplish this?

Thanks in advance!

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:

Welcome to the community @vinicius_oliveira !

Tip for sharing information

Pasting your n8n workflow


Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.

```
<your workflow>
```

That implies to any JSON output you would like to share with us.

Make sure that you have removed any sensitive information from your workflow and include dummy or pinned data with it!


You could remove duplicates in the spreadsheet itself, see Split text, remove duplicates, or trim whitespace - Computer - Google Docs Editors Help. Wouldn’t that suit your use case better?

If you do need to compare datasets in the workflow, you can use Compare Datasets node. The idea is to pull all the rows from the spreadsheet and compare the IDs in it with the ID in question. The output “Same” will contain the duplicated rows.

You would need to exclude any other fields from comparison if it is ID only you are after. Here’s a demo workflow. The last node will present the IDs that encountered more than once in the spreadsheet.

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