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 / Change camera to front...
Power Apps
Answered

Change camera to front/back

(0) ShareShare
ReportReport
Posted on by 909

Hello,

 

Is it possible to allow users to change camera control front/back?

Cause in my app it is always back camera, and I need to allow front camera for convenience.

 

Categories:
  • timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    Hi @Elitezone 

    The Camera property of the camera control controls the camera. It accepts a numeric id. You could link this to a slider control to enable the user to change the camera.

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-camera

     

  • Elitezone Profile Picture
    909 on at

    @timl 

    I created a toggle and made a function:

    Camera1.Camera = 1

    OnCheck

    on OnUncheck:

    Camera1.Camera = 0

     Camera1 is my camera control.

     

    Am I doing something wrong?

    When I manually change camera parameter it seems do be doing something but this toggle isn't working...

  • Verified answer
    ganeshsanap Profile Picture
    1,555 on at

    @Elitezone , Set OnChange property of Toggle control to:

     

    UpdateContext({cameraMode: !cameraMode})

     

    Set Camera property of you camera control to:

     

    cameraMode

     

    This should work for you. You can also set default value to cameraMode varibale at screen OnVisible or App OnStart property as per your requirements.


    Please click Accept as solution if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

     

  • timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    Hi @Elitezone 

    You should be able to just set the Camera property to:

    If(Toggle1.Value, 1,0)

    Another thing is that some devices may have more than 2 cameras so depending on the device, the id that you need to use may be someting other than 0 and 1.

  • rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    hi there

     

    set the Camera1.camera = value(radiobox.selectedvalue.tex) or in your case toggle, If(toggle.value,1,0)

     

    R

     

  • Elitezone Profile Picture
    909 on at

    It works

    @rubin_boer @timl @ganeshsanap 

    I just hope my users will have two cameras at most.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I had a problem to get the back camera of a Samsung Galay A50 working.

     

    The back camera wasn't responding for the Camera poperty  = "1" 

     

    Finaly I had to use the value "2"  for the Camera poperty to get it working.

    UpdateContext({DeviceCamera: If(DeviceCamera = 0;2;0)})

     

    Regards Gerhard

  • Jace Profile Picture
    58 on at

    I had high hopes for this solution.  I found another article explaining these same steps.  Unfortunately, it didn't work.  Troubleshooting further, I realized the phone I was testing on actually has two front facing cameras.  So, while the cameraMode was successfully toggling, it was toggling between camera 0 and camera 1 which are both the front facing camera.  Another solution in the thread brought up a similar issue and solved it by toggling between the values 0 and 2

    UpdateContext({DeviceCamera: If(DeviceCamera = 0;2;0)})

     

    This approach would seem to fix the issue, but my worry is for other devices that may indeed only have two cameras.  In that case, it could break.  I really don't want to resort to a drop-down for selecting the camera, but I just worry about not having control what phone the user has and the amount of front/back cameras that could vary between the devices.  Not sure if there is a way to toggle between every possible camera by a button, but any advice/help would be greatly appreciated.

  • Matthewvize Profile Picture
    37 on at

    You may want to check the permissions of the app on your phone as I was having similar issues

  • swanders Profile Picture
    45 on at

    You share my worries @Jace , different phones have different camera's. Have you ever gotten a workaround to this? I'm thinking of something like capturing the options and 'loop' trough the camera's with a button, even if this makes you select the 'front' or 'back' twice (for example).

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard