cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MrNguyen
Helper I
Helper I

Appending to API Array [Array cannot be appended to Array]

Hi guys!

I have a concept here that should, in theory, work without hiccups. The base idea is to get a result from Power BI REST API and append them together and eventually create a CSV file to be stored. 

 

1. Get query results from API

2. Append to an array for all items within loop

3. Continue loop until max iterations have exceeded.

4. Once done, create a CSV file (not shown)

 

In my current flow, I'm having a BadRequest issue where I'm unable to append two or more results together within a loop. Here is a screenshot of my current flow
flow-sample-base-layout.png 

 

Within my "Execute A DAX Query: the following sample result is displayed:

flow-sample-return-01.png

 

I need everything after the nested rows array, and so within my "DrillDown To Results" the following expression is used within a compose:
flow-sample-drilldown.png

With a sample expected result of:
flow-sample-result-02.png

 

Everything is peachy so far, but when I attempt to append the results I'm receiving this error:
flow-sample-error-02.png

 

Is there something obvious that I'm missing? I want to avoid using a PARSE JSON step because the output will be shared and the fields may be different between different executions.

 

EDIT: Here is a sample flow with a sample input if anyone wants to test.

flow-sample-debug-layout.png

 

[
  {
    "SampleTable[Value]": 1,
    "SampleTable[Random]": 1412,
    "[@id]": 3
  },
  {
    "SampleTable[Value]": 10,
    "SampleTable[Random]": 943,
    "[@id]": 1
  },
  {
    "SampleTable[Value]": 11,
    "SampleTable[Random]": 1171,
    "[@id]": 2
  },
  {
    "SampleTable[Value]": 12,
    "SampleTable[Random]": 1478,
    "[@id]": 4
  },
  {
    "SampleTable[Value]": 13,
    "SampleTable[Random]": 1613,
    "[@id]": 5
  }
]

 

1 ACCEPTED SOLUTION

Accepted Solutions
MrNguyen
Helper I
Helper I

Turns out I figured out a solution. Not sure if it's efficient but to get it working I needed another apply to each to go through each record and append one by one

 

flow-sample-solution.png

View solution in original post

1 REPLY 1
MrNguyen
Helper I
Helper I

Turns out I figured out a solution. Not sure if it's efficient but to get it working I needed another apply to each to go through each record and append one by one

 

flow-sample-solution.png

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,635)