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 Automate
Unanswered

undefined

(0) ShareShare
ReportReport
Posted on by 17

I'm having a hard time with the "filter array" step after retriving SharePoint items.  Without the filter, all items are returned. But when I try to filter, it returns nothing.  The output of the filter step is just an empty array []

 

I'm not sure what I'm doing wrong. My goal is to have a filter like this.

Items with a "Status" field equal to "Pending", and then any items where the user that initated the flow is in any of the fields "Assigned To", "RVP", or "TSM".  My filter step looks like this:

 

@and(
 equals(item()?['Status'], 'Pending'),
 or(
 equals(item()?['Assigned_x0020_To'], triggerOutputs()['headers']['x-ms-user-name-encoded']),
 equals(item()?['RVP'],triggerOutputs()['headers']['x-ms-user-name-encoded']),
 equals(item()?['TSM'], triggerOutputs()['headers']['x-ms-user-name-encoded'])
 )
)

When this didn't work, I tried simply 

@equals(item()?['Status'], 'Pending')

but that didn't work either. It always returns no items.

I've also tried defining it using the UI instead of advanced:

 

status.png

 

The field is named "Saved Status" but the true internal name of the field is just "Status".  I also notice that the Flow UI lists both "Save Status" and "Save Status Value" as possible field choices for the left side of the filter step, but neither works.  I definitely verified that there are items in the list with the Pending status.

 

My end goal is to have a button flow that lets a user receive an email with the list items relevant to them in the email body.

Categories:
I have the same question (0)
  • ScottShearer Profile Picture
    25,329 Most Valuable Professional on at

    @CmdrKeene 

    I obviously don't know your situation, but is there a reason that you didn't use an OData filter in your Get Items action?  That will likely eliminate the need to do any other filtering as well as making your Flow faster.

     

     

  • CmdrKeene Profile Picture
    17 on at

    Excellent question and point, I totally agree.  Although I think that becomes a new question of how to achieve my filter in OData, I wasn't finding success in trying to craft my particular and/or filters in there.  But using "Status eq 'Pending" in the OData filter worked, so that's a good sign.  I'm going to dig deeper into the documenation on that front now.

  • CmdrKeene Profile Picture
    17 on at

    My initial test met failure, trying to filter to Status=Pending and AssignedTo=(user who started flow).  I'm assuming I need to use SharePoint's intial field name here "Assigned_x0020_To" here.  But this resulted in an error 400, The expression \"Status eq 'Pending' AND Assigned_x0020_To eq Shawn Keene\" is not valid.

     

    filter.png

  • ScottShearer Profile Picture
    25,329 Most Valuable Professional on at

    @CmdrKeene 

    Glad to hear it.

    On thing to note when using OData filters with SharePoint - Flow usually uses the internal column names in the OData filters.  So, it you have columns with spaces and in some other circumstances, then you'll need to find out how Flow references the column.

    An easy way to see how Flow refers to a column is to use a Get Items action with no filter, run the Flow and then look at the output.  Refer to the columns in the same way as they appear in the output.

     

    Finally, here a a blog post on using OData filters with SharePoint in Flow.

     

     

     

     

     

     

  • ScottShearer Profile Picture
    25,329 Most Valuable Professional on at

    @CmdrKeene 

    If assigned to is a person or group column, then there are some special rules which are explained here.

    If you use the email address instead, I suspect that AssignedTo/Email is likely the correct syntax.

     

    Also, you can't assume that Assigned to will be referred to with the _x0020_ - use my earlier suggestion and look at the ouput of Get Items on a successful run.

     

     

  • CmdrKeene Profile Picture
    17 on at

    I was really getting hopeful but I'm losing that hope.  I've tried just about everything I've found or can think of.

    Since I couldn't get the OData filter to work, at this point I resigned to using OData filter for the base query (just get pending items, which returns ~ 50 records), then I figured I'd use a secondary filter step to limit those to only ones where the user launching the flow appeared in any of the 3 fields they could be in.  But try as I might, that filter option always ends up giving me an empty array.

     

    I wasn't able to find the referenced link on the Doctor Flow blog that was mentioned in that other thread.

     

    I was able to determine a few things:

    1. Retreiving all items and looking at the output, I did see the field referenced as Assigned_x0020_To, which itself is an array of other properties like DisplayName and Email.
    2. Setting a filter action to be something like AssignedTo Email contains "Smith" correctly identifies records that are assigned to a user with an email of "TSmith@...", but I observed it is case-sensitive.  If I use the variable of triggerOutputs()['headers']['x--ms-user-email-encoded'] (aka "email of user that triggered flow"), that value itself is lowercase and doesn't match so causes the filter to return an empty array.  That might be possible to fix if I could find the correct syntax to convert the sharepoint assignedTo email to a lowercase string.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 293 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 186 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 144 Super User 2026 Season 2

Last 30 days Overall leaderboard