cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Disable phone's camera

Hello everyone,

I would like to know if it is possible to disable phone's camera (or cameras in case there is more than one) through a control, perhaps by scanning a QRcode or so.

Thanks

Omar salgado

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps
Power Apps

Re: Disable phone's camera

You can disable the camera as it's being used in your app within PowerApps. You cannot disable the camera for all apps in the phone.

 

To disable the camera in your app, you can set the DisplayMode property of the camera control to an expression that is dependent on a variable, such as the following:

If(cameraEnabled, DisplayMode.Edit, DisplayMode.Disabled)

You can now use a button, for example, to update the value of the 'cameraEnabled' variable. If you have the expression below in a button's OnSelect property, it will toggle the camera will be enabled / disabled when the button is clicked:

UpdateContext({cameraEnabled: !cameraEnabled})

If you have more than one camera control in your app, you can set the Disabled property of all of the controls to the same value.

 

As far as scanning a QR Code, PowerApps currently doesn't support it natively. One possibility would be to tap into the OnSelect property of the camera to call a custom API that processes the image that was captured. But that requires this custom API to exist (you could build one yourself if a public one doesn't exist).

View solution in original post

1 REPLY 1
Highlighted
Power Apps
Power Apps

Re: Disable phone's camera

You can disable the camera as it's being used in your app within PowerApps. You cannot disable the camera for all apps in the phone.

 

To disable the camera in your app, you can set the DisplayMode property of the camera control to an expression that is dependent on a variable, such as the following:

If(cameraEnabled, DisplayMode.Edit, DisplayMode.Disabled)

You can now use a button, for example, to update the value of the 'cameraEnabled' variable. If you have the expression below in a button's OnSelect property, it will toggle the camera will be enabled / disabled when the button is clicked:

UpdateContext({cameraEnabled: !cameraEnabled})

If you have more than one camera control in your app, you can set the Disabled property of all of the controls to the same value.

 

As far as scanning a QR Code, PowerApps currently doesn't support it natively. One possibility would be to tap into the OnSelect property of the camera to call a custom API that processes the image that was captured. But that requires this custom API to exist (you could build one yourself if a public one doesn't exist).

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,675)