cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
omi18
Post Partisan
Post Partisan

Action Parse_JSON Failed

Hello,

 

I'm getting this error in the Parse JSON step. 

 

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

 

I'm passing the below schema.

 

{
"type": "object",
"properties": {
"body": {
"type": "string"
},
"num_segments": {
"type": "string"
},
"direction": {
"type": "string"
},
"from": {
"type": "string"
},
"date_updated": {
"type": "string"
},
"price": {
"type": "string"
},
"error_message": {
"type": "string"
},
"uri": {
"type": "string"
},
"account_sid": {
"type": "string"
},
"num_media": {
"type": "string"
},
"to": {
"type": "string"
},
"date_created": {
"type": "string"
},
"status": {
"type": "string"
},
"sid": {
"type": "string"
},
"date_sent": {
"type": "string"
},
"error_code": {
"type": "integer"
},
"price_unit": {
"type": "string"
},
"api_version": {
"type": "string"
},
"subresource_uris": {
"type": "object",
"properties": {
"media": {
"type": "string"
},
"feedback": {
"type": "string"
}
}
}
}
}
 
Thanks,
Omi
1 ACCEPTED SOLUTION

Accepted Solutions
StalinPonnusamy
Super User
Super User

Hi @omi18 

 

Sorry for the late response. I was travelling for past few days.

 

Your Schema to parse the JSON will be

 

{
    "type": "object",
    "properties": {
        "body": {
            "type": "string"
        },
        "num_segments": {
            "type": "string"
        },
        "direction": {
            "type": "string"
        },
        "from": {
            "type": "string"
        },
        "date_updated": {
            "type": "string"
        },
        "price": {
            "type": "string"
        },
        "uri": {
            "type": "string"
        },
        "account_sid": {
            "type": "string"
        },
        "num_media": {
            "type": "string"
        },
        "to": {
            "type": "string"
        },
        "date_created": {
            "type": "string"
        },
        "status": {
            "type": "string"
        },
        "sid": {
            "type": "string"
        },
        "date_sent": {
            "type": "string"
        },
        "price_unit": {
            "type": "string"
        },
        "api_version": {
            "type": "string"
        },
        "subresource_uris": {
            "type": "object",
            "properties": {
                "media": {
                    "type": "string"
                },
                "feedback": {
                    "type": "string"
                }
            }
        }
    }
}

 

Result : (For testing displaying Status field)

StalinPonnusamy_0-1648597844131.png

 

Steps:

  • In the Parse JSON step
  • Click "Generate from sample"
  • New window should open
  • Paste the data on that window like below

StalinPonnusamy_1-1648598010858.png

  • Click "Done"
  • This should generate the schema for the data like below

StalinPonnusamy_0-1648598180616.png

 


Thanks, Stalin (Microsoft MVP)
Blog - Learn To Illuminate Blog
YouTube - Learn To Illuminate Videos

View solution in original post

5 REPLIES 5
StalinPonnusamy
Super User
Super User

Hi @omi18 

 

I see the valid JSON you are using for schema. Schema and Data should match it. By looking the error, both is not matching.

 

Can you share what data (JSON) that you are trying to parse it?


Thanks, Stalin MVP
Blog - Learn To Illuminate Blog
YouTube - Learn To Illuminate Videos

Hi @StalinPonnusamy ,

 

Sure.

 

{
"body": "/schedule_a_phone_appointment",
"num_segments": "5",
"direction": "outbound-api",
"from": "+16175536610",
"date_updated": "Thu, 24 Mar 2022 16:03:57 +0000",
"price": "-0.03750",
"uri": "/2010-04-01/Accounts/AC09daad6d985d2334ae1/Messages/SM2d00d7b3c994c7bef5db7ea10.json",
"account_sid": "AC095d23401e45dcae42834ae1",
"num_media": "0",
"to": "+13467836",
"date_created": "Thu, 24 Mar 2022 16:01:16 +0000",
"status": "delivered",
"sid": "SM2d00d7b33433484c994c7bef5db7ea10",
"date_sent": "Thu, 24 Mar 2022 16:03:57 +0000",
"price_unit": "USD",
"api_version": "2010-04-01",
"subresource_uris": {
"media": "/2010-04-01/Accounts/AC09daad6d985d23401e45dcae42834ae1/Messages/SM2d00d7b33433484c994c7bef5db7ea10/Media.json",
"feedback": "/2010-04-01/Accounts/AC09daad6d985d23401e45dcae42834ae1/Messages/SM2d00d7b33433484c994c7bef5db7ea10/Feedback.json"
}
}
 
Thanks,
Omi
StalinPonnusamy
Super User
Super User

Hi @omi18 

 

Sorry for the late response. I was travelling for past few days.

 

Your Schema to parse the JSON will be

 

{
    "type": "object",
    "properties": {
        "body": {
            "type": "string"
        },
        "num_segments": {
            "type": "string"
        },
        "direction": {
            "type": "string"
        },
        "from": {
            "type": "string"
        },
        "date_updated": {
            "type": "string"
        },
        "price": {
            "type": "string"
        },
        "uri": {
            "type": "string"
        },
        "account_sid": {
            "type": "string"
        },
        "num_media": {
            "type": "string"
        },
        "to": {
            "type": "string"
        },
        "date_created": {
            "type": "string"
        },
        "status": {
            "type": "string"
        },
        "sid": {
            "type": "string"
        },
        "date_sent": {
            "type": "string"
        },
        "price_unit": {
            "type": "string"
        },
        "api_version": {
            "type": "string"
        },
        "subresource_uris": {
            "type": "object",
            "properties": {
                "media": {
                    "type": "string"
                },
                "feedback": {
                    "type": "string"
                }
            }
        }
    }
}

 

Result : (For testing displaying Status field)

StalinPonnusamy_0-1648597844131.png

 

Steps:

  • In the Parse JSON step
  • Click "Generate from sample"
  • New window should open
  • Paste the data on that window like below

StalinPonnusamy_1-1648598010858.png

  • Click "Done"
  • This should generate the schema for the data like below

StalinPonnusamy_0-1648598180616.png

 


Thanks, Stalin (Microsoft MVP)
Blog - Learn To Illuminate Blog
YouTube - Learn To Illuminate Videos

Hi @StalinPonnusamy ,

 

Thanks, for the message. I was doing the same step. But it still gives the same error.

 

Thanks,

Omi

Hi @StalinPonnusamy ,

 

I was missing the [] from the data. It's working now. 

 

Thanks,

Omi

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (3,759)