Compare date in Google sheet with today's date

I have a Google sheet with a series of messages.
The structure is as follows:

  1. Row 1 is the header row. A1: Week, B1: Date, C1: Message
  2. The actual messages start from row 2

So what is supposed to happen is this:
If the date in Google sheet equals today’s date, the message should be sent to Discord.

I’ve been trying everything with the formatDate filter, but nothing seems to work.

formatDate(now;MM/DD/YYYY)
formatDate(now;DD/MM/YYYY)

I also tried parseDate… nothing is working.

I checked previous posts with solutions, but still no result :frowning:

1 Like

Send a screenshot of the date as it appears on your sheet
and of the module in which you search for the corresponding lines in Google Sheets

You need to make sure the values coming in from sheets is a date value. If not you need to parse it into a date that matches the format of date the now() function gives you.

Planning-Q-A-Graduaat-Programmeren-AO-2024-2025-Google-Spreadsheets-10-03-2024_03_46_PM

The date is entered in the Date format of Google Sheets but it’s in DD/MM/YYY instead of YYYY/MM/DD. I don’t know if that makes a difference?

1 Like

I think the issue might be that in Google sheet, the date is formatted like this: DD/MM/YYYY and I guess it should be parsed to YYYY/MM/DD… ?

1 Like

You need to parse the date. How are you mapping the parseDate() function?

Hi @abstudent


Best regards,

Msquare Automation
Gold Partner of Make
@Msquare_Automation

formatDate-now

I’m getting this error:
Cannot process data because of the error. The reason is: Failed to evaluate filter ‘0-0’: Function ‘formatDate’ finished with error! ‘now’ is not a valid date.

This is my first module

and in the first Tools module I’ve set Variable name to “5. Datum (B)”.

1 Like

Hi @abstudent
Should not write like this , it should be{{now}}
image

Or you can map from here:

Best regards,

Msquare Automation
Gold Partner of Make
@Msquare_Automation

1 Like

Yes! It works! Thank you so much! This will save me a lot of time :star_struck:

1 Like