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 Automate
Answered

Parse JSON Error

(0) ShareShare
ReportReport
Posted on by 65

Greetings. I'm getting the following error:

[
 {
 "message": "Invalid type. Expected Object but got Array.",
 "lineNumber": 0,
 "linePosition": 0,
 "path": "",
 "schemaId": "#",
 "errorType": "type",
 "childErrors": []
 }
]

 

 

The Sample Schema is:

{
 "type": "object",
 "properties": {
 "body": {
 "type": "array",
 "items": {
 "type": "object",
 "properties": {
 "id": {
 "type": "integer"
 },
 "name": {
 "type": "string"
 },
 "type_id": {
 "type": "integer"
 },
 "external_id": {},
 "parent_id": {
 "type": "integer"
 },
 "parent_external_id": {}
 },
 "required": [
 "id",
 "name",
 "type_id",
 "external_id",
 "parent_id",
 "parent_external_id"
 ]
 }
 }
 }
}

 

 

And the actual JSON I'm trying to parse, returned from a 3rd Party API, is: 

{
 "body": [
 {
 "id": 123456,
 "name": "ItemName",
 "type_id": 654321,
 "external_id": null,
 "parent_id": 0,
 "parent_external_id": null
 }
 ]
}

 

 

There's got to be a way to fix this, but I can't seem to figure it out. Thanks in advance for any advice.

Categories:
I have the same question (0)
  • mobashee Profile Picture
    Microsoft Employee on at

    Dear Partner,

    Add below syntax  before "type""object" and add two }} at the end and validate

     

    {
        "type""array",
        "items": {

     

    Did I answer your question? Please consider to mark my post as a solution to help others.

     

    Regards,

    Mohamed Sanuj Basheer

     

     

  • garnern2 Profile Picture
    65 on at

    Hi Mohamed.

     

    I did as you stated. However, the outputs are unexpected. I get: Body, body, Items, Items. When I try to select id or name, an Apply To Each is automatically created. I've tried various combinations of the output from the previous steps. I chose Body>Body once, but it just entered a never-ending loop creating numerous duplicates of records until it timed out.

  • Verified answer
    garnern2 Profile Picture
    65 on at

    Hi, I solved it. I actually needed to remove rather than add.

     

    Thanks.

     

    {
     "type": "array",
     "items": {
     "type": "object",
     "properties": {
     "id": {
     "type": "integer"
     },
     "name": {
     "type": "string"
     },
     "type_id": {
     "type": "integer"
     },
     "external_id": {},
     "parent_id": {
     "type": "integer"
     },
     "parent_external_id": {}
     },
     "required": [
     "id",
     "name",
     "type_id",
     "external_id",
     "parent_id",
     "parent_external_id"
     ]
     }
    }

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 251 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 239

#3
Expiscornovus Profile Picture

Expiscornovus 220 Most Valuable Professional

Last 30 days Overall leaderboard