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 / How To Create Dynamic ...
Power Automate
Unanswered

How To Create Dynamic HTML Table from JSON Array Variable Values

(0) ShareShare
ReportReport
Posted on by 15

 

I already have a step in Power Automate which creates a filtered list of JSON values, which will be the unique reports that have been requested for review for this automation. I'm then taking that JSON and setting an array variable ("Non-EmptyReports") with that finalized array, and here's what the raw output of the variable looks like.

{
   "name":"Non-EmptyReports",
   "value":[
      {
         "PBIReport1":"https://app.powerbi.com/groups/group1/reports/report1/ReportSectionf1?experience=power-bi",
         "PBIReport2":"https://app.powerbi.com/groups/group1/reports/report2/ReportSectionf1?experience=power-bi"
      }
   ]
}

I would like to dynamically create a HTML table that can be inserted into a MS Teams Chat and Outlook email with these values. There could be anywhere from 1 - 20 values in this array, so I cannot define a table with a set number of rows within it. I would like to build the table like this based on the JSON from above:

Any help/advice would be greatly appreciated!​

Categories:
I have the same question (0)
  • Cgangweg01 Profile Picture
    727 Super User 2025 Season 2 on at
    Hello swolfe2,
     
    I'm not certain this is the solution you are after, but I did something similar with the output of a filtered array.
     
    Input to the Create HTML table action
     
    Create HTML table action
    Format the HTML table with some styling
     
    Send the formatted table in an email
     
     
  • swolfe2 Profile Picture
    15 on at
    Hey Cgangweg01,
     
    Hmmm, I'm not able to get that solution to work on my end. I think part of it could be related to the JSON array that I have:
    {
       "name":"Non-EmptyReports",
       "value":[
          {
             "PBIReport1":"https://app.powerbi.com/groups/group1/reports/report1/ReportSectionf1?experience=power-bi",
             "PBIReport2":"https://app.powerbi.com/groups/group1/reports/report2/ReportSectionf1?experience=power-bi"
          }
       ]
    }
    
     
     
    I think to get your solution to work, I would need to load each row of this JSON into separate values like:
    {
       "body": [
             {"PBIReportURL":"https://app.powerbi.com/groups/group1/reports/report1/ReportSectionf1?experience=power-bi"},
             {"PBIReportURL":"https://app.powerbi.com/groups/group1/reports/report2/ReportSectionf1?experience=power-bi"}
       ]
    }
    Is there a way to do this without looping through the output?
  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    Cgangweg01 I noticed in your post that the styling you are using for the CSS of your table includes using nth-child in tables tr td th. Does that actually work for you? I didn't think it was supported by Outlook.
  • Cgangweg01 Profile Picture
    727 Super User 2025 Season 2 on at
    Hi -
     
    I really don't know much about the CSS and if it is applying everything it includes. I copied from someone else's solution from a blog post somewhere.
    But it worked, the table is rendered with formatting just as I need with header and one or more rows.
     
    Perhaps a Parse JSON, Compose and Select actions are needed for the other part of your solution.

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard