Data Extraction Scope: Index was outside the bounds of the array

I have used Data Extraction Scope activity and it is giving error - Data Extraction Scope: Index was outside the bounds of the array .
I have written classificationResult- classificationResult(0) and other relevant details ,
please help me on this. In case of any other information please let me know.
Please help!!

Thanks

1 Like

@programmer I guess that error might be because the classificationResults were empty, it did not have any value in it.

You should use an if Condition to check the classificationsResults are empty or not and then Continue with Data Extraction

1 Like

classificationsResults are empty I checked but not getting the reason why it’s empty .
i have used keyword based classifier in which i have used keywords for the documents to train.
Can you please help me for this , it’s little urgent.

Thanks,

@programmer What is the OCR Engine used ? If it’s OMNI Page OCR then Change it’s Profile to Scan and check if it works, Also can you send a Screenshot of the Keywords that you have used ?

I have used Tesseract OCR in digitize document activity , should i use OMNI Page OCR ? actually i was not able to find in my package can you let me know which package it is available in. Some of keywords are:
“version:”, “1”, “current”, " open", " vulnerabilities:", “awaiting”, " remediation", “critical”, “0”, “high”, “0”, “medium”, “8”, “remediation”, “in”, " progress", “critical”, “high”, “medium”, “0”, “0”, “0”, “pending closure”, “critical”, “0”, “high”, “0”, “medium”, “0”

@programmer If you just type OmniPage in Manage Packages, you should be able to get it.

Also Before doing that Test with all types of OCR which are available and Change it’s Profiles as well and check

Thanks for helping ,what is meaning of Change it’s Profiles for all types of OCR.
While using omni page ocr i got option to choose profile i change to scan is it correct .

@programmer Yes. Were you able to get the result?

No i still don’t know what is the issue i have used classificationResult(0).ToString in writeline activity but it is giving me error there only Data Extraction Scope: Index was outside the bounds of the array . If you can please suggest for this.

@programmer Check the Output text of Digitize Document Activity. Do not check the classificationResults variable in that way, Use an If Condition to check if there are any values in it.

Also can you send a Screenshot of how you have developed your Workflow ?
What type of PDF you are using? Scanned or Native ?

i have put the value of document type id and removed classification result
Please find screenshorts
[image]

[image]

[image]

[image]

[image]

[image]

[image]

[image]

After running the output of excel file is blank . if you can help me with this.

Thanks

@programmer The Screenshots are not visible :sweat_smile:

Due to some network issue images are not visible but classification result does not have any value i have used for each to fetch it’s value and message box to print the value but control not going inside for each . I have used value of document type id and removed classification result , it’s running fine but excel sheet that i used the last to fetch desired result is empty.

I was getting the same error and tried several different solutions. I finally resolved the error by changing the ‘ForceApplyOCR’ input field within the ‘Digitize Document’ activity to True.

In my case this error was caused also by ClassificationResult - it couldn’t classify the document so Data Extraction was giving me error about “Index was outside the bounds of the array”. Simply I’ve added “Present Classification Station” before extraction to manually classify document and it solved my problem.