Image Processing- Invoice recording using Power App, Microsoft Flow and Cognitive Service- Part 3


In the last two posts (Post1 and Post2), the process of how to set up a simple Power Apps for the aim of converting the image to text has been explained. The created Power Apps capture a picture from a receipt or any text.  Also, how to create a flow that received the image from the Power Apps then pass it to the OCR component in Microsoft flow has been explained.

In this post, we are going to show how to connect these two components to each other. As you remember we created a Microsoft Flow and name it FlowAppsOCR, moreover the flow the last component send back the result to Power Apps via variable OCRResult.


Then, back to Microsoft Flow click on the Image Processing and make sure the ONSelect properties has been selected. Then click on the Action at the top of the page, then click on the Flow, now in the list that has been appeared you able to see the flows that have been created ( in the same account).

Click on the FlowAppsOCR then a formula will appear in the formula bar as below
The flow that has been created there need a variable to pass. We need to pass the taken image in Power Apps to this function.

As you remember from the first post the image has been saved and shown in a label  named: Image1 then we need to call the output of the flow that has been identified in created flow, ocrresult.

The function : FlowAppsOCR.Run(Image1).ocrresult

Return a text has been identified in the Flow.

We want to show this to the use in Power Apps, as a result, there is a need to assign it to a variable using a Set function.

Set(TextResultOCR, FlowAppsOCR.Run(Image1).ocrresult )

So the result of the OCR has been saved in the TextResultOCR variable. To show it to their user, we are going to create a new Lable. Click on the Insert option and choose the Label.

 As it can be a long test we need to make the label much bigger and able to scroll, hence click on the properties Overflow then type Scroll.

Now choose another property of the image and choose the Text then write: TextResultOCR

Now you able to run the Power Apps, click on the Run button at the top of the page, put a paper recipe or any image with text infron of the camera and then click on the Image Processing. After a while, the text will appear.
Some note:
1- Before running anything, make sure you already created an OCR component in Azure [1]
2- Be sure you run the Power Apps and Flow in the same account
3- Make sure you have access to the Sharepoint folder
4- Make sure in Microsoft Flow it is running properly by testing it.

Leila Etaati on LinkedinLeila Etaati on TwitterLeila Etaati on Youtube
Leila Etaati
Trainer, Consultant, Mentor
Leila is the first Microsoft AI MVP in New Zealand and Australia, She has Ph.D. in Information System from the University Of Auckland. She is the Co-director and data scientist in RADACAD Company with more than 100 clients in around the world. She is the co-organizer of Microsoft Business Intelligence and Power BI Use group (meetup) in Auckland with more than 1200 members, She is the co-organizer of three main conferences in Auckland: SQL Saturday Auckland (2015 till now) with more than 400 registrations, Difinity (2017 till now) with more than 200 registrations and Global AI Bootcamp 2018. She is a Data Scientist, BI Consultant, Trainer, and Speaker. She is a well-known International Speakers to many conferences such as Microsoft ignite, SQL pass, Data Platform Summit, SQL Saturday, Power BI world Tour and so forth in Europe, USA, Asia, Australia, and New Zealand. She has over ten years’ experience working with databases and software systems. She was involved in many large-scale projects for big-sized companies. She also AI and Data Platform Microsoft MVP. Leila is an active Technical Microsoft AI blogger for RADACAD.

3 thoughts on “Image Processing- Invoice recording using Power App, Microsoft Flow and Cognitive Service- Part 3

  • Thanks for your work on this, I am struggling to get my app working having followed the instruction above I am constantly getting “Invalid number of argument received 1 expected 2”, for my button any idea what I have done wrong

    Set(varOCR, OCRTest.Run (Image1).ocrtext)

Leave a Reply