How to use Text Recognizer in Canvas App

Sending
User Review
0 (0 votes)

Introduction:

Microsoft AI builder comes with many amazing features and can be integrated with Power Platforms. We have seen in our previous blog how to use barcode scanner control in Power Apps. In today’s blog, we will explore how to integrate Microsoft AI builder Text Recognizer in Canvas App. Here, we must have AI Builder License enabled to use Text Recognizer in Canvas App.

Let’s consider a scenario where a person wants to send daily notes to all the students according to the class. Now the person will open the Canvas App, upload the images in text recognizer control, select the class from the drop down and hit the ‘Send Email’ button to send the notes to all the students of the class selected from the drop down. For this, first you have to create a custom entity ‘Student’ in Dynamics 365 CRM which contains Name, Email and Class of the student as shown in the below screenshot:

Text recognizer in canvas app

Now to send daily notes to all the students, follow the steps given below:

1. Create a Canvas App and click on AI Builder to add a Text Recognizer Control as shown in the below screenshot:

Text recognizer in canvas app

2. Now add a Drop Down Input and add the below formula in Item property of drop down so that the drop down will show a list of classes:

Text recognizer in canvas appText recognizer in canvas app

3. Now add HTML Text to show the text obtained from Text Recognizer so that the user can verify the text and send the email.

Text recognizer in canvas app

To see the text, set the HTMLText property as shown in the below screenshot:

Formula on HTMLText Property: Concat(TextRecognizer.Results,Text & “<br>”)

In the above formula, the Concat function concatenates strings obtained from the Text Recognizer result and prints each text in the next line using the <br> tag of HTML.

Text recognizer in canvas app

4. You can add ‘Office365Outlook’ connector to send the email message which will contain text extracted from Text Recognizer control as shown in the below screenshot:

Text recognizer in canvas app

5. Add Student data source from Common Data Service in the Canvas App to send an email from the Student Data as shown in the below screenshot:

Text recognizer in canvas app

6. Add a ‘Send Email’ button and for the onSelect property of the button, add the below formula to filter student records depending on the class and send emails to them.

ForAll(

    Filter(

        Students,

        ClassDropdown.Selected.Text exactin Class

    ),

    Office365Outlook.SendEmail(

        Email,

        “Notes – ” & Today(),

        TextHtmlText.HtmlText

    )

)

The above formula will filter the Student records depending upon the Class selected in the dropdown and for each student record, an email is sent containing the text obtained from Text Recognizer.

Text recognizer in canvas app

7. Now let’s run the app, upload an image in the Text Recognizer control and send an email to the student as shown in the below screenshot:

Text recognizer in canvas app

Conclusion:

In this way, we can add Text Recognizer in Canvas App to get text from images by using Text Recognizer control.