world cup 2018 prediction game - microsoft · and install the powerapps mobile application. if...

25
World Cup 2018 Prediction Game Step-by-Step Deployment Guide

Upload: others

Post on 10-Oct-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

World Cup 2018 Prediction Game

Step-by-Step Deployment Guide

Page 2: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

PowerApps World Cup 2018 Prediction Game Overview and Pre-requisites

©2018 Microsoft Corporation 2 | P a g e

Pre-requisites

Step 1: Pre-requisites

Task 1: Download the GamePackage Files

1. Save a local copy of the package content: Download the GamePackage.zip from

http://aka.ms/worldcuppacakage, save it to a local folder and extract the package. This package contains the

pre-built World Cup prediction game PowerApps app, CDS solution package and some default data in a CSV file.

Task 2: Sign-in to PowerApps

1. Confirm that you are licensed to use PowerApps: Go to http://web.powerapps.com and sign-in with your

business or school account. This is the same as your Office 365 or Dynamics 365 login.

2. Plan 2 Trial of PowerApps: Usage of the Common Data Service requires a PowerApps Plan 2 license. Go to

https://powerapps.microsoft.com/pricing to start a free 30-day trial for Plan 2. For more detailed information on

signing up for a free Plan 2 trial, click here. For information on signing up for a free community plan for individual

use, click here.

NOTE: This documentation assumes that you will use the web version of the PowerApps Studio, which runs on a browser:

Microsoft Edge, Internet Explorer 9+, Google Chrome, Firefox or Safari.

If you are unable to sign-up for a PowerApps Plan 2 license using your organization credentials, you may provision a free

Office365 demo tenant at http://aka.ms/Office365E5Trial. Use the demo tenant credentials to sign up for a PowerApps

Plan 2 Trial.

Task 3: Install the PowerApps and Flow mobile applications

1. Install the PowerApps mobile application: Go to the app store on your mobile device. Search for “PowerApps”

and install the PowerApps mobile application. If prompted, enable push notifications.

2. Install the Microsoft Flow mobile application: Go to the app store on your mobile device. Search for “Microsoft

Flow” and install the Flow application. If prompted, enable push notifications.

Task 4: Create a new environment and CDS for Apps database instance

You must have a newly created CDS for Apps environment and database instance, that was created on or after Apr 1,

2018. If you don’t have a new environment or have an older environment, follow the steps below to create the

environment and provision the database instance.

1. Open the PowerApps admin center by navigating to http://admin.powerapps.com in a web browser.

2. You may be prompted to sign up for a free PowerApps Plan 2 trial if you did not already complete this as part of

Task 2. Follow the prompts to start your Plan 2 trial, which will give you access to the admin center.

Page 3: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

World Cup 2018 Prediction Game

3 | P a g e ©2018 Microsoft Corporation

Note: you can also access the admin center by signing in at http://web.powerapps.com and clicking the settings

icon in the top right and selecting Admin center.

3. In the Admin center, select the +New environment option in the top right of the screen.

4. Provide a name for the environment.

5. Select your Region.

6. Select “Trial” as the Environment Type.

7. Click Create Environment.

Page 4: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

PowerApps World Cup 2018 Prediction Game Overview and Pre-requisites

©2018 Microsoft Corporation 4 | P a g e

8. On the next screen, click Create database.

9. Select your Currency.

10. Select your Language.

11. Click Create database.

12. You will see a screen listing all environments that will show the newly created environment. Notice that the new

CDS for Apps environment has a unique ID in the name, such as “org93c6433d” in the screenshot below. This is an

easy way to differentiate the newer CDS for Apps environments from older CDS environments.

Page 5: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

World Cup 2018 Prediction Game

5 | P a g e ©2018 Microsoft Corporation

13. Click on the environment you just created, you will see a message – “Provisioning database…”.

IMPORTANT: You need to wait for the database to finish provisioning before trying to create an application.

14. This may take a few minutes to complete. Wait for it to complete before proceeding with creating an app. If it has

been over two minutes, try refreshing the browser. Once the database has been created you should no longer see

this “Provisioning database” message.

Page 6: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

PowerApps World Cup 2018 Prediction Game Overview and Pre-requisites

©2018 Microsoft Corporation 6 | P a g e

Step 2: Import the World Cup Game CDS solution package

In this step, you will import the solution package into your CDS environment.

1. Open a new browser tab, navigate to https://web.powerapps.com

2. Click Canvas.

3. Select Model Driven.

Page 7: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

World Cup 2018 Prediction Game

7 | P a g e ©2018 Microsoft Corporation

4. Click Advanced and wait for the page to finish loading.

7. Click Import.

5. Remove everything after .com of the URL and click <enter>

6. Navigate to Settings | Solutions .

Page 8: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

PowerApps World Cup 2018 Prediction Game Overview and Pre-requisites

©2018 Microsoft Corporation 8 | P a g e

8. Click Choose File.

9. Select the “WorldCup_1_0” and click Open.

10. Click Next.

Page 9: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

World Cup 2018 Prediction Game

9 | P a g e ©2018 Microsoft Corporation

11. Click Import

12. Click Publish All Customizations. Wait for the solution to publish

13. Click close and Refresh the browser (page)

Page 10: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

PowerApps World Cup 2018 Prediction Game Overview and Pre-requisites

©2018 Microsoft Corporation 10 | P a g e

Step 3: Import data for Matches entity in CDS

1. Go to “Settings” and Select “Matches” under “Extensions”

2. Click on Import Data on the Form

Page 11: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

World Cup 2018 Prediction Game

11 | P a g e ©2018 Microsoft Corporation

3. Upload the csv file “Matches Default Data” and click on the Next button until you reach the Map Record Types wizard.

Page 12: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

PowerApps World Cup 2018 Prediction Game Overview and Pre-requisites

©2018 Microsoft Corporation 12 | P a g e

4. In the below image, under Microsoft Dynamics 365 Record Types, select the Matches entity from the dropdown. Click

on Next button until you reach the submission wizard and finally click Submit.

5. Click Finish and close the import wizard

Page 13: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

World Cup 2018 Prediction Game

13 | P a g e ©2018 Microsoft Corporation

Step 4: Import World cup Game PowerApps Package

In this step, you will import PowerApps package into a PowerApps app.

1. Open a new browser tab, navigate to https://web.powerapps.com

2. Click on the environment name and select the environment you created in step 1.

3. Select Apps and click Import package.

Page 14: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

PowerApps World Cup 2018 Prediction Game Overview and Pre-requisites

©2018 Microsoft Corporation 14 | P a g e

4. Click Upload.

5. Select the zip file located in PowerApps package and click Open.

Wait until the package is uploaded.

Page 15: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

World Cup 2018 Prediction Game

15 | P a g e ©2018 Microsoft Corporation

6. Click Import

7. Wait for the application import to complete.

8. Click Apps in the left pane, locate the application you imported, click on ‘…’ and click Edit.

Page 16: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

PowerApps World Cup 2018 Prediction Game Overview and Pre-requisites

©2018 Microsoft Corporation 16 | P a g e

9. Make sure the application loads in the PowerApps studio without any issues and asks for the following permissions.

Click Allow

10. Check the application has all data sources as shown below.

View -> Data Sources

11. Go to File -> Save & Publish the app

Page 17: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

World Cup 2018 Prediction Game

17 | P a g e ©2018 Microsoft Corporation

Step 5: Assign security roles to users

Common Data Service (CDS) for Apps uses a role-based security model to help secure access to the database. User will be

assigned a security role to an environment at https://admin.powerapps.com/environments

1. Select the environment in the environments table.

2. Select Security tab.

3. View if the user already exists in the environment, by selecting view the list of users in the environment.

4. In case user doesn’t exist, Add the user by mentioning the email address of the user in your organization, and click

Add user.

Page 18: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

PowerApps World Cup 2018 Prediction Game Overview and Pre-requisites

©2018 Microsoft Corporation 18 | P a g e

Wait for a few minutes to check if the user is available in the list of users in the environment.

5. Select the user from the list of users in the environment.

6. Assign the Common Data Service User and GamePlayers security roles to the user.

Note: Currently, security roles can only be assigned to the users. Assigning a security role to a group is not possible

7. Select OK

Now, Share the app with your colleagues and Enjoy the world cup 2018

Page 19: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

World Cup 2018 Prediction Game

19 | P a g e ©2018 Microsoft Corporation

Score calculator configuration

In this step, we will import new CDS solution package and will see how to calculate the score.

1. Follow Step 2 (Import the World Cup Game CDS solution package) from above documentation to Import new

solution package. New Solution includes score calculator plugin.

You will see version 2.0 after finishing the import of solution

2. Refresh the browser and Go to “Settings” and Select “Matches” under “Extensions”

3. Now, Filter only admin records in order

• Change the view to Sorted Matches

• Click on user column filter and set it to “admin” and click apply as shown below

Page 20: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

PowerApps World Cup 2018 Prediction Game Overview and Pre-requisites

©2018 Microsoft Corporation 20 | P a g e

4. Edit the admin records “Selected Home” and “Selected Away” columns inline to actual team ids per “Home

Team” and “Away Team” column values and click “Save”

For Example:

• Consider Match 49(Round 1), Its “Home Team” and “Away Team” column values are “winner_a” and

“runner_b” which means winner from Group A vs Runner from Group B

• Winner from Group A is Uruguay and its team id is 4. Update Selected Home to 4

• Also, Runner from Group B is Spain and team id is 6, Update Away to 6

• Consider Match Name 57(Round 2), Its “Home Team” and “Away Team” column values are “49” and “50”

which means winner from Match 49 vs winner from Match 50 i.e., if Team 4 wins the match 49 and Team 15

wins the Match 50, Update Selected Home (49) – 4 and Selected Away (50)- 15

Page 21: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

World Cup 2018 Prediction Game

21 | P a g e ©2018 Microsoft Corporation

Please follow above logic for rounds 1, 2 ,3

Special case for Round 4 or Finals: For Round 4(Match 63), We need to update additional columns – “Home

Result” and “Away Result”

As shown in below image, if Selected Home (Team 17) wins the finals, update the Home Result: 1, Away Result:

0 and vice versa if Selected Away (Team 5) team wins, Set Home Result: 0, Away Result : 1

Note: Teams details are available in shared Teams Default data csv file

5. After saving records, click “CALCULATE SCORE” button which shows a dialog to initiate process, click “Proceed”.

It starts background process for score calculation.

Note: Process might take 2-3 minutes to finish the scoring calculation

Page 22: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

PowerApps World Cup 2018 Prediction Game Overview and Pre-requisites

©2018 Microsoft Corporation 22 | P a g e

6. To confirm score calculations, Go to “Settings” and Select “GameUsers” under “Extensions”, you will see scores

for users

7. We still need to sort the Leader board collection in POWERAPPS

• Open a new browser tab, navigate to https://web.powerapps.com

• Open the World Cup app in Edit mode

Page 23: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

World Cup 2018 Prediction Game

23 | P a g e ©2018 Microsoft Corporation

• Edit the App, Go to LeaderBoardScreen -> LeaderboardGallery -> Items and use below formula

Sort(LeaderboadCollection, ms_score, Descending)

• Click Save and Publish the app

• Now, you can see scoring in the app

Note: Please follow points 2 and 3 for rounds 2,3,4 (which are yet to happen) to update User scores

Page 24: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

PowerApps World Cup 2018 Prediction Game Overview and Pre-requisites

©2018 Microsoft Corporation 24 | P a g e

Scoring logic:

100% - A Score is calculated based on your selection for the World Cup winner and the number of teams that you

correctly predicted to enter each of these rounds – Round of 16, Quarter-finals, Semi-finals, and Final

Each prediction has a weight that depends on which Round the game belongs to:

Category Multiplier

Winner 500

Each finalist you picked correctly 100

Each semi-finalist you picked correctly 50

Each quarter-finalist you picked correctly 25

Each round of 16 team you picked correctly 10

Example 1: Let’s say a contestant picks the correct winner of the cup and correctly predicts 50% of the teams in

each round. They will get a total score of 780

Multiplier # Correct Prediction Score

Winner 400 1 500

Each finalist 100 1 100

Each semi-finalist 50 2 100

Each quarter-finalist 25 4 100

Each round of 16 10 8 80

Total Score: 880

Example 2: A contestant selected the correct winner but only predicted one team correctly in each round. They will

get a score of 585.

Multiplier # Correct Prediction Score

Winner 400 1 500

Each finalist 100 1 100

Each semi-finalist 50 1 50

Each quarter-finalist 25 1 25

Each round of 16 10 1 10

Total Score: 685

Page 25: World Cup 2018 Prediction Game - Microsoft · and install the PowerApps mobile application. If prompted, enable push notifications. 2. Install the Microsoft Flow mobile application:

World Cup 2018 Prediction Game

25 | P a g e ©2018 Microsoft Corporation

Information in this document, including URL and other Internet Web site references, is subject to change without notice.

Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people,

places, and events depicted herein are fictitious, and no association with any real company, organization, product, domain

name, e-mail address, logo, person, place or event is intended or should be inferred. Complying with all applicable

copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may

be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic,

mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of

Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering

subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the

furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual

property.

The names of manufacturers, products, or URLs are provided for informational purposes only and Microsoft makes no

representations and warranties, either expressed, implied, or statutory, regarding these manufacturers or the use of the

products with any Microsoft technologies. The inclusion of a manufacturer or product does not imply endorsement of

Microsoft of the manufacturer or product. Links may be provided to third party sites. Such sites are not under the control

of Microsoft and Microsoft is not responsible for the contents of any linked site or any link contained in a linked site, or

any changes or updates to such sites. Microsoft is not responsible for webcasting or any other form of transmission

received from any linked site. Microsoft is providing these links to you only as a convenience, and the inclusion of any link

does not imply endorsement of Microsoft of the site or the products contained therein.

© 2017 Microsoft Corporation. All rights reserved.

Microsoft and the trademarks listed at https://www.microsoft.com/en-

us/legal/intellectualproperty/Trademarks/Usage/General.aspx are trademarks of the Microsoft group of companies. All

other trademarks are property of their respective owners.