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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Add camera control and...
Power Apps
Unanswered

Add camera control and take photo in PowerApps (Android) not working

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have added a camera control to a screen in a PowerApps canvas app.

 

The next steps should give the user the ability to go to said screen, then approves the pop-up notification (from the Android OS at first use of the app) which asks for permission to access the camera and hence, will be able to take a photo which will be stored in an image control or gallery control on the following screen/page.

 

I managed to add the camera control which I named Camera1. I installed the PowerApps app for Android from Google Play on an Android phone, logged in with the Microsoft two-factor authentication and am correctly receiving the permission prompt for the camera access at first use. The camera then gets activated in both the PowerApps universe web application (on the PC) as well as when running the app on the Android phone.

 

In order to let the user take a photo and add it to the image control/gallery control on the next screen/page, I followed the steps listed in this permalink https://www.spguides.com/powerapps-camera-control/#Powerapps_add_picture_control under "Powerapps add picture control" but in vain (code doesn't seem to work on the camera control OnSelect function).

 

However, when running the canvas app on the Android phone hereafter and with the back camera of the phone being accessed, tapping the camera control doesn't take any photo no matter what. The only thing that works is the access to the camera which is shown "live" in the camera control (squared window).

 

My question now is...

 

a) how can I enable the user to take a photo tapping the camera control and

b) how do I store this photo on the next page in the image control/gallery control itself?

 

Could anyone please advise on the correct procedure and what I am doing wrong?

 

Thanks.

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

    Hi @Anonymous ,

    What is your OnSelect of the Camera control ?

    Your second question is a broad one and this blog of mine should assist.

     

    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.

    Visit my blog Practical Power Apps

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz and thank you for your swift reply.

     

    My OnSelect on the camera control is Camera1.Photo (Camera1 being the current name of the camera control) and there has been a surprising development today, when I tried running the exact same app as I did yesterday on an iPhone. Tapping the control on the iPhone actually registers a photo being taken as the "shutter sound" is played by the phone. Although this didn't happen yesterday with the exact same code, oddly it does work today. It somehow seems at times, that the sync and update progress between the web application and locally installed apps on the phones doesn't always work or needs a humongous amount of time to register the changes. On the Android there isn't any shutter sound when tapping the camera control (for what reason I do not know) but I added a 1 px frame around the control and it shows up when one taps the control itself - so maybe the same registration that indicates, taking a photo but just showing it visually.

     

    Also, there is a new issue which is that the iPhone and two other Androids display the back camera, which is what is needed. The same goes for the web application running in the browser which accesses the primary (frontal but only and primary) camera of the laptop correctly. However, one of the two Androids that we used so far to test the app (older model running 8.0.0) was my own phone until the screen broke and I needed a new one. I bought a new Android yesterday (Galaxy A53 5G) and when trying out the app on that updated model with a newer OS, it is suddenly accessing the front camera instead of the back camera unlike on the the two older Androids, the iPhone and the PC, where the correct behavior persists. I tried this solution to solve the issue https://powerusers.microsoft.com/t5/Building-Power-Apps/using-multiple-camera-Controls-on-one-app/m-p/1316708/highlight/true#M343697 applying the code on the control in the fx function section of the camera control itself but this wasn't successful. However, I'll leave this problem for another time as this isn't the most biggest issue right now. 

     

    The most pressing issue right now is the displaying of the photo to the user after it is taken in either an image control or a gallery control (not so important which one) and then to send it with some date, input text and the photo itself from PowerApps to Microsoft Planner as a task (which is the ultimate goal). Thanks for the link to your blogpost which I am studying as we speak. I can see that your approach involves sending all of the data to Sharepoint but although we have access to this web app in the Microsoft Universe, I am unsure as to whether or not one could use Sharepoint to pass the data on to Planner or if it would be required/easier to do it directly from the PowerApps canvas app to Planner using an alternative way.

     

    Looking forward to your advice. Thanks in advance.

     

    PS. I also just realized that your blogpost tutorial references. that you are supplying the various options for storing and viewing images in Power Apps, using SharePoint as a data source but what I am trying to do is to basically only send data the other way - from PowerApps to Planner. Not sure if your tutorial is applicable on that same issue as well. Alternatively, could there be a way of saving all this data to e.g. OneDrive or similar?

  • WarrenBelz Profile Picture
    154,793 Most Valuable Professional on at

    Hi @Anonymous ,

    I need to cut through all of that at the moment to the fundamental question - you need to store the photo somewhere on the device (a Variable or Collection) and then use that to write the image to the destination An OnSelect of Camera1.Photo  is not doing anything.

    UpdateContext({varPhoto: Camera1.Image})
    

    will put it into a Variable and 

    Collect(colphotos, camera1.Image)

    will make a collection of several photos.

    Also  I have never used Microsoft planner as a target destination, so not sure what assistance I can be there (I am not sure it is possible), but my blog should give you some syntax for the photo export.

     

    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.

    Visit my blog Practical Power Apps

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz and thanks so much for your feedback and kind help.

     

    First of all, I got - good - news about the camera issue. Apparently, there seemed to be an issue with the publishing, which I was doing in a wrong way. This in turn meant, that the functions and code on the camera control didn't respond as intended. Having fixed that issue, all is working as intended. Tapping the camera control on a mobile device now takes a photo, that photo is then stored in the memory of said device (automatically) and then displayed in an image control. So, I am happy to answer you your most fundamental question and that that part is working and solved. 😊

     

    I also understand your approach of using a variable to store the photo and then loading it into the control from said variable, but as mentioned above, it's all working and not required at the moment - although I'll keep it in mind as it could come in handy in the future. Thanks also here.

     

    In regards to sending the photo and text to Microsoft Planner from the PowerApps canvas app, who of the pros in here would you suggest asking? I can see a lot of them listed under "Top Kudoed Authors" and "Top Solution Authors" and was figuring, that some of them could help out instead. Any suggestions here?

     

    Thanks again.

  • WarrenBelz Profile Picture
    154,793 Most Valuable Professional on at

    Hi @Anonymous ,

    You can probably post as a new thread with the specific subject, however I did a quick test Flow and there is no field in Planner that will accommodate and image

    WarrenBelz_0-1663017454789.png

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi again @WarrenBelz,

     

    thanks. I sure will. 🙂👍

     

    Yeah, we have been discussing that issue with the image in Planner previously. It seems, that there is no direct way of doing this. But would there be a workaround such as storing the images in say, OneDrive or using Sharepoint etc. as you mentioned before and then just linking to those images with a hyperlink in a text field in Planner? Or something akin to that solution?

     

    PS. I just scoured the net, trying to figure out if there was a possibility at all to do what I want to in terms of attaching images and came up with the following from MS documentation.

     

    https://support.microsoft.com/en-us/office/attach-files-photos-or-links-to-a-task-52c688e1-aeb0-4b49-8d78-42984cd553f7https://support.microsoft.com/en-us/office/attach-files-photos-or-links-to-a-task-52c688e1-aeb0-4b49-8d78-42984cd553f7 

     

    Apparently, there seems to be a possibility to do this anyway. 😊 What do you think?

     

     

    Also, there are two unrelated issues with the camera control:

     

    1) When we test the app on an older iPhone, the "shutter" sound is being played when tapping and taking a photo with the camera. However, this doesn't happen when testing the app on two separate Android devices (this is probably related to whether or not the OS being used has this feature). Is there a fix for that? Can a sound be played or is it possible to display some animation/text/give the camera some animated border effect that confirms to the user, when no photo and then respectively a photo has been taken?

     

    2) When the user progresses to the next page, where the photo taken is displayed in the image control and where additional input controls give the user the possibility to also add some text information, an issue arises with the behavior of the camera control. We decided to add a back arrow that navigates to the previous page where so the user can take a new photo with the camera control if the image for some reason isn't satisfactory. This in turn removes the photo from local storage and repeats the process of taking a new photo, which is what we want. However, when navigating to the previous page on the Android devices, the camera control displays a black screen and the error message as seen in this post (black image with white text).

     

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Camera-isn-t-set-up-properly-message-appearing-despite/m-p/1202517/highlight/true#M315308

     

    The only way of getting the camera to work/activate it again is by selecting one of the other cameras from the dropdown or pushing the on/off-button on the Android device twice in rapid succession, which is a real issue. This behavior doesn't happen with the older iPhone though, which might indicate an issue with the OS/PowerApps or a camera issue on older vs newer devices.

     

    Is there any way of fixing this problem?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 519 Most Valuable Professional

#2
11manish Profile Picture

11manish 489

#3
Haque Profile Picture

Haque 327

Last 30 days Overall leaderboard