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.
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!
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.