← Al Davies, 250 High Street

How to use Filter array in Power Automate

Add a Filter array action, put your list in From, and set a condition on item(). The output keeps only the rows that match, and you loop over that output instead of the full list.

What does the Filter array action do?

Filter array takes a list of items and returns a smaller list. It keeps each item where your condition is true. It does not change the source list.

Use it after an action such as Get items or List rows present in a table. It filters the rows already in the flow, so it does not reduce the size of the first request. If the first action returns too few rows, see our guide on Get items returning only 100 rows.

How do you add Filter array to a flow?

  1. Select New step, then search for Filter array under Data Operation.
  2. In From, select the dynamic content that holds your list, such as value from Get items.
  3. Select the left box of the condition and choose a field from the dynamic content.
  4. Pick an operator, such as is equal to or contains.
  5. Type or choose the value to compare.
  6. Use the Body of the Filter array action in later steps, such as Apply to each.

How do you write the condition in advanced mode?

Select Edit in advanced mode to type one expression. Inside Filter array, item() means the row being tested. For example, @contains(item()?['Department'], 'IT') keeps rows where Department includes IT.

The contains test is case-sensitive, so match the capital letters exactly. Wrap both sides in toLower() when the case may differ.

To test two things, use and() or or(). For more patterns, see our guide on Condition field is empty.

How do you filter for empty or blank values?

Use empty() on the field. The expression @empty(item()?['Notes']) keeps rows where Notes has no value. Add not() around it to keep rows that have a value.

SharePoint columns can come back as null, not as an empty string. If empty() does not match, test the field with equals(item()?['Notes'], null) and compare the results on a sample run.

How do you check if Filter array found nothing?

Add a Condition after Filter array. Use the expression length(body('Filter_array')) is greater than 0. If the length is 0, no row matched.

Do not compare the body to an empty string. The body is a list, so it is never a string. The action name in the expression must match the name of your step, with underscores in place of spaces.

Why does Filter array return an empty list?

  1. The case does not match. Check capital letters in the value.
  2. The field name is wrong. Dynamic content for choice and person columns sits one level deeper, such as item()?['Status']?['Value'].
  3. The From box holds a single item, not a list.
  4. The value has extra spaces or a hidden line break. Wrap it in trim().
  5. An earlier action returned no rows. Open the run history and check the Get items output. See run history for how long it is kept.

Should you use Filter array or a filter query?

Use a filter query in Get items when you can. SharePoint then sends back only the matching rows, and the flow runs less data. See our guide on Get items filter query not working.

Use Filter array when the test cannot run in the query, when you need several different slices of one list, or when the data does not come from SharePoint. If you want a fixed-price build for your own flow, see how approval flows are priced.

FAQ

Does Filter array change the original list?

No. It returns a new, smaller list and leaves the source as it was.

How do I count the rows Filter array kept?

Use length(body('Filter_array')). Match the name to your step, with underscores for spaces.

Sources