Hi all
I am hoping someone will be able to help me
I have some JSON format, where sometimes the item will contain a single entry or an array which is causing it to fail/error when there is only a single item. How can I get the flow to work regardless of it being a single item or an array
Parse JSON
}
},
"Operating_x0020_Company": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"@@@odata.type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Id": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Value": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
},
"required": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
},
"Operating_x0020_Company@odata.type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Operating_x0020_Company#Id": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
},
"Operating_x0020_Company#Id@odata.type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"DAB_x0020_Status": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"@@@odata.type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Id": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Value": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
},
"DAB_x0020_Status#Id": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Action_x0020_Status": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Action_x0020_Status@odata.type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Action_x0020_Status#Id": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Action_x0020_Status#Id@odata.type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Action_x0020_Type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Action_x0020_Type@odata.type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Action_x0020_Type#Id": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Action_x0020_Type#Id@odata.type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Created": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Author": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"@@@odata.type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Claims": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"DisplayName": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Email": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Picture": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Department": {
"type": "object",
"properties": {}
},
"JobTitle": {
"type": "object",
"properties": {}
}
}
}
}
},
"Author#Claims": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Editor": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"@@@odata.type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Claims": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"DisplayName": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Email": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Picture": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Department": {
"type": "object",
"properties": {}
},
"JobTitle": {
"type": "object",
"properties": {}
}
}
}
}
},
"Editor#Claims": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Modified": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"{Identifier}": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"{IsFolder}": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"{Thumbnail}": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"Large": {
"type": "object",
"properties": {}
},
"Medium": {
"type": "object",
"properties": {}
},
"Small": {
"type": "object",
"properties": {}
}
}
}
}
},
"{Link}": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"{Name}": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"{FilenameWithExtension}": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"{Path}": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"{FullPath}": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"{HasAttachments}": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"{VersionNumber}": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
},
"required": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
Output -
[
{
"message": "Invalid type. Expected Object but got Array.",
"lineNumber": 0,
"linePosition": 0,
"path": "",
"schemaId": "#",
"errorType": "type",
"childErrors": []
}
]
How can i fix this - please help