cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Using a Power Automate flow in Power App

Dear All,

 

I am getting stuck to use an "AI" flow in my power app. I have designed a flow which uses an Object Recognition AI to detect logos and brands on pictures. Then it sends an email based on what he has detected (Attachment 1). The flow works the way I want it to, but I'm getting stuck to use it exactly the same way in my PowerApp.

 

I tried build another flow starting with "PowerApp" but I'm getting stuck to have it work correctly (attachment 2).

 

Am I using it in the right way? Can you enlighten me on this point? 

 

 

Many thanks,

Pierre

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps
Power Apps

Re: Using a Power Automate flow in Power App

Thanks @Pierre-Quem for clarifying your scenario. 

 

You can send an email directly from Power Apps. To do so you will need.

 

1. Add a mail connector. In this case I used Mail, but you can use others like Office 365 Outlook or Gmail for example. 

2020-04-26_17-08-14.png

 

2. On the OnChange event for the Object Detector you inserted, write the following formula. This formula will be executed each time a new image is analyzed, and if a brand is detected, an email will be sent with the names of the detected brands.

 

2020-04-26_17-10-27.png

If(
    CountRows(
        Filter(
            ObjectDetector1.VisionObjects,
            count > 0
        )
    ) > 0,
    Mail.SendEmailV3(
        "WRITE THE EMAIL ADDRESS HERE",
        "EMAIL SUBJECT: Brand detected",
        "EMAIL CONTENT: Brands detected: " & Concat(
            Filter(
                ObjectDetector1.VisionObjects,
                count > 0
            ),
            displayName & ", "
        ),
        false
    )
)

 

I hope this helps!

View solution in original post

6 REPLIES 6
Highlighted
Power Apps
Power Apps

Re: Using a Power Automate flow in Power App

Hi @Pierre-Quem,

 

If you want to make use of your AI Builder model in Power Apps, you will find when creating your app a control called Object Detector under the Insert menu --> AI Builder

 

The following documentation page will explain how to use it: https://docs.microsoft.com/en-us/learn/modules/get-started-with-ai-builder-object-detection/3-use-mo...

 

I hope this helps and feel free to ask any additional question.

Highlighted
Regular Visitor

Re: Using a Power Automate flow in Power App

Hi @JoeF-MSFT,

 

Thank you for your answer.

 

My question was different, but I probably did not frame it properly.

 

I designed this flow which uses my "Brand detector" (Object Detection system that recognizes sports brand logos). We trigger the flow by selecting an image (My image) and then if the system detects a specific brands on this picture it sends me an email. 

 

 My flowMy flow

 

Everything is ok with this flow. But I can only use it through Power Automate :

 

Capture d’écran 2020-04-26 à 16.04.54.png

 

 

What I want is to be able to use this flow exactly the same way, but in my Powerapp. Is it possible ?

 

Or alternatively, is it possible to trigger the sending of an email directly inside Powerapp when the detector recognizes a brand ? (picture below)

 

Capture d’écran 2020-04-26 à 16.19.33.png

 

 

Many thanks,

Pierre

Highlighted
Power Apps
Power Apps

Re: Using a Power Automate flow in Power App

Thanks @Pierre-Quem for clarifying your scenario. 

 

You can send an email directly from Power Apps. To do so you will need.

 

1. Add a mail connector. In this case I used Mail, but you can use others like Office 365 Outlook or Gmail for example. 

2020-04-26_17-08-14.png

 

2. On the OnChange event for the Object Detector you inserted, write the following formula. This formula will be executed each time a new image is analyzed, and if a brand is detected, an email will be sent with the names of the detected brands.

 

2020-04-26_17-10-27.png

If(
    CountRows(
        Filter(
            ObjectDetector1.VisionObjects,
            count > 0
        )
    ) > 0,
    Mail.SendEmailV3(
        "WRITE THE EMAIL ADDRESS HERE",
        "EMAIL SUBJECT: Brand detected",
        "EMAIL CONTENT: Brands detected: " & Concat(
            Filter(
                ObjectDetector1.VisionObjects,
                count > 0
            ),
            displayName & ", "
        ),
        false
    )
)

 

I hope this helps!

View solution in original post

Highlighted
Regular Visitor

Re: Using a Power Automate flow in Power App

Wow, that's exactly what I wanted. Thank you very much @JoeF-MSFT. It works perfectly.

 

Last 2 questions related to the code :

- Is it possible to add a attach file to the mail (in this case I want to attach the Image provided) ?

- Is it possible to put bold text inside the email? 

 

Otherwise if you have any documentation concerning this code I could find it by myself 🙂 

Regards, 

Pierre

 

 

 

Highlighted
Power Apps
Power Apps

Re: Using a Power Automate flow in Power App

Hi @Pierre-Quem,

 

Glad it helped! 🙂

 

To add the image as an attachment to the email and put text in bold do the following:

1. Any text you want in bold, put in between the tags <b> and </b>

2. Set the fourth parameter to true, so the email is sent as an HTML email.

3. Add this additional parameter: {files:ObjectDetector1.OriginalImage, filenames:"image.jpeg"}


2020-04-26_18-54-25.png 

Highlighted
Regular Visitor

Re: Using a Power Automate flow in Power App

Thank you @JoeF-MSFT  for you help ! 🙂

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (5,328)