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 / Appending object to ar...
Power Automate
Answered

Appending object to array variable

(0) ShareShare
ReportReport
Posted on by

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

mrsamd_3-1644921070714.png

 

Pending: 

mrsamd_2-1644921030414.png

Overdue: same as pending but different select function. 

 

I then append these to a variable.

mrsamd_0-1644920872701.png

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. 

Categories:
I have the same question (0)
  • Verified answer
    abm abm Profile Picture
    32,985 Most Valuable Professional on at

    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

  • mr-samd Profile Picture
    on at

    THANK YOU!

     

    I knew there was a simple solution. I couldnt find this ANYWHERE online. 

    But this has completely solved my problem

     

    Cheers

  • Rajath Krishna S Profile Picture
    50 on at

    Hi @abm ,

    I used the same method here as you suggested but I'm getting output in E-mail like this.

    Rajath_0-1673541776614.png

    Can you please help?

     

     

  • Rajath Krishna S Profile Picture
    50 on at

    This is my Compose action

     

    Rajath_1-1673541903123.png

     

  • abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Hi @Rajath 

     

    Could you please create a new thread and post a screenshot of your flow? The below solution is different to yours.

     

    Thanks

  • Rajath Krishna S Profile Picture
    50 on at

    Ok sure I will do that

  • Rajath Krishna S Profile Picture
    50 on at

    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) 

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 784

#2
Valantis Profile Picture

Valantis 581

#3
Haque Profile Picture

Haque 545

Last 30 days Overall leaderboard