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 / Parsing JSON Problem -...
Power Automate
Unanswered

Parsing JSON Problem - Null Array Error

(0) ShareShare
ReportReport
Posted on by 9

Hi, I'm fairly new to Power Automate. I'm trying to add data that I pull from an API call to a SharePoint Online List. I'm able to pull the data in the original API request; However, when I try to add the parsed output from the API call, I get a Null Array Error. Here is the full message:

 

ExpressionEvaluationFailed. The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@body('Parse_JSON')?['body']?['audits']' is of type 'Null'. The result must be a valid array.

 

KJLee_0-1698100731765.png

Here is a sample of the payload that I used to generate the JSON schema:

 

{

    "body": {

        "count": 1000,

        "total": 10081,

        "audits": [

            {

                "audit_id": "audit_123",

                "modified_at": "2017-05-30T22:24:01.154Z",

                "template_id": "template_a"

            },

            {

                "audit_id": "audit_345",

                "modified_at": "2017-05-31T00:10:05.754Z",

                "template_id": "template_b"

            }

        ]

    }

}

 

Any help will be greatly appreciated.

 

Thanks!

Categories:
I have the same question (0)
  • NickMerrick Profile Picture
    419 Super User 2024 Season 1 on at

    have you looked through the parse JSON output to see what its actually generating? consider making a compose to show the results and see why there is a null value in your audits column. 

  • KJLee Profile Picture
    9 on at

    Thanks for your reply. I tried doing a compose after the JSON parse, but it comes up with the same error. I don't believe that the schema that was generated is working. I'm not sure what I need to use as a payload to make this work.

  • Verified answer
    KJLee Profile Picture
    9 on at

    Hi NickMerrick,

     

    I just wanted to let you know that I've resolve this issue. For some reason the generated JSON schema that is native to Power Automate was not working correctly. I noticed that regardless of the payload, the generated JSON schema would never change. I ended up generating the JSON schema using a free online JSON Schema converter and copying the JSON schema into flow. I'm no longer getting that error. 

     

    Thanks

     

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard