Power Apps Camera Control – How to Use

Power Apps Camera control allows users to capture snapshots with a device’s camera. In this Power Apps Tutorial, we will go over all of the Power Apps camera controls and the many sorts of attributes that fall under camera control, as well as how to use this control in various circumstances.

Currently, we got introduced to the Power Apps Camera control while working with the Power Apps canvas app.

Below, I have explained how to add that camera control to how to use that control to get the live captured image with a step-by-step guide.

Power Apps Camera control

A Power Apps Camera control is used to take images using a device’s camera. The device must have a camera, and the user must grant the app permission to utilize the camera. The device might be a phone, tablet, laptop, or any other device with a camera.

We can capture the real-time image by clicking on the camera control.

Add a Power Apps Camera Control to Canvas App

In Power Apps, the camera control comes under the ‘Media’. To add a camera control to the Power Apps canvas app screen, the following steps are:

  • On the Power Apps canvas app, navigate to the Insert tab.
  • Expand Media > Select Camera. We can see the camera control will be added to the Power Apps screen as shown below:
Power Apps camera control

This is how to add a camera control to the Power Apps canvas app screen.

Properties of PowerApps Camera Control

After you’ve added the Camera control to the Power Apps screen, you can change its properties and configure it to our requirements. These are some examples of common properties and functionalities:

  • Camera: It allows us to enter the camera’s numeric ID. It is useful for devices (that have front cameras, and back cameras just like smartphones) that have more than one camera.
  • OnSelect: When the control is selected or clicked, you can define an action to be performed. You can use this property to capture a picture while clicking on the camera control.
  • OnStream: The Stream attribute describes how the app responds when it is updated.
  • StreamRate: In milliseconds, how frequently the picture on the Stream property should be updated. This number might range from 100 (1/10th of a second) to 3,600,000 (1 hour).

How to take photos in Power Apps Camera Control

Let’s have a look at how to capture a photo with the Power Apps camera control. To show the captured picture via camera control, we will use a Power Apps Image control.

For this, the following steps are:

  • On the Power Apps screen, add a camera control and image control.
  • Select the image control and insert the below expression on the image control’s Image property.
Image = Camera1.Photo

Where Camera1 is the name of the Power Apps camera control that we have used.

Additionally, I have used 2 text labels for the camera control and image control as shown below:

PowerApps camera control take photo
PowerApps camera control take photo

That’s it! Let’s publish the app and preview it. We can see that once we clicked on the camera control, the captured image will appear on the image control as shown below:

PowerApps camera control capture photo
PowerApps camera control capture photo

This is how to take photos and display them using the Power Apps camera control.

PowerApps camera control to attachment

We recently published an article on how to save pictures captured by the Power Apps camera control to the SharePoint list attachment column. Follow the mentioned link to fulfill the business requirement.

Snap Pictures on Button Click in Power Apps camera control

In this section, we will see how to snap pictures via a button click instead of a Power Apps camera control.

That means we will add a camera control and a button control to the app. We will use the button control to take the shot; instead of by tapping on the camera control. Also, we will collect all the captured images within a collection.

To implement the above scenarios, the following steps are:

  • On the Power Apps screen, add a camera control and button control.
  • Set ‘false’ on the camera control’s OnSelect property.
  • Give a text to the Power Apps button control. (Ex: “Click Here To Capture” )
  • Insert the below expression on the button’s OnSelect property.
OnSelect = Select(Camera1);
Collect(
    CapturedImages,
    {
        Snap: Camera1.Photo,
        Date: Now()
    }
);

Where Camera1 is the name of the Power Apps camera control, CapturedImages is the name of the collection to collect the captured data with the current date and time.

Power Apps camera control button click
  • Next, we will use a Power Apps vertical gallery to display the collection.(that collected the captured images)
  • Add a Power Apps vertical gallery to the screen and connect that gallery to the collection that we have created (i.e., CapturedImages) and keep the layout as ‘Image and Title‘.
  • That’s all! Publish the app for now and we can see that the image will capture only when clicking on the button.
  • Additionally, the collected images will be saved in the collection and displayed via galley with the real-time captured timing, as shown below:
Power Apps Camera control button

This is how to use a Power Apps camera control via a button.

Conclusion

From this Power Apps Tutorial, we learned all about Power Apps camera control such as:

  • What is a Camera control in Power Apps
  • Add a Camera Control in Power Apps Canvas App
  • Properties of PowerApps Camera Control
  • How to take photos in Power Apps Camera Control
  • PowerApps camera control to attachment
  • Power Apps camera control button

You may also like:

  • The button method doesn’t seem to work correctly. The images in the gallery are all the exact same.

  • >