Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Trying to parse JSON data to Excel in a Flow. Unable to get past the Initialize variable

Hi all,

Here is my challenge.  As I preface every message I submit, I’m new to the PowerPlatform arena and far from a developer in any sense.  So I apologize for the remedial question.  Here is my use case and challenge – Use case:  We are being asked to create an app that can call the YouTube API and return specific information for review.  The challenge I currently having is on the Flow; I’m able to pass the data from the HTTP REST API invocation to a Response.  The issue now is on parsing this data into an Excel table.  I have searched for a method and have been able to derive at:

  • PowerApps trigger
  • HTTPS REST API invoke
  • Response (JSON Schema)
  • Initialize variable (This is where I’m stuck)
  • Apply to each
    • Parse JSON
    • Add rows to Excel

Where I am stuck is passing the data from the Response to the Initialize variable to the Parse JSON.  I’ve been able to directly add Array values directly to the Initialize variable to kind of ‘synthesize’ the process successfully, but I need to be able to these come from the Response above.  If I remove the manually inserted data from the Initialize variable Value area and add Dynamic content from the Body of the HTTP REST API invoke I get an error on test:  The variable 'Data' of type 'Array' cannot be initialized or updated with value ‘ {the json string of data}’ of type 'Object'. The variable 'Data' only supports values of types 'Array'.

Here is the visual details:












Initialize variable error:




Any guidance or advice would be greatly appreciated and thank you in advance

Michael B

Super User
Super User


Sorry I got lost with the purpose of the 'Data' variable

I assume you inspected the outputs from the Youtube API and ensured it provides an array as its response, right?

If so, you should assign this array as 'Apply to each' input

Now, I assume the array has objects as elements, you can just copy one of these elements, then on 'PArse JSON' click on 'Generate for sample' and paste the sample object elment there


But, if you wanna keep this 'Dat variable approach for testing purposes... I would try to initialize a variable of type object, let's call it 'DataObject' assign the single object element you are dealing in your current 'Data' variable, then initialize variable of type array, and use the following WDL expression


Hope this helps

Each time you click on any of our inspiring answers 'Thumb up' icon... ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!

Escribo sobre Power Automate en:

Proud to be a Flownaut!

Thank you for your response @efialttes !

I'm really struggling with this one 😞 - I removed the Initialize Variable, added the object sample to the Parse JSON to have it generate the schema, but now getting the following error at the Parse JSON when testing:

ExpressionEvaluationFailed. The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@body('HTTP')' is of type 'Object'. The result must be a valid array.


Sorry to ask for all the help on this


Current flow after changes:



Helpful resources

Register for a Free Workshop.png

Register for a Free Workshop

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

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (4,703)