Adv Hands On Lab1: Package components in development environment and deploy, patch, and upgrade to production

Scenario

Application lifecycle management (ALM) is a vital part of a successful strategy for Power Platform projects. Contoso has provisioned a new development instance and would like to set up a build and deploy process where modifications of any of the components are only performed in the development environment and then deployed as a managed solution to the production environment. Components required to be deployed include a model-driven app and a canvas app. They also would like to take advantage of new tools like Solution Checker to monitor the health of what they are building.

You will be packaging components as a new unmanaged solution in the development environment and deploy, patch, and upgrade this solution in the production environment as managed.

Environment

The lab requires two PowerApps environments with a Common Data Service database created and the sample apps installed.

You are working in a shared tenant. Do not do your exercises in the default environment. You have been assigned a development environment and a production environment for this course.

Note: Specifically, for the labs in this course, it is best always to use a private/incognito browser session.

Provided for students:

  • Unmanaged solution that contains a model-driven app that includes account and contact.
  • Existing sample canvas app that uses a gallery control to display accounts.

Requirements

The following have been identified as requirements you must implement to complete the project.

  • R0 – In the production environment, a user must be able to start a model-driven app that includes access to Accounts and Contacts entities.
  • R1 – User must be able to run the canvas app providing access to accounts using a gallery control.
  • R2 – Maker must be able to run Solution Checker and resolve any issues flagged.
  • R3 – Maker must be able to add and remove components from the managed solution in the production environment by deploying patches and upgrades.

Exercise 1 – Setup the Development Environment

In this exercise, you will be preparing your new environment with some existing assets, so we can then look at how we can package all this into a solution file and deploy.

High-level tasks

Task 1– Install solution checker.

Task 2– Import solution ContosoBase. Publish it and confirm the model-driven Account Project Tracker App and its sitemap have imported.

Task 3– Import canvas app package named Accounts; open the app, and authorize its use.

Task 1: Install Solution Checker

The solution checker feature is a static analysis tool that reviews the solutions you build looking for anything that might impact performance, stability, and reliability of what you build. Currently, it requires a small installation; in the future, it will be pre-installed.

Note: As of the writing of this document, this feature is actively being added to all data centers. If you find no Solution Checker in the ribbon of your environment, don’t worry! That means you already have it and can proceed to the next task.

  1. Navigate to https://make.powerapps.com and log in. Make sure you are in your development environment.
  2. Select Solutions and click Solution Checker
  3. If you only see the install option like the image then click Install otherwise it is already installed, and you can continue to Task 2.


  1. Click Get it Now.


  1. Click Continue.
  2. If you agree, accept the terms and conditions, select your dev environment and click Agree.

  1. You should be automatically redirected to the Manage your solutions page. Locate PowerApps Checker and make sure the installation is pending.


  1. You may close the browser tab. The installation will continue in the background.
  2. Click Done.


Task 2: Import Solution

In this task, you will import an unmanaged solution to your environment. This contains a small PowerApps model-driven app that we will use later.

  1. In a new tab, navigate to https://make.powerapps.com/ and make sure you have your development environment selected.

  1. Select Solutions and click Import.

  1. Click Browse, select the ContosoBase solution located in the lab resources folder and click Open.   You will need to download these samples from here: https://powerusers.microsoft.com/t5/PowerApps-Community-Blog/Adv-Hands-On-Lab1-Package-components-in-development-environment/ba-p/345778

  1. Click Next.
  2. Click Import.
  3. Wait for the import to complete and click Publish All.

  1. Wait for the publishing to complete and click Close.
  2. Click to open the imported solution Contoso Base.

  1. You should have model-driven Customers App, a sitemap for the application, and a web resource.

Task 3: Import Canvas Application

In this task, you will import a canvas application into your environment. We are doing this using the old standalone import capability that doesn’t use solutions so we can bring in a canvas app that isn’t solution aware and then show you how to make it solution aware.

  1. Select Apps and click Import Package.

  1. Click Upload.

  1. Select the Accounts app located in the lab resources folder and click Open.

  1. Click Import.

  1. The app package should import without errors. Click Open App.

  1. You will be asked for permission, click Allow.

  1. The app designer should open, and your accounts list should show data.

  1. Close the app designer browser tab/window.

Exercise 2 – Build Solution

In this exercise, you will start building your new solution. The first step is to create a publisher and the actual solution container.

Each solution is linked to a solution publisher. The solution publisher provides information about how to contact the publisher as well as customization prefix value. When you create things like an entity that prefix is part of the name to keep it unique. For example, Contoso might use a prefix of contoso, and if they created a new entity named Project, the logical name would be contoso_project. This ensures that if another app is installed that also has an entity named Project, it won’t collide with others.

High-level tasks

Task 1: Create a solution and a publisher, both named Account Project Tracker. The publisher prefix should be set to apt. Add the following existing components:

  • Model-driven app Customers App
  • Customers App sitemap
  • Account entity and Account form.

Task 2: Add a new entity with the name Project

  • New fields to the Project entity.

Task 1: Create Solution

In this task, you will create a publisher and a new solution.

  1. Navigate to https://make.powerapps.com/ and make sure you in your development environment.
  2. Select Solutions and click New
    Solution.

  1. Enter Account Project Tracker for Display Name and click on the Publisher dropdown.

  1. Select + Publisher.

  1. Enter Account Project Tracker for Display Name, enter apt for Prefix and click Save and Close.

  1. Click on the Publisher dropdown and select the publisher you created.

  1. Enter 1.0.0.0 for Version and click Create.

  1. Click to open the solution you created.

  1. Next, we are going to add the existing model-driven app into our empty solution. Click Add Existing | App | Model-Driven App. Add Existing is how you bring in assets that already exist and associate them with your current solution container.

  1. Select the Customers App and click Add.

  1. Click Add Existing again and select Other | Site Map. Model-driven apps also use a site map to define navigation, and this is a separate component. We are bringing this also into the solution, so we have all our dependencies of the app. You could also do this by selecting the model-driven app and clicking add required components.

  1. Select Customers App sitemap and click Add.

  1. Click Add Existing | Other | Web resource.

  1. Select Show Name and click Add. If needed, you can search for the web resource in the search bar in the upper right-hand corner of the window.

  1. Click Add Existing and select Entity.

  1. Select Account and click Next.

  1. Click Select Components. By default, when you add existing of an entity any of the fields, forms and views are not referenced. That is a good thing as it means you don’t have dependencies on those items. If you wish to change any of the existing fields, forms, or views, you can use the Select components to associate them along with the entity to your solution. Notice there is also an Include all components. This should not be used when adding existing entities that managed by other solutions like Account. It should only be used for new entities that have been created as unmanaged in this environment.

  1. Select the Forms tab.
  2. Select the Account form and then click Add.

  1. Click Add again.

Task 2: Add new entity to the solution

In this task, you will add new Project entity to the solution.

  1. Click + New and select Entity.

  1. Enter Project for Display Name and click Create.

  1. Make sure the Fields tab is selected and click Add Field.

  1. Enter Start Date for Display Name, select Date Only for Data Type, make the field Required, and click Done.

  1. Click Add Field again.
  2. Provide the information below and click Done.

  1. Click Add Field one more time.
  2. Provide the information shown in the image below and click Done.

  1. Click Save Entity in the lower right corner
  2. Select the Relationships tab.
  3. Click Add Relationship and select Many-to-One.

  1. Select Account for Related Entity and click Done.

  1. Click Save Entity.

  1. Select Account Project Tracker and click Publish All Customizations.

  1. Wait for the publishing to complete.

Exercise 3 – Deploy the solution

In this exercise, you will be exporting your solution from the development environment and importing it into the production environment.

You will export both an unmanaged solution and a managed solution. The unmanaged solution is for if you need to re-create your development environment in the future. The managed solution is the solution you will import into production. You should always have a matching unmanaged solution anytime you export a managed solution.

High-level tasks

Task 1: Run solution checker and correct any issues found.

Task 2: Export solution, both managed and unmanaged. Deploy the managed solution to production.

Task 3: Test your work in the production environment.

Task 1: Verify solution using Solution Checker

  1. Navigate to https://make.powerapps.com and make sure you are in your development environment.
  2. Select the Account Project Tracker solution you created and click Solution Checker | Run.


  1. The Solution Checker should start running.


  1. Wait for the Solution Checker to complete checking your solution.


  1. Select the solution and click Solution Checker | View Results.


  1. You will get issues related to the web resource you created. Expand the issue.


  1. You will get more information on the issues including the severity, category, and statement.

  • The first error is telling us to not ship web resources with debug script like console.log.
  • The second error is caused by the usage of deprecated API xrm.page.
  • The third is telling us to use strict mode.

You will fix these errors next.


  1. Select Solutions and open Account Project Tracker solution.
  2. Click to open the Show Name web resource.


  1. Click Text Editor.


  1. You worked with the developer of the code, and they provided you an update. Replace the function with the snippet below and click OK.

function onload(executionContext)

{

    “use strict”;

var formContext = executionContext.getFormContext();

var name = formContext.getAttribute(“name”).getValue();

}


  1. Click Save.
  2. Click Publish.
  3. Close the solution explorer.
  4. Click Done.
  5. Select Solutions.
  6. Select Account Project Tracker and click Solution Checker | Run.
  7. Wait for the Solution Checker to complete the check.
  8. Click on the … More Commands button and click Solution Checker | View Results.


  1. You should not get any errors.
  2. Select Apps and click to open the Solution Health Hub.


  1. Select Analysis Jobs. You should see the results of the solution checks you ran.


  1. Click to open the result from the first solution check.


  1. The sub-grid will list all the errors. Double click on the Xrm.Page message.


  1. You will get more information about the result.


  1. Close the Solution Health Hub application.

Task 2: Deploy solution

It this task, you will export the solution you created and import it into your “prod” environment.

  1. Make sure you are in your Dev environment and select Solutions.
  2. Select Account Project Tracker solution and click Export.

  1. Click Next.

  1. Make sure Unmanaged is selected and click Export.

  1. Save the solution to your computer.
  2. Export the solution again and this time export as Managed. Notice the solution version has incremented for the second export.

  1. Save the solution on your computer.
  2. Switch to your “Prod” environment (Prod-user00 (orgcc8fibb2)).

  1. Select Solutions and click Import.

  1. Click Browse.
  2. Select the managed solution you exported and click Open.

  1. Click Next.
  2. Click View solution package details.

  1. You can review what is included in the import. Close this window.

  1. Click Import.
  2. Wait for the import to complete and click Close.
  3. Click to open the solution you imported.
  4. Make sure all the components you added are listed.

Task 3: Test Deployed Solution

In this task, you will test the app in the solution.

  1. Navigate to https://make.powerapps.com and make sure you are in your “Prod” environment.
  2. Select Apps and click to open the Customers App.

  1. Change the view to All Accounts. Accounts should load.
  2. Select Contacts, change the view to show All Contacts and the contacts should load.
  3. Click New.

  1. Enter Test for Last Name, enter your personal email for Email and click Save.

  1. Close the model-driven app browser tab.

Exercise 4: Update, Patch, and Upgrade

In this exercise, you will use the patch and upgrade features of Solutions. Patches allow transporting only the changes you make. For example, if you fix the length of a field, you would add the entity and just that field to the patch solution and then that would be all you transport to production. Patches do require the initial release solution to be installed in order to install a patch.

You got the feedback below:

User doesn’t always have the Start and End Date of projects and needs to be able to create projects without these fields.

Note: In the interest of time, we have not included steps about unit testing your work and changes. In real-world implementations it’s always important to test as you go, even for the smallest of changes.

High-level tasks

Task 1: Clone a patch and remove the requirement for Start and End Date fields.

Task 2: Import the patch to production.

Task 3: Clone solution, remove field, add your canvas app, and export solution.

Task 4: Import cloned solution to production.

Task 1: Clone Patch

In this task, you will create a “clone a patch” solution and remove the requirement for Start Date and End Date of the Project entity.

  1. Navigate to https://make.powerapps.com/ and make sure you are in your Dev environment (Dev-user00 (orgcc8fibb2)).
  2. Select Solutions and click to open the Account Project Tracker solution.
  3. Click on the button and select Clone | Clone a Patch. When you do this, your solution is changed to read-only. A new patch solution is created. This patch solution starts out empty, and then you add into it any items you wish to change or create.

  1. The minor version will be incremented for you, change the Display Name to Account Project Tracker Patch and click Save.

  1. You should see a message that will tell you can’t edit the Account Project Tracker solution anymore.

  1. Select Solutions and click to open the patch solution.

  1. Click Add Existing and select Entity.

  1. Select the Project entity and click Next.

  1. Click Select Components.

  1. Select Start Date and End Date fields and click Add.

  1. Click Add again.

  1. Click to open the Project entity.

  1. Open the End Date.

  1. Remove the requirement and click Done.

  1. Open the Start Date.

  1. Remove the requirement and click Done.

  1. Click Save Entity.

  1. Select Solutions and click Publish All Customizations.
  2. Wait for the publishing to complete.
  3. Select the Patch solution and click Export.

  1. You will be prompted to publish and/or run solution checker. You can if you wish.

  1. Click Next.
  2. Select Managed and click Export.

  1. Save the Patch solution on your computer.

Task 2: Import Patch Solution

In this task, you will import the Patch solution into your “Production” environment.

  1. Navigate to https://make.powerapps.com/ and switch to your “Production” environment (Prod-user00 (orgcc8fibb2)).
  2. Select Solution and click Import.

  1. Click Browse.
  2. Select the managed Patch solution you exported and click Open.

  1. Click Next.
  2. Click Import.
  3. Wait for the import to complete and click Close.
  4. Your “Production” environment will now have the initial solution and the patch solutions. Click to open the Patch solution.

  1. You should only have the components you added to Patch solution. Click to open the Project entity.

  1. You should have only the two fields you added to the solution.

Task 3: Clone Solution

When you are ready to create the next version of your solution and are done patching the current version, you clone the solution to create the next version. This combines all patches back into the base solution file and makes the base solution file editable for you to build your next version of the solution. After being combined with the base solution, all patches are removed, and you are left with only the base solution.

You realized the Cost field in no longer needed because it is roll-up field from tasks that will be added in future date.

You also now know that you can include your canvas app in your solution and move it through your ALM process at the same time.

  1. Navigate to https://make.powerapps.com and make sure you have your Dev environment selected.
  2. Select Solutions.
  3. Click on the button of Account Project Tracker solution and click Clone | Clone Solution.

  1. The Version will be incremented for you, click Save.

  1. The two solutions will be combined, and your Dev environment will now have just one Account Project Tracker solution.

  1. You will now delete the Cost field from Project entity. Open the Account project Tracker solution.
  2. Click to open the Project entity.

  1. Locate the Cost field, click on the … button and click Delete. When you delete a field of type currency, you only delete the input field. The reference to base currency will automatically also delete on save.

  1. Click Save Entity. With this type of change a publish of customizations is not required for the changes to take effect.
  2. We will now add our canvas app to the solution to prepare it for transport to the production environment. While still viewing your Account Project Tracker solution, click Add Existing and select App | Canvas App.


  1. Select Outside solutions


  1. Select the Accounts App and click Add. This will take a moment to load. You may want to refresh the hosting browser after a minute to test if is there.
  2. Select Solutions and click Publish All Customizations.
  3. Wait for the publishing to complete.


  1. Select Solution, click on the … button of Account project Tracker and select Export.

  1. Click Next.
  2. Select Managed and click Export.

  1. Save the solution on your machine.
  2. Export the solution again but select Unmanaged this time.
  3. Save the solution on your machine.

Task 4: Import the Clone Solution

  1. Navigate to https://make.powerapps.com/ and make sure you are in your “Production”. Environment.
  2. Select Solutions and click Import.
  3. Click Browse.
  4. Select the managed solution you just exported and click Open.

  1. Click Next.
  2. The import wizard will recognize the solution as an update. Click Next.

  1. Click Import. Notice the Stage for upgrade is checked. This is enabled any time you have patches already installed. It allows the new version to be imported and then when you click apply the old versions of the patches are removed and any destructive changes like removing fields and entities are completed and then finally the old solution is removed, and the new staged one is renamed the same as the original solution file.

  1. Click Apply Solution Upgrade.

  1. Click Close.

  1. The solutions in your “Production” environment will be combined, and you will have just one solution with version 1.1.x.x. Click to open Account Project Tracker.

  1. Click to open the Project entity.

  1. The Cost field should be deleted from the solution.

  1. Navigate to Apps.
  2. Select Apps and click to play the Accounts App.

  1. You will be asked for permission, click Allow.
  2. Accounts list should load, click on one of the accounts.

  1. Details of the account will load.

  1. Close the canvas app browser window.

Adv Hands On Lab 6: Connect PowerApps to Custom API

We will be building (or using) a custom connector to use in our event mobile app we’ve previously created. We will be adding a QR code generator to the attendee screen.

 

Environment

The lab requires a PowerApps environment with a Common Data Service (CDS) database created and the sample apps installed.

You must have completed module three first or import the final solution EventManagementFinal.zip

Note: Exercise 1 is targeted toward developers. If you are not a professional developer, go straight to Exercise 2.

Exercise 1 – Build custom API

In this exercise you will be building custom API that generates QR images based on the text information passed in.

Note: You will need an Azure subscription to complete this exercise. If you are not a developer or don’t have an Azure subscription, it is ok to skip to exercise 2 and use the API that we have pre-built.

Task 1: Create function app

  1. Navigate to https://portal.azure.com/ and click Create a Resource.

  1. Search for Function and select Function App.

  1. Click Create.

  1. Enter ContosoEventsQR (Your Initials) (or any unique name) for App Name, select your subscription, select Create New Resource Group and enter ContosoHR (replace HR with your initials).

  1. Select Consumption Plan for Hosting and click Create.

  1. Wait for the app to be created, you will get a notification when it is ready.

Task 2: Create function

  1. Select All Resources.

  1. Search for the function app you created and click to open.

  1. Click Create New function.

  1. Select In-Portal and click Continue.

  1. Select More Templates and click Finish and View Templates.

  1. Select HTTP Trigger.

  1. Enter qr64gen for Name, select Anonymous for Authorization Level, and click Create. (note: this is for the exercise only, not recommended for production use)

  1. Click View Files.

  1. Click + Add.

  1. Name the new file function.proj

  1. Paste the xml fragment below in into the new file and click Save.

<Project Sdk=”Microsoft.NET.Sdk”>

<PropertyGroup>

<TargetFramework>netstandard2.0</TargetFramework>

</PropertyGroup>

<ItemGroup>

<PackageReference Include=”QRCoder” Version=”1.3.5″ />

</ItemGroup>

</Project>

  1. Select the run.csx file.
  2. Replace the function code with the following.

#r “Newtonsoft.Json”

 

using System.IO;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

using Microsoft.AspNetCore.Mvc;

using QRCoder;

public static async Task<IActionResult> Run(HttpRequest req, ILogger log)

{

log.LogInformation(“C# HTTP trigger function processed a request.”);

string text = req.Query[“text”];

 

if (text != null) {

// Generate QRCode

byte[] qrCodeAsPngByteArr = null;

string output = null;

await Task.Run(() => {

QRCodeGenerator qrGenerator = new QRCodeGenerator();

QRCodeData qrCodeData = qrGenerator.CreateQrCode(text, QRCodeGenerator.ECCLevel.Q);

PngByteQRCode qrCode = new PngByteQRCode(qrCodeData);

qrCodeAsPngByteArr = qrCode.GetGraphic(20);

output = Convert.ToBase64String(qrCodeAsPngByteArr, 0, qrCodeAsPngByteArr.Length,

Base64FormattingOptions.None);

});

 

if(output != null) {

return (ActionResult) new ObjectResult(new {Image = output});

}

}

return new BadRequestObjectResult(“Please pass a text on the query string”);

}

7. Save. Resolve any compilation errors

Task 3: Test the API

  1. Click Get function URL.

  1. Click Copy.

  1. Start a new browser window and paste the URL you copied.
  2. Add ?text=Hello world at the end of the URL and hit the [ENTER] key.

  1. You should get a result like image below, copy the base64string.

  1. Navigate to https://codebeautify.org/base64-to-image-converter (or any other converter of your choice).
  2. Paste the string you copied and click Generate Image.

  1. QR Code image should be generated.

  1. Bonus testing. Open QR reader on your phone (iPhone or Android). You should get

    Hello world.

Exercise 2 – Create custom connector

In this exercise you will be building a custom connector using either the URL for our pre-built function (find it here https://bas2019.azurewebsites.net/api/qr64gen
) or the one you created in Exercise 1 above.

Task 1: Create connector

  1. Navigate to https://make.powerapps.com sign in and make sure you are in the correct environment.
  2. Expand Data and select Custom Connectors.

  1. Click + New Custom Connector and select Create from Blank.

  1. Enter QR Generator for Connector Name and click Continue.

  1. Type your host name:

    If you created the function yourself enter yourfuntionname.azurewebsites.net

    If you are using our function enter bas2019.azurewebsites.net

  2. Type /api for Base URL, and click Security.

  1. Select No Authentication and click Definition. Do not navigate away from this page.

 

Task 2: Add action

  1. Click + New Action.

  1. Enter QRCode for Summary, QR Code base64 for Description, and QRCode64 for Operation.
  2. Go to the Request section and click Import from Sample.

  1. Select GET for the Verb.

    If you are using our function enter https://bas2019.azurewebsites.net/api/qr64gen/?text=Hello

    If you created the function yourself enter https://yourfuntionname.azurewebsites.net/api/qr64gen/?text=Hello

    Click Import.

  1. Scroll down and click on the Response.

  1. Enter 200 for Name and click Import from Sample.

  1. Paste {“image”:”sample”} in the Body and click Import. Do not navigate away from this page. (the box may appear as read-only, but you can paste the needed text using Ctrl+V)

  1. Click Create Connector. Do not leave this screen.

 

 

Task 3: Test

  1. Select Test.


  1. Click Create.


  1. Click + New Connection.


  1. Make sure QR Generator is selected and click Create.


  1. Select Custom Connectors and click Edit on QR Generator.


  1. Select Test again.


  1. Enter Hello Contoso for Text and click Test Operation.


  1. You should get OK (200) for Status and the Body should look similar to the image below.


  1. Click Close.


Note: You can also create Custom Connectors using Open API defintions https://docs.microsoft.com/en-us/connectors/custom-connectors/define-openapi-definition or Postman collections https://docs.microsoft.com/en-us/connectors/custom-connectors/define-postman-collection That can be helpful when the API is more complex.

Exercise 3 – Use the custom connector

Task 1: Add data source

  1. Navigate to https://make.powerapps.com and make sure you are in the environment you used for Module 03.
  2. Select Apps, select Event Day Manager app, and click Edit.

  1. Select the View tab and click Data sources.

  1. Go to the Data pane and click + Add Data Source.

  1. Select QR Generator.

Task 2: Display QR Code

  1. Select the Sessionscreen.
  2. Select the Insert tab, click Media and select Image.

  1. Rename the image imgBarcode.

  1. Set the Image property to the formula below.

“data:image;application/octet-stream;base64,” & QRGenerator.QRCode64({text:txtAttendeeCode}).image

  1. Move the imgBarcode to bottom of the screen.

Task 3: Test

  1. Select the MainScreen and click Preview the App.

  1. Select the Event.

  1. Select one of the Sessions.

  1. Type something on the Attendee field. The QR Code image should change every time you change the test text.

 

Challenge:

You might notice that even if there is no attendee looked up a QR code still is displayed. If you have time, try to update the app to only show the QR code when an attendee is looked up. After you complete this challenge it should look like the following if no code is provided.

Adv Hands On Lab 5: Embedding PowerApps into Power BI

 

Power BI Dashboard

In this lab, you will create a Power BI dashboard with an embedded PowerApp. The final product will look like the image below.

Exercise 1: Build Power BI Report

High level tasks

    Task 1: Connect to PowerBI and enable sample data. Build PowerBI report

    Task 2: Import PowerApp visual for use in report

Task 1: Build Report

In this task, you will build the Power BI Report.

  1. Navigate to https://powerbi.microsoft.com and click Sign in.
  2. At the bottom of the left navigation, click Get Data
  3. Select Samples.

  1. Select the Retail Analysis Sample.

  1. Connect.

  1. Your sample dataset will take a moment to load.

  1. Expand My Workspace and click to on the Retail Analysis Sample under the Datasets. If you have completed the prior steps and do not see this sample, refresh your browser.

  1. Go to the Fields pane, expand the Store table, and select the Territory and Chain fields. Be sure to select the Territory field first or the designer will add table visual to the canvas, instead of map visual. You can also add the map visual to the canvas first and then select the fields in any order.

  1. The map visual will be added for you. Resize and reposition the map as shown below.

  1. Select the canvas and click Slicer visual.

  1. With Slicer selected, go to the Store table and select the Store Type field.

  1. Resize and reposition the Slicer as shown below.

  1. Select the canvas, go to the Store table and select the Name and Open Year fields.

  1. The table will be added for you. Resize and reposition the table as shown below.

  1. Select the canvas and click on the Pie Chart visual.

  1. With the Pie Chart selected, expand the Sales table and drag Last Year Sales filed to Values.

  1. With the Pie Chart still selected, expand the Item table and drag Category field to Legend.

  1. Resize and reposition the Pie Chart visual as shown below.

 

Task 2: Import PowerApps Custom Visual

In this task, you will import PowerApps custom visual.

  1. Go to the Visualization pane and click Import from Marketplace.

  1. Search for PowerApps and click Add.

  1. You should now have the PowerApps visual available for you to use.

 

 

Exercise 2: PowerApps Visual

High level tasks

    Task 1: Create the canvas app you will use as a visual    

Task 1: Create PowerApp Visual

  1. Click on the PowerApps Visual.

  1. With the PowerApps visual selected, expand the Store table and select City and Name.

  1. Click on the environment name and select the environment you want to create the PowerApp in.

  1. Click Create New.
  2. PowerApps studio will open in a new browser tab and Gallery will be added to screen.

  1. Resize Gallery1 it until it looks like the image below.

  1. Click on the Edit button. The gallery will go into edit mode.

  1. Resize the item template of the gallery and make it slightly taller.

  1. With the gallery still in edit mode, select the Insert tab and click Label.

  1. Reorder the labels as shown in the image below.

  1. Double click on Screen1 and rename it MainScreen.

  1. Double click on Gallery1 and rename it storeList.

  1. Select MainScreen and click insert Label.

  1. Rename the new label headerLabel, move to the top of the screen and resize it.

  1. Change the Text for the headerLabel to COMPLIANCE VISIT.
  2. Select the Home tab.
  3. Select the headerLabel, change the font Size to 32,
    Color to White, Fill to Blue, and click Align.

  1. Select Center.
  2. Click File and click Save.

  1. Enter Compliance Visit for Name and click Save.

  1. Click on the PowerApps back button (not the browser back button).

 

 

 

Exercise 3: Connect to Microsoft To-Do

High level tasks

    Task 1: Add connector to Microsoft To-Do

    Task 2: Save and test your work

 

Task 1: Add Microsoft To-Do Connector

  1. While still in the app designer, select the View tab and click Data Sources.
  2. Click Add New Source.

  1. Click New Connection.

  1. Search for Microsoft To-Do and select it.

  1. Click Create.
  2. Close the Data pane.

  1. Select the MainScreen.
  2. Select the Insert tab, click Text and select Text Input.

  1. Rename the new text input todoTitle and place it below the storeList.

  1. Change the Default value to the formula below.

Concatenate(“Visit “, storeList.Selected.Name, ” in “, storeList.Selected.City)

  1. Change the Mode to MultiLine.

  1. Resize todoTile and make sure it looks like the image below.

  1. Select the Insert tab, click Controls and select Date Picker.

  1. Rename the Date Picker dueDate.
  2. Place the dueDate control below the todoTitle control.

  1. Select the Insert tab and click Button.

  1. Rename the button submitButton.

  1. Change the Text of the submitButton to add to list.

  1. Set the OnSelect value of the submitButton to the formula below. This formula will add to-do item to the Tasks folder, set the title of the to-do item to the text in the todoTile input control, and set the due date to the date selected from the dueDate control.

‘MicrosoftTo-Do(Business)’.CreateToDo(todoTitle.Text, {folderId: “Tasks”, DueDateTime:{ DateTime:dueDate.SelectedDate, TimeZone:’UTC’ }})

  1. Move the submitButton below the dueDateControl and resize it.
  2. Your MainScreen should look like the image below.

  1. Click File and click Save.

  1. Click Publish.
  2. Click Publish this Version.

 

Task 2: Test Application.

  1. Go back to Power BI.
  2. Resize and reposition all the visuals until the report looks like the image below.

  1. Click Save.

  1. Enter Compliance Visit for Name and click Save.

  1. Select Pin Live Page.

  1. Select New Dashboard, enter Embedded PowerApp and click Pin Live.

  1. Go to the Dashboards section and select Embedded PowerApps dashboard.

  1. Your dashboard should load.

  1. Go to the map, zoom in, and select Virginia. All the visuals should update including the PowerApp.

  1. Select Colonial Heights Lindseys from the PowerApp list. The input text value should get updated.

  1. Select future date for due date and click add to list.

  1. The item should be added to your to-do list.
  2. Select Tennessee from the map.
  3. Select Cookeville Lindseys from the PowerApp, select future date for due date and click add to list.
  4. Go to https://to-do.office.com and login.
  5. Select the Tasks list. You should see the items you added by the embedded PowerApp.

 

Bonus: Go back and edit the canvas app you have made to give the user a message to confirm submission of the to-do item.

PowerApps AI Builder Hands-On Lab Binary Classification

The PowerApps AI Builder product team did a great job of creating Labs for PowerApps AI Builder. The challenge I found is they actually put the content in a couple of different locations: Two different GitHub Repos with two different locations in docs that need to be knit together to get it all working. This post simply brings all that content to a single location until the Team makes the demo an installable component.

PowerApps AI Builder needs a large enough dataset size as to train your models. This being the case to get started you need to import data into your CDS instance.

Data Preparation:

    1. Download the AI Builder sample datasets solution, AIBuilderOnlineShopperIntention_1_0_0_0.zip, from here.
    2. In PowerApps, select Solutions in the left-side navigation pane, then select Import at the top of the screen.
    3. In the pop-up screen, select Choose File, and then select AIBuilderOnlineShopperIntention_1_0_0_0.zip that you downloaded in step 1.
    4. Follow the on-screen instructions to import the solution, and then select Close after you finish.

    Next, import the sample data into the entity. In this example, we use the aib_onlineshopperintention.csv file:

    1. In the list of AI Builder samples, select the aib_onlineshopperintention.csv file, and then select Download to open the raw version of the file.
    2. Copy the URL from the address bar in your browser. In this case, the URL to copy is: https://raw.githubusercontent.com/microsoft/PowerApps-Samples/master/ai-builder/aib_onlineshopperintention.csv.
    3. In PowerApps, select Entities in the left-side navigation pane, select Get data > Text/CSV, and then paste the copied URL from the last step into the File path or URL box.
    4. Set the following properties, and then select Next:
      • On-premises data gateway = (none)
      • Authentication kind = Anonymous
    5. On the Map entities screen, make sure Load to existing entity is selected, and under Destination entity, select aib_onlineshopperintention in the drop-down menu.
    6. Select the Delete rows that no longer exist in the query output check box, and then select the Auto-map function that is on the upper right of the Field mapping screen. Select Next.
    7. On the Refresh settings screen, select the Refresh manually check box, and then select Create to start the import process.

    Allow some time for the import to complete. Then, make sure the data is imported correctly.

    1. In PowerApps, go back to Entities under Data and select Online Shopper Intention.
    2. Select Views and then select Active Online Shopper Intention.
    3. Add fields on the left side to validate that all the fields have been imported correctly.
    4. Select Publish to save the current view with the selected fields.

Now that you some data you can use AI Builder!!

This section of the Lab is found in the following Git Repo: https://github.com/microsoft/PowerApps-Samples/blob/master/ai-builder/labs/AIBuilder_Lab.zip

Binary classification

Binary classification uses historical data to predict whether new data falls into one of two categories. You can use these insights to develop actionable intelligence for your business.

In this lab, we will build and train a binary classification model. We will also review the level of influence of the selected criteria. Finally, we will make a model-driven application to review this data prediction.

The data used here will help us predict online shopper intentions. We have details of a shopper’s site visit as well as if that visit resulted in a sale (revenue). Once we have the prediction information, we can use that to help guide marketing plans, website updates, promotional communications, and more.

Note: If you are building the first model in an environment, click on Explore Templates to get started.

Exercise 1

In the first exercise you will build and train your model.

  1. From the left navigation, expand AI Builder and select Build.

  1. Select Binary Classification.

  1. Name your model. Because you are working in a shared environment make sure to include your name as part of the model name. This will make it easier to find later. Click create.

  1. Your screen should look like the following image.

  1. Notice the progress indicator on the left.

  1. You will see Quick tips on the right.

  1. In the center we will build our model. Click in the Entity field and select Online Shopper Intention. This is a custom entity that collects the data we are storing regarding the online shopper’s visit to our site.

  1. From the selected entity we will now see available binary fields for prediction. The only fields we will see here are of type “Two option.” Select Revenue. Click Next.

  1. The next screen will show us available fields on the entity. Each field selected will be evaluated by the model for the fields influence on the end result. By default, all fields will be selected, do not remove any fields. Click Next.
  2. Notice our progress indicator has moved to the next item. Click Train.

  1. Your Binary Classification model will now train. Go to Models.

  1. Locate and open your saved model. If you need help finding it, type your name into the search box.

  1. After each training, AI Builder uses the test data set to evaluate the quality and accuracy of the new model. A summary page for your model shows your model training result, including a Performance score. The score we have is 65% and we should expect it to change over time. And now we can view some details about our trained model. Click on View Details.

  1. Our details report will show the data influencers and how much influence that data has on our prediction model. Close the details.

  1. Publish your model. Once published the data will get scored, and scoring will happen daily for a published model.

About that score

:

Performance score calculations

AI Builder calculates the performance score for your model based on the precision and recall of the prediction results:

Performance score: This is the harmonic mean of precision and recall. It balances both for an imbalanced class distribution. Performance score values are between 0 – 100. Generally, the higher the performance score, the better your model performs.

Precision: The fraction of correct predictions among all the positive predictions.

Recall: The fraction of correct predictions among all true positive cases.

Exercise 2

We will make a small model driven application to view the data. This approach allows us a quick look at the data. You could also make a canvas app that allows users to interact with the data from a mobile device.

  For the purposes of this lab, we have taken some shortcuts in the interest of time. In general, you should always be working in a specific solution, you should rename items with smart names for better team development and more. A full lesson on customization and solution strategy is beyond the scope of these labs. However, Microsoft has many learning choices available. Please ask your instructor if you’d like more information.
  1. In your PowerApps maker portal, from the left side navigation, navigate to Apps and select Create an app and select Model-driven.
  2. If this is your first time connecting to a canvas app in this environment, you might be prompted to choose your region. Select the default.
  3. Give your app a name, remember to include your own name as part of it. Leave all other options as they are and click Done.
  4. You should see something like the image below. 
  5. We will now add our online shopper intention entity to the site map. Click the edit icon on the Site Map.

  1. With focus set on the Area give the area a name such as Online Shopper Intentions. Select and name the Group as well.

  1. With the New Subarea selected select Type of Entity and Online Shopper Intention as the entity. Leave other fields as defaults.

  1. Save your Site Map and go back to the App Designer.
  2. You should now see the assets needed for the Online Shopper Intention entity are included in our model-driven app.
  3. Let’s add a view to our app so we can better see the prediction data. Click on Views and then Create New.

  1. If prompted with unsaved changes, you can dismiss by clicking OK (assuming you’ve followed our steps so far!).

 

  1. Click Column Attributes Primary Entity.
  2. Drag and drop the following fields to the view: revenue-predicted(modelname); revenue-probability(modelname); and revenue.Note:

    You will see fields added for the models of all of the students working in the same environment, look for the ones with your model name in the field name.

  1. Adjust column widths to make them wider and easier to view. With the column selected, increase the width using the options on the right side of the view designer.

  1. Save your view, remember to include your name as part of the view name.

  1. Return to App Designer. Save your app and publish it.

  1. Play your app.

  1. You should now be in your new model-driven app. Select the view you just created.

  1. View the data. You can see the prediction score, and the prediction that follows. With this information you can create automation such as a flow that would trigger based on a customer’s expected revenue and send discount emails to customers likely to complete a purchase. Creating such automation is beyond the scope of this workshop.

 

A “cliff notes version of these direction are also in the docs here: https://docs.microsoft.com/en-us/ai-builder/binary-classification-model-driven-app

  • Sign in to PowerApps, select Apps from the menu, and then select Create an app > Model-driven at the top of the screen.
  • On the Create a New App screen, complete the fields and then select Done.
  • On the App Designer screen, you need to:
    • Create a view of your entity that contains the predicted fields from prediction output.
    • Add the view to the site map.
  • Select Entities on the Components menu, select your entity, and then select Back.
  • Select Save at the top of the screen so that you don’t lose your progress when you create a view, then select Views under Entity view and select Create New on the Components tab.
  • Select Column Attributes – Primary Entity on the Components tab, and then select the fields generated by prediction output.
  • Select Save And Close, give your view a name, and then select the view you just created. Then, select Save again.
  • Select the pencil icon next to Site Map and rename New Group appropriately.
  • Select New Subarea and select Entity as the Type, and then select your entity from the Entity drop-down menu.
  • Select Save And Close and then select Publish.
  • Select Play. Your output should look something like this

Power Platform Training Materials

This week I have had a couple of requests for PowerApps training.

I typically direct these requests to the great page Saurabh put together: PowerApps and Microsoft Flow: Learning Resources

That said of the four pages of content only a subset is dedicated to training and step by step walk throughs.

Hands on Labs:

Step by Step Guides:

Videos:

Samples:

The list above includes some great training content, I do recommend bringing in one of our amazing trainers…end of the day this will save you time!

To get expert help from PowerApps partners please see: https://powerapps.microsoft.com/partners/

PowerApps Training Content:

Older Content Power BI Training Content

(The new owner is on the process of onboarding)

In addition to all the training by the Power BI Partners, the development team works on additional courses that may assist you in your training efforts.  This page was created to serve as a directory for these efforts:

Finished that are updated regularly

Being Created Now:

NEW:  Excel “Better Together” BI training

Announcing soon on, Demos.Microsoft.Com you will find an entire walk through demo of how to use Excel as both the presentation tier and data model in a BI solution.   Additionally this link will take you to an entire day long Excel based BI class delivered internal to Microsoft to show Excel practitioners how they can solve their BI needs with the tool they are already familiar with  -Excel.

*For reference only not for distribution.

Dashboard in a Day

Dashboard in a Day (DIAD) is a 1 Day hands-on workshop for Business Analysts, covering the breadth of Power BI capabilities.

At the end of the day, attendees will better understand how to:

  • Connect to, import, and transform data from a variety of sources
  • Define business rules and KPIs
  • Explore your data with powerful visualization tools
  • Build stunning reports
  • Share your dashboards with your team and/or the world

All DIAD workshop assets; presenter deck, demo scripts, step-by-step student Hands-on-Lab and dataset, plus a train the trainer video on how to execute a successful event, are updated monthly by the Power BI engineering team and are offered for free to all Partners.

The DIAD assets are split into 2 parts:

Instructor content: which includes Presentation decks, Demo Scripts and train the trainer materialcan be downloaded here.


Attendee content: which includes the Lab Manual and datasets, can be downloaded here.

The guidance for using the content is:

  1. Partners cannot make any changes to the dataset.
  2. If partners want to make any changes to the content, then they should brand the event as DIAD.
  3. The person presenting should be very familiar with Power BI and be able to answer any customer questions related to the workshop or Power Bi in general.

We are definitely open to feedback and enhancing the content and would love to hear and take feedback and iterate.

Please send your feedback to diadq@microsoft.com

If you are a customer looking to attend a DIAD, please reach out to your Microsoft representative or check our partner training offers in the Consulting Services Marketplace.

Feel free to print and distribute to students.

Power BI Developer in a Day

Power BI for Developers  Full Day Workshop Level: 300 (Advanced). This course targets developer who want to leverage Power BI in their applications, or want to extend Power BI features with custom visuals. It’s an advanced course where you will learn what Power BI platform has to offer developers including:

• Embedding Power BI content into web applications

• Power BI REST API and using it in custom .NET applications

• Streaming data concepts; pushing data into real-time dashboards.

• Introduction to Custom Visuals; creating new visuals (overview only)

Prerequisites:Familiarity with Power BI content creation (i.e., modeling, report building, publishing to service)Familiarity with .Net, PowerShell and JavaScript basics are highly desirable Power BI Pro account (60 day free trial is sufficient)

Feel free to print and distribute to students.

Administrator in a Day

Need to come up to speed fast on the administration for Power BI? Then this all-day course is for you!

 Advanced Modeling with Power BI

This course will walk through parsing data modeling formulas, using DAX to create calculations, consequences of data model design decisions, concepts of calculated columns and measures, with particular focus on patterns & CALCULATE.

Feel free to print and distribute to students.

Advanced Visualization with Power BI

Gain familiarity with Power BI report layouts and structure the agile process to creating Power BI data visualizations. Understand the art behind visualizations, implications behind choosing the right charts, the impact of color, shape and size, and finally the use of Power BI custom visuals.

Feel free to print and distribute to students.

Advanced Data Shaping with Power BI

At high level this session will cover, using Power BI Desktop to import and shape data from a variety of different sources. Specifically, you will be able to: Understand the Power BI Desktop data model, the components of effective schemas, gain an understanding of the Power Query M language, import data from a variety of sources (including XLS and CSV files), create queries using toolbar navigations and Advanced Editor, understand parameters and finally, organize queries using folders.

Feel free to print and distribute to students.

Getting the Simrad NSS8 to receive AIS and DSC

 

Finally getting my Pursuit back the water and realized that neither Simrad: NX40 nor NSS8 is communicating with my Standard Horizon 2150.

…I know the NX40 has a couple of issues but got the NSS8 working on the other boat.

Then i remembered this was a replacement NSS8…and all my settings would have been lost.   After a quick search i found the very very good Standard Horizon documention (see below) but those were the settings were still on the radio from before i parked the Pursuit.

http://www.standardhorizon.com/downloadFile.cfm?FileID=7527&FileCatID=86&FileName=Wiring%20to%20SIMRAD%20NSE%20%26%20NSS%20to%20GX2150%20%282%29.pdf&FileContentType=application/pdf

SH

After a LOT more searching turns out the Simrad defaults to not transmitting NMEA and that too needs to be turned on…and the settings changed to match the 2150

http://www.simrad-yachting.eu/globalassets/lowrance/manuals/dansk-manual/nmea-0183-til-nss–hds-gen-3-enheder-brugermanual-skandinavisk.pdf

simrad2

Related Posts:

 

https://sterlingsdotlife.wordpress.com/2015/04/27/displaying-a-buddies-boat-on-a-simrad-nss-8-using-standard-horizon-21502200-and-dsc/

https://sterlingsdotlife.wordpress.com/2012/01/16/displaying-dsc-information-with-a-standard-horizon-chartplotter/

https://sterlingsdotlife.wordpress.com/2012/01/16/how-to-wire-your-dsc-vhf-to-a-nmea-0183-chartplotter-so-you-can-remove-them/

https://sterlingsdotlife.wordpress.com/2011/11/28/displaying-ais-data-on-a-simrad-nx40-using-a-standard-horizon-matrix-2150/

 

Microsoft Business Application Summit Power Platform Workshop

 

Hands on workshop walking attendees through integrating PowerApps and Power BI to create a scoreboard application.

Step 1.  Create an app workspace to host the application. 

To do this: Log in to PowerBI.com and click on Workspaces > New Workspace.

For people doing this at Microsoft Business Applications Summit we have created accounts for you to use with the names MBASUser201@Powermvps.com through MBASUser400@Powermvps.com (Yes we have 200 people signed up!!) …I will give out the Pass word at the event.  As I used the name MBAS please name yours MBAS### with the number being your assigned account.

SCOREBOARD1

Step 2.  Navigate to the Workspace content view

SCOREBOARD2

Step 3.  Create a streaming dataset

Click on create and select streaming Dataset

SCOREBOARD3

Step 4.  Set the streaming dataset to be API based.

Click on API and select Next

SCOREBOARD4

Step 5.  Set the streaming dataset properties

Add the fields:

Score > as number

Person > as Text

Contest > as Text

Date > as DataTime

SCOREBOARD5

Step 6.  Create a report displaying the streaming dataset

Select Datasets and then select that chart glyph for the dataset you just created in the above step

SCOREBOARD6

Step 7.  Add a visual to display the score by Person

Drag the Score field to the Power BI report design canvas.  This should default to a clustered Column chart, if not change it one and add the person as the axis.

SCOREBOARD7

Step 8.  Pin the Column Chart to a Scoreboard dashboard.

Click the push pin glyph in the visual you just created and save the report with the name “Scoreboard”

SCOREBOARD8

Step 9.  Create a new Dashboard

Select New dashboard and give the dashboard name “Scoreboard” and click pin.

The reason for using a dashboard rather than a report is the fact that reports are not real time yet. (written 6/3/2019).   Do NOT navigate to the dashboard yet. 

Scoreboard9

Step 10.  Adding a PowerApps to the Power BI Report (using the PowerApps custom visual)

In the Power BI visuals section click the ellipsis select the “Import from marketplace”, search for PowerApps and select the visual “PowerApps (Preview)”.

SCOREBOARD11

Step 11.  Creating the PowerApps application with the Power BI custom visual.

Drag the fields Contest, Person and Score to the PowerApps custom visual.

SCOREBOARD12

Step 12.  Add a Rating control to the PowerApps application

SCOREBOARD14

Step 13.  Add a Button control to the PowerApps application

SCOREBOARD15

Step 14.  Add a Text Input control to the PowerApps application

SCOREBOARD16

Step 15.  Add a Label control to the PowerApps application

SCOREBOARD17

Step 16.  Creating a new Flow and attaching it to the PowerApps button

SCOREBOARD18

Step 17.  Add the Power BI Action to the Flow

SCOREBOARD19

Step 17.  Add the Power BI action to the Flow.

Set the workspace to the workspace you created in step one i.e. MBAS####.

Set the dataset to “Scoreboard” that you created in step #5.

The table will be called “Real Time Data” (this set automatically)

SCOREBOARD20

Step 18.  Set every field to “Ask in PowerApps”

Set every field every field in your dataset to “Ask in PowerApps.  For the first field you will see this option by default.  For subsequent fields you will need to click the “See More” option.

SCOREBOARD21

Step 19.  Set every field to “Ask in PowerApps”

Set every field every field in your dataset to “Ask in PowerApps.  For the first field you will see this option by default.  For subsequent fields you will need to click the “See More” option.   In this image that option has been set and now shows “See Less”

SCOREBOARD22

Step 20.  Set every field to “Ask in PowerApps”

Set every field every field in your dataset to “Ask in PowerApps.  For the first field you will see this option by default.  For subsequent fields you will need to click the “See More” option.   In this image that option has been set and now shows “See Less”

SCOREBOARD23

Step 21.  Set every field to “Ask in PowerApps”

Set every field every field in your dataset to “Ask in PowerApps.  For the first field you will see this option by default.  For subsequent fields you will need to click the “See More” option.   In this image that option has been set and now shows “See Less”

SCOREBOARD24

Step 22.  Save your Flow

Now save your Flow.  While not done in this screen shot it is recommended that you name your Flow by default called “from PowerApps” before saving.

SCOREBOARD25

Step 23.  Connect your button to the Flow

Navigate back to the PowerApps tab and select the Flow you have saved in the step above.  This will add a parameter to the Flow call for every field in the streaming dataset.

SCOREBOARD26

Step 24.  Supply the Flow parameters

Set the score flow parameter for score to value property of the Rating1 control.  Set the person parameter to the TextInput1.Text control property.  Set the contest parameter to the harded coded string “MBAS”.  Set the Date parameter to “Now()”.

SCOREBOARD27

Step 25.  Save the PowerApps application

Under the file menu select “Save”

SCOREBOARD28

Step 26.  Save the PowerApps application (cont)

Name your application and select the “Save” button in the lower right hand corner.

SCOREBOARD29

Step 27.  Pin the PowerApps application to the dashboard to the Power BI Dashboard.

Navigate to the Power BI Tab.  You will notice the application is already visible in the Power BI.  In the upper right hand corner of the Power BI visual select “Pin visual”.

Select the “Scoreboard” dashboard created above.

SCOREBOARD30

Step 28.  Test the PowerApps/Power BI integration .

In the Power BI Dashboard type a persons name and select a score.  Hitting the button should update the column chart created above.

finished

Congratulations you have created a streaming dataset, a PowerApps application and a real time dashboard!