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 Platform Community / Forums / Power Automate / SharePoint Get File Pr...
Power Automate
Answered

SharePoint Get File Properties Trying to Parse JSON but Getting "Invalid type. Expected Object but got Array"

(0) ShareShare
ReportReport
Posted on by

I'm successfully getting an individual file's properties but when I then try to Parse the output as JSON, I can't seem to do so and am getting a "schema validation error", "message"Invalid type. Expected Object but got Array.".  I'm taking the output from a prior run and pasting it into the Parse JSON to generate the schema, which seems fine, but it fails when I run it (using the body/value output).  I have tried it with and without the header portion.

 

I'm just confused why the output from a previous run wouldn't be valid for a schema payload for future runs.  I wanted to use JSON as I can get more values that way, such as file version and who last modified it.

 

I'm not sure the best way to post the schema, other than as below:

{
    "value": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "@@odata.etag": {
                                "type": "string"
                            },
                            "ItemInternalId": {
                                "type": "string"
                            },
                            "ID": {
                                "type": "integer"
                            },
                            "Modified": {
                                "type": "string"
                            },
                            "Editor": {
                                "type": "object",
                                "properties": {
                                    "@@odata.type": {
                                        "type": "string"
                                    },
                                    "Claims": {
                                        "type": "string"
                                    },
                                    "DisplayName": {
                                        "type": "string"
                                    },
                                    "Email": {
                                        "type": "string"
                                    },
                                    "Picture": {
                                        "type": "string"
                                    },
                                    "Department": {
                                        "type": "string"
                                    },
                                    "JobTitle": {
                                        "type": "string"
                                    }
                                }
                            },
                            "Editor#Claims": {
                                "type": "string"
                            },
                            "SharedWithUsers": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "@@odata.type": {
                                            "type": "string"
                                        },
                                        "Claims": {
                                            "type": "string"
                                        },
                                        "DisplayName": {
                                            "type": "string"
                                        },
                                        "Email": {
                                            "type": "string"
                                        },
                                        "Picture": {
                                            "type": "string"
                                        },
                                        "Department": {},
                                        "JobTitle": {}
                                    },
                                    "required": [
                                        "@@odata.type",
                                        "Claims",
                                        "DisplayName",
                                        "Email",
                                        "Picture",
                                        "Department",
                                        "JobTitle"
                                    ]
                                }
                            },
                            "SharedWithUsers@odata.type": {
                                "type": "string"
                            },
                            "SharedWithUsers#Claims": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            },
                            "SharedWithUsers#Claims@odata.type": {
                                "type": "string"
                            },
                            "SharedWithDetails": {
                                "type": "string"
                            },
                            "MediaServiceImageTags": {
                                "type": "array"
                            },
                            "MediaServiceImageTags@odata.type": {
                                "type": "string"
                            },
                            "MediaServiceImageTags#WssId": {
                                "type": "array"
                            },
                            "MediaServiceImageTags#WssId@odata.type": {
                                "type": "string"
                            },
                            "Created": {
                                "type": "string"
                            },
                            "Author": {
                                "type": "object",
                                "properties": {
                                    "@@odata.type": {
                                        "type": "string"
                                    },
                                    "Claims": {
                                        "type": "string"
                                    },
                                    "DisplayName": {
                                        "type": "string"
                                    },
                                    "Email": {
                                        "type": "string"
                                    },
                                    "Picture": {
                                        "type": "string"
                                    },
                                    "Department": {},
                                    "JobTitle": {}
                                }
                            },
                            "Author#Claims": {
                                "type": "string"
                            },
                            "OData__DisplayName": {
                                "type": "string"
                            },
                            "{Identifier}": {
                                "type": "string"
                            },
                            "{IsFolder}": {
                                "type": "boolean"
                            },
                            "{Thumbnail}": {
                                "type": "object",
                                "properties": {
                                    "Large": {
                                        "type": "string"
                                    },
                                    "Medium": {
                                        "type": "string"
                                    },
                                    "Small": {
                                        "type": "string"
                                    }
                                }
                            },
                            "{Link}": {
                                "type": "string"
                            },
                            "{Name}": {
                                "type": "string"
                            },
                            "{FilenameWithExtension}": {
                                "type": "string"
                            },
                            "{Path}": {
                                "type": "string"
                            },
                            "{FullPath}": {
                                "type": "string"
                            },
                            "{IsCheckedOut}": {
                                "type": "boolean"
                            },
                            "{VersionNumber}": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "@@odata.etag",
                            "ItemInternalId",
                            "ID",
                            "Modified",
                            "Editor",
                            "Editor#Claims",
                            "SharedWithUsers",
                            "SharedWithUsers@odata.type",
                            "SharedWithUsers#Claims",
                            "SharedWithUsers#Claims@odata.type",
                            "SharedWithDetails",
                            "MediaServiceImageTags",
                            "MediaServiceImageTags@odata.type",
                            "MediaServiceImageTags#WssId",
                            "MediaServiceImageTags#WssId@odata.type",
                            "Created",
                            "Author",
                            "Author#Claims",
                            "OData__DisplayName",
                            "{Identifier}",
                            "{IsFolder}",
                            "{Thumbnail}",
                            "{Link}",
                            "{Name}",
                            "{FilenameWithExtension}",
                            "{Path}",
                            "{FullPath}",
                            "{IsCheckedOut}",
                            "{VersionNumber}"
                    }
                    }
                }   
}

 

Categories:
I have the same question (0)
  • Verified answer
    v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @Ukiman1014 

    You can get the output of the "Get files properties" in your flow run history:

    vyueyunmsft_0-1718326810573.png

    We need to put the  array after "value" to the parse json:

    vyueyunmsft_1-1718327025248.png

     

    Bu another , you can also do not need to use the "Parse Json" action, you can directly extract the data using expression.
    For example , if you want to extract the versionnumber:

    vyueyunmsft_2-1718327115045.png

    You can use this expression in the Apply to each action:

    vyueyunmsft_3-1718327166745.png

     

    items('Apply_to_each')?['{VersionNumber}']
     
    And the field Name you can get from your flow run history!
     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

     

  • Ukiman1014 Profile Picture
    on at

    Thanks again, but I also need to get the name of the person who changed the file, the "DisplayName" of the "Editor".  Is there a way to do that without parsing the JSON?

     

    From your previous screenshot:

    Ukiman1014_0-1718646481203.png

     

  • Verified answer
    v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @Ukiman1014 

    Please use this :
    items('Apply_to_each')?['Editor']?['DisplayName']

     

    Best Regards,

    Yueyun Zhang

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 410

#2
Vish WR Profile Picture

Vish WR 289

#3
David_MA Profile Picture

David_MA 282 Super User 2026 Season 1

Last 30 days Overall leaderboard