Blog

Utilities - The best way to peform OCR on images of Power Apps Formulas

If you need to convert images of Power App formulas to text, here's a review comparison of some OCR tools that you can use.

I occasionally need to convert images of Power Apps formulas to text - a use-case scenario is when I'm reviewing forum questions.

In these situations, converting images to text with OCR (optical character recognition) saves a lot of time.

What's the best tool to convert images of formulas to text? This post reviews 3 options.

1 - Using the 'Text Extractor' utility in Microsoft Power Toys

Power Toys is a free set of Windows utilities with many great features. This includes Windows Explorer extensions, a Windows shell extension for resizing images, the ability to modify keyboard mappings, a bulk file renaming feature, and many more.

Here's the download link for Power Toys.


A very feature of Power Toys is 'Text Extractor'. This integrates into Windows and we start it by pressing the following keyboard combination: ⊞ Win+Shift+T

This initiates the process to take a screenshot of an image. The utility then extracts text from the screenshot and saves the result into the Windows clipboard.

To test the effectiveness of Text Extractor, I used Text Extractor to screenshot the following formula that I found on a forum post.

Here's the result from Text Extractor.

Patchl • Product Order List • ,
ForA11 Filter Gal Ler 4. All Items ! rem
WindowSizeNumber: Textln utl. Text
WindowSizeWidth: Dro downl.Se1ected.Va1ue
WindowSizeHei ht: Dro downl 1. Selected . Value
Windo uantit
. Dro downl 2. Selected. Value
WindowCoverin T
. Dro downl 3. Selected . Value
WindowFre uenc OfUse: Dro downl 4. Selected. Value
WindowShape: Dropdownl 5. Selected. Value.
Title: Self . LastSubmit. ID

As we can see, the result isn't great. Text Extractor fails to recognise much of the formula, including characters such as single quotes and brackets. It fails to recognise many of the keywords, and it confuses the 'l' in 'ForAll' with the number '1'.

2 - Using 'Copy text from Picture' in Microsoft OneNote

Microsoft OneNote includes built-in OCR capabilities. When we paste an image into a OneNote page, we can right-click the image and select the 'Copy Text from Picture' option.


This extracts the text from the image and copies the result into the clipboard. We can then paste the result where it's needed.

In the screenshot below, I pasted the result next to the source image.


The result is very similar to Text Extractor - it's not great. It doesn't correctly recognise many of the keywords and punctuation, and it also confuses the character 'l' with '1'.

3 - Using the AI Builder 'Text Recognizer' control in Power Apps

With Power Apps, we can perform OCR by using AI Builder. I created an app and added a 'text recognizer' control to a screen.

I then ran the app and uploaded a saved image of the formula through the control. In the label control shown below, I 'concat' the extracted lines into the text property.

As we can see, AI Builder produces the best result. It didn't recognise some of the punctuation but it did a great job of correctly recognsing all the keywords. Unlike the previous products, it was able to correctly differentiate the character 'l' with '1'.

Conclusion

If you need to perform ad-hoc OCR on images of formula, AI Builder produces the best result. This is understandable, given that AI builder can better interpret the context of the source image and optimise the text extraction for formula/code.

For a completely free solution, the Text Extractor utility in Power Toys offers a convenient and passable solution. In all cases, the results were not bad, considering that the formula in the source image was obscured by the red squiggly error highlighting.
Related posts