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 / SharePoint Get File Pr...
Power Automate
Unanswered

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

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard