Hi,
I am creating a flow to collect the count of pending and overdue reports for each department. I have successfully made a flow to get these numbers in an 'apply to each' department action. To get this outside the apply to each I am appending the results to an array variable with the intention of creating a HTML table to send in an email.
What i am having trouble with is how to properly append to the array to get it to work with the HTML table. below is what I currently have.
Department: items('Apply_to_each')['Department'] - From a select function getting unique departments

Pending:

Overdue: same as pending but different select function.
I then append these to a variable.

This gives the following output:
[
"[\n{\n “Department” : “Department 1”,\n “Pending” : “12”,\n “Overdue” : “14”,\n }\n]",
"[\n{\n “Department” : “Department 2”,\n “Pending” : “0”,\n “Overdue” : “18”,\n }\n]",
"[\n{\n “Department” : “Department 3”,\n “Pending” : “5”,\n “Overdue” : “1”,\n }\n]",
"[\n{\n “Department” : “Department 4”,\n “Pending” : “4”,\n “Overdue” : “4”,\n }\n]",
"[\n{\n “Department” : “Department 5”,\n “Pending” : “6”,\n “Overdue” : “0”,\n }\n]",
"[\n{\n “Department” : “Department 6”,\n “Pending” : “3”,\n “Overdue” : “0”,\n }\n]"
]
If i try and create a HTML table it gives an error:
The property 'columns' must be specified unless the 'from' property value is an array of objects.
I think this is because im not correctly appending my data to the variable but im not sure how to fix it.
Any help is greatly appreciated.