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 / Append Labeled Array t...
Power Automate
Answered

Append Labeled Array to New Empty Array

(0) ShareShare
ReportReport
Posted on by 1,387 Moderator

I am looping through the array AllSiteEmployees.

Within that loop, I am filtering the array AllChipAwards for the current item in the loop.

This works.

IPC_ahaas_0-1692721559218.png

When a match is found, I want to append the result (body) to a new array AllSiteChipAwards.

When I try to use "Append to Array Variable", it says I cannot append an array to an array.

 

When I try to use "Append to String Variable", it appends, but the resulting data is a mess:

IPC_ahaas_1-1692721989449.png

How can I create an array of these?

 

    "EmployeeName""Jane Doe",
    "EmployeeID""6237M",
    "GrantedBy""Jon Doe",
    "GreenChips""+1",
    "RedChips"null
 
Categories:
I have the same question (0)
  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    Can you show your full flow? I think the logic might need a bit of adjusting.

  • IPC_ahaas Profile Picture
    1,387 Moderator on at

    Basically what I'm trying to do is run a report of all chips given out for a time period, by Site for a given time period. The log of chips given has employee information, but not Site. A separate list has all employee info including Site.

     

    1. Get AllSiteEmployees "EmployeeIDs" and put them in an Array

    IPC_ahaas_1-1692723502781.png

    2. Get AllChipTransactions and use Select the values I want

    IPC_ahaas_2-1692723582097.png

    3. Initialize an empty array AllSiteChipAwards 

    IPC_ahaas_3-1692724317241.png

    4. Loop through the AllSiteEmployees array and for each loop, filter the AllChipAwards array for the current item, then append that result to AllSiteChipAwards

    IPC_ahaas_5-1692724673599.png

    and this is where we're at now. I either can't create the AllSiteChipAwards array or I get a messy string.

     

     

     

     

  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    Are you using a Filter Query in the Get Items action? If not, I'd recommend doing that first. Only returning items from your specified time period. Otherwise you'll be unnecessarily looping through a bunch of items that you don't need to loop through.

  • IPC_ahaas Profile Picture
    1,387 Moderator on at

    Yes, I am using filter query to limit the date range. This has nothing to do with my issue.

  • Verified answer
    IPC_ahaas Profile Picture
    1,387 Moderator on at

    I figured this out on my own. The only way I could move forward was to put the result of the filter in it's own "Apply to Each" and then putting the "Append to Array Variable" inside that.

     

    IPC_ahaas_0-1692735689326.png

     

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard