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 / How to access each ite...
Power Automate
Answered

How to access each item in JSON array?

(0) ShareShare
ReportReport
Posted on by 161

Hi,

I have an HTTP action that returns a maximum of 400 results per call. In order to collect all available items I'm storing each call's results in an array variable.

 

For example, the total results count is 423. This means I have to execute the HTTP action twice to get all items. However, if I check with the length() expression it will show an array length of 2. the first array contains 400 JSON objects and the second one the remaining 23. 

 

My problem is that I'm unable to work with all 423. I've tried "Apply to each", "Select", "Parse JSON" but none gives me individual JSON objects to work with.

 

Here's the JSON schema, imagine that I have 423 times of what that is included in "value":

 

{
 "type": "object",
 "properties": {
 "odata.metadata": {
 "type": "string"
 },
 "value": {
 "type": "array",
 "items": {
 "type": "object",
 "properties": {
 "Identity": {
 "type": "string"
 },
 "AuditData": {
 "type": "string"
 },
 "CreationDate": {
 "type": "string"
 },
 "IsValid": {
 "type": "boolean"
 },
 "ObjectState": {
 "type": "string"
 },
 "Operations": {
 "type": "string"
 },
 "RecordType": {
 "type": "string"
 },
 "ResultCount": {
 "type": "integer"
 },
 "ResultIndex": {
 "type": "integer"
 },
 "UserIds": {
 "type": "string"
 },
 "ObjectIds": {},
 "IPAddresses": {},
 "SiteIds": {}
 },
 "required": [
 "Identity",
 "AuditData",
 "CreationDate",
 "IsValid",
 "ObjectState",
 "Operations",
 "RecordType",
 "ResultCount",
 "ResultIndex",
 "UserIds",
 "ObjectIds",
 "IPAddresses",
 "SiteIds"
 ]
 }
 },
 "odata.nextLink": {
 "type": "string"
 }
 }
}

So, "Apply to each" only applies to the two arrays - not getting the individual JSON objects.

"Select" doesn't work because it's not compatible with the array where the results are stored in.

Using "Parse JSON" again also doesn't give me individual JSON objects to work with.

 

Any idea how I can access them?

Perhaps it's not smart to collect the HTTP action results in an array variable or they have to be filtered beforehand, i.e. narrowed down to the individual "value" JSON objects?

 

Thanks for your help.

Categories:
I have the same question (0)
  • RezaDorrani Profile Picture
    12,143 on at

    Hi @colonel_claypoo 

     

    Can you share the response JSON

  • Verified answer
    v-litu-msft Profile Picture
    on at

    Hi @colonel_claypoo,

     

    Please share a screenshot of the HTTP response, if it returns an array with two sub-array, maybe you can use two Apply to each structure:Annotation 2019-09-27 153757.png

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • colonel_claypoo Profile Picture
    161 on at

    That worked. Did this in an do...until action to also check when there're no more rsults to be retrieved. Thanks for the pointer.

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

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard