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

Notifications

Announcements

Community site session details

Community site session details

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

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 Super User 2025 Season 2 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,129 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,129 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,436 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard