web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / filter array if item i...
Power Automate
Answered

filter array if item is empty OR " "

(0) ShareShare
ReportReport
Posted on by 75
I am looking to do a filter array in my power automate flow to remove empty list items.  The problem I am running into is this: the flow is not recognizing " " as being empty: 
Before Filter Array: 
 
After Filter Array:
 
Expression that I am using for the filter array is this: 
 
My question is how do I write a Filter Array expression to filter out empty OR " " items?  I'm trying a number of different things and nothing is working.  Any guidance would be much appreciated.  Thanks!
Categories:
I have the same question (0)
  • Building with Why Profile Picture
    351 Moderator on at
    Your current expression filters out empty, but string(' ') is not an empty value.
     
    Have you tried equals(item(), string(' '))?
     
    If so what other options have you tried?  If not and that expression works, please mark my reply as answered.
  • JD-03091828-0 Profile Picture
    75 on at
    Thank you for the suggestion.  How would I combine these statements to check for both empty AND " "?  It is possible that in my flow, both situations may arise.  Thank you!
  • Suggested answer
    chiaraalina Profile Picture
    1,851 Super User 2026 Season 1 on at
    Hi 
     
    Please try this: @and(not(empty(item())), not(equals(item(), ' ')))
     
  • JD-03091828-0 Profile Picture
    75 on at
    Thank you for the suggestion!  When I entered this formula into the Filter Array: 
    I received the following error: 
  • chiaraalina Profile Picture
    1,851 Super User 2026 Season 1 on at
    Hi
     
    Is this error related to the Filter array step?
     
    Can you screenshot the steps before the filtering?
  • Verified answer
    Chriddle Profile Picture
    8,672 Super User 2026 Season 1 on at
    Use function trim() to remove whitespace before check if empty:
    empty(trim(item()))
    is equal to
     
    false
     
  • JD-03091828-0 Profile Picture
    75 on at
    This worked beautifully - thank you!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 557

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 264 Super User 2026 Season 1

Last 30 days Overall leaderboard