What I’m trying to do
I have a DB in Notion with a formula property that outputs a date with time. I want to filter based on that property so that if, for example, the value in the property is 7/28/25 at 5pm, and the scenario runs on 7/28/25 at 5pm, that item passes through the filter.
What the problem is
I can’t get the filter to work.
Now, I know what you’re saying. You’re saying “of course the filter doesn’t work because the scenario isn’t running at exactly 5pm and no milliseconds.”
And that’s where the real problem comes in.
What I’ve tried
I tried to use addMinutes() so that there would be a window on either side of the exact time. That generated errors:
I think that this may be because the output of the formula (although it outputs a date, and you can see in the error message that it’s a date) shows up as a number in the properties list, which you can see here in the filter:
You can also see how this is complicated in the properties list:
Since treating the date as a date was causing errors, I then tried using formatDate() on both sides of the operator, thinking that then it would be comparing two strings:
Thank you for phrasing your reply in such a gracious way instead of pointing out that I’m an idiot. I do know better. I know that it’s supposed to be a semicolon, and I even thought that I’d double-checked that my syntax was correct, but…apparently I had not double-checked after all.
Quick follow up: that did fix the error! Unfortunately I didn’t get a reminder that I was expecting to get from the scenario, so it still needs more work.
Coming back to this with more data about what doesn’t work here.
As a reminder,the goal is to get a TRUE value when comparing two date/times: one is the date/time of {{now}} (to minute level precision) and the second is the value of a date/time property in Notion.
In my scenario, I have routes for two separate filters, each of which seem to me that they ought to work, but neither of which actually do:
The logic here was that if the scenario ran at 5:00:45 (that is, set to run at 5:00 but isn’t going to run precisely then), and the date/time in Notion is 5:00, then (now minus 1 minute) <= notion property <= (now plus 1 minute), but when the scenario actually ran (at 5:00:26), this is what the filter calculated:
The logic here is that the formulas on both sides of the statement would convert both the Notion property and the time when the scenario runs to a string at the correct level of precision, so they should match as long as the scenario runs close to the time it’s supposed to. But this is what the output was when the scenario ran at 5:00:26 and the Notion property was 5:00:
Mh not sure Rebecca - one question: when you open the “2 hours before reminder time” formula in NOTION, what output data type does it show? Is it a Date, or Unknown/something else?
I solved the dates problem! It turned out to be a combination of an obvious error (I’d selected the wrong property value) and a less obvious error, and I figured it out by adding a Set Multiple Variables module and using that to compare the outputs of all of the formulas. (This was a suggestion in another thread from quite some time ago, and it was brilliant.)
UNFORTUNATELY it turns out that now my array filter isn’t working, even though it used to, so now I have more troubleshooting to do.