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 not working
Power Automate
Unanswered

Filter array not working

(0) ShareShare
ReportReport
Posted on by 6
Hi,
From a Sharepoint list of items that have Approvers , want to send a reminded to those users when those items are near or past the due date.
As those list can be quite long, I just want to send one email per person with the list of items for them to review. 
 
My flow get the items, remove duplicate users, format the key data I want to send in the email body.  
For each unique user I want to filter their data. this return a blank array.
 
   
The "output" for "apply to each" is the unique approver  from "Compose - Unique approver" it has 2  records .
The "output" for "Filter Array" is from "Select Items from doc List" it generate the Json as per the next screen shot. 
The filter array in advance more looks like this @equals(item()?['ApproverEmail'], items('Apply_to_each'))
 
------------------------------------------------------------------------------------------
runtime scree shot
 
the Filter Array input is as expected from the "Selected Item Doc List", the output is empty!!
 
 
i have put the "current item" in a compose to see if they was any issues. 
 
I have try to put the Json in a array 1st but I am still hitting the same issue. 
is there way to debug what the filter array is actually doing? 
It feels like there is something wrong with this : @equals(item()?['ApproverEmail'], items('Apply_to_each')) 
 
Thanks in advance for the help. 
Categories:
I have the same question (0)
  • Ellis Karim Profile Picture
    12,175 Super User 2026 Season 1 on at
    Hi @AT-02011332-0​​​​​​​,
     
    Switch the Select mode to Text mode, and you'll get a list of Approver email addresses.
     
    Example:
     
     
    The runtime output of the Select action. It contains all values from the Email Address column.

     
    Ellis Karim
  • AT-02011332-0 Profile Picture
    6 on at
    Hi @Ekarim
    The issue is with the "Filter Array" in the "Apply to each" loop. Not with either of the select before hand. 
    Inside the Filter Array, i have changed the Filer Query from "is equal to" to "contains".
    This generate the error bellow at runtime. 
    InvalidTemplate
    The execution of template action 'Filter_array' failed: The evaluation of 'query' action 'where' expression '@contains(item()?['ApproverEmail'], items('Apply_to_each'))' failed: 'The template language function 'contains' expects parameters of matching types: a dictionary and a key (string), an array and a value (object), or a string and a substring. The provided types 'String' and 'Object' are incompatible. Please see https://aka.ms/logicexpressions#contains for usage details.'.
    It make me think that i am not comparing the right data type, can i convert? is there a way to inspect at runtime?
     
    FYI,
    The 1st Select work as per your reply, 1st give me the list of (duplicate) users, This is why i use the union right after to get a unique user list. 
    The 2nd select takes the Sharepoint raw data to the nicely formatted one. As per the those 2 screenshots. 
     
    My aim is to extract the Json block where "Chris" is the approver. I am trying to get just the 1st block of data for further manipulation
       
  • AT-02011332-0 Profile Picture
    6 on at
     
    Hi @Ekarim
    Your initial Answer fixed the issue, thank you. 
     
    For anyone reading it the "select Get Approver" add extra   :"" 
    the solution from Ekarim  clean it up , enabling the array filter to work. 

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 245

#2
David_MA Profile Picture

David_MA 216 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 212

Last 30 days Overall leaderboard