cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TomD
New Member

Creating Nested (2D) Array for Graph API Call

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!

0 REPLIES 0

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,300)