I have written a script in Pipedream to get the dates I put in a certain column in my Google Sheets. I want to count them to be able to determine how many time a certain date appears in that column but I still get as count 0 and I do not know where it is going wrong. I tried the 5th of February because I have it appearing 5 times in that column just to test the code but for in the future it needs to check every day how many times the date of today appears.
export default defineComponent({
async run({ steps, $ }) {
let count = 0;
let dates = steps.get_values_in_range.$return_value;
for (let date of dates) {
if (date === "02-05-2023") {
count++;
}
}
return {
count,
event: steps.trigger.event,
get_values_in_range: steps.get_values_in_range.$return_value,
};
},
});
You just need to change one line from your code.