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 / Creating Nested (2D) A...
Power Automate
Unanswered

Creating Nested (2D) Array for Graph API Call

(0) ShareShare
ReportReport
Posted on by 4

Hello All,

 

I'm working on an automation where I'm trying to write some data back to an Excel sheet with Graph.

 

I initially collect my data and parse the json without issue:

TomD_0-1628003418625.png

The next bit is where it all falls are, my final graph POST; it accepts the following:
values Json A 2-dimensional array of unformatted values of the table rows (boolean or string or number).

something like:

 

 

{
 "values": [
 ["MyData1"],
 ["MyData2"]
 ]
}

 

 

 

My problem is building an object to match this post call. I have to iterate over each item returned from the initial API call to access 'displayName'

TomD_1-1628003777009.png

If I try to write this value to an array object I get the following error when saving:

 

 

Flow save failed with code 'WorkflowRunActionInputsInvalidProperty' and message 'The inputs of workflow run action 'Append_to_array_variable' of type 'AppendToArrayVariable' are not valid. The provided value of '[ "@{items('Apply_to_each')?['displayName']}" ]' of type 'Array' must be a primitive type, or a valid template language expression.'.

 

 

This proves difficult as when I make my call I was trying to pass this Nested array:

TomD_2-1628003991732.png

I tried to build a string variable as another alternative - which worked until I made the post call as once it was entered and sent it ended up escaping the quotation marks and failing the post:

TomD_3-1628004308032.png

Does anyone know how I can iterate over my values returned from my initial json parse in and build an object required by the API?

 

 

{
 "values": [
 ["MyData1"],
 ["MyData2"]
 ]
}​

 

 

 

Thank you everyone!

Categories:
I have the same question (0)
  • JanWidmer Profile Picture
    8 on at

    Hey @TomD

     

    I've faced the same problem. I wanted to include an array into the API Call.

     

    What I had to do, was to use a String instead of an array. So in your foreach loop you take the exact part that has to go into the API Call, and append it to a String. Don't forget to include all brackets and other characters.

     

    In my case:

    JanWidmer_0-1660738617452.png

     

    And in the API Call you add the String into the Call:

    JanWidmer_2-1660738873678.png

     

     

    I hope this helps you or anyone else, who has a similar problem.

     

     

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard