cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
devgianart
Helper I
Helper I

HELP! How do I convert an arrays into rows

I have an array variable that stores contents as follows:

[
     ["Colum1", "Column2", "Colum3"], ["A", "B", "C"], ["D", "E", F"]
]

 

How do I convert this into a usable HTML table with a column header of  the first array?

 

The result would look like the following:

devgianart_0-1623236442570.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User
Super User

Like this:

2021-06-09_12-08-08.png

Somewhat difficult to explain, so I copied the actions in to a scope for you:

{"id":"b36d4ce8-5aaf-4abb-977b-31bf-a7ac4850","brandColor":"#8C3900","connectionReferences":{},"connectorDisplayName":"Control","icon":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDMyIDMyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KIDxwYXRoIGQ9Im0wIDBoMzJ2MzJoLTMyeiIgZmlsbD0iIzhDMzkwMCIvPg0KIDxwYXRoIGQ9Im04IDEwaDE2djEyaC0xNnptMTUgMTF2LTEwaC0xNHYxMHptLTItOHY2aC0xMHYtNnptLTEgNXYtNGgtOHY0eiIgZmlsbD0iI2ZmZiIvPg0KPC9zdmc+DQo=","isTrigger":false,"operationName":"Scope","operationDefinition":{"type":"Scope","actions":{"ArrayOfArrays":{"type":"Compose","inputs":[["Colum1","Column2","Colum3"],["A","B","C"],["D","E","F"]],"runAfter":{}},"Select":{"type":"Select","inputs":{"from":"@skip(outputs('ArrayOfArrays'),1)","select":{"@{outputs('ArrayOfArrays')[0][0]}":"@item()[0]","@{outputs('ArrayOfArrays')[0][1]}":"@item()[1]","@{outputs('ArrayOfArrays')[0][2]}":"@item()[2]"}},"runAfter":{"ArrayOfArrays":["Succeeded"]}}},"runAfter":{}}}

Just copy the code above, then go into a new flow, add a new action, go to "My Clipboard". Press CTRL-V and then you will see the scope appear. You will then see how I reformatted it.

View solution in original post

4 REPLIES 4
Paulie78
Super User
Super User

Like this:

2021-06-09_12-08-08.png

Somewhat difficult to explain, so I copied the actions in to a scope for you:

{"id":"b36d4ce8-5aaf-4abb-977b-31bf-a7ac4850","brandColor":"#8C3900","connectionReferences":{},"connectorDisplayName":"Control","icon":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDMyIDMyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KIDxwYXRoIGQ9Im0wIDBoMzJ2MzJoLTMyeiIgZmlsbD0iIzhDMzkwMCIvPg0KIDxwYXRoIGQ9Im04IDEwaDE2djEyaC0xNnptMTUgMTF2LTEwaC0xNHYxMHptLTItOHY2aC0xMHYtNnptLTEgNXYtNGgtOHY0eiIgZmlsbD0iI2ZmZiIvPg0KPC9zdmc+DQo=","isTrigger":false,"operationName":"Scope","operationDefinition":{"type":"Scope","actions":{"ArrayOfArrays":{"type":"Compose","inputs":[["Colum1","Column2","Colum3"],["A","B","C"],["D","E","F"]],"runAfter":{}},"Select":{"type":"Select","inputs":{"from":"@skip(outputs('ArrayOfArrays'),1)","select":{"@{outputs('ArrayOfArrays')[0][0]}":"@item()[0]","@{outputs('ArrayOfArrays')[0][1]}":"@item()[1]","@{outputs('ArrayOfArrays')[0][2]}":"@item()[2]"}},"runAfter":{"ArrayOfArrays":["Succeeded"]}}},"runAfter":{}}}

Just copy the code above, then go into a new flow, add a new action, go to "My Clipboard". Press CTRL-V and then you will see the scope appear. You will then see how I reformatted it.

Thanks sir @Paulie78  you nailed it. I thought I'm having fever figuring out how to do this

Items have morethan 3 what function we have to use insted of item()[0]/[1]/[2]

 

Please help me to get Name, EMPID, Date and Attendc related values in power automateScreenshot (56).png

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (1,956)