Blog
Utilities - The best way to peform OCR on images of Power Apps Formulas
October 11. 2022
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.
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.
- Categories:
- formula
Related posts
- FormuIas - Is it possible to call a user-defined function recursively in Power Apps?
- Formulas - A beginners guide on how to create and call user-defined functions (UDFs)
- Formula - How to add a button that converts degrees Centigrade to Fahrenheit and vice versa
- Formula - How to convert a single delimited string to rows and columns
- Data - How to group data in a gallery and calculate sums
- Formula - How to calculate compound interest
- Example - How to use a drop down control to convert currencies
- Formula - How to parse JSON in Power Apps- 4 examples
- Data - How to get a row by ordinal number
- Formula - What to do when the If statement doesn't work?
- Formula - Boolean And / Or operators - What is the order of precedence?
- Controls - How to set the data source of a Combo Box to a comma separated string
- Numbers - 10 examples of how to round numbers
- Formula - Difference between round, square, and curly brackets
- Top 3 highlights of upcoming enhancements to the Power Apps language (Power FX)
- Email - Sending email attachments with the Office 365 Outlook connector
- Formula - What to try when numbers don't format correctly
- Controls - How to convert HTML to Text
- Formulas - how to return all days between two dates
- Formula - How to create comma separated (CSV) list of items
- Formula - How to use the IF and Switch functions - 3 common examples
- Location - Finding the closest location and and sorting records by distance, based on the current location of the user
- Formulas - How to cope with weekends and public holidays in date calculations