Hi guys,
I'm trying to create a flow that triggers when a user checks in a document. Apparently this isn't supported yet by Flow so I have used a work around supplied by a helpful user on these forms here.
Here is the code I typed out:
{
"type": "object",
"properties": {
"d": {
"type": "object",
"properties": {
"OData__ModerationStatus": {
"type": "integer"
}
}
}
}
}
Unfortunately that user didn't post the JSON in text format and I had to type it out myself. My flow fails at the "Parse JSON" step with this error message:
[
{
"message": "Invalid type. Expected Object but got Array.",
"lineNumber": 0,
"linePosition": 0,
"path": "",
"schemaId": "#",
"errorType": "type",
"childErrors": []
}
]
Any help would be greatly appreciated (including any other ways to trigger a flow when a document in a library is checked in!)
Thanks guys - thanks for being so patient. I think the root of the issue was that I was using a template and editing the initial trigger. When I set the HTTP request URI it was automatically putting it inside an Apply to Each.
I made a new flow from blank and it parses the JSON just fine!
Since the trigger fires for each file that is modified you don't need the Apply to each loop. As you can see from my example with the same trigger I don't have one.
Hi,
I think the problem is the apply to each condition and that the parse to JSON is outside the apply-to each condition.
Not sure about the need for apply to each. Refer to @Pstork1 example - You can perhaps have the send an http request immediately after the file modified trigger. If you really need to have the apply to each, then use parse json inside the apply to each instead of outside
I believe I'm using the exact same trigger as you are - see screenshot.
I can see in the error tracker that the data is an object before it is submitted to be parsed, but turns in to an array after it is received by the parser (see second screenshot). Am I misinterpreting that or perhaps that's something to go on?
Screenshot 2
The article was based off using a Get File Properties action, but I'm using the actual trigger properties. So in my case its not Path, Its Folder Path, since Path isn't available from just the trigger. Given the error you are getting I suspect you are using Get Files instead of Get File (notice the plural). That's why it says you are getting an array rather than an object. Here's what my working flow looks like
Thanks for the quick reply - here's a screenshot of my HTML call (same as in the post I linked, except for my sharepoint site of course).
screenshot of HTML call
This is the JSON schema that works for me when I make the call he is suggesting. Can you share a screenshot of the HTTP call you are using?
{
"type": "object",
"properties": {
"d": {
"type": "object",
"properties": {
"CheckOutType": {
"type": "integer"
}
}
}
}
}
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1