Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Suggested answer

Filter array not working

(0) ShareShare
ReportReport
Posted on by 341
Hello - looking for some assistance with a flow I'm building.
 
I have a timeout set on the start and wait for approval, as i need the response within 7 days, so i auto move the flow forward. I need a copy of all the response and also info on who has not responded.
 
So, I have this filter array
 
from: @body('Start_and_wait_for_an_approval_1')['body']['responses']
condition: @item()?['responder']?['email'] is equal to @items('Apply_to_each')?['email']
 
I then have this compose action
 
concat(
  'System Owner: ', items('Apply_to_each')?['name'], '<br>',
  'Response Date: ', if(empty(first(body('Filter_array'))?['responseDate']), 'BLANK', formatDateTime(first(body('Filter_array'))?['responseDate'], 'dd/MM/yyyy')), '<br>',
  'Response: ', if(empty(first(body('Filter_array'))?['approverResponse']), 'USER FAILED TO RESPOND', first(body('Filter_array'))?['approverResponse']), '<br><br>',
  variables('AllResponses')
)

Essentially I need to check that if an email is in the items('Apply_to_each')?['email'] BUT IS NOT in the item()?['responder']?['email'], then I still need their information in the concat i.e items('Apply_to_each')?['name'] however the responsedate and response should say BLANK as there is no match found.
 
I'm getting an error on the filter array because there is no response found, however that's the point! I'm assuming i may need to change the compose action also?
 
"The 'from' property value in the 'query' action inputs is of type 'Null'. The value must be an array."
 
 
 
  • Suggested answer
    Michael E. Gernaey Profile Picture
    42,661 Super User 2025 Season 1 on at
    Filter array not working
    Hi @Jap11
     
    @Robu1 is super close to how I would do it, but based on your requirement I would do this slightly differently.
     
    1. create an array that will hold all response details regardless of if they are there or not, but initialize it with headers
    2. Loop through your user responses, and see if the response exists
     
    If it does then populate the array with all the information
    If it does NOT then populate it, but leave the 2 columns blank
     
    This way, you can then use a Create Table on the Array, and create a nice looking Table, that you can email etc.
  • Suggested answer
    Robu1 Profile Picture
    1,254 Super User 2025 Season 1 on at
    Filter array not working
    Hi  ,
     
    Thank your for choosing Power Platform Community.
     
    Instead of filtering based on responses, you can ensure your flow properly accounts for cases where no responses exist.
     
    Here’s an alternative way to structure your flow:
    Initialize a variable: Create an array variable, e.g., MissingResponses, to store users who didn't respond.
    Modify the filter logic: Instead of filtering on responses, loop through Apply_to_each and check if the email exists in the response list. If it doesn't, append it to MissingResponses.
    Adjust your compose action: Modify your logic to include both responses and missing users:
     
     
    If this fixes the issue, please mark as resolved to help others with find it.
     
    Happy to help 
    Robu1
    SuperUser| Moderator
     

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Automate - Building Flows

#1
David_MA Profile Picture

David_MA 385 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 330

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 330 Super User 2025 Season 1

Overall leaderboard