Using a Timer as a constraint for a Rule or Action

I want an action executed via Automation Command but only if it has been 15 minutes since a Specific Automation Command was last executed.

Is there a way to create a timer when an automation command is executed and then use a constraint for a different automation command so that it only fires the action if the timer has passed 15 minutes.

Example:
I have an Automation Command that executes via a popup at Login (Clock In) I would like for this action to start a timer.

I have another Automation Command that is executed with a Clock Out button is pressed that I only want to execute if the timer that was started from the Clock In command has passed 15 minutes.

I think I already know the answer that it is currently not possible… However if it is not I would love to request an Action that starts a timer and be able to read that timer within rules.

Or even better have it time stamp the first automation command then give a rule the ability to read the recent time stamp of that automation command and execute an action if it has been a certain amount of time that has passed.

Basically I want to write a set of actions/rules that are bound to an automation command button. When the button is pressed it would look to see if a set amount of time has passed since the last time it was executed. If the required time has passed it would execute action A. If the time has not passed it would execute action B.

This is what I use to tag Tickets with Payment Type and Time of Payment, so that I can go days, weeks, or even months back in the past and pull up a Ticket to see how it was Settled. Without these Ticket Tags, I have no way of telling what Type of payment was made. I implemented this since I recently had some disputes on CC charges, and I had nothing to go on other than the day and amount. In the case that a Ticket was Settled in-part by Cash and in-part by CC, I wouldn’t be able to tell if it were not for these Tags.

TL;DR: The pertinent part that I want to point out for your scenario is the Helper function:

[=Helper.GetUniqueString()]

This returns a unique date/time which you can parse using .substr() function:

[=Helper.GetUniqueString().substr(8,2)].[=Helper.GetUniqueString().substr(10,2)].[=Helper.GetUniqueString().substr(12,3)]

The above is really 1 line, and it returns:

09.17.634

If you were to store this in a Program Setting variable, you could use it for comparison purpose to determine if x minutes have passed.

[=Helper.GetUniqueString().substr(8,2)].[=Helper.GetUniqueString().substr(10,2)].[=Helper.GetUniqueString().substr(12,3)] [[:PaymentTypeName]]

Great I will see if I can use this. Basically I plan to use it with the TImeTrex integration and restrict Clock Out to only function if its been atleast 30 minutes since clock in if it has not been then the button will display a popup that says You must wait [time] before you can Clock Out. Obviously [time] is not real but I would like to design it to behave such a way.

I completely forgot about that function. You had already helped me use it to name my reports dynamically. I guess it didn’t dawn on me that I could store it and recall it to compare. Great idea.

1 Like

I will have to study this more to get the full understanding before I can make it do what I want. I understand how to make it store the time When user clocks in. What I am struggling with is how to make the Clock Out rule read that time and then compare it to see if 30 minutes has passed if 30 minutes has not passed it would not execute and it should read exactly how many minutes have passed and trigger a popup to show how many minutes have passed.

My popup message would look something like You must wait [:Time] before you can punch again! Syntax may not be exact but you can see what I am trying to do.

The goal is to restrict the minimum clock in time before they can clock out to 30 minutes. So once clocked in they have to at least work a 30 minute shift.

I think I will wait to pursue this any further. I need to build my knowledge of the syntax before I am confident on attempting this. I can build everything but the comparison. I don’t want you to waste anymore time trying to help me with this I will study it myself.