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 / Invalid type. Expected...
Power Automate
Unanswered

Invalid type. Expected Object but got Array.

(1) ShareShare
ReportReport
Posted on by 77

Hi there, I am getting the error mentioned above using Parse JSON action. Looking at the error message, I guess the issue is coming from Bill_Number?

{
 "errors": [
 {
 "message": "Invalid type. Expected Object but got Array.",
 "lineNumber": 0,
 "linePosition": 0,
 "path": "Report.Tablix3.Matter_Code_Collection.Matter_Code[12].Matter_Name_Collection.Matter_Name.WIP_Status1_Collection.WIP_Status1.Bill_Number_Collection.Bill_Number",
 "schemaId": "#/properties/Report/properties/Tablix3/properties/Matter_Code_Collection/properties/Matter_Code/items/properties/Matter_Name_Collection/properties/Matter_Name/properties/WIP_Status1_Collection/properties/WIP_Status1/properties/Bill_Number_Collection/properties/Bill_Number",
 "errorType": "type",
 "childErrors": []
 }
 ]
}

 

I checked the Schema and it is saying that Bill_Number is an object. I am still pretty new to this JSON thingy, can someone please shed some light? Thanks

nicklimcs_0-1720665800695.png

 

 

Workflow:

nicklimcs_1-1720665894098.png

 

Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at

    Hi @nicklimcs 

     

    Where did you get the schema from?

     

    I would take the output you get from Compose (json) and put that into an Validator. Like I use NotePad++ with the JSON extension.

     

    So that you can properly get a schema

     

    Let's assume that the payload has all the details, as in things aren't missing.

     

    Then you can use that as your sample for creating your Parse JSON schema.

    So, get the output from your Compose, from a Run.

    Copy out the schema you have (and save it)

    Paste in that example from that run into the flow to change the schema.

     

    Then Re-Run that flow and verify it works.


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • nicklimcs Profile Picture
    77 on at

    @FLMike 

     

    The schema was taken directly from the Compose output like you suggested.

  • Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at

    Thanks @nicklimcs  ugg that stinks

     

    If you re-run the flow that you got the schema from, does that one fail (is this that flow?).

     

    Crud hmm for me to help I'd really need the Schema in the JSON and the Data you got out of the Compose. If you are good sharing, we can do it privately over DM.

    If it has data you cannot share... Is there some way we can pair it down so its ok to share.


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • nicklimcs Profile Picture
    77 on at

    @FLMike 

     

    Yeah unfortunately I can't share the data and it's going to take ages for me to remove those sensitive data as I will have to go through 4000 lines.

     

    Sorry am not sure if this is going to help

    nicklimcs_0-1720670220863.png

     

     

     

  • Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at

    @nicklimcs 

     

    No worries. What is weird to me, is what you do show (thank you), it is clearly and Array NOT an object.

     

    By Chance, where did you get the sample you used. I know you said that Compose, but can you grab compose data from the flow you grabbed it from

     

    Then grab the compose data from this one

     

    Verify that each of them show as an Array, or does one of them Have Bill Number: [ ] 

    Versus the one you are showing as { }

     

    That or you will need to manually change the schema from Object to Array and try again


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • nicklimcs Profile Picture
    77 on at

    @FLMike 

     

    There is a part is showing as Bill_Number: []. This is captured from the Compose output

     

    nicklimcs_0-1720672241968.png

     

    I tried changing the type to array and was getting the same error but with multiple lines. I think it got even worse

    nicklimcs_1-1720672563600.png

     

    nicklimcs_3-1720672631347.png

     

     

  • Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at

    Hi @nicklimcs 

     

    Sorry a little confused, you showed me a screen clip a bit ok, it clearly showed Bill Number as an Array, not an object.

    FLMike_0-1720672976021.png

    Now this data you are showing me (not this picture) but in your recent post that show data that has it like an Object.

     

    Where is that from?

     

  • nicklimcs Profile Picture
    77 on at

    @FLMike 

     

    Apologies, let me start over again.

     

    Firstly, I run the flow with Export To file for Paginated Report > Compose for converting the XML to JSON. Then I copy the outputs from the "Compose | XML to JSON" action

    nicklimcs_1-1720673793100.png

     

    Then, I added Parse JSON format and click on "Generate from sample" and paste in the OUTPUTS from "Compose | XML to JSON" > Done

    nicklimcs_2-1720674070491.png

     

    Ran the flow and received this error

    nicklimcs_3-1720674122263.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

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