cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Making a timer

Hello everyone,

I am a Power Automate Desktop User

The desktop version of Automate is really great.
Actually, I want to create a system that would do the work after it's the right time.
Ex - If I want to click on a specific button at 8:40 am, so it would do that and if the time is not 8:40 it should wait, and then another button at 8:55, and so on...
So, I tried to create such a thing with the "DateTime" section with the help of "if" conditionals, but it did not work- even the time was the correct time it did not act.
Please help.

Thanks and Regards.


1 ACCEPTED SOLUTION

Accepted Solutions

Yeah, FormattedDateTime is correct...the 3 is because this is my "Test" workflow where I troubleshoot all my issues here.  I actually messed up in the screenshot below because the time variable is saved to 3, the first one has the 3, and the second one doesn't.  I simply have 3 FormattedDateTime variables in all of the subflows.  That is all.  I can provide more screenshots of the underlying setup:

MichaelAnnis_0-1628782601248.png

 

 

MichaelAnnis_1-1628782618873.png

 

 

MichaelAnnis_2-1628782632432.png

And then, instead of "click UI element", I didn't have anything to do, so I said display message box, and the second my computer clock changed to the right time, the message box came up.

 

Here are my variables (when I ran it just now, changing it to 9:40):

MichaelAnnis_3-1628782852903.png

and it worked.  So just watch your FormattedDateTime and make sure it is showing up how you expect it to.

 

Good luck.

 

 



View solution in original post

19 REPLIES 19
chienhsianghung
Advocate I
Advocate I

Hi @Anonymous ,

 

You should schedule it through the cloud flow to trigger local PAD.

Anonymous
Not applicable

Hello @chienhsianghung 

I did not understand what you are saying.

Anonymous
Not applicable

Please rephrase if you could.
Thanks.

Hi @Anonymous,

 

To trigger desktop flows through Power Automate, you have to use machines or machine groups. As an alternative to the machines, you can use the on-premises data gateway. The gateway is an enterprise-grade secure connection between Power Automate and your device.

 

You can check here.

Anonymous
Not applicable

Hello @chienhsianghung 
Sorry, but it is not helping me find the solution and I feel like it's not what I want, if possible then can you tell me the process to do the thing?

Anonymous
Not applicable

So can you tell me a way to make my query possible just by using the "Power Automate Desktop" only?

Thanks 

MichaelAnnis
Memorable Member
Memorable Member

MichaelAnnis_0-1628692858970.png

If you run this before 8:40, it will loop until 8:40, click the button and then stop.  If you run it between 8:41 and 8:55, it will loop until 8:55, click the button, and then stop.

 

This could be taxing on your computer as it will be consistently running in the background.  Some things you could try:

1)  using Microsoft Flow, it would be a simple "If time is, click the button."  If you link Power Automate with Microsoft Flow, you could have Power Automate set up to click a button, and have Microsoft Flow say, "If time is, run Power Automate."

 

2)  If you really want to just use Power Automate, put some wait times in here.  It only takes about 5 seconds for this whole flow to run, so you could put in a "Wait (50)" before "Go to StartOver", that way it only does about 1 loop per minute instead of 10-12 loops per minute.

 

Best of luck!

Anonymous
Not applicable

Hi @MichaelAnnis 
Thanks for the reply.
But eventually, the program is not working, I coped everything the same(except the time).
Even if it is the right time, it is just looping continuously.

Thanks and Regards.

Odd, it worked like a charm for me, just happened to be 8:39 when I created it and at 8:40, it went through.  When you are running the loop, can you see the time?  What time does the current date/time say.  Also, case matters on "mm".  "MM" is month and "mm" is minutes.  That's all I can think of for now.

Anonymous
Not applicable

No no, I have done it correctly and I knew that.
🤔 Sorry to ask but is it possible for you to record the program while you are making it??

As there is a little difference between my program and your:
In your program, you have taken- %FormattedDateTime3%

But, in my program, I have taken- %FormattedDateTime%

So, what's the 3 for?

Thanks And Regards.

 

Yeah, FormattedDateTime is correct...the 3 is because this is my "Test" workflow where I troubleshoot all my issues here.  I actually messed up in the screenshot below because the time variable is saved to 3, the first one has the 3, and the second one doesn't.  I simply have 3 FormattedDateTime variables in all of the subflows.  That is all.  I can provide more screenshots of the underlying setup:

MichaelAnnis_0-1628782601248.png

 

 

MichaelAnnis_1-1628782618873.png

 

 

MichaelAnnis_2-1628782632432.png

And then, instead of "click UI element", I didn't have anything to do, so I said display message box, and the second my computer clock changed to the right time, the message box came up.

 

Here are my variables (when I ran it just now, changing it to 9:40):

MichaelAnnis_3-1628782852903.png

and it worked.  So just watch your FormattedDateTime and make sure it is showing up how you expect it to.

 

Good luck.

 

 



View solution in original post

Anonymous
Not applicable

Hi @MichaelAnnis 
Thank you so much!

The problem was with me, instead of selecting, "%FormattedDateTime%"
I was selecting, "CurrentDateTime" 😅Sorry for that.

And thanks!

Anonymous
Not applicable

Hello again,
The problem is solved but I wanted to ask that how do I mention "AM" and "PM" in the program?
As here you can see it is night/pm now-

Lightning_125_0-1628784809975.png

So, if I will do it in the morning, will it not bother AM or PM?
Note: I use 12 Hrs Clock format

Thanks

It will do it both times.  Better to use capital HHs to secure a 24-hour time frame so it only runs when you want to:

MichaelAnnis_0-1628789091512.png

 

MichaelAnnis_1-1628789127319.png

 

Anonymous
Not applicable

Hi there,
But I use a 12-hour clock format and if I mention there hours, it will ultimately not work.
So, is there any other way?
Or I will have to change my format to 24 hrs clock?
Or maybe I can only run it in the morning?

Thanks

Look at the screenshot you first sent. The current datetime is 23:38, but when you set it to hh:mm, it changed it to 09:38. All I am saying is to make the “convert to text” HH:mm, so that your trigger can differentiate between 09:38 and 21:38. If you still need hh:mm for another variable, you can create that as a separate output, but for the purpose of this trigger, I recommend 24 hour format (HH:mm) so there is no confusion. 

Anonymous
Not applicable

Hello @MichaelAnnis,
Thanks for replying.
Actually, I wanted to ask that, for the day we take "dd" for a month we take
"mm" so I wanted to ask that whats the keyword is for days of the week? like, "Monday, Tuesday, etc.."


Thanks and Regards

Make sure you use MM for the month. Lowercase “mm” is for minutes. 
I’m not sure on the day of the week. 

Anonymous
Not applicable

Oh ok,
Thanks

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,812)