Hi.
We have a Sharepoint site with 900+ different contracts scanned to PDF files.
We want to use an OCR Action to extract the text to make the contract data searchable.
We have set up a Cloud flow to extract the File Content and perform the OCR Action, but I am struggling a bit with the output from the Action.
I want to concat all the text from each contract into 1 string that I can then write to a text file WITHOUT using a Loop to append to a variable, but I am not able to find a way to properly reference the the Text property of the returned JSON data.
The JSON schema looks like this:
{
"type": "object",
"properties": {
"body": {
"type": "object",
"properties": {
"@@odata.context": {
"type": "string"
},
"responsev2": {
"type": "object",
"properties": {
"@@odata.type": {
"type": "string"
},
"operationStatus": {
"type": "string"
},
"predictionId": {
"type": "string"
},
"predictionOutput": {
"type": "object",
"properties": {
"@@odata.type": {
"type": "string"
},
"results@odata.type": {
"type": "string"
},
"results": {
"type": "array",
"items": {
"type": "object",
"properties": {
"@@odata.type": {
"type": "string"
},
"page": {
"type": "integer"
},
"lines@odata.type": {
"type": "string"
},
"lines": {
"type": "array",
"items": {
"type": "object",
"properties": {
"@@odata.type": {
"type": "string"
},
"text": {
"type": "string"
},
"boundingBox": {
"type": "object",
"properties": {
"@@odata.type": {
"type": "string"
},
"left": {
"type": "number"
},
"top": {
"type": "number"
},
"width": {
"type": "number"
},
"height": {
"type": "number"
},
"polygon": {
"type": "object",
"properties": {
"@@odata.type": {
"type": "string"
},
"coordinates@odata.type": {
"type": "string"
},
"coordinates": {
"type": "array",
"items": {
"type": "object",
"properties": {
"@@odata.type": {
"type": "string"
},
"x": {
"type": "number"
},
"y": {
"type": "number"
}
},
"required": [
"@@odata.type",
"x",
"y"
]
}
}
}
}
}
}
},
"required": [
"@@odata.type",
"text",
"boundingBox"
]
}
}
},
"required": [
"@@odata.type",
"page",
"lines@odata.type",
"lines"
]
}
}
}
}
}
}
}
}
}
}
I have tried referencing the data in various formats, but each time I end up getting the error: Array elements can only be selected using an integer index
I am able to reference the Line property, which should contain the Text, but after that I am coming up short on trying to concat the text into a single compose.
I think we are getting issues because there are several pages in the PDF files instead of 1 page.
Any help would be much appreciated!