Power Apps | Collections exercise | Add the Beatles to a collection by clicking on buttons

This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

Software ==> Power Apps  (13 exercises)
Version ==> Latest update
Topic ==> Collections  (1 exercise)
Level ==>
Subject ==> Power BI training
Before you can do this exercise, you'll need to download and unzip this file (if you have any problems doing this, click here for help).

You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

Create a new app, and save it as The Beatles.

Add the four pictures in the folder above into your app:

Adding an image Choosing image files
Choose to add an image ... ... then add all 4 at the same time.

Add five buttons at the top of your screen:

Five buttons

You may be beginning to sense where this is going ...


Attach code to one of the top buttons to add an item to a collection (let's call it Beatles) using the Collect command and setting values for the following fields:

Field Valuie
name The first name of the relevant Beatle
song In your opinion, their best song
picture The name of the picture you've added

Add a gallery to your app, using the Vertical template:

The gallery template

This should automatically put the fields in the right place when you associate the gallery with your Beatles data source.


Add code to the other three Beatles' buttons - when you click on them you should get this:

Beatles list

You may find it helpful when testing to attach code to the Reset button to clear your collection, to give an easy way to remove all the Beatles you've added to your collection.


Add one more button which adds someone who you think has a just claim to being called the fifth Beatle, but using the Patch command instead of Collect:

Fifth Beatle button

Perfectionists will also need to add an image of their fifth Beatle to their app, so that they can show this picture next to the person's name in their collection.

If you still have the time and energy, you could always change the code for each of the main Beatle buttons so that it only adds an item to the collection if it's not already there (one way to do this might be to test where the number of rows when you filter the data source by the Beatle-in-question's name is greater than 0).

Save your changes and leave your app!

You can unzip this file to see the answers to this exercise, although please remember this is for your personal use only.
This page has 0 threads Add post