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:
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:
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:
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);
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.
- 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:
This is how to use a Power Apps camera control via a button.
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:
- Power Apps Form field validation on submit
- Power Apps CRUD Operations: Business Consultation App
- How To Use Power Apps Image Control
- Power Apps Column Chart
After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (9 times). I have also worked in companies like HP, TCS, KPIT, etc.