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.
Hi @abm
I have created a new thread and posted the question, please look into it.
Link: Send email using append an array from SharePoint l... - Power Platform Community (microsoft.com)
Ok sure I will do that
Hi @Rajath
Could you please create a new thread and post a screenshot of your flow? The below solution is different to yours.
Thanks
This is my Compose action
Hi @abm ,
I used the same method here as you suggested but I'm getting output in E-mail like this.
Can you please help?
THANK YOU!
I knew there was a simple solution. I couldnt find this ANYWHERE online.
But this has completely solved my problem
Cheers
Hi @mr-samd
Try the below
Before the append to array step add a compose action step and add the below without the square brackets.
{
"Department":"YourDynamicColumn",
"Pending":"YourDynamicColumn",
"Overdue":"YourDynamicColumn"
}
Next Append to array variable map the output of the compose
Thanks
stampcoin
51
Michael E. Gernaey
39
Super User 2025 Season 1
CU30040420-0
23