cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

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
Power Apps
Power Apps

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.

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

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

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

 

 

 

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 

Thank you @JoeF-MSFT  for you help ! 🙂

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Solution Authors
Top Kudoed Authors
Users online (36,426)