WISE OWL EXERCISES
POWER BI EXERCISES
POWER APPS EXERCISES
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.
You can learn how to do this exercise if you attend the course listed below!
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:
|Choose to add an image ...||... then add all 4 at the same time.|
Add five buttons at the top of your screen:
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:
|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:
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:
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:
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!