Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

How to create multiple HTML tables from one array

Like (0) ShareShare
ReportReport
Posted on 24 May 2023 13:24:20 by 14

Hi!

I'd like to create multiple HTML tables from one array. Let's say that my array looks like below:

 

 

 [
 {
 "User": "AAA",
 "Project": "Project1",
 "TimeSpent": 10
 },
 {
 "User": "AAA",
 "Project": "Project2",
 "TimeSpent": 20
 },
 {
 "User": "AAA",
 "Project": "Project3",
 "TimeSpent": 30
 },
 {
 "User": "BBB",
 "Project": "Project1",
 "TimeSpent": 50
 },
 {
 "User": "BBB",
 "Project": "Project3",
 "TimeSpent": 10
 },
 {
 "User": "CCC",
 "Project": "Project4",
 "TimeSpent": 100
 },
 {
 "User": "CCC",
 "Project": "Project5",
 "TimeSpent": 60
 }
 ]

 

 

 

 

As a result, I'd like to get 3 tables:

UserProjectTimeSpent
AAAProject110
AAAProject220
AAAProject330

 

UserProjectTimeSpent
BBBProject150
BBBProject310

 

UserProjectTimeSpent
CCCProject4100
CCCProject560
  • kamil_k Profile Picture
    14 on 30 May 2023 at 10:55:16
    Re: How to create multiple HTML tables from one array

    Thank you! I was trying something very similar but it didn't work. Your solution works and that's exactly what I was looking for.

  • Verified answer
    v-wenjuan-msft Profile Picture
    Microsoft Employee on 26 May 2023 at 01:53:31
    Re: How to create multiple HTML tables from one array

    Hi @kamil_k ,

     

    Try this:

    union(body('Select'),body('Select'))

    vwenjuanmsft_0-1685065758164.png

    vwenjuanmsft_1-1685065846926.png

    vwenjuanmsft_2-1685065887893.png

     

    Result will be the same as before but this process will be dynamic~

     

    Hope this helps!

     

    Community Support Team _ Wenjuan Zou

    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • kamil_k Profile Picture
    14 on 25 May 2023 at 15:35:09
    Re: How to create multiple HTML tables from one array

    Thanks for your reply! It will work for this particular array but in my scenario, this array may have multiple records (hundreds of users). Any idea how to deal with it? It will be not possible to use this "static" filtering.

  • Verified answer
    v-wenjuan-msft Profile Picture
    Microsoft Employee on 25 May 2023 at 07:00:29
    Re: How to create multiple HTML tables from one array

    Hi @kamil_k ,

     

    I store your array in a variable and make a simple demo:

    vwenjuanmsft_0-1684997404234.png

     

    Use "Filter array" action to retrieve data whose "User" field is AAA, and "Create HTML table" by its output. Repeat these two actions to create HTML table for BBB and CCC.

    Here's how it looks like in a mail:

    vwenjuanmsft_1-1684997545805.png

     

    Hope this helps!

     

    Community Support Team _ Wenjuan Zou

    If this post helps, then please consider Accept it as the solution to help the other members find it.

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,030 Most Valuable Professional

Leaderboard