Hi @mzayn, I donât have access to your Google Sheet so wonât be able to run your workflow. It also seems you are using a rather old version of the Google Sheets node, and I am not super familiar with the data structure it would use.
If youâre using the latest version of n8n and the Google Sheets node, you should get a data structure like this from the node:
[
{
"row_number": 2,
"ID": 1,
"First Name": "SpongeBob",
"Last Name": "SquarePants"
},
{
"row_number": 3,
"ID": 2,
"First Name": "Patrick",
"Last Name": "Star"
},
{
"row_number": 4,
"ID": 3,
"First Name": "Squidward",
"Last Name": "Tentacles"
},
{
"row_number": 5,
"ID": 4,
"First Name": "Eugene H.",
"Last Name": "Krabs"
},
{
"row_number": 6,
"ID": 5,
"First Name": "Sheldon J.",
"Last Name": "Plankton"
},
{
"row_number": 7,
"ID": 6,
"First Name": "Karen",
"Last Name": "Plankton"
},
{
"row_number": 8,
"ID": 7,
"First Name": "Sandra \"Sandy\"",
"Last Name": "Cheeks"
},
{
"row_number": 9,
"ID": 8,
"First Name": "Mrs. ",
"Last Name": "Puff"
},
{
"row_number": 10,
"ID": 9,
"First Name": "Pearl",
"Last Name": "Krabs"
},
{
"row_number": 11,
"ID": 10,
"First Name": "Gary",
"Last Name": "the Snail"
}
]
So if you look at the first item, thatâd be this one:
{
"row_number": 2,
"ID": 1,
"First Name": "SpongeBob",
"Last Name": "SquarePants"
}
So this wouldnât be an array and your check Array.isArray(rows)
wouldnât return true
. So perhaps you simply want to use code like below instead:
const today = new Date().toISOString().slice(0, 10);
let results = [];
for (const item of $input.all()) {
const dateExpired = item.json['Date Expired'];
if (today === dateExpired) {
results.push({
json: {
username: item.json['username'],
Number_Whatsapp: item.json['Number'],
ExpiredDate: item.json['Date Expired'],
Subscribe_Email: item.json['Subscribe - Email'],
Subscribe_Status_IV_ID: item.json['Subscribe - Status & IV ID'],
Subscribe_Activation_Date: item.json['Subscribe - Activation Date'],
Subscribe_Expired_Date: item.json['Subscribe - Expired Date']
}
})
}
}
return results;
Going forward itâd be great if you could open a new thread instead of posting on those marked as solved as I tend to overlook these. Thank you