I am doing a get OCR activity to scrape text from a word document. Most times the document comes this way:
Name : vdvhjkeh udh
Age: 35
loacation: gvdjb rjijrijrjr
hobbies: bdn,k jdkdrokrd
etc but sometimes some fields will come empty and the values are used somewhere else. The robot throws an error saying Scrape returned empty text. How can i make it so that it replaces the empty space with ‘none’ instead of throwing an error and stopping the whole process?
You could use a Try/Catch maybe. That will skip over it if it can’t return any text. However, if there’s really text there and still is throwing the error, then you might try other methods like a Retry Scope and change the scale each retry.
The basic premise is:
Should an exception be thrown when performing the ‘Read OCR Text’ activity, it will be caught in the ‘Catch’ segment.
This will set the extracted text variable (strExtractedText) to “None”.
Afterwards, I’ve included an ‘If’ so you can see how it works, which basically checks whether the extracted text (strExtractedText) equals “none”.
With that said, you should be making use of the Try/Catch activity within your sequences to prevent unhandled exceptions stopping your process, the attached example is simply for demonstration purposes.
Hi All,
I am getting same issue (Google OCR : Scrape returned empty text),
but I am facing this issue after 2 hours from process run.
I think this is due to the ideal time of system but I am not sure why this issue is occurring.
Try catch will not useful me because, In catch I will handle that its returning empty text.
But I am using Attach window and under attach window we have Get OCR Text Activity,
In this case I am able find attach window but not able to extract text from Get OCR Text Activity.
And I know that whenever Attach window found there should be value in Get OCR Text Activity but it does not work.
and one more important point that it works till login session of machine will not get ideal means after 2 hours Get OCR Text Activity will get failed. So I am thinking that, it would be session ideal issue.