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 / Filtering an Array help
Power Automate
Unanswered

Filtering an Array help

(0) ShareShare
ReportReport
Posted on by 71

Hello,

 

I have an array that structured as a list of dictionaries (that act as rows)  and I am trying to use the Filter array such that it will only grab elements (rows) where the key (column) equals certain value. Any ideas?

 

Background: Creating a flow to send email to individuals with records that they are assigned to. Ultimately would later create an HTML table from the filtered array to be placed in the email. 

 

Below is the Code View of the filter array (Distinct_Email is a value):

{
  "type": "Query",
  "inputs": {
    "from": "@outputs('Compose_ListOfRecords')",
    "where": "@equals(outputs('Compose_ListOfRecords')?['[Email Column]'] outputs('Distinct_Email'))"
 
 
  }
}
 
EDIT:
I have included a screenshot of the flow (at the top there's another run query action for Hire Anniversaries).
  1. It query two datasets from a PBI report, one for the distinct managers (Mgers) and another for their employees whose birthday is coming up (EE_Birthday) & whose hire anniversary (EE_HireAnni) is coming up. So a total of 3 different queries 
  2. For each distinct manager, I want to filter the dataset such that manager email field in the EE_HireAnni matches with the distinct manager's email (and I want to do the same for EE_Birthday). 
    1. Compose grabs current item, and Compose 1 grabs the value (manager's email) - wonder if that can be condense into 1 action.
  3. Then I would like turn each results into a HTML table that I can put both in the same email (two separate tables) and then email to that manager
Categories:
I have the same question (0)
  • v-yetonggu-msft Profile Picture
    on at

    Hi @cferv_77 ,

    Could you please post a screenshot of your complete flow configuration?

    The more information you provide, the better I can help you solve your problem.

     

    Best Regards,

    Sunshine Gu

  • Verified answer
    cferv_77 Profile Picture
    71 on at

    @v-yetonggu-msft 

     

    Hello, thank you for your reply. In my original post, I have included a screenshot of the flow and additional details of what I am trying to do. 

     

    Update:

    I have been able to get far with the help of these links:

    https://powerusers.microsoft.com/t5/Building-Flows/Test-for-Empty-Array/td-p/177356 
    https://powerusers.microsoft.com/t5/Building-Flows/filter-array/td-p/2376385 
    https://www.youtube.com/watch?v=s-0aRnl7BTg

    It involved creating another Compose action (Compose 1) to extract just the value: @outputs('Compose')?['[Email]']

     

    But my new problem is "Create the HTML table" action. I tried into wrapped the output in <table> and Power Automate keeps moving the variable out, messing up with the HTML structure. Personally, I do not understand why the Create HTML table action does not come with borders by default. I tried deleting and redoing the action but the problem persists. And I noticed this problem happens on new flows too. Any ideas?

     

    EDIT: 

    This video helped with that as well. Why is HTML body messed up in Power Automate send email v2 ? - YouTube

     

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