In this Power Automate Filter Array tutorial, you will learn what a filter array data operation action is and how to use the filter array to filter your array collections efficiently.
Power Automate Filter Array Examples
In this section, we will understand the filter array in Power Automate with examples.
What is Power Automate Filter Array?
Filter Array is an action in Power Automate (formerly known as Microsoft Flow) that allows you to filter an array or a collection of items based on a specified condition. The action takes an array as input, applies a filter query to it, and returns a new array containing only the items that match the condition specified in the filter.
To use the Filter Array action, you need to specify the input array and the filter query. The filter query is a Boolean expression that evaluates each item in the array and returns true or false based on whether the item matches the specified condition.
The Filter Array action is useful when you need to work with specific items in an array, such as retrieving all items that meet certain criteria or removing items that do not meet specific conditions. By using Filter Array, you can streamline your workflows and automate repetitive tasks, such as processing data from different sources or filtering through large datasets to find specific information.
Examples: Power Automate Filter Array
Here are some examples of using the Filter Array action in Power Automate:
Power Automate Filter array with greater than expression
Suppose you have an array of objects, each with a “Name” and “Age” property, and you want to filter out all objects where the age is less than 18. You can use the Filter Array action to achieve this. Here’s how:
- Initialize an array of objects with “Name” and “Age” properties, for example:

[ { "Name": "John", "Age": 25 }, { "Name": "Mary", "Age": 17 }, { "Name": "Bob", "Age": 21 }, { "Name": "Sue", "Age": 16 } ]
2. Add the Filter Array action to your flow.
3. Set the From property to the array of objects you initialized in step 1.

4. In the Filter Query field, enter the following expression:
@greater(item()?['Age'], 18)
5. The output of the Filter Array action will be an array containing only the objects with an age greater than or equal to 18:
[ { "Name": "John", "Age": 25 }, { "Name": "Bob", "Age": 21 } ]

Power Automate Filter array with greater than equal to expression
To get all people whose age is greater than or equal to 18, use the below expression:
@greaterOrEquals(item()?['Age'],18)
Power Automate Filter array with less than expression
To get all people whose age is less than 18, use the below expression:
@less(item()?['Age'],18)
Power Automate Filter array with less than equal to expression
To get all people whose age is less than or equal to 18, use the below expression:
@lessOrEquals(item()?['Age'],18)
Power Automate Filter array with contain expression
To get all people whose name contains letter ‘M’, use the below expression:
@contains(item()?['Name'], 'M')

Output: Power Automate Filter Array Output

Power Automate Filter array with AND and equals expression
To get all people whose department name is sales and age is 30, use the below expression:
@and(equals(item().Department, 'Sales'),equals(item().Age, 30))

Output: Power Automate Filter Array Output

Power Automate Filter Array Multiple conditions (with AND OR expression)
To get all people whose department is IT and whose age is 25 or all people from any department whose age is 21, use the below expression:
@or(and(equals(item().Department, 'IT'),equals(item().Age, 25)),equals(item().Age, 21))

Output: Power Automate Filter Array Output

Power Automate Filter array with Empty() equals expression
Let’s say we have an array of numbers from 1 to 8, and the eighth one is the empty string. We want to filter all numbers that are not empty.
Number Array example:
[ "1", "2", "3", "4", "5", "6", "7", "" ]
To filter all numbers that are not empty, use the below expression:
@equals(empty(item()),false)

Output:

Filter Array With SharePoint List Items
Let’s say you have big data in a SharePoint list or document library where thousands of items are stored. And you want to Get Items OData filter query. Here in the OData filter query, we don’t have the leverage to pass all columns, so we can get all items using the Get Items pagination feature, and we can further refine the list items by the columns that we need in the filter array data operation action. This will improve the efficiency and speed of the execution of the query.
This is the Get Items action, which used to get all items from the SharePoint list.

Filter arrays with SharePoint list items: This is the filter array configuration for SharePoint list items from the above Get Items output. Here, we are filtering the Get-Items query output with the country list column, where we are getting all items where country is equal to Australia.

Now, if we click on the “edit in advanced mode” link, we can see the expression of mode this filter query.

Note:
- In the above, “filed_1” is the internal name of the country column.
- In all the examples above, we have used the “Edit in Advanced Mode” feature of the filter array action. In fact, we must use the “Edit in advanced mode” feature for the query expression.
- For the Power Automate conditional trigger, we should use the filter array expression in advanced mode, then we can pass the expression to the trigger condition. This way, we can avoid the expression syntax error in the Power Automate conditional trigger.
Power Automate Filter Array: various conditional statements (expressions)
There are varieties of conditional statements (expressions) in the Power Automate Filter Array, such as:
- contains
- does not contain
- is equal to
- is not equal to
- is greater than
- is greater than or equal to
- is less than
- is less than or equal to
- start with
- does not start with
- ends with
- does not end with

We can see that using the above conditional statements or expressions, we can handle any type of business scenario to compare two strings.
Power automate get length of filter array
To get the length of the filter array output result, use the below expression in the compose data operation action:
Syntax:
length(body('Your_Filter_Array_Name'))
Example:
@{lenght(body(‘Filter_array_with_SharePoint_List_Items’))}

Output:

Note:
- With the output of Filter Array, we can create a very nice-looking HTML table in Power Automate.
Summary: Filter Array Power Automate
Thus, in this article, we have learned about how to work with Power Automate Filter Array expression.
This article provides step-by-step instructions, screenshots, and explanations to help users understand how to use the Filter Array action in Power Automate. It also includes some examples of common scenarios where the Filter Array action can be useful, such as filtering SharePoint lists or Excel spreadsheets.
To conclude this article, the Power Automate Filter Array article is a helpful resource for anyone looking to learn more about using this feature in their Power Automate flow automation.
See Also: Other Power Automate Tutorials
You may also look into the below Power Automate Tutorials:
- SharePoint Button to Trigger Power Automate Flow: Boost Your Productivity
- Trigger Power Automate for a Selected Item in SharePoint Online to Boost Your Productivity
- ChatGPT and Power Automate: Boost Your Power Automate Productivity with ChatGPT Integration
- Top 3 best ways get all files in a folder Power Automate
- Send Email Attachments with Power Automate: Simplify Your Process
- oData filter query power automate: Best way to filter file by name
- 2 Best way to check null or empty in Power Automate
- Power Automate Filter using From and To Date: Filter SharePoint list by date range Power Automate
- Power Automate flow get items filter query by content type in SharePoint online document library – 3 ways
- Instantly using Power Automate create CSV file and send email attachment
- Why Power Automate Trigger Conditions are Crucial for Effective Automation (30 Examples)
- Take care of what’s important. Automate the rest.
Are you preparing for a SharePoint job interview?
You can refer to these exclusive interview questions and answers that will help you get into your high-paying dream job:
- 50+ Tricky SharePoint Online Interview Questions and How to Answer Them
- Top 50 Tricky Power Apps interview questions and answers for experienced – Part 2
- 50 Tricky Power Automate Interview Questions and How to Answer Them
- Top 50+ Power Apps interview questions and answers for experienced – Part 1
Buy SharePoint Online eBook
Buy the premium version of SharePoint Online & Office 365 administration eBook from here:
If you would like to appreciate our efforts, please like our post and share it with your colleagues and friends. You may join the email list; it won’t spam you; it’s just notifications of new posts coming in, nothing else. 🙂