WorkshopPLUS - Power Apps For Power User - Labs
WorkshopPLUS - Power Apps For Power User - Labs
WorkshopPLUS - Power Apps For Power User - Labs
WorkshopPLUS
Power Platform: Power Apps for Power User
This is a beginner level lab with optional intermediate modules for you to get hands-on
experience with the Microsoft Power Platform technologies – Power Apps and Power Automate.
The lab includes step-by-step instructions for someone new to these technologies to build a
Device Orders solution in a few hours.
Technologies covered:
Make sure to follow all the pre-requisite steps listed in this document before starting the labs.
Once you have completed the lab, please share your feedback with the Engineer delivering this
course.
This lab is divided into one primary module and a few (intermediate) optional modules:
Power Apps canvas studio has three panes and a ribbon that make app creation feel like
building a slide deck in PowerPoint. Formulas are entered within a function bar that is like Excel.
Interface layout:
1. App authoring pane, which allows you to navigate screens and controls, data sources
etc.
2. Canvas pane, which contains the app screen that you are working on, screen selector
and zoom options
3. Properties pane, where you configure properties for controls, bind to data and set
additional advanced settings
4. Properties list, where you select the property for the selected control that you want to
configure
5. Formula bar, where you add formulas (like in Excel) that define the behavior of a
selected control
6. Ribbon, where you perform common actions including customizing design elements.
Solution Overview
Microsoft Power Platform technologies enable users familiar with technology (aka ‘citizen
developers’) to build a customized device ordering solution. The application user interface and
interaction logic are built in Power Apps, the approval process is automated using Power
Automate, and the device order data is stored in a SharePoint list.
If you are experiencing problems with progressing through these labs – please, ask your instructor for help.
4. Click ‘Skip’ if you receive the Welcome to Power Apps Studio prompt
5. If prompted, select your region, then click ‘Get Started’
It is a good practice to rename screens and controls as you create them so that they are easier to locate as
you work with formulas that reference different controls. In this lab, we will rely on the best practices and
naming conventions defined in Canvas apps coding standards and guidelines.
Full document link: https://aka.ms/powerappscanvasguidelines
1. Make sure you have selected Tree View (1) in the App authoring pane
Click +New screen (2) and select Sidebar (3) layout
2. Click “…” next to Screen2 (or right click) and select the Rename option
4. Click “…” next to Screen1 (or right click) and select the Delete option
In this task, you will save an initial version of the app. Power Apps saves automatically each 2
minutes after the first save (Tip: This setting can be disabled).
1. First, check if there are any errors in the app. Click on the ‘App checker’ icon
2. App checker pane will become visible. If there are any errors, they will be displayed here 3.
Close the App checker pane
4. Click Settings button in the ribbon
This setting will make app screen responsive instead of simple app resize, but it will
require you to leverage techniques to enable dynamic layout.
For more details read: Create responsive layouts in canvas apps
8. Click ‘X’ in the top-right corner to close the dialog
9. Click Save button in the ribbon toolbar
Tip: In Power Apps, when you save a version of your app, the first version is published by default
and available to everyone that you share the app with. Subsequent saves are only visible to the
app maker in the studio. You must explicitly publish it for all app users to get the update.
In this exercise you will learn how to add a header to the app and display the logged in user’s
name.
Task 1: Add a header containing the app name and logged in user’s name
In this task, you will add a header to the Main Screen that displays the app name and the
logged in user’s name
3. For ctHeader set the Fill property to RGBA(0, 18, 107, 1) in order to change the color to
dark blue.
Select the ‘Insert’ tab in the ribbon and select ‘Text Label’
6. Select Text from the property drop-down list and enter “Device Orders” in the formula
bar. You can also type directly into the label by double-clicking it
Size 24
Tip: All functions in Power Apps are case-sensitive. As you start typing ‘User’ you will see a
dropdown of available choices. It is a good idea to pick from the auto-complete options. You
will also notice help text at the top showing the parameters that are expected, in this case it
requires no input parameters.
17. Change the PaddingRight property from 5 to 20. You can do this quickly by using the
Properties pane on the right-hand side.
18. Your app header may look like this. The task is complete.
In this exercise you will learn how to connect the app to the various data sources required for
the app to both display devices and track device orders.
Tip: What is a data connection? In Power Apps, a data connection adds data to your app. Your
canvas app can connect to SharePoint, Dataverse / Dataverse for Teams, SQL Server, Microsoft
365 and over 900 first- and third-party services.
In this task you will learn how to create a connection to the Excel spreadsheet containing device
data for the solution.
2. Click +Add data dropdown, in popup menu type Excel into the search box
5. Click Open
6. In the right-hand pane, from the Choose a table dialog, select both the Devices and
Manufacturers tables
7. Click Connect
8. The Devices and Manufacturers connections should be listed in the Data pane
In this task you will learn how to create a connection to the SharePoint site that contains the
‘Order Data’ list (task four of the Prerequisites).
2. Click +Add data dropdown, in popup menu type SharePoint into the search box
3. Select SharePoint
6. Click Connect
7. In the ‘Enter the SharePoint URL for the location of your list’ input box, paste the URL of
your SharePoint site, or select the sire URL from the list of recent sites and click Connect
9. Click Connect
10. The ‘Order Data’ list connection will appear in the list of connections in the Data pane
In this exercise, you will add a gallery containing all available devices making it easy for users to
browse the list and get a quick overview of the devices available.
Tip: What is a gallery? A gallery control can show multiple records from a data source, and each
record can contain multiple types of data. For example, a Gallery control can show multiple
contacts with each item showing contact information that includes a name, address, and a
phone number for each contact.
In this task you will learn how to add a gallery control to your app containing a list of all devices.
1. Select ctMainSection and in Insert dialog search for Horizontal gallery Add it to
ctMainSection
This will add a gallery called Gallery1 onto the screen. Notice the control tree view on the left
displays this gallery with three controls within it – two text labels and an image. A data pane will
pop up on the right.
3. Select ‘Devices’ from the list of data connections under the ‘In your app’ section
TemplateSize 200
6. Select the Image1 and in the properties pane select Imagen Position → Fit
To select the entire gallery – click on the gallery in the tree view on the left or click on the
second or third cell inside the gallery. Clicking any cell that is not the first cell of the gallery will
select the entire gallery. Now you can specify properties that apply to the entire gallery, such as
the items property (the galleries data source).
In this task you will add a second gallery that lists the various device manufacturers. This will be
a single column vertical gallery positioned on the left side of the screen, with each cell
displaying the manufacturer’s logo image. This gallery will later be used as a filter for the device
gallery created above.
8. Change the Wrap Count from 2 to 1. This will change the gallery to a single column Set
Template Size as 150
10.Select save.
In task three, you added a single column, vertical gallery connected to the manufacturers table
in the Excel data connection. In this task, you will update the gallery to display the manufacturer
logo.
1. Select the galManufacturers. Make sure the whole gallery is selected, and not just the
first cell
2. Select Items from the property drop-down and ensure that Manufacturers is visible
3. Select the image control in the first template cell in the gallery and change the value of
Image in the formula bar fromThisItem.HQ to ThisItem.Logo
Height 150
All items in the gallery will now display logo images (see the image below)
In this task, you will learn how to use the TemplateFill property of the manufacturer gallery to
specify a highlight color for the item.
4. Use the preview mode to perform a quick test of the highlighting. You can enable
preview mode by holding down the Alt key and clicking a few different manufacturers in
the gallery. Preview mode ends when you stop holding the Alt key.
Tip: You could alternatively click the Play button to enter preview mode, and to exit this you
would click the X in the upper right corner or use the Esc key.
In this task, you will learn to use the Filter() function to filter the items in the galDevices to only
display devices that match the selected item in the galManufacturers.
4. Select a different item in the manufacturer gallery on the left, and you will notice the device
gallery will update accordingly
In this task you will learn how to configure text label formatting to the template cell.
Formatting suggestions (these are optional, feel free to move forward to step 4).
- Expand the width of the label to the template width
- Change the PaddingLeft from 0 to 10
- Change the Font to Segoe UI
4. Select the Subtitle1 control
5. In the property drop-down list, select the Text property, change it to ThisItem.Price:
In this task, you are going to format devices that have a value greater than $1,000 by displaying
the price in Red.
1. Select the label in the template cell that displays the price
2. In the properties drop-down, select the Color property.
3. In the formula bar, enter the following: If(ThisItem.Price>1000, Color.Red, Color.Green)
We want to be able to allow users to compare devices before making an order, in this task you
will learn how.
3. Make sure that only the first item in the gallery is selected
7. Change the checkbox text to ‘Compare’ (you can do this by setting the Text property or
click within the text of the control and typing directly into the control)
In this task you will create a collection called CompareList. This will allow users to compare
devices before deciding to place an order.
Tip: What is the collection? A collection is a group of items that are similar, such as devices in a
device list
3. Click the OnUncheck value and type the following expression in the formula bar
Note: The Default property of the checkbox is a Boolean (true of false) value that determines if
the checkbox should be checked or not by default. Setting it to this formula will ensure that the
checkbox is checked by default if the item has already been added to the collection since the
result will be true, i.e., this item ‘is’ in the CompareList collection.
6. Test the checkbox functionality. Run the app in preview mode (F5) or by clicking the
preview button, click on checkboxes of three items
10. Run the app in preview mode (F5) or by clicking the preview button, click on checkboxes
of three items to uncheck them
13. Check that all items were removed from the CompareList collection
In this task, you will learn how to ensure that the app doesn’t display a blank list of devices when
the app starts by setting the default item in the Manufacturer gallery to be the first item.
2. From the properties drop-down, select the Default property. Enter the
following expression in the formula bar
The compare screen is where users will compare the selected devices and then choose the
device that they wish to submit for approval.
In this task you will add the Compare Screen to the app.
In this task you will learn how to add buttons to the Main Screen that add functionality to the
app to navigate to the Compare Screen and clear the selected devices for comparison
Note: This will remove all the items in the CompareList collection when the user clicks the
button
22. Click Preview and select a couple of devices and click the Compare button
23. Verify that it takes you to the Compare Screen, then close Preview (clicking X)
In this task, you will copy the various controls that you want to display on both the Main Screen
and Compare Screen.
6. Select paste.
In this task you will configure the gallery to show devices that were selected from the
comparison gallery on the Main Screen.
3. The gallery will now show the selected items from the Main Screen
In the Compare Screen we are selecting a specific item to place an order/ submit for approval,
so we no longer require the compare checkbox. In this task you will remove the compare
checkbox and add new controls to the template cell.
10. Insert one more Text Label into the gallery template
11. Rename the new label as lblDeviceMemory
12. Set the Text property to the following expression: ThisItem.Memory
13. Repeat this process to add in the following labels:
lblDeviceProcessor ThisItem.Processor
lblDeviceStorage ThisItem.Storage
lblDeviceScreenSize ThisItem.ScreenSize
14. Order your text labels. Your screen should look like the bellow one:
In this task you will recreate the behavior of the selected manufacturer in the Main Screen.
When a user clicks on a device, you will set the template fill to show that it is highlighted.
This is conditionally setting the Fill color if the cell is selected. Click a few different items in the
gallery, notice the selected item is highlighted in a light blue color.
In this task you will learn how to add an icon to navigate back to the Main Screen.
2. Click Insert in ribbon tool bar and find Back arrow icon. Add it into ctHeader_1
3. In Tree view , in ctHeader_1 container select Icon and reorder it to the start
OnSelect Back ()
So far, you have built the app. Users can browse and compare devices. In this exercise you will add
additional functionality so that users can create an order using form and submit a device for approval. In
this lab, device orders will be managed in a SharePoint list (created as part of the prerequisites). Power
Automate flow will be created in subsequent exercises to manage the approval process.
In this task, you will add an order button to the galCompareList template cell.
c. Gap → 15
d. Wrap → On
4. From the properties drop-down select the Text property and change it from ‘Button’ to
“Order”
5. Select the OnSelect property and in the formula bar, enter the following expression:
Patch('Order Data', {
Title: galCompareList.Selected.Title,
Price: galCompareList.Selected.Price,
OrderStatus: "In review"
}
)
Patch(Order Data'; {
Title: galCompareList.Selected.Title,
Price: galCompareList.Selected.Price,
OrderStatus: "In review"
}
)
6. Test the app. Enter preview mode (F5) and click the Order button for one of the laptops.
Check that the order information was created in the SharePoint list:
Tip: The Patch() function creates or modifies a record. In the expression above, we are creating a
new record in the SharePoint list titled ‘Order Data’.
Task 2: Notifying the user
In this task, when an order has been placed, you will create a notification to communicate that
the order has been placed to the user.
4. Press Shift+Enter
5. On the new line, append the following expression:
In alternate/European locales:
Patch('Order Data', {
Title: galCompareList.Selected.Title,
Price: galCompareList.Selected.Price,
OrderStatus: "In review"
}
);;
6. Test the app, enter preview mode, and click the Order button. You should see a
notification shown in the image below:
3. Before creating a flow, switch to the correct environment (where your organization
permits development apps to be created).
Click the Environments drop-down in the top right of the screen to switch to the correct
environment.
Tip: Flows are started with a ‘Trigger’. There are three basic triggers to start a flow:
- Automated: designated events will start the Flow; for example: a new item created in a
SharePoint list
- Instant: Flows are started manually by the user
- Scheduled: Flows start at a frequency specified; for example: every day at 10:00 hours
6. In the ‘Build an automate cloud flow’ dialog, enter Purchase approval in the Flow name
box, select ‘When an item is created’ (SharePoint) and finally click Create.
7. Click in the Site address input box, select Enter custom value and type/ paste the URL of
the SharePoint site that you created for Order Data, and in the List name drop down,
select the ‘Order Data’ list
2. In the Choose an action dialog, enter Office 365 Users in the search box. Then select
Office 365 Users from the results pane
6. Click the ellipsis (…), then select ‘Add a note. In the comment box, enter ‘This step looks up
the requester manager’ .
7. Click inside the User (UPN) box and select ‘Add a dynamic content’ icon
In this task you will learn how to use the Approvals connector.
Note: If your organization blocks this via DLP (Data Loss Prevention) policies, then you will not
be able to proceed with this task.
4. In the approval type drop-down, select ‘Custom responses – wait for one response’
7. Type ‘Approval’ in the search box, then select ‘Wait for an approval’
8. Click the ellipsis (…), rename the step ‘Wait for approval decision’
In this task you will learn how to add in a condition. A condition action handles specific
conditions in your Flow, such as ‘If a property equals a value’, or ‘If a property is greater than a
value’.
3. Click the ellipsis (…), then rename the step ‘Approval decision’, and add a note
‘This condition handles the approval or rejection of the request’
7. In the search box type Email and from the list of available connectors, select Office 365
Outlook. From the list of available actions, select ‘Send an email (V2)’:
17. In the Site Address box, enter the URL of the SharePoint site
18. Select the ‘Order Data’ list from the List drop-down
Many thanks
29. In the search connectors box, type SharePoint. From the list of actions returned, select
Update item
31. Your action should look the same as the image below:
It is a good idea to save and test your app regularly. There are a few ways in which you can test
your app:
- Hold the Alt key down and click on controls to activate the functionality
- Enter preview mode (F5)
- Play the app
In this exercise you will run through some tests of your app
1. Go to the Main Screen and Preview the app by clicking the Play button in the top right
4. Check the compare box on a few devices on the main screen from a few different
manufacturers
6. Click the Back button and confirm you get back to the main screen
Clic
8. The CompareList collection will clear, and the Compare button will become disabled
In this task, you will test the flow. When a device order is placed, a corresponding item is created
in SharePoint. Creation of this list item will trigger the flow
1. Go to https://outlook.office.com and confirm that when you place a request for a new
device, you receive the following email:
2. Click ‘ Approve’
3. Click ‘Submit’
5. Go back to outlook and check that you have received the confirmation
email.
In this exercise you will replace some elements of the app using reusable components.
Tip: What are reusable components? In this hands-on step-by-step guide, you grouped
together and then copied some controls from one screen to another. If we wanted to make an
update to these controls, then we would need to update each copy (across ‘n’ number of
screens). Many small edits can amount to a significant task. Reusable components are reusable
building blocks for canvas apps. They behave in a master-instance manner, meaning that any
updates you make to the original component will apply to other copies in your app.
In this task you will learn how to give the reusable component properties, much like the controls
that you have been working with throughout this hands-on step-by-step guide.
Tip: What are custom properties? A component can receive input values and emit data if you
create one or more custom properties. An input property is how a component receives data to
be used in the component. For example, the Default property of a text input control.
An output property can emit data or component state. For example, the Selected property on a
gallery control is an output property.
23. Your list of custom properties should now look like the image below:
In task two you created a custom property. In this task you will set the properties for the device
ordering app.
9. The label should update and display the text that we added in the AppTitle property.
Resize the label so that the text does not wrap.
10. You can also update the following properties of the label so that the appearance matches
the app, for example:
- Font size: 20
- Font weight: Bold
- Align: Center
- Color: White
11. Select the component cmpHeader and set the background fill to the same color blue as
the app:
OnSelect Back ()
In this task, you will add the component to the Main Screen and Compare Screen
In this exercise, you will learn how to use AI builder to create a form processing app.
Note: Prerequisites – you should ensure that before attempting this module, that you have
saved the five sample invoices to a local folder and AI Builder trial, or license is available for you.
In this task, you will learn how to create a form processing model. Form processing identifies the
structure of your documents based on examples you provide to extract text from any matching
form.
6. In the top right corner click on Form Processing model name and rename it to Contoso
Invoice processing
7. Click Rename
8. In ‘Choose document type’ step select ‘Structured documents’ and click Next
14. Set the name of the table as SalesPeople and set up the following columns:
Salesperson, PO Number, Requisitioner, Shipped via, FOB Point, Terms
15. Add one more table called OrderItems with the following columns:
16. Check that you have all the required fields and tables and click Next
17. In ‘Add collections of documents’ step, click New collection button 19. Then click on
Collection 1 that was just added
22. Browse to the location where you have saved the five example invoices and select all
The upload feature will complete, check that green ticks appear next to all files
27. When tagging SalesPeople and OrderItems table, you will also need to tag each column
in special Advanced tagging mode
32. Upload one of the invoices from your local folder and check that fields and tables are
recognized correctly
Click Close
33. Click Publish and wait till the model gets published
In this task, you will add the form processing model to a new Power App.
1. Browse to https://make.powerapps.com
2. Click Create new app
3. Click +Blank app -> Canvas app
4. In the App name box, enter AI Builder Demo
5. In ribbon click +Insert and add Form Processor control from AI builder category
6. In the AI model dialog, select the Contoso Invoice Processing model that you created in
Task 1.
In this task, you will add data fields from the Contoso Invoice Processing model and display
them in the app. You will then add a few test invoices to check that the model is functioning as
expected.
13. The Data dialog will display each field, you can move these fields to reorder table columns
Close the dialog when you are ready
1
Activate – Power Platform: Building a Power App – Hands-on Labs
19. After a short delay, the table should be populated with data from the invoice: