Google calendar events trigger base on day and month

Hi everyone,

I am currently working on a project where I aim to set up automated birthday triggers using Google Calendar. Specifically, I want to create a scenario where the Google Calendar event for a user’s birthday triggers on their birthday and sends notifications via email or SMS.

I have successfully created the scenario and tested it with dates like 19/11/2023 and 20/11/2023, and successfully received notifications via email and SMS as preconfigured. However, I am facing an issue. I want the calendar event to trigger only for users whose day and month match the current day and month.

For instance, I tried setting a user’s date to 21/11/2001 to see if the event would trigger on the day (21) and month (11), but it didn’t. Instead, the calendar triggered other events, such as April 24, 1980.

I would appreciate any insights or suggestions on how to ensure the calendar event triggers accurately based on the current day and month.

Calendar Scenario

Calendar setup

Calendar Output

Hi @miheso ,

To be sure that I well understand, you want to extract from your calendar all the events having a date like DD-MM without considering the year, that’s it?

Maybe you could use the Query field and time functions.

PBI

2 Likes

I want to retrieve only those events that are due today(current day/month) excluding any other events.

How do i use the time function in the calendar to get that.

NB: All events are created on google calendar already.

Or better still let me put it this way.

I want the watch events module to only output users whose birthday is today(current day and month) without considering the year.

how do i setup the calendar to get that.

In the query field, you could define a predicate like:
data_name = formatDate(now; “DD.MM.YYYY”)
where data_name is the name of the variable corresponding the the date in Calendar.

2 Likes

Thank you so much @Philippe_Billet .

with the attached file, which is the calendar output, does it means i need to replace the data_name in your query withstart from my calendar output ?

If start is the date of interest, yes.
After in the Query field, you have to “play” with the time functions.
You could try this:
formatDate(start; “DD.MM”) = formatDate(now; “DD.MM”)
Not sure that it works directly, you can also share your intermediate results.

2 Likes

I’m currently encountering an issue where no output is being returned when i run the module.

I right clicked on the module and select choose where to start and i select All but nothing shows in the output.

Output shows no operations

And this one: formatDate(start; “DD.MM”) = formatDate(now; “DD.MM”) ?

2 Likes

Same . No output

Sorry, you have to use: {{formatDate(start; “DD.MM”) = formatDate(now; “DD.MM”)}}
or you can retype the “code” using the buttons in the contextual menu.

2 Likes

Output

I don’t know why I am not getting any output .

There is something strange (but it will not solve the problem), when you paste the “code” I gave you, you should have obtained: (the " " are not useful)
image
As you can also see, there is a comment saying that it searches for events containing the specified text.
Here, I led you down the wrong path thinking that querying was like every other database, but it is not.

PBI

2 Likes

That’s fine. Thank you so much for letting me know .

Have you been able to figure out how to retrieve calendar trigger events based on the current day and month?

Hi @samliew,

Do you have any idea to solve this problem?

Thanks for @miheso

BR,

PBI

2 Likes

I think you should use “Search Events” module instead.

The secret might be the “Single Events” field – set to Yes

Of course, you shouldn’t run/schedule this scenario more than once a day.

2 Likes

Thank you @samliew . I will try that and get back to you shortly

Output

Start Date
{{setHour(setMinute(setSecond(now; 0); )0; 0)}}

End Date
{{setHour(setMinute(setSecond(now; 59); )59; 23)}}

The order of the brackets, semicolon, and numbers must be in the exact same order as my screenshot.

{{setHour(setMinute(setSecond(now; 0); 0); 0)}}
{{setHour(setMinute(setSecond(now; 59); 59); 23)}}
3 Likes