cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cnorris135
Helper IV
Helper IV

Do Until multiple conditions

Ive been struggling on a Do Until multiple condition although i think im close... can someone help me here?  Im not sure a Do Until piece can handle it.... i dont know....

This will be a OR situation....  the Options are 

Approved
Rejected
Done

how do i write this to use OR?  I got the Approved one but after that, how can i add an OR for Rejected and .Done.  And yes it is all on the same field Approval_Status


@equals(body('Update_item_5')?['Approval_Status'], 'Approved ')

1 ACCEPTED SOLUTION

Accepted Solutions
ScottShearer
Super User
Super User

@cnorris135 

First, be sure to click on Change limits in your condition.  A do until defaults to timing out after the lesser of 60 loops or 1 hour - you can change that if you click on change limits.  Also, remember that no Flow can run for more than 30 days.

Also, you'll need to requery the SharePoint list item inside of your loop to see if the value has changed.  The values received from the trigger are static.  The only way to know if a column value has changed is to use a Get item action inside of your loop.

I suggest initializing a variable before your loop - probably a boolean variable initialized to false.  Set your loop to run until the variable is true.  After your Get item action, use a standard condition with with multiple conditions set up in an OR fashion.  If the condition is met, set the variable to true.

Also, you'll want to add a delay action somewhere inside of the loop.

MultiCondx.jpg

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

3 REPLIES 3
VictorIvanidze
Community Champion
Community Champion

Something like this:

@or(or(equals(body('Update_item_5')?['Approval_Status'], 'Approved '),equals(body('Update_item_5')?['Approval_Status'], 'Rejected ')),equals(body('Update_item_5')?['Approval_Status'], 'Done'))

 

 

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.
ScottShearer
Super User
Super User

@cnorris135 

First, be sure to click on Change limits in your condition.  A do until defaults to timing out after the lesser of 60 loops or 1 hour - you can change that if you click on change limits.  Also, remember that no Flow can run for more than 30 days.

Also, you'll need to requery the SharePoint list item inside of your loop to see if the value has changed.  The values received from the trigger are static.  The only way to know if a column value has changed is to use a Get item action inside of your loop.

I suggest initializing a variable before your loop - probably a boolean variable initialized to false.  Set your loop to run until the variable is true.  After your Get item action, use a standard condition with with multiple conditions set up in an OR fashion.  If the condition is met, set the variable to true.

Also, you'll want to add a delay action somewhere inside of the loop.

MultiCondx.jpg

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
alrez
Community Support
Community Support

Hi,

 

Scott has made some excellent suggestions here. I would recommend trying those out for now and letting us know if you have any additional questions. I also wanted to add in our documentation on Flow limits.

 

https://docs.microsoft.com/en-us/power-automate/limits-and-config

 

Regards,

 

Alex

 

-------

 

Community Support Team _ Alex Rezac
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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
Users online (6,425)