web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to Parse Output of...
Power Automate
Unanswered

How to Parse Output of SharePoint Batch request in Power Automate?

(0) ShareShare
ReportReport
Posted on by

Hi Folks,

 

I'm using "Send an http request to SharePoint" action to send a batch API request clubbing multiple GET queries. The number of get queries can vary each time. I used multiple select action to convert the response data into below format:

 

[
 [
 {
 "Employee": {
 "EMail": "useremail@gmail.com",
 "Title": "username"
 },
 "Id": 6,
 "Title": "Test Title",
 "ID": 6
 },
 {
 "Employee": {
 "EMail": "useremail@gmail.com",
 "Title": "username"
 },
 "Id": 111,
 "Title": "Initiative",
 "ID": 111
 }
 ],
 [
 {
 "Employee": {
 "EMail": "useremail@gmail.com",
 "Title": "username"
 },
 "Id": 103,
 "Title": "Testpro321",
 "ID": 103
 },
 {
 "Employee": {
 "EMail": "useremail@gmail.com",
 "Title": "username"
 },
 "Id": 107,
 "Title": "Test project",
 "ID": 107
 }
 ]
]

As you can see it's an array of arrays. I'm trying to combine all child arrays (In the above scenario 2 child arrays) in to a single array. How can I achieve this without using apply to each action. Please note that number of child arrays can vary.

 

Any suggestions?

 

Thanks you. 

 

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @rbn_nue ,

     

    How can I achieve this without using apply to each action. Please note that number of child arrays can vary.

     

    No, I'm afraid it is necessary to use 'apply to each action' , especially the number of subarrays is uncertain.

     

    Best Regards,
    Bof

  • rbn_nue Profile Picture
    on at

    Hi @v-bofeng-msft 

     

    Thanks for the response. What if I say we can know how many subarrays there will be in advance, but the number can vary each time? Any suggestions?

     

    Thanks. 

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @rbn_nue ,

     

    You could try something like:

    union(body('Send an http request to SharePoint')[0],body('Send an http request to SharePoint')[1],,body('Send an http request to SharePoint')[2])

     

    Best Regards,

    Bof

  • rbn_nue Profile Picture
    on at

    Hi @v-bofeng-msft 

     

    Thanks for the suggestion. I'm trying to carry out the union with its parameters filled out dynamically. I managed to get the below output without hardcoding, inside a compose action:

     

    outputs('Send_an_HTTP_request_to_SharePoint')?['body']?['$multipart'][0]?['body']?['$applicationHttp']?['body']?['value'],outputs('Send_an_HTTP_request_to_SharePoint')?['body']?['$multipart'][1]?['body']?['$applicationHttp']?['body']?['value'],outputs('Send_an_HTTP_request_to_SharePoint')?['body']?['$multipart'][2]?['body']?['$applicationHttp']?['body']?['value'],outputs('Send_an_HTTP_request_to_SharePoint')?['body']?['$multipart'][3]?['body']?['$applicationHttp']?['body']?['value'],outputs('Send_an_HTTP_request_to_SharePoint')?['body']?['$multipart'][4]?['body']?['$applicationHttp']?['body']?['value']

     

    rbn_nue_0-1684908655931.png

    Now I'm trying to use this output as parameter of Union() function but it's throwing error:

     

    rbn_nue_1-1684908866250.png

     

    rbn_nue_2-1684908907575.png

     

    It seems Power Automate is treating the parameter as a single string and not converting it to the array values it holds. How can I resolve it to array values from SharePoint and use union? If I copy the output I pasted in the above section and put it directly in a union expression it works.

     

    Any suggestions?

     

    Thanks.

     

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @rbn_nue ,

     

    How can I resolve it to array values from SharePoint and use union? 

     

    No, a string value is just a string , it can not be used as expression .

     

    Best Regards,
    Bof

  • rbn_nue Profile Picture
    on at

    Hi @v-bofeng-msft 

     

    Thanks for the response. In that case how can we automate retrieval of response from Send an http request action for multiple batch requests?

     

    Like I said I know the number of separate child arrays that will returned, but it can vary each time.

     

    so if there are two items, I can use union( Outputs(Action)[arrays..][0], Outputs(Action)[arrays..][1]. Is there any way to automate this?

     

    Thanks

     

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @rbn_nue ,

     

    You could use the switch action.

     

    If the number is 2 then 

    union(table1,table2)

     

    if the number is 3 then 

    union(table1,table2,table3)

     

    In fact, using 'Apply to each' combined with 'Append to an array' is the best solution. 

     

    Best Regards,
    Bof

  • rbn_nue Profile Picture
    on at

    Hi @v-bofeng-msft 

     

    Switch might not work for as the count can vary from 1 to 100s. How can I use append to array variable as we're trying to combine multiple arrays and not objects? Any other methods?

     

    Thanks.

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @rbn_nue ï¼Œ

     

    No, please use apply to each.

     

    Best Regards,
    Bof

  • JQ-26061535-0 Profile Picture
    3 on at

    Probably a bit too late for you now, but I've used XPaths to extract the nodes. For my batch-select the data was always returned as ../value node with a few fields inside - email, displayname, etc

    JDQuaid_0-1693433183426.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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 103 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 87

#3
trice602 Profile Picture

trice602 63 Super User 2026 Season 1

Last 30 days Overall leaderboard