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

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.

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.



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



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

Have a good one


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