Dynamics 365 Articles

Microsoft Cognitive Services with PowerApps – Snap It and Translate

Microsoft cognitive services gives rich Artificial Capabilities into the applications. These capabilities can be used with PowerApps when building Apps. Cognitive services can help to make your Apps Smarter.

Artificial Intelligence and Data science go in hand in hand. Microsoft packaged in all capabilities and packages those together to create easy to consume API’s such as Cognitive Services and Bot Framework.

Microsoft provides 23 Cognitive Services API’s. It’s categorises into five areas namely Vision, Speech, Language, Knowledge and Search. For the experiment below I have used Computer Vision & Microsoft Translator API’s. It helps to detect text content from an image using OCR (Optical Character Recognition) & Translate text to different languages.

You can find further information on cognitive services information by following link below.

https://azure.microsoft.com/en-us/services/cognitive-services/

When creating Connections inside PowerApps would require getting an Account Key and Site URL. Use below link to get it.

https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision/

If you do not have an Azure Account yet you can use the 7-day trial to get started.

Below Image depicts the simple flow of the actions involved with the app.

Set properties as below.

Image

Image = First(colPhoto).Url

Camera

Onselect = ClearCollect(colPhoto,Camera1.Photo)

Text BOX

Text = varOCR

Overflow = Overflow.Scroll

Capture Text Button

Onselect = Set(varOCR,ImageOCR.Run(First(colPhoto).Url).ocrtext)

To Translate

Text = MicrosoftTranslator.Translate(varOCR,Dropdown1.Selected.Value)

Use the MS flow to recognize the Optical Character Recognition.

Special Note: Images can be saved in different formats. Computer Vision API is looking for binary format of the Image therefore below expression must be used in the Image Content box in OCR to Text to convert to binary format.

dataUriToBinary(triggerBody()[‘Createfile_FileContent’])

Now you can start creating your own Translator Buddy app. 😊

Kasun

1

Kasun


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.