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 / Flow to create email w...
Power Automate
Answered

Flow to create email with HTML Table with user name and all SharePoint records from today.

(0) ShareShare
ReportReport
Posted on by 20
Hi,

I have 2 tables:
 
1. 'List of Users' - currently 30 app users our of 50 who should be considered in the daily email
2. 'Main List' - List with user name, date, category (A or B), project number
 
1 and 2 has the same values in "user name" column, so i would like to get this connected for later (I assume it will be needed).

Every weekday the email report should be created with 30 small tables (for each user from list 1, even if no records today) to see what each person did. So, it should be like:

Hi mr manager, its your daily report:
User 1:
<table with category, project number, date>
User 2:
<table with category, project number, date>
User 3:
<table with category, project number, date>
etc.

How this can be achieved?
Categories:
I have the same question (0)
  • Suggested answer
    David_MA Profile Picture
    14,485 Super User 2026 Season 1 on at

    You can do this:

    Get Items (Users Table)

    • Use a Get items action to retrieve all users. The exact table depends on your data source 

    Union Expression for Unique Users

    • Use a union() expression to remove duplicates. This works because union() removes duplicates when the same array is passed twice.
    • Example: union(body('Get_items'), body('Get_items') 

    Apply to Each (Loop Through Unique Users)

    • Loop through each unique user.
    • Inside the loop, use another Get items action with a Filter Query to get data relevant to the current user.
    • Example Filter Query (for SharePoint): UserName eq 'currentUserName' 

    Select Action to Shape Data

    • Use Select to format the data into a simplified array of objects (e.g., columns like Date, Task, Status).
    • This helps prepare the data for the HTML table 

    Convert to HTML Table

    • Use Create HTML Table to convert the selected data into a readable format for e-mail.

    Send E-mail to Current User

    • Use Send an e-mail (V2) action.
    • Set the recipient to the current user in the loop.
    • Include the HTML table in the body.
  • Scott_itD Profile Picture
    Community Manager on at
    Thanks for posting @David_MA, we appreciate your desire to help the Community!
     
    I think your reply might be an AI-assisted post, but I do not see any tools or sources cited. Can you update the post to include your sources, or confirm this was not produced using AI?
     
    Please refer to the Use AI responsibly section of Writing effective responses in the community:
     
    Do not
     
    • Copy and paste AI-generated answers into the forum without verification. While AI is a valuable tool, it is not always correct, and can provide detailed answers that look correct, but are not.
    • Conceal the use of AI. If your answer was written in concert with AI, be forthright about it to ensure that others have an opportunity to review or vet your response for accuracy.
     
    Thank you!
     
  • David_MA Profile Picture
    14,485 Super User 2026 Season 1 on at
    Thank you @Scott_itD. I wrote the response below. I use this method many times for generating reports. It is a straightforward approach for creating a weekly report from a SharePoint list.
     
  • Scott_itD Profile Picture
    Community Manager on at
    Appreciated @David_MA thanks!
  • Chriddle Profile Picture
    8,689 Super User 2026 Season 1 on at
    David's answer might be AI-generated, but it's still a working approach.
    This is the first time I've written something like this in the context of Power Automate🤣
    General rule: If it works, it's probably not AI (alone).
     
    If you're having trouble implementing the concept, I recommend providing more information about the structure of the two lists.
    Then our help can be more specific.
  • CU19121404-0 Profile Picture
    20 on at
    @chriddle 

    The main table is "SQL Timesheet Data" (but in reality it’s also a SharePoint list) with columns such as "Date", "User", "Category", "Project Number"; and the list of users is "EmployeeList" with columns such as "Title" which is the user name. Thank you
     
  • Chriddle Profile Picture
    8,689 Super User 2026 Season 1 on at
    How are these lists connected? If the "Main list" already contains the user, why the "List of Users"? Does it have the email column?
     
    Can I assume that the lists looks like this?
     
    SQL Timesheet Data
    [
      {
        "Date": "2025-08-15",
        "User": "Smith, Jim",
        "Category": "Development",
        "Project Number": "PN-00123"
      },
      {
        "Date": "2025-08-14",
        "User": "Smith, Jim",
        "Category": "Testing",
        "Project Number": "PN-00124"
      },
      {
        "Date": "2025-08-13",
        "User": "Miller, Jane",
        "Category": "Support",
        "Project Number": "PN-00125"
      }
    ]
    EmployeeList
    [
      {
        "Name": "Smith, Jim",
        "Email": "j.smith@example.com@example.com"
      },
      {
        "Name": "Miller, Jane",
        "Email": "j.miller@example.com"
      }
    ]
     
  • Verified answer
    Chriddle Profile Picture
    8,689 Super User 2026 Season 1 on at
    This flow creates the HTML tables for each User:
    Select-Users
    From: @{outputs('Compose-Timesheet_')}
    Map: @{outputs('Compose-Timesheet_')}
     
    Apply to each
    @{union(body('Select-Users'), json('[]'))}
     
    Filter array-Timesheet
    From: @outputs('Compose-Timesheet')
    @item().User is equal to @items('Apply_to_each')
     
    Create HTML table
    From: @{body('Filter_array-Timesheet')}
     
    Filter array-Employee
    From: @outputs('Compose-EmployeeList')
    @item().Name  is equal to @items('Apply_to_each')
     
     
    You get these two HTML tables:
     
    As a last action within the "Apply to each" add a "Send an Email" action:
    To: @{first(body('Filter array-Employee')).Email}
    Body: @{body('Create_HTML_table')}
  • CU19121404-0 Profile Picture
    20 on at
    @Chriddle how this approach may work when you have to type in emails and stuff manually?
  • Chriddle Profile Picture
    8,689 Super User 2026 Season 1 on at
    Of course, the Compose is just a mock,
    Replace it with the body of a Get items (and change the references to it in the expressions)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 976

#2
Valantis Profile Picture

Valantis 863

#3
Haque Profile Picture

Haque 547

Last 30 days Overall leaderboard