web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Use button to capture ...
Power Apps
Unanswered

Use button to capture pictures

(0) ShareShare
ReportReport
Posted on by 726

I currently have a Camera on my app that when clicked adds a captures a photo adds this to a collection that is then shown in an attachment control, these attachments are then send via email. 

 

The issue i'm having is at the moment they have to select the camera control to take a photo, i'd like to change this and have button press to do it. 

 

On Select for the camera is 

 

Collect(
 MyPics, /*create a collection to save the pic*/
 {
 DisplayName: Concatenate(
 PhotoType_2.Selected.Value,
 
 ".jpg"
 ),
 Value: Self.Photo,
 AbsoluteUri: "",
 Id: "00000000-0000-0000-0000-000000000000"
 }
); Notify("photo captured", NotificationType.Success, 10000)

 

A shorted version of the email (i've just removed all the content from the body to show how its working without all the extra details) 

 

Office365Outlook.SendEmailV2("aharkus@tbrown.com", "Subject", "Body",
{Attachments:AddColumns( RenameColumns(AttachmentControl.Attachments, Value, ContentBytes), '@odata.types', ""), IsHtml:true, Importance: "Normal",From:"SharePoint_NoReply@TBrownGroup.onmicrosoft.com"}); 

Notify("Data has been saved and emailed", NotificationType.Success); Clear(MyPics)

 

So i have tried to add a button that does the same as On Select for the camera but changing from self to the camera1

 

Collect(
 MyPics, /*create a collection to save the pic*/
 {
 DisplayName: Concatenate(
 PhotoType_2.Selected.Value,
 
 ".jpg"
 ),
 Value: Camera1.Photo,
 AbsoluteUri: "",
 Id: "00000000-0000-0000-0000-000000000000"
 }
); Notify("photo captured", NotificationType.Success, 10000)

 

But this doesn't work, it shows the picture in the attachment control but i get an error on the email button, Any ideas on what i'm doing wrong? 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    Hi @amyharkus86 ,

    I assume your question is in the first part regarding using a button to activate the camera. If so, on the Button OnSelect put

    Select(Camera1)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Suggested answer
    KA-15101452-0 Profile Picture
    2 on at
    I was struggling with this for a bit, but just found the answer.

    In my button, I have the following code:
    Select(Camera1);
    Set(gblImage,{Image:Camera1.Stream});

    In my image control's image property:
    gblImage.Image

    Now the final thing I did before it worked was to make the Camera control's "stream rate" property "100". It is "0" by default.

    This should work seemlessly. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard