Check items exits in google sheets

I use the webhook to get the data and write it to the google sheet.
I want to add only new documents to avoid duplication of old content
You can see pictures.

Here is my code

const new_items = $node["Extract data"].json["link"];
var new_items1 = [];
const data = $node["Google Sheets1"].json["link"];
// = || [];
for (let i = new_items.length - 1; i >= 0; i--) {

// Check if data is already present
  if (data.includes(new_items[i])) {
  } else {

// if new data then add it to an array
      json: {
        link: new_items[i],
return new_items1;

I am not getting output

By default, if the node does not return anything, all the nodes connected afterward are not executed. To override this behavior, go to the node’s setting and set the parameter Always Output Data to true.

Did it work?

It still didn’t work,
I am reviewing the code

I just had a look again and noticed that the Check exist node would be executed two times for each webhook call. I do not think that is what you want to do :thinking:. Instead, you can place the Extract data node after the google sheets1 and then connect the Extract data to the Check exists node.

I used another simply available n8n, and it worked