cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Zdahn
Helper I
Helper I

Make Loop every minute

Hi,

 

I'm doing data gathering every minute so I'm doing loop in my flow but I don't know how. So if anyone have done loop time interval please do share with me.

 

Thanks.

2 ACCEPTED SOLUTIONS

Accepted Solutions

What I hear as your problem is:

 

if the flow takes 20 seconds, I only need a 40 second wait time….if the flow takes 10 seconds, I need a 50 second wait time, etc.

 

in order to achieve this, I would:

Loop

    Get  urgent date time to %StartTime%
    Add 1 minute to %StartTime% to get %NextTime%
    ‘Perform 1 Loop’s actions here

    Loop While 1= 1

        Get current datetime to %CheckTime%
        If %CheckTime% is > %NextTime%
            Exit (Loop)

        End(If)

    End (Loop)

End(Loop)

 

this will loop through checking what time it is and move onto the next loop when the CurrentDateTime is exactly 1 mins past the previous start time.

View solution in original post

Glad you got it figured out. I thought there was an Add DateTime function that is just a number parameter and then a drop down for interval (days, months, hours, minutes, etc).  

always good new to hear it works. Best of luck in your future flows.

View solution in original post

14 REPLIES 14
Rhiassuring
Super User
Super User

Every minute, forever?

You could have a scheduled flow run every minute, instead, by using the schedule trigger.


Otherwise, in a loop, you would put in a delay at the top of it.

 

Rhiassuring_0-1669433427254.png

 

 

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



VJR
Super User
Super User

Hi @Zdahn

In a nutshell you will have to use a combination of "Wait" and any of the "Loop" actions.

If that does not suffice, please share more details of what you are looking for and what do you intend to do.

 

 

Hi @Rhiassuring, PS: this is Desktop Flows forum 😉

 

 

 

 

momlo
Impactful Individual
Impactful Individual

Yeah, as @VJR wrote - you would need to give some context. Otherwise, we can only advice using the "wait" action.

 

What are you waiting for in that loop?

Is this some information that popups in the web or GUI app? If yes -try to use dedicated actions such as: wait for a text, wait for window, wait for element, wait for image to appear/disappear etc.

 

In general i avoid using pure "wait" as this affects performance vs if i can wait for specific element/text/image 

 

The WEB that I'm working is https://www.tradingview.com/chart/?symbol=BITSTAMP%3AXRPUSD showing a minute interval countdown for every closing price. I'm supposed to use wait for an element, unfortunately no popups in web that 1 minute time already lapsed or closing interval. In addition, that countdown display stays as it is and it can't pick an element,

Zdahn_0-1669542581614.png

I think it's a canvass.

 

So my plan actually is to use another clock apps in windows but you will have to automate to reset in a loop which will turn out to exceed 1 minute and may not sync with the WEB's interval countdown.

 

Any assistance would be very much appreciated.

 

Thanks

Zdahn.

momlo
Impactful Individual
Impactful Individual

Use their API  😎 instead of automating interface 

https://www.tradingview.com/rest-api-spec/

What I hear as your problem is:

 

if the flow takes 20 seconds, I only need a 40 second wait time….if the flow takes 10 seconds, I need a 50 second wait time, etc.

 

in order to achieve this, I would:

Loop

    Get  urgent date time to %StartTime%
    Add 1 minute to %StartTime% to get %NextTime%
    ‘Perform 1 Loop’s actions here

    Loop While 1= 1

        Get current datetime to %CheckTime%
        If %CheckTime% is > %NextTime%
            Exit (Loop)

        End(If)

    End (Loop)

End(Loop)

 

this will loop through checking what time it is and move onto the next loop when the CurrentDateTime is exactly 1 mins past the previous start time.

That I don't know how. I'll look in to it. Thanks for advise

momlo
Impactful Individual
Impactful Individual

@Zdahn 

Just an idea, I've noticed the two values on the screenshot are spyable, so maybe use those?

 

  1. In the loop:  Work with 2 variables: "OldPrice" and "CurrentPrice"
    1. Assign "OldPrice" = "CurerntPrice"
    2. Grab new value to "CurrentPrice"
    3. If "OldPrice" does not equal "CurrentPrice" --> call/do any logic you want to execute on the price value
    4. wait for 1s 

 

Or, as mentioned earlier, avoid using fixed wait: Grab the new price, do logic, and wait until the price disappears in a loop

 

  1. Grab the current price to "CurrentPrice"
  2. Do any logic you want to do on the price change
  3. Wait until the price changes - you can use something like waiting for the text to disappear from the web page
  4.  

 

 

 

momlo_2-1669567004884.png

 

 

How do you add a minute to %StartTime% ?

How do you add a minute to %StartTime% ?

Hey MichaelAnnis,

 

You're awesome, It did work !!! We finally created auto-repeat interval. Check if I did it right and if any improvement that I need to do in this flow please let me know..

Zdahn_0-1669626669442.png

Again thanks.

 

Zdahn

 

I still have to add another condition within the loop. This is to resolve issue if %StartTime .minute% = 0.

Zdahn_0-1669637769406.png

 

Glad you got it figured out. I thought there was an Add DateTime function that is just a number parameter and then a drop down for interval (days, months, hours, minutes, etc).  

always good new to hear it works. Best of luck in your future flows.

Zdahn
Helper I
Helper I

Sharing with you final revision.

 

Loop still did not exit if Start time minute gets to zero(0) eventually makes %NewTime% as 1. So here's the final version I did and tested already.

 

Zdahn_0-1669705192142.png

Thanks.

 

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,396)