How to schedule in Power Automate Desktop WITHOUT Power Automate Cloud or Premium license)
HTML-код
- Опубликовано: 24 окт 2024
- Please watch this ONE Step Hack first. It's much simpler: • One STEP hack to sched...
Power Automate Desktop - Scheduler Hack - How to "Hack" PAD to Schedule workflows using Javascript.
Special thanks to Gozz Gozzilla for highlighting the bug in my code for Run Javascript 2 (within the loop). Please see below for the correct codes.
How to schedule in Power Automate Desktop WITHOUT Power Automate Cloud or Premium license)
Please help me to help other people just like you by subscribing to my channel and like the video if you think it's helpful.
You can donate to support my channel here (No refunds):- www.paypal.me/...
Run Javascript 1
var StartDateTime = new Date(%UserInput%).getTime();
var CurrentDateTime = new Date().getTime();
var Value_StartDateTime = new Number(StartDateTime);
var Value_CurrentDateTime = new Number (CurrentDateTime);
var WaitTime = (Value_StartDateTime - Value_CurrentDateTime)/1000;
WScript.echo(WaitTime);
Run Javascript 2 (within the loop)
var StartDateTime = new Date(%UserInput%).getTime();
var CurrentDateTime = new Date().getTime();
var Value_StartDateTime = new Number(StartDateTime);
var Value_CurrentDateTime = new Number (CurrentDateTime);
var WaitTime = ((Value_StartDateTime+%LoopIndex%*(24*60*60*1000)) - Value_CurrentDateTime)/1000;
WScript.echo(WaitTime);
There are two hacks available to schedule workflows without any license:-
1) Short way (one step hack): ruclips.net/video/ztHCHQPb1ko/видео.html
2) Long way: ruclips.net/video/FPjBBgIOwZU/видео.html
3) Multiple workflows using timetable in Excel: ruclips.net/video/TpWS9XeL38Q/видео.html
If they help you, please give the video a like and subscribe to the channel. ;)
Please watch this ONE Step Hack first. It's much simpler: ruclips.net/video/ztHCHQPb1ko/видео.html
Special thanks to @Gozz Gozzilla for pointing out a bug in my Javascript 2 (within the loop). Please see corrected code in description.
This channel only have 50 subscribers. If this video helps you, please remember to subscribe so I can help more people. I need to get 1000 subscribers :). Thank you!
You can buy me coffee or tip me here (No refunds):- www.paypal.me/excalteryx
Came here from your reply on my comment on the Power Automate Desktop March 22 Update Blog. All looks good. Liked and subscribed.
I little feedback for you videos, try to have some sort of 1-2 minute "outro" segment because RUclips buts on screen there recommendations for the next video at the end and it obscures the view of what you were trying to show 👍
Thanks for the feedback. Much appreciated! I will do a longer outro. Thanks for staying all the way to the end of the video. Please let me know if you have any further automation issues as generally my viewers give me the best ideas on what video I want to make next. Win win :)
Hi Gareth, if it's helpful for you, I have just created a video for multiple workflows using timetable in Excel: ruclips.net/video/TpWS9XeL38Q/видео.html
WaitTime is not a variable produced for the first javascript but the script is exactly what you have in the description. I see others with the same issue but no fix was documented in the comments
Thanks for the comment and welcome! Are you able to elaborate further what the issue is? Cheers!
This works perfectly fine for me! I tested it to run every minute by changing 24*60*60*1000 to 1*1*60*1000. it works even on lock screen.
but @powerAutomator just wondering if we could run 2nd flow with different loop timing? for eg. 1st one runs Daily, 2nd one runs Weekly. THANKS!
I think logically is possible. Just build your daily loop within a weekly loop then put the weekly task just before the daily loop
Sorry but it seems it's not scheduled, it's delayed... you can also create a subflow using the "wait" snippets already built in the application, so no need for an external script for waiting time...
Maybe you will like this one better ruclips.net/video/ztHCHQPb1ko/видео.html
Or this one ruclips.net/video/TpWS9XeL38Q/видео.html
Thank you for the video. But I have a question; your format of DateTime doesn't run on my computer. Is it really 'Jan 5 17:50 2022'. If I use this format my Flow runs into a fault. Thank you for any answer
Thank you for your support. You might be in a different locale. So try to change the format. docs.oracle.com/cd/E19455-01/806-0169/overview-7/index.html
docs.oracle.com/cd/E19455-01/806-0169/overview-6/index.html
This is working great, thanks!
Is it possible to run for 5 days, pause for 2 days and then run again for 5? So basically run on weekdays and pause on weekends?
Hi mate, thanks for the comment. gearupwindows.com/how-to-show-day-of-week-in-windows-11-10-taskbar-clock/
Add the day in the time on the window task bar then include a If statement in the loop. If screen has Sat or Sun, go to back to beginning of loop somewhere. Have a try. Theoretically is possible. I will try it when I get some time.
Thanks for your quick reply! I’m away next week but will try your suggestions when I’m back
@@PowerAutomator Actually wouldn't creating a new Variable and doing a switch based on that variable work too? Via
1.)Get Current Date and Time
2.) Set Variable WeekdayName {%CurrentDateTime.DayOfWeek%}
3.) Switch on WeekdayName
4.) Case #1 if WeekDayName Contains 'Saturday' (ignore case)
4.a) Stop Flow successfully
5.) Case #2 if WeekDayName Contains 'Saturday' (ignore case)
5.a) Stop Flow successfully
6.) Default Case Action - Catches all other name days (Monday through Friday)
6.a) (Run Main Flow)
Yeah I think will work much better using cases. Thank you for writing those up! Hopefully someone can try it out
@@ethanmcnemar8814 Thanks for this. At what step should I add your variable to the desktop flow?
hi - this tool works perfectly and i sent you a cup of coffee :-)
Thank you but I didn't see the coffee. Lol. Did you use the PayPal link www.paypal.com/paypalme/excalteryx?
@@PowerAutomator yes
Hello, this is great tip for scheduling. But once I schedule my flow to run daily, and turn off my laptop, still this works?
Won't work anymore. The screen cannot be locked too. Screen saver need to be turned off too.
Good job, thanks! Loop and flow can run at background? Otherwise, pc should be kept running and switched on for whole period of the loop and flow?
Yeah pc need to be kept running unfortunately.
Hi Sen Ozk, if it's helpful for you, I have just created a video for multiple workflows using timetable in Excel: ruclips.net/video/TpWS9XeL38Q/видео.html
thank you for sharing
No problem buddy
@PowerAutomator
Hello, thanks for the guide. I recreated it exactly as you described. Unfortunately, it does not jump to the loop after the waiting time has expired. What could be the problem? How can I solve it? I would appreciate your help.
Hi, did you put loop from 1 to 1000?
Great! Thank you very much!
You are welcome Marcus!
Thanks so much . Very helpful video .
Thank you for subscribing! Helps me a lot too. Feel free to let me know if you need me to make other videos to help you
Hi d k, if it's helpful for you, I have just created a video for multiple workflows using timetable in Excel: ruclips.net/video/TpWS9XeL38Q/видео.html
Any idea why I'm getting the following error message? "Parameter 'Text to convert': Variable 'WaitTime' doesn't exist". Perhaps the system datetime format differs on my PC?
Does your Run Javascript has the waittime variable?
Hi Steve, if it's helpful for you, I have just created a video for multiple workflows using timetable in Excel: ruclips.net/video/TpWS9XeL38Q/видео.html
Hi, can we schedule a flow for specific days not daily?
Pls help
You can make power automate desktop to wait for text of the day (I.e. Thu) to appear at bottom right of the screen. You need to set windows up to show the day. www.top-password.com/blog/show-day-of-week-in-windows-10-taskbar-clock/
@@PowerAutomator Thank you
First Thanks for this VDO, it help me a lot. However I got problem after the first loop passed then the second loop always got error said " Timeout values can only be in the range 0 to 2147483 seconds" and the variable WaitTime show -282.826....Could you pls suggest ?
I think you might have keyed in a time that has already passed. Key in a future time. Maybe your month and day got in the reverse order.
@@PowerAutomator in the JavaScript, each loop should I add loopindex to be Value_startDate Time + loopIndex *(24*69*60*1000) - Value_CurrentDateTime)/1000 because Value_StartDateTime should increase 1 day every loop, right?
@@gozzgozzilla1787 wow you are right. My code is buggy. There's a small typo in your code - 69 which should be 60. Also you need to add %LoopIndex%. The code for the line should be like this:
var WaitTime = ((Value_StartDateTime+%LoopIndex%*(24*60*60*1000)) - Value_CurrentDateTime)/1000;
Please let us all know how you go! Cheers mate
@@PowerAutomator After modified Javascript and let it run for several days, everything is ok, working fine now...Thanks
BTW, can we have Power Automate refresh data for Power BI desktop file?
@@gozzgozzilla1787 You are the champion! You are the first subscriber who told me that the process can be run several days non-stop! lol. On your Power BI desktop question, can you have a look at this video first ruclips.net/video/NCQQMkiD668/видео.html Then you can add the steps to ask Power Automate to click on the UI Elements of Home then Refresh button. Let me know if it doesn't work for you.
Variable produced Wait time not show, how to get it, please advise.
You need to output to WaitTime (not "Wait time" with a space) in step 3. Please remember to subscribe. Thank you :)
It works, I just recreated it
The following is not shown in the video
> Variables produced (blue text) Value_WaitTime
Click on the blue text Produced Variables and enter "WaitTime or Value_WaitTime" there, then it works.
How can we apply the same method to run every 1 hour?
Hi Rene, get rid of step 8 and 9. Then in step 10 type in 216000 ( it's an hour in seconds) . Please don't forget to like and subscribe :). Cheers
Hi Rene, if it's helpful for you, I have just created a video for multiple workflows using timetable in Excel: ruclips.net/video/TpWS9XeL38Q/видео.html
How can i make this script run every three minutes by the way ure a genius
Thank you mam. Just use Wait functions 180 seconds. Please remember to subscribe! :)
@@PowerAutomator where exactly do i put the wait function
In between loop, right after the start of a loop, then use the wait function
@@PowerAutomator thank you i have been able to make it work perfectly kudos boss
Wow you are amazing! :)
Does this still work in 2023,
I tried running the code and got the following error
Can't convert text '' into a valid number (text provided is either in a non-recognizable format or contains too many characters).
Microsoft.Flow.RPA.Desktop.Modules.SDK.ActionException: Can't convert text '' into a valid number (text provided is either in a non-recognizable format or contains too many characters).
at Microsoft.Flow.RPA.Desktop.Modules.Text.Actions.ConvertTextToNumberAction.Execute(ActionContext context)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)
can any one help?
It works, I just recreated it
The following is not shown in the video
> Variables produced (blue text) Value_WaitTime
Click on the blue text Produced Variables and enter "WaitTime or Value_WaitTime" there, then it works.