How to solve the error - Google OCR : Scrape returned empty text

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?

Thank you.

1 Like

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.

Hope that helps. Thanks.

Thank you. Do you have a small example i can follow please? The one on the site isn’t clearly understood.

Hi there @Olaoluwa,
I’ve attached a very basic example of this.

TryCatch_Example.xaml (9.6 KB)

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.

1 Like

Thank you very much

1 Like

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.

Can you please share the solution over this.


Hi Sandip,

Have you tried using the trycatch activity for the value that returns empty text?



Look through this example

TryCatch_Example.xaml (9.64 KB)

Hi Ola,

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.

So looking for solution.