Event Condition not calculating correctly

I am creating an app for maintenance schedule.
I need to schedule email 10 days before the next service date
I gave filtering condition to Bot as
[next service date]-Today()=10

When I test expression, irrespective of the next service date, all rows are testing “True”



0 5 94
5 REPLIES 5

Date minus Date equals a Duration value, which is in the form of “hhh:mm:ss”. “10” is just a Number value, you cannot directly compare these. You need to convert the Duration value into a number of days. TOTALHOURS() / 24 should do it.


Also, I think you clicked “Test” on the Bot itself, not the expression.

thanks
It looks working
will it automatically adjust the fraction output of the expression Totalhours()/24? or do i need to take any special care?

When you do Date - Date, those Date values are converted to DateTime values, at 12:00:00 AM. Which means that the resulting output will always be “hhh:00:00”, where hhh is a multiple of 24, and the minutes and seconds are always 0. So, no, in this case, you shouldn’t need to worry about any fractional output from the division. But it is good that you have thought about that.

Thanks,
the expression is testing “Y”
but Bot is still not sending email. I updated “Time” inside the schedule two three times

Even Bot tests the condition to be true but doesnt execute the email task

If I press Run, it will is sending email.

I would assume there is some bit of delay, after you setting up a schedule Event, before the Appsheet system can actually trigger on it. Try to set the time for like an hour or two from now, or just set it when you want it and wait for tomorrow.

Or maybe something else is wrong that I can’t see.

Top Labels in this Space