Rules are not being run on the schedule

I noticed that I have a scheduled rule which suppose to run every day. However, it doesn’t there is no logs indicating the reason why - it just doesn’t run:


Worspace: reify-academy

Okay,
I think there are some caching issues with using Today() function.
Here is example that I’m investigating:

  1. Schedule setup:

    Suppose to filter only habits which are repeating today and create tracker for each of those habits.
  2. Here is the log:

As you can notice in the log it created trackers for previous day even so in the rule I specify to use today.

@Oleg @ChrisG Any idea is this a bug or I’m holding it wrong?

It’s blocking us from releasing public template for habit tracking.

Hello.
First of all big thanks for providing so many details.
It’s a timezone issue. Unfortunately Fibery does not support user-defined timezones at the moment. See this guide . | Fibery.
Today() function returns date in UTC timezone. Probably your local timezone is much more ahead, that’s why Today() return previous date for you.

We can fix it for your particular workspace, by adding time difference between UTC and your timezone to the formula in action.
In filters it’s a bit harder, as we don’t allow formulas there at the moment. But knowing the logic behind ‘Next Repeat For Occurence’ – I think it is also possible to find a workaround.

But you told that you are planning to distribute a solution via template. And it’s harder to give a good-working advice, as target workspaces may live in whatever timezones.

It seems you need to run your schedule rule on such time, when there is the same day in UTC timezone and your timezone. Otherwise Today() function will return different day for you. Note that when you choose time of rule run, it’s chosen in your local(browser) timezone.

The logic for Next Repeat for Occurence is the following:

[Last Repeat For Occurence].[Дата] + Days([Повторяется каждые Х дней])

Translated from my mix of Russo/English fields:

[Last Repeat For Occurence].[Date] + Days([Repeat every X days])

And Last Repeat For Occurence is:

Trackers.Sort([Дата]).Last()

Translated:

Trackers.Sort([Date]).Last()

So it’s just a date without datetime which should be okay with timezones. I believe, however maybe when it compares to today it depends on UTC. I’m in GMT+8 timezone which means that if I run the formula at 6am my time it’s still previous day in UTC. Now that makes a lot of sense.

The problem is that I do start my today at 6/7am and I want my habits to be ready by that time.
Hm…

I’m going to try this:
Create a separate field - Repeat Today
with following formula:

[Next Repeat For Occurence] = Today() + Hours([Created By].[Timezone offset])

I added timezone offset to my user. Will need to think of a better way for multiple user setup but let’s see if it works first.

1 Like

I didn’t get the switch from

[Next Repeat For Occurence] = [Last Repeat For Occurence].[Дата] + Days([Повторяется каждые Х дней]

to

[Next Repeat For Occurence] = Today() + Hours([Created By].[Timezone offset])

But it doesn’t matter if it works for you!
You got everything correctly, adding offset to Today from let’s say User.[Timezone offset] field will do the trick.
Just keep in mind that whenever you use Today() in formulas or automations – it will be date at UTC timezone, which may differ from what you have on the clock in your timezone. Even though it is date without time.

In future we hope to add offset as a workspace setting, so it will be configurable. But no promises on concrete dates.

This is separate field - I’m not changing Next Repeat Occurence.
It’s actually more complicated formula in case someone stumbles on this later:

[Next Repeat For Occurence] = Date(Year(Today() + Hours([Created By].[Timezone offset])),Month(Today() + Hours([Created By].[Timezone offset])),Day(Today() + Hours([Created By].[Timezone offset])))
1 Like