Why you should use filter instead of condition in Power Automate
Posted On September 6, 2020
Does your Power Automate flow use condition to process all the items instead of a filter to get only the relevant ones?
Does it take very long for the flow to finish?
It could be any Power Automate flow that should process only small amount of the items in your list or library. Some reminder sending flow, or archiving flow. You get all items in a list and then use a condition to decide if the item should be processed or not.
The flow is probably working fine (even if it’s taking a while to finish). Until you realize that it’s not really doing what you expect. You open the flow run history to find the problem, and you see this:
…hundreds, maybe even thousands of items entering the condition. You wanted to process only 5 or 10 or 20 out of these, all the others end in the If no branch. How do you find the ones that fit the condition? Unless you really enjoy clicking your mouse, you won’t.
But you don’t have to, if you reduce the number of processed items via Filter Query in the Get items / Get files action. For example, you can filter only items with today’s deadline.
…and instead of hundreds of items to loop through, you’ll get only the relevant ones. Minutes of runtime will be reduced to seconds. You’ll save a ton of mouse clicks (and time) during testing and debugging.