Google OCR - Variable Scale


Hey guys,

I’m currently using Studio 2018.2.2 and Windows 10 Professional. I’m currently building a robot to read PDF files that have been scanned in from documents. To read the files, I’m using the Google OCR and i’m using the Find OCR Text to locate specific pieces of data on the page.

I’m using a combination of Get OCR Text and Find OCR Text and I’ve been adjusting the scale to try to improve the accuracy.

The question is, is it possible to use a variable scale for the engine in case I want to code a retry if the text i’m looking for is not found and I want to try searching using a different scale?




Yeah you can do that by using either a Retry Scope or a Do While with a Try/Catch inside.
Store a default value to the scale variable, then use an Assign scale+1 (or -1) after you do the Find OCR Text, so when it throws an error it will retry with a different scale value. —you can do the same thing with Image activities on accuracy.

I hope that helps.



Hi ClaytonM,

Thank you very much for your response :slight_smile:

When I try setting a variable scale in the Google OCR Engine, I get an error in the parent Find OCR Text activity as follows:

I’m not sure what this means, the variable is definitely in scope…



That looks correct, though sometimes it glitches where you need to click out of the activity for the error to go away.

If you can share the workflow, I might be able to look at it quick, cause from my point of view it looks correct.


Hi ClaytonM,

I message’d you directly with the workflow… wasn’t sure if you saw it…



I think you found a bug with the Find OCR Text Position activity.
It works with the Get OCR Text activity. Can you use that one instead? There is also a Results property where you can store the text position.




Sorry, I take that back cause you need to look for specific text and use that location. Maybe Find Image is an option. Since it’s a bug, you could probably escalate the issue with UiPath:



Ok thanks… I submitted it to UIPath so they can take a look at it… I’ll post their response on this thread so that others can know about it…

Again, thanks for taking a look.