Intelligent OCR / Data Extraction Scope, Message "Index was outside the bounds of the array"

Hi,
I am running a Demo workflow on Intelligent OCR, including the Classify Document Scope Activity. On some of the documents processed (i.e. not all of the same type, some get classified OK), I am getting the “Index was outside the bounds of the array” in Data Extraction Scope Activity.

I reckon the exception is related to the preceding Classify Document activity, if the Classification result returns no value. When I change input in Data Extraction Scope from ClassificationResult (in argument) to DocumentTypeID (thus removing the classification from the loop), the Extraction Activity works just fine.

I am passing ClasResult(0) in the in argument.
image

Any ideas how to make it more reliable (by changing/adding/removing the Keywords in Classifier maybe?) or any other fix to this? My experiments gain no improvement.

I would prefer to avoid manual classification via if or try/catch if achievable.

Thanx

Libor

Hi @libork

That means the document doesn’t have classifications, because your Classification array doesn’t have any member. You have to validate first if the document has been classified, and after that you can proceed to use the Data Extraction Scope.

Here you can find an example about how to do that

Regards,

Andres

Hi @AndresTarazona,
Thanx a lot, this is very helpful insight!

Have a good one

Libor

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.