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 / Convert An Array Into ...
Power Automate
Suggested Answer

Convert An Array Into A Matrix

(0) ShareShare
ReportReport
Posted on by 2
Hey guys I have a little issue which I can't wrap my head around and can't seem to find any sources online to assist me.
I want to create a bus timetable which will be automatically populated in a word template. 

My Current Array:

[
  {
    "Bus No": "434",
    "Station": "FRATTON",
    "Start Time": "23:38"
  },
  {
    "Bus No": "434",
    "Station": "PSEA",
    "Start Time": "23:43"
  },
  {
    "Bus No": "435",
    "Station": "PHBR",
    "Start Time": "06:33"
  },
  {
    "Bus No": "435",
    "Station": "PSEA",
    "Start Time": "06:40"
  },
  {
    "Bus No": "435",
    "Station": "FRATTON",
    "Start Time": "06:45"
  }
]

My Desired Output As A HTML Table:

                               
434                     435
FRATTON                23:38                   
PSEA                       23:43                    
PHBR                                                06:33
PSEA                                                 06:40
FRATTON                                          06:45


One of the biggest issues I'm having is understanding what this HTML table would look like as an array and whether it is actually possible. With the flow there will be an unknow number of bus numbers and an unknown number of stations so the solution must be dynamic. Any help at all is greatly appreciated.
Categories:
I have the same question (0)
  • Suggested answer
    Mark Nanneman Profile Picture
    993 Moderator on at
    There is a create HTML table action that will make a simple HTML template from an array.
     
    You can set it to automatically use the column/property names from your array as headers, or map your own.
     
     
     
    If you're end goal is to populate a word template, you can do that with a table, some text content controls and a repeating content control.
     
     

    Create a table in your word template

    Make sure you have the developer tab added to your word ribbon.

    Add plain text content controls for each value/column in your array.  Click on properties and name each one appropriately.  It's also smart to type in some sort of placeholder that lets you know what data is supposed to go in the column.

     
     

    Select the whole row of placeholder values

    Add a repeating section content control

    Name the repeating section control "row" or something

     

    Upload your word template to sharepoint

    Add "Populate a Microsoft Word Template" action to your flow


    Click the button to check the array view of your template's repeating section to see the schema

    all you have to do is make your array have the same schema then you can dump it straight into the word template action. 
    You can update your array to match the word template schema with a Select action or just make sure that your content controls in the template are named the same way as your array is already.
     
     
    Just put the final correctly formatted array into the populate a word template action.  After that you need to save the file or email it.
     
    If this helped you, please click "Does this answer your question" and give it a like to help others in the community and close the ticket
    Power Platform Developer | LinkedIn: Mark Nanneman | Blog: Power Stuff  | YouTube: Mark's Power Stuff 

     
     
  • AA-05021610-0 Profile Picture
    2 on at
    Unfortunately not Mark,

    The solution provided would simply list the array into a html table, where each array of objects represents a new row - this is not the output I'm after. I need each unique bus number to form the columns, the station names to form the rows and the values within the matrix to be the arrival times.



    This is essentially the output I need in Microsoft Word - Really appreciate the help though.

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