Send Notifications before the Event Time

Hi, I would like to send notifications 2 hours before an event occurs. In this case, the event is a horse race and the event time is in a column [PT], Post Time.

The records added to the table are added anytime a day before or on the same day. The records contain data on a horse bet.

The data add event has the problem that the condition is checked just at the moment a row is added, and it is true the notification is sent.

This is my condition: AND([PT]>(TIMENOW()+2-USERTZOFFSET()/60),[Date] = TODAY())

With this condition, I have to add the records 2 hours before the race, same day. Previous rows added, won't trigger a notification.

My question is. If there a way to do this.

yastaaa_0-1662421770735.png

I appreciate your ideas for a turnaround to perform this.

Solved Solved
0 13 444
3 ACCEPTED SOLUTIONS


@dbaum wrote:

instead use “wait until a time” and for the time create an expression that results in the time you want the notification sent. For example, something like: (start time - now) + now


As I imagine you already realized, I should have said to use Wait for a period of time with an expression like (start time - now). Sorry if I confused you!

View solution in original post

Thanks. It was clear for the first time.

I did this. I added a column to the table [DTAdded] that registers when the record is added, with a formula for the initial value NOW().

Then I added a virtual column [WaitPT]

yastaaa_2-1662731125265.png

 

And this is the expression in the Wait of the automation.

yastaaa_1-1662730959760.png

The second condition of the IF expression is when I add the record in the period of two hours before the race. I established a wait time of 5 min because I have realized that if the notification is sent right away, the LINKTOVIEW can show a blank because works faster the notification than the record add.

I am testing this but I am confused about the subtraction of 2 hours. If it has to be like this @Steve .

yastaaa_4-1662731784786.png

 

@Steve wrote:

Raw Duration values in expressions should have at least three digits in the hours position:

"000:10:00"

 

 

 

View solution in original post

IMO the usage of an VC with AppFormula to provide the wait duration could be a problem.
Please use the expression inside the "Period" of the Wait step directly

View solution in original post

13 REPLIES 13

I can't think of a way without using a lot of bot events and even then you couldn't trigger it exactly 2 hours prior to the event, that would need 24*60 events

In your automation triggered by the row add event, include a Wait step with an expression that calculates the duration from the time of the row add to the time when you want the notification sent.

Tried first with a wait condition and it doesn't work. The same expression I use in a slice to show the bombs two hours before the race. I don't understand why the notification is sent right away.

[PT] are EST Timezone

 

 

 

yastaaa_0-1662562304506.png

 

Don’t use “wait for a condition”. If nothing triggers the expression to reevaluate, then there’s no changed condition to detect. instead use “wait until a time” and for the time create an expression that results in the time you want the notification sent. For example, something like: (start time - now) + now

Ok. I understand. This is not like a Programmed Logic Controller that every 0.5 seconds is checking the condition. The condition is checked once.

 

I think the condition is probably checked anytime the data it references (e.g., [_THISROW].[PT], [_THISROW].[Date]) is updated. Again, if nothing triggers recalculation of the row that it references, then the Wait condition expression has no updated data to reference.

This is the only way I found to express 10 min. In a wait time. 😲 Complicated. 

Is the only wait to express a duration is with an arithmetic operation +- of times?

yastaaa_0-1662610076781.png

 

Raw Duration values in expressions should have at least three digits in the hours position:

"000:10:00"


@dbaum wrote:

instead use “wait until a time” and for the time create an expression that results in the time you want the notification sent. For example, something like: (start time - now) + now


As I imagine you already realized, I should have said to use Wait for a period of time with an expression like (start time - now). Sorry if I confused you!

Thanks. It was clear for the first time.

I did this. I added a column to the table [DTAdded] that registers when the record is added, with a formula for the initial value NOW().

Then I added a virtual column [WaitPT]

yastaaa_2-1662731125265.png

 

And this is the expression in the Wait of the automation.

yastaaa_1-1662730959760.png

The second condition of the IF expression is when I add the record in the period of two hours before the race. I established a wait time of 5 min because I have realized that if the notification is sent right away, the LINKTOVIEW can show a blank because works faster the notification than the record add.

I am testing this but I am confused about the subtraction of 2 hours. If it has to be like this @Steve .

yastaaa_4-1662731784786.png

 

@Steve wrote:

Raw Duration values in expressions should have at least three digits in the hours position:

"000:10:00"

 

 

 

IMO the usage of an VC with AppFormula to provide the wait duration could be a problem.
Please use the expression inside the "Period" of the Wait step directly


@dbaum wrote:

include a Wait step


I was thinking something along these lines as well.

I've got an app that I built to help me keep track of all the details for my Friday live stream, and in that I've included some alerts to help keep me moving along in the script.  For each segment, I can push a button to "start" that segment, which then kicks off an automation to wait for the amount of time I estimated this segment to take; when that time expires, AND the segment is still active, then a push notification is sent to me telling me to wrap things up.

----------------------------------------------------------------------------------

As @dbaum hinted at, you'll need some actual interaction from a person to kick off your automation.

As @SkrOYC pointed out, if you wanted to go the scheduled route (where you wouldn't need any interaction from a person), you'd need to create a bunch of automation elements to make things work.

Based on these platform restrictions, for me it's easier to go the route of pushing a button to kick something off.

This has the added benefit of allowing me to create the records ahead of time, giving me the chance to finalize things before they go out; then when I'm ready, I can push the "go" button and start things off.

Thanks, @dbaum @SkrOYC @Steve 

Top Labels in this Space