Reader small image

You're reading from  Learn Microsoft Power Apps - Second Edition

Product typeBook
Published inSep 2023
PublisherPackt
ISBN-139781801070645
Edition2nd Edition
Right arrow
Authors (2):
Matthew Weston
Matthew Weston
author image
Matthew Weston

Matthew is a Microsoft 365 & SharePoint specialist from the Midlands in the United Kingdom. He has spent several years working in various Consultancy roles. Matthew is the Managing Director of Vantage 365, which fuels his love of working on projects surrounding Microsoft 365, especially those that involve SharePoint, Microsoft Teams, Power Apps, and Power Automate. This could be helping businesses find solutions for their problems or offering training to help people use these technologies better. Matthew leads the Black Country Power Apps & Power Automate user group, and the Office 365 & SharePoint User Group in the West Midlands. Matt is a Microsoft Most Valuable Professional in the field of Business Applications.
Read more about Matthew Weston

Elisa Bárcena Martín
Elisa Bárcena Martín
author image
Elisa Bárcena Martín

Elisa Bárcena Martín is currently a project leader at LogiRAIL, having previously worked as a business apps specialist at Intelequia and a project analyst at GlaxoSmithKline. As a Power Platform enthusiast with more than 3 years of experience with the Power Platform, she has steadily grown from her initial role as a developer into her project leader position. She is a scientist and teacher by vocation, loving process optimization and believing in continuous improvement and learning.
Read more about Elisa Bárcena Martín

View More author details
Right arrow

Securing Your Power Apps

One of the most fundamental features of any system is the ability to secure the data that is being stored and processed. When developing any type of app, we should always keep security at the forefront of our mind, especially when our apps display or process any form of data.

We need to ensure that the users have access to only the information that they are authorized to see, and that their levels of access are not higher than what they need to be able to perform their duties.

In previous chapters, we investigated retrieving and displaying data from data sources. We will now start to look at how security at the data source affects our app and how we can implement some levels of security within the app to govern what people can and cannot do.

App developers often make the mistake of simply hiding data in the app and assuming that this makes the data secure. This is certainly not the case as the underlying data source could be accessed in other ways...

Feedback

We are constantly looking at improving our content, so what could be better than listening to what you as a reader have to say? Your feedback is important to us and we will do our best to incorporate it. Could you take two mins to fill out the feedback form for this book and let us know what your thoughts are about it? Here's the link: https://forms.office.com/r/STtMpJAhFS.

Thank you in advance.

In the previous chapter, we started to capture more contextual information within our apps by utilizing the built-in GPS functions of a mobile device. In this chapter, we will expand our utilization of mobile device capabilities by capturing and using images, as well as being able to read/identify information from barcodes and Quick Response (QR) codes.

Both barcodes and QR codes are available on almost everything that we interact with on a day-to-day basis, whether that is on our food goods or our electronics, and even for quickly locating apps. These unique identifiers can be utilized...

Technical requirements

To follow along with this chapter you will need to have completed the previous labs.

In order to be able to use the camera controls, you will need a device with a camera. To use the barcode scanner, you will need a mobile device with the Power Apps app installed.

Understanding how to store images within Power Apps

Before we start to utilize the image controls within Power Apps, it is important to understand where we can actually store them. Power Apps can read and use images from a number of different storage types, including SharePoint. However, while saving the images, we can only natively save them to Excel, SQL Server, and Dataverse, which we will discover more about in Chapter 19, Dataverse. While we can't directly save the images to SharePoint (and other more obvious image stores), there are ways in which we can utilize other areas of Office 365 to save images, which we will investigate in the next chapter.

When we talk about capturing images, we are introducing ways in which we can use visual inputs, rather than constantly using something textual. Really, when we are considering how we want to use images within Power Apps, especially given that we are designing for a mobile device, the obvious way of using images is with the camera...

Using the camera control

The Camera control is one of the controls that directly interacts with the camera attached to the device. This could be a camera that is built into the device itself, for example, the camera in a phone, or it could be a wired camera that is attached to a desktop device. The camera control allows us to directly capture an image using that device and then do something with it in Power Apps.

The Camera control can be inserted into the page from the Insert | Media menu, and when it appears on your page, it will immediately start to stream a feed from your camera:

Figure 11.1: The camera control on the canvas showing a live feed

Within our app, we have the ability to select the camera that we want to take the feed from. The camera selection takes the form of a numerical value, with your primary camera being 0, and then subsequent cameras being numbered from there.

If we take Microsoft Surface as an example, the front-facing camera is camera 0, while the rear-facing...

Using the Add picture control

Using the Add picture control is the quickest and easiest way for images to be added to an app in Power Apps since it allows us to upload images from the local device. If this control is used and accessed using a desktop browser, then the local file explorer will be used to select the file, and if the control is used on a mobile device, then you will simply select the images from the local image store.

Power Apps supports all of the common image types, including the following:

  • jpg
  • jpeg
  • png
  • gif
  • bmp
  • tif
  • tiff
  • svg

The behavior of the Add image control is quite interesting as it actually creates a group of controls. It adds a button for the user to click on to upload an image and adds an image control, all within a control group, as shown in the following screenshot:

Figure 11.6: Control group containing an add media button and an image control

The camera on a device is versatile and can be used to capture data as well as images.

Understanding the barcode scanner

Barcodes come in a range of different sizes and types – even in different formats since you could consider a QR code to be a barcode. Both types of graphics are designed to encode data into a graphic that scanners can then retrieve and process.

Barcodes are used within our day-to-day lives, most commonly associated with shopping, with the goods being scanned and the scanning solution being able to immediately recognize what the goods are based on the code. Domestically, we see this also being used more and more within selling services such as Ziffit or SellitBack, where the user scans a barcode and gets immediate product feedback. The same applies to QR codes, which are now more commonly associated with web pages so that someone can scan the image and the associated page loads in the browser.

The Barcode scanner control supports the following barcodes:

  • Universal Product Code A (UPC A)
  • UPC E
  • European Article Number 8 (EAN 8)
  • CODE 39
  • CODE 128
  • Interleaved...

Lab 9

Within this lab, we are going to add two additional elements to our asset tracking app by capturing a picture of the asset and the barcode at the point of entry. The reason for using a barcode during this lab is because most products ship with at least one identifying barcode on them, making testing the solution much simpler.

Activity 1: Updating the data source

First of all, we need to update our data source to be able to receive the two new pieces of data:

  1. Open the Excel spreadsheet, Assets.xlsx, which we have been using as our asset store throughout the previous labs.
  2. Add a column with the title Asset Photo[image].
  3. Add a column with the title Asset Barcode:

    Figure 11.11: Excel spreadsheet with added columns
  4. Save and close the spreadsheet.

Now that we have prepared our data source, let's update our app so that we can feed data into it.

Activity 2: Updating the Power App to capture a photo

Now, we are going to add two new data cards to the input form in the asset management...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Learn Microsoft Power Apps - Second Edition
Published in: Sep 2023Publisher: PacktISBN-13: 9781801070645
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (2)

author image
Matthew Weston

Matthew is a Microsoft 365 & SharePoint specialist from the Midlands in the United Kingdom. He has spent several years working in various Consultancy roles. Matthew is the Managing Director of Vantage 365, which fuels his love of working on projects surrounding Microsoft 365, especially those that involve SharePoint, Microsoft Teams, Power Apps, and Power Automate. This could be helping businesses find solutions for their problems or offering training to help people use these technologies better. Matthew leads the Black Country Power Apps & Power Automate user group, and the Office 365 & SharePoint User Group in the West Midlands. Matt is a Microsoft Most Valuable Professional in the field of Business Applications.
Read more about Matthew Weston

author image
Elisa Bárcena Martín

Elisa Bárcena Martín is currently a project leader at LogiRAIL, having previously worked as a business apps specialist at Intelequia and a project analyst at GlaxoSmithKline. As a Power Platform enthusiast with more than 3 years of experience with the Power Platform, she has steadily grown from her initial role as a developer into her project leader position. She is a scientist and teacher by vocation, loving process optimization and believing in continuous improvement and learning.
Read more about Elisa Bárcena Martín