© Ralph Mercurio and Brian Merrill 2021
R. Mercurio, B. MerrillBeginning Microsoft 365 Collaboration Appshttps://doi.org/10.1007/978-1-4842-6936-7_13

13. Power Apps

Ralph Mercurio1   and Brian Merrill2
(1)
Clayton, NC, USA
(2)
Morrisville, PA, USA
 

In the previous chapter, I discussed Power BI, Microsoft’s data and reporting platform. In this chapter, I will be discussing Microsoft Power Apps, a new and innovative way to build solutions within Microsoft 365.

Like Power Automate and Power BI, Power Apps is the final application to make up the Power Platform. This platform allows for more advanced workflows, reporting, and now applications to make collaboration even more engaging. Power Apps is available in a wide variety of Microsoft 365 licenses, including E1, E3, and E5 Microsoft 365 plans.

Microsoft Power Apps allows you to create custom applications with connections to a wide variety of data sources. This application was designed to provide low- or no-code interfaces to users to begin to build applications. As your skills develop in Power Apps, you can then begin to build advanced Power Apps and have the ability to add code.

The goal of this chapter is to expose the reader to the basics of Microsoft Power Apps. For more information on using and creating great Microsoft Power Apps, please take a look at Beginning Power Apps: The Non-Developer's Guide to Building Business Applications, Second Edition, by Tim Leung.

Overview of the Power Apps Interface

Within Microsoft 365, click the app launcher in the upper-left corner and select Microsoft Power Apps, as shown in Figure 13-1.
../images/459026_2_En_13_Chapter/459026_2_En_13_Fig1_HTML.jpg
Figure 13-1

Launching the Microsoft Power Apps application

Once you click the application, you will be presented with the Power Apps dashboard (see Figure 13-2). The Power Apps dashboard includes links within the left-hand navigation (similar to the Power Automate interface), an area to access datasets, app wizards, trainings, and apps recently created by you.
../images/459026_2_En_13_Chapter/459026_2_En_13_Fig2_HTML.jpg
Figure 13-2

Microsoft Power Apps interface

Now that you know the layout, let’s take a deeper dive and explore the options within Power Apps before we embark on our journey of Power Apps development. The left-hand navigation menu contains the following links:
  • Home: Provides a link back to the home screen.

  • Learn: Resources such as training, support, and documentation.

  • Apps: Power Apps that have been developed by you along with the last time modified, owner, and Power Apps type.

  • + Create: Preconfigured Power Apps templates to use.

  • Data: The Data menu contains Tables, Choices, Dataflows, Export to data lake, Connections, Custom Connectors, and Gateways. Tables are a way to structure and store data; Power Automate and Power Apps share tables. Connections will allow you to see all the connections that are used for your account, while Custom Connectors will list any custom connectors used. Gateways, which refer to data gateways, allow the cloud services to reach on-premises data.

  • Flows: Shows flows that have been created on the Power Automate platform.

  • Chatbots: Allows you to build chatbots to interact with users in a preprogrammed question/answer format we are used to.

  • AI Builder: Allows you to add artificial intelligence to your applications. This functionality can be used to extract information, detect objects, or utilize predication.

  • Solutions: Allows you to import prebuilt solutions from the marketplace or from software providers. These solutions can then be used within the Power Apps platform.

The Power Apps application contains four main areas, “Start from data,” “Make you own app,” “Learning for every level,” and “Your apps”:
  • Start from data: Predefined connectors that allow you to connect to a wide variety of data sources including but not limited to Microsoft 365, SQL, Dropbox, Oracle, and so on.

  • Make your own app: Default templates that allow you to create one of the three types of applications. We will explore each type more in the next section.

  • Learning for every level: Provides training and documentation resources.

  • Your apps: A list of applications that you have created.

Power Apps

Power Apps provides the ability to build three different types of applications from blank templates (see Figure 13-3.) Each one of these types has its own benefits and use. Let’s take a look at each type and explore them in more detail.
../images/459026_2_En_13_Chapter/459026_2_En_13_Fig3_HTML.jpg
Figure 13-3

Types of blank Microsoft Power Apps templates

Types of Power Apps

Start from Data

Power Apps gives you the option to begin development from a dataset. This dataset can be in Excel (as a table) or any of the other supported datasets. This is one of the fastest ways to build a PowerApp, and shortly we will walk through an example of creating a PowerApp from a dataset.

Canvas

Canvas apps are a type of PowerApp and are aimed at a zero-code development process. These apps allow the app builder full control over the interface and can connect to a wide variety of data sources. Canvas apps can be formatted to fit the tablet or phone devices.

Model Driven

Model-driven apps are a bit different than canvas apps in that they are based on the data source, not the user experience.

Portal

Portal apps are the third type of Power Apps that is available for use. These apps differ than the other apps in that they align with Dynamics 365. These apps are externally facing websites and allow for outside users to connect with a variety of authentication providers.

Overview of the Power Apps IDE

Left Navigation Menu

Once we choose the type of PowerApp we would like to create, we are brought to the canvas to build our application. The left-hand menu is replaced as seen in Figure 13-4.
../images/459026_2_En_13_Chapter/459026_2_En_13_Fig4_HTML.jpg
Figure 13-4

Power Apps canvas left menu

This menu allows us to control different elements of our PowerApp. We will describe each option in the following:
  • Tree view: This option shows us the hierarchical view of the different screens that are part of our application. Each screen drop-down will show the different elements added to that screen in a list.

  • Insert: This option allows us to add items to our current screen in our app. There are many options from buttons to user input. We will cover these options in more depth in a bit.

  • Data: This option will allow us to see all of the data we are bringing into our app to use. We are also able to connect new data sources by clicking Add Data via this option.

  • Media: Here we are able to see media, photos, videos, and audio files that we have access to in the app. We are also able to upload new items via this menu option.

  • Advanced tools: We have two tools in this option: Monitor and Tests. Monitor allows us to see our app usage and the performance and monitor for possible bugs, presented in the app. Tests allows us to write tests to validate our app and ensure it does the correct actions depending on how our tests are written.

Create a PowerApp

Your First PowerApp

Now that we have a basic understanding of how to access Microsoft Power Apps, let’s create one as seen in Figure 13-3. Our first PowerApp will be created from a data source (Excel). This will allow Power Apps to build out the majority of the entire application and with very little code.

The first step in creating this PowerApp from data is to create the data source in Excel. Open Excel, and enter the data (or similar) as seen in Figure 13-5.
../images/459026_2_En_13_Chapter/459026_2_En_13_Fig5_HTML.jpg
Figure 13-5

Creating the Excel data source

Once the Excel data source is created, the next step is to format the cells and columns to be a table. By creating a table, Power Apps can ingest it and create the appropriate connectors to read and write to the file. To create the table, highlight the cells and choose “Format as Table” in the Excel ribbon, under the Home tab as seen in Figure 13-6.
../images/459026_2_En_13_Chapter/459026_2_En_13_Fig6_HTML.jpg
Figure 13-6

Formatting the Excel as a table

Pick a style and check the checkbox “My table has headers.” When complete, it should look similar to Figure 13-7.
../images/459026_2_En_13_Chapter/459026_2_En_13_Fig7_HTML.jpg
Figure 13-7

Checking the checkbox “My table has headers”

Now that the table has been completed and formatted, the final step is to rename the table, which can be done from the Design tab of the Excel ribbon. We are now ready to save the file to a location that Power Apps can access it. For this example, I will save the Excel document to my OneDrive. If you need a refresher on OneDrive, please refer to Chapter 3, which details the OneDrive application.

Once the file is saved to your OneDrive, we can then navigate back to Power Apps and create our first PowerApp. Navigate to Power Apps and choose “Other data sources” from the Start from data graphic as seen in Figure 13-3. Next, choose OneDrive for Business connection; if you do not see it, you may need to add the connection so Power Apps can access the file. Select the correct file as seen in Figure 13-8.
../images/459026_2_En_13_Chapter/459026_2_En_13_Fig8_HTML.jpg
Figure 13-8

Choosing the Excel file

Once you select the file, Power Apps will ask for the table, select the correct table, and click “Connect” in the lower-right corner. This will initiate Power Apps and begin to build the data-driven application. The process takes a few seconds and after a few seconds will display the completed application as seen in Figure 13-9.
../images/459026_2_En_13_Chapter/459026_2_En_13_Fig9_HTML.jpg
Figure 13-9

First version of the data-driven app created by Power Apps

Note

The Excel file must be closed during this process as Power Apps creates connectors to read/write to the file. The file cannot be open while the application is in use as it will cause conflict errors.

When looking at the Power Apps interface, there are a few areas to be aware of. These areas include the Power Apps ribbon, Object panel, main design area, and Properties panel as seen in figure 13-10.
../images/459026_2_En_13_Chapter/459026_2_En_13_Fig10_HTML.jpg
Figure 13-10

Power Apps IDE

The four areas pictured in the preceding are the following:
  • Power Apps ribbon (1): The Power Apps ribbon contains tabs that allow to insert controls, view objects of the PowerApp, and be able to set actions such as start a Power Automate. You will also be able to save the application and preview it.

  • Object panel (2): This panel shows the various components included in the PowerApp, as well as the ability to insert components similar to the Insert tab in the ribbon.

  • Main design area (3): This stage shows the PowerApp, and you are able to modify it as needed.

  • Properties panel (4): As you select an object in the Object panel, any associated properties will be displayed in this panel.

Now that we are familiar with the Power Apps IDE, let us take a look at the application and quickly change the table name to something that is meaningful. To change the table name (upper--left corner), left-click the “Table32”; once clicked, you then will be able to change the name by the property in the Properties panel. For reference, see Figure 13-11, which details the change.
../images/459026_2_En_13_Chapter/459026_2_En_13_Fig11_HTML.jpg
Figure 13-11

Changing the name of the table text

Let us preview our first PowerApp; to do so, click the play button in the upper-right corner. The application will render within the browser as a new tab, and the following functions will be available out of the box. These functions include sorting, adding an item, deleting an item, and refresh. To add a new item, click the plus sign in the upper corner of the application and enter an employee name and a lunch item. When entered, click the checkmark icon in the upper corner of the app to save your changes.

Like adding, deleting is very straightforward as well. To delete an item, select an item from the application and click the trash can icon in the upper corner. To edit an item, click the pencil to edit the item. Any changes within the application will be automatically saved back to the Excel spreadsheet.

Once we are satisfied with our application, let us add it to Microsoft Teams. To publish the app, click File in the Power Apps ribbon. Save the application, and then choose Share. In the Share window, select “Add to Teams” as seen in Figure 13-12.
../images/459026_2_En_13_Chapter/459026_2_En_13_Fig12_HTML.jpg
Figure 13-12

Exporting the application

Once you clicked the link, you will be promoted to save the file locally. Click “Download app,” in the lower-right corner; the file format will be a zip file. Now that we have the zip file of our PowerApp, choose which Team you want to add the PowerApp to. In my example, I will be adding the PowerApp we created to the All Employees team. Within the General channel of the team, click the plus sign (Add a tab) and select Manage apps located in the lower-right corner as seen in Figure 13-13.
../images/459026_2_En_13_Chapter/459026_2_En_13_Fig13_HTML.jpg
Figure 13-13

Adding a custom app to Teams

In the next screen, select “More apps” ➤ “Upload a custom app” and choose the file we saved from Power Apps earlier. In Figure 13-14, you can see that we embedded the PowerApp into Teams and in a new tab.
../images/459026_2_En_13_Chapter/459026_2_En_13_Fig14_HTML.jpg
Figure 13-14

The completed PowerApp deployed within a team

This is a very simple PowerApp but shows the basic functionality that can be provided. As your skillset grows, you will be able to create more complex Power Apps.

Editing a SharePoint List Form with Power Apps

As we briefly mentioned in Chapter 2, we can edit the SharePoint list forms in Power Apps. For the IT users who are familiar with InfoPath, this is not a full replacement; however, it is getting closer. For new users, InfoPath, which has been deprecated from the Office product, was Microsoft’s attempt at a user-friendly form product.

Editing a form in Power Apps only currently applies to lists and not libraries as well as some other restrictions. The first step in this project will be to create a SharePoint list and associated columns with the appropriate data type. Once completed, the list and form should look like Figure 13-15.
  • List name: Budget Details

  • Column: Title (single line of text)

  • Column: Amount (currency)

  • Column: New Request (yes/no)

  • Column: Vendor (single line of text)

  • Column: Renewal (yes/no)

  • Column: Contract Number (number)

../images/459026_2_En_13_Chapter/459026_2_En_13_Fig15_HTML.jpg
Figure 13-15

The configured SharePoint list and current form

The next step is to edit the form in Power Apps. As discussed in Chapter 2, click Power Apps in the list and choose “Customize forms.” This will open the form in Power Apps and allow us to begin to edit the form as seen in Figure 13-16.
../images/459026_2_En_13_Chapter/459026_2_En_13_Fig16_HTML.jpg
Figure 13-16

Editing a SharePoint list form in Power Apps

The first thing we are going to do is to remove the ability to add an attachment; to do so, simply delete the attachment field by highlighting the field and pressing the Delete key.

The next thing we are going to do is to set the visible property on the Vendor and Contract Number fields via conditional formatting. The idea is that if the user does not need to fill in those fields, we can leave them blank. In Power Apps this is very simple to accomplish; it starts with setting the visible property of the control to false via a formula. To do so, click the form to identify the control that will be used to hide the other fields as seen in Figure 13-17.
../images/459026_2_En_13_Chapter/459026_2_En_13_Fig17_HTML.jpg
Figure 13-17

Determine the control that will be used for hiding the other fields

This toggle is identified as New Request_DataCard1, and the toggle control is called DataCardValue3 as highlighted in red in Figure 13-17. The correct formula for this example is “If(DataCardValue3.Value = true, true),” which will be used to hide the Vendor field. Other types of fields such as choice can be used for conditional formatting.

The next step is to select the Vendor field and set the visible property to “If(DataCardValue3.Value = true, true),” as seen in Figure 13-18. Repeat the process again by selecting the correct value for the Renewal toggle and setting the Contract Number field to hidden/shown based on the chosen value.
../images/459026_2_En_13_Chapter/459026_2_En_13_Fig18_HTML.jpg
Figure 13-18

Setting the visible property of a field based on conditional formatting

Once completed, the form should look like Figure 13-19. To test functionality within the Power Apps IDE, hold down the Alt key and interact with the form. The fields should react to the chosen value for both New Request and Renewal toggle fields.
../images/459026_2_En_13_Chapter/459026_2_En_13_Fig19_HTML.jpg
Figure 13-19

The completed form edited in Microsoft Power Apps

Once, you make the needed changes and are happy with the form, go to File ➤ Save. Once saved you will be able to publish back to the SharePoint list, by clicking “Publish to SharePoint.” Once the form is published, navigate back to the SharePoint list, and click “New.” The edited form will be displayed as seen in Figure 13-20.
../images/459026_2_En_13_Chapter/459026_2_En_13_Fig20_HTML.jpg
Figure 13-20

The completed form displayed in SharePoint

As you can see, Microsoft Power Apps offers an extraordinary interface to begin crafting applications and editing list forms within SharePoint. This chapter only exposed a very tiny bit of the power of Power Apps. I encourage you to explore the available templates to understand and interact with nearly built applications provided by Microsoft. If you are interested in learning more about Power Apps, please take a look at Beginning Power Apps: The Non-Developer's Guide to Building Business Applications, Second Edition, by Tim Leung.

In the next chapter, we will summarize the key aspects of the applications and provide a very high-level plan to use them.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.126.5