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

Community site session details

Session Id :
Power Automate - Building Flows
Suggested answer

HOW TO GET DATA FROM FILTER_ARRAY AND FEED IT TO EMAILS

(0) ShareShare
ReportReport
Posted on by 2
Hello everyone.
 
I am working on a simple flow where I have this google sheets with employee data and their date of birthdays (DOB). This gets fetched into power automate and then im using filter array to filter only those rows where dates matches current date.
 
it could match just one row, zero row or multiple rows.
 
The flow works fine till here, but I am unable to figure out how to send an email against each filtered row. I have tried using for each loop, but it kind of gets stuck and goes on forever.
 
Any help would be appreciated.
I have the same question (0)
  • Suggested answer
    SpongYe Profile Picture
    5,603 Super User 2025 Season 2 on at
    HOW TO GET DATA FROM FILTER_ARRAY AND FEED IT TO EMAILS
    Hi, 
     
    Here’s a simplified example of how the flow should look:
     
    1. Trigger: Recurrence (e.g., daily at a specific time)
    2. Get rows: Fetch data from Google Sheets
    3. Filter array: Filter rows where date of birthdays (DOB) equals current date
    4. Apply to each: Loop through filtered rows
    In the loop: Send an email: Send an email to each employee whose birthday is today
     
    If the loop is getting stuck, it might be due to an infinite loop please check the filter condition if it gives the expected results.
  • CU18122126-0 Profile Picture
    2 on at
    HOW TO GET DATA FROM FILTER_ARRAY AND FEED IT TO EMAILS
    Hey SpongYe, thanks for your reply.
     
    I am successfully retrieving below output from filter_array, but I think I am struggling with extracting individual Email address from below, which I need to feed to the action of *email TO*.
     
    Below could be more than one results, or just one, depending on how many birthdays fall on same day.
     
    Below is dummy data just for practice.

    case1, just 1 birthday on a day.
     
    [
      {
        "@odata.etag""",
        "ItemInternalId""952201a9fd1d44778727fc075defb620",
        "Employee_x0020_ID""E02002",
        "Full_x0020_Name""Kai Le",
        "Job_x0020_Title""Controls Engineer",
        "Department""Engineering",
        "Business_x0020_Unit""Manufacturing",
        "Gender""Male",
        "Ethnicity""Asian",
        "DOB""12/19/2024",
        "Age""47",
        "Hire_x0020_Date""2/5/2022",
        "Annual_x0020_Salary""$92,368",
        "Bonus_x0020__x0025_""0%",
        "Country""United States",
        "City""Columbus",
        "Exit_x0020_Date""",
        "Email""TheDataCorner5@proton.me",
        "__PowerAppsId__""952201a9fd1d44778727fc075defb620,2"
      }
    ]

    Case 2, two birthdays on same day.
     
    [
      {
        "@odata.etag""",
        "ItemInternalId""952201a9fd1d44778727fc075defb620",
        "Employee_x0020_ID""E02002",
        "Full_x0020_Name""Kai Le",
        "Job_x0020_Title""Controls Engineer",
        "Department""Engineering",
        "Business_x0020_Unit""Manufacturing",
        "Gender""Male",
        "Ethnicity""Asian",
        "DOB""12/19/2024",
        "Age""47",
        "Hire_x0020_Date""2/5/2022",
        "Annual_x0020_Salary""$92,368",
        "Bonus_x0020__x0025_""0%",
        "Country""United States",
        "City""Columbus",
        "Exit_x0020_Date""",
        "Email""TheDataCorner5@proton.me",
        "__PowerAppsId__""952201a9fd1d44778727fc075defb620,2"
      },
      {
        "@odata.etag""",
        "ItemInternalId""2fed53697d2d46c2844d5e0e211ea453",
        "Employee_x0020_ID""E02003",
        "Full_x0020_Name""Robert Patel",
        "Job_x0020_Title""Analyst",
        "Department""Sales",
        "Business_x0020_Unit""Corporate",
        "Gender""Male",
        "Ethnicity""Asian",
        "DOB""12/19/2024",
        "Age""58",
        "Hire_x0020_Date""10/23/2013",
        "Annual_x0020_Salary""$45,703",
        "Bonus_x0020__x0025_""0%",
        "Country""United States",
        "City""Chicago",
        "Exit_x0020_Date""",
        "Email""TheDataCorner5@proton.me",
        "__PowerAppsId__""2fed53697d2d46c2844d5e0e211ea453,3"
      }
    ]
  • Chriddle Profile Picture
    8,343 Super User 2025 Season 2 on at
    HOW TO GET DATA FROM FILTER_ARRAY AND FEED IT TO EMAILS
    Typically, you use the "Create HTML table" action with the filtered array and insert its text into the email body.

    To get the desired email recipients, use a "Select" with the filtered array, map each item to item()['Email'].
    Then make them unique  and join the result with a semicolon: join(union(body('Select'), json('[]') ), ';')

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 614 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 401 Moderator

#3
chiaraalina Profile Picture

chiaraalina 282

Last 30 days Overall leaderboard