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
Solved! Go to Solution.
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.
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.
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!
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 flow
Everything is ok with this flow. But I can only use it through Power Automate :
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)
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.
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.
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!
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"}
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.