web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Appending object to ar...
Power Automate
Unanswered

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,865 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,865 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard