Skip to main content

Notifications

Community site session details

Community site session details

Session Id : IGfcqqIwS6kwuJZdu4V8aq
Power Automate - Building Flows
Answered

Appending object to array variable

Like (0) ShareShare
ReportReport
Posted on 15 Feb 2022 10:36:28 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. 

  • Rajath Krishna S Profile Picture
    50 on 12 Jan 2023 at 18:35:52
    Re: Appending object to array variable

    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) 

  • Rajath Krishna S Profile Picture
    50 on 12 Jan 2023 at 17:51:54
    Re: Appending object to array variable

    Ok sure I will do that

  • abm abm Profile Picture
    32,464 Most Valuable Professional on 12 Jan 2023 at 17:50:07
    Re: Appending object to array variable

    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 12 Jan 2023 at 16:45:27
    Re: Appending object to array variable

    This is my Compose action

     

    Rajath_1-1673541903123.png

     

  • Rajath Krishna S Profile Picture
    50 on 12 Jan 2023 at 16:43:17
    Re: Appending object to array variable

    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?

     

     

  • mr-samd Profile Picture
    on 15 Feb 2022 at 13:11:54
    Re: Appending object to array variable

    THANK YOU!

     

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

    But this has completely solved my problem

     

    Cheers

  • Verified answer
    abm abm Profile Picture
    32,464 Most Valuable Professional on 15 Feb 2022 at 11:02:28
    Re: Appending object to array variable

    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

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 51

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 39 Super User 2025 Season 1

#3
CU30040420-0 Profile Picture

CU30040420-0 23

Overall leaderboard