Thursday, August 24, 2017

.NetCore 2.0, AzureAD and OpenIdConnect

.NetCore 2.0, AzureAD and OpenIdConnect

If you develop with .NetCore you probably already know that there are some significant changes from .NetCore 1.1 to .NetCore 2.0
  1. 2.0 — Most .Net Packages are now under a single Namespace — Microsoft.AspNetCore.All
  2. More significant changes are in how we setup our Startup.cs — Configure , ConfigureServices and TokenValidated. 
  3. More, I'm just getting started with 2.0
I had to dig into the Class libraries to figure out how to get this to work in 2.0, the Microsoft docs have not caught up with .NetCore 2.0 just yet, the docs on Authentication still reference 1.1 for now, or maybe I just didn’t look hard enough. 

I’m going to focus on using OpenIdConnect to connect to AzureAD for user authentication in this basic post.

Project setup: 
I put all my Azure connect settings into the appsettings.json file for this post, you may want to put your settings in some other place depending on your security requirements.

app settings.js

“AzureAd” : {
“ClientId”: “
Your ClientId”,
“Tennant”: “
Your Tennant”,
“TennantId “: “
Your TennantId”,
“AADInstance”: “
Your AADInstance”,
Your PostLogoutRedirectUri
}, “More settings here, removed for brevity”

You can find these settings on your Azure Portal: 

Azure Active Directory -> App Registrations -> "Your App" -> Properties 

The Code!

.NetCore 1.1

In .NetCore 1.1, I setup the Configure, ConfigureServices, TokenValidated methods of my startup.cs file like this: 


services.AddAuthentication( SharedOptions => SharedOptions.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme);


app.UseCookieAuthentication(new CookieAuthenticationOptions()); 

app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions {
ClientId = _config[“AzureAd:ClientId”],
Authority = String.Format(_config[“AzureAd:AADInstance”],
ResponseType = OpenIdConnectResponseType.IdToken, 
PostLogoutRedirectUri = _config[“AzureAd:PostLogoutRedirectUri”],
Events = new OpenIdConnectEvents {
OnTokenValidated = TokenValidated,
OnRemoteFailure = OnAuthenticationFailed
 } });


private Task TokenValidated(TokenValidatedContext context)
string issuer = context.SecurityToken.Issuer;
string subject = context.SecurityToken.Subject;
DateTime validFrom = context.SecurityToken.ValidFrom;
DateTime validTo = context.SecurityToken.ValidTo;
string tenantID = context.Ticket.Principal.FindFirst(“").Value;
IEnumerable<string> approvedTenantIds = new List<string>
if (!approvedTenantIds.Contains(tenantID))
throw new SecurityTokenValidationException();
return Task.FromResult(0);

.NetCore 2.0

In 2.0, we no longer need to specify app.UseCookieAuthentication nor app.UseOpenIdConnectAuthentication,
instead all authentication is now available with



services.AddAuthentication(options=> {
 options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
 options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
 .AddOpenIdConnect(options => {
 options.Authority = String.Format(Configuration[“AzureAd:AADInstance”], Configuration[“AzureAd:Tenant”]);
 options.ClientId = Configuration[“AzureAd:ClientId”];
 options.ResponseType = OpenIdConnectResponseType.IdToken;

 options.Events = new OpenIdConnectEvents
 OnTokenValidated = TokenValidated,
OnRemoteFailure = OnAuthenticationFailed

TokenValidated()In .NetCore 1.1 TokenValidatedContext was located in the namespace 


In .NetCore 2.0 TokenValidatedContext is now under


So we need to change how we find the tenantId, everything else is the same as above.

string tenantID = context.Ticket.Principal.FindFirst(“").Value;

string tenantID = context.Principal.FindFirst(“").Value;

I did make an addition, I added this to the 2.0 version.
string audience = context.SecurityToken.Audiences.FirstOrDefault();
string upn = context.Principal.FindFirst(ClaimTypes.Upn)?.Value;

OnAuthenticationFailed is the same in both 1.1 and 2.0

 private Task OnAuthenticationFailed(AuthenticationFailedContext context)
 context.Response.Redirect(“/Home/Error/?message =” + context.Exception);
 return Task.FromResult(0);

For more information on .NetCore 2.0 changes

Hope this helps.

Tuesday, January 24, 2017

Microsoft PowerApps and Flow Learning Resources

An ongoing list of Microsoft PowerApps and Flow Resources

I'll update as I come across helpful resources.

Main Sites:
  1. - Main hub for PowerApps, Flow, Power Bi and Microsoft Stream
  2. - Documentation on everything PowerApps
  4. Guided Learning -
  5. Documentation on Connectors -
Related Technologies

Common Data Model:
  1. MS Ignite - Dive into the Common Data Model -
Azure :

Video - PowerApps

  1. MS PowerApps -
  2. Microsoft Mechanics - Step-by-step guide to building PowerApps for SharePoint:
  3. MS Ignite - Build business applications with Power Apps, Microsoft Flow, and Office 365 -
  4. MS Ignite - Dive into PowerApps, building apps that mean business without writing code -
  5. MS Ignite - Dive into Microsoft Flow, create automated workflows between your favorite apps and services -
  6. MS Ignite - Build business applications with Power Apps, Microsoft Flow, and Office 365 -
  7. MS Ignite - Build business apps for Office 365 - InfoPath, PowerApps, Flow and more -
  8. MS Ignite - Convert InfoPath/Designer workflow processes to PowerApps -
  9. Channel 9  -
  10. Scott Hanselman - PowerApps + Azure App Service for Developers -
  11. Azure Friday with Scott Hanselman and Rob Caron - Arif Kureshy demonstrates
  12. Azure Friday with Scott Hanselman and Rob Caron - Karthik Bharathy demonstrates
  13. Azure Friday with Scott Hanselman and Rob Caron - Karthik Bharathy demonstrates
  14. Azure Friday with Scott Hanselman and Rob Caron - Karthik Bharathy demonstrates
  15. Azure Friday with Scott Hanselman and Rob Caron - Karthik Bharathy demonstrates
  16. Azure Friday with Scott Hanselman -
  17. Azure Friday with Scott Hanselman -
  18. PowerApps Pro Dev API Experience with Scott Hunter and Guang Yang -
  19. Audrie Gordon - - Design, Connectors, porting InfoPath to PowerApps etc...
  20. chassMSFT -
  21. MS Ignite sessions list provided by Group Program Manager, PowerApps -

Non Microsoft:
  1. Laura Rogers -
  2. Daniel Christian -

Video - Flow

  1. Dive into Microsoft Flow, create automated workflows between your favorite apps and services -
  2. Microsoft Cloud Platform -

Monday, January 9, 2017

SharePoint Developer Options

Disclaimer: All opinions are my own. I am not affiliated with any company mentioned in this post.
There are a number of ways to develop applications in SharePoint these days. To find out more please visit
  1. Script Editor - Great for manipulating a single page.
  2. Host pages in a SharePoint Document Library - All of your pages can be uploaded to a Document Library and organized using Folders. All of your code must be client based only. You cannot load code that runs on the SharePoint server. You can use plain JavaScript, a JavaScript Framework like Angular, Angular2, Knockout etc... Various Javascript libraries such as JQuery, ReactJS etc... Custom Stylesheets, BootStrap and many more. But all must run on the client, no SharePoint Server side code is allowed anymore.
  3. SharePoint Add-In (SharePoint Hosted or Provider Hosted) - Given what I am seeing in blog posts I follow, SharePoint Hosted Add-Ins are supported at this time but are quickly falling out of favor. Provider Hosted Add-Ins are preferred, this is where all of your code resides on your own server and you make either CSOM or REST Calls into SharePoint to surface your data. You will need to have permission or someone with permissions to register your app with the Sharepoint catalog.
  4. SharePoint Framework - This is still in Developer Preview Release at the time of this post, but it is expected to be made Generally Available sometime in 2017 for SharePoint Online and SharePoint 2016. The SharePoint Framework allows you to create SharePoint page Web Parts using modern technologies like I mentioned in item 2 above. You can create these web parts using a Mac or Windows dev machine. More information is available at to get started. You will need to have permission or someone with permissions to register your web part with the Sharepoint catalog.
  5. Microsoft PowerApps - Designed primarily for Power Users in an Organization as a replacement for InfoPath. PowerApps is so much more though, your data store is not limited to just SharePoint, you can surface data from a variety of Social Networks (Facebook, Twitter, Slack, etc...) from Azure Sql Server, On-Premise SQL Server, Vimeo, YouTube, WordPress, the Common Data Service which is part of each PowerApps environment etc... and many many more pre built Connectors. If a connector is not available for your datasource you can create your own. PowerApps apps can be web, phone, or tablet based. This is a no code solution, to manipulate the web part you use Excel type formulas to add dynamic functionality to your apps. At the time of this post PowerApps apps are limited to your organization, there is no path to sell your apps in one of the app stores. You can find more information at
A great resource to keep on hand is the Microsoft Patterns and Practices website linked from , here you can find a wealth of information, code samples and much more.
One thing to note if you do not already know, as of SharePoint 2016, Sandbox solutions have been deprecated. Your technology of choice may be limited due to your companies policies but none the less, it is exciting to know that we have many options.

Wednesday, January 4, 2017

Microsoft PowerApps + Flow - My opinion on "No code Enterprise App Development"

Microsoft designed PowerApps and Flow for PowerUsers who may or may not know how to write code.
In my opinion LOB ( Line of Business ) Developers such as myself can benefit from this new offering as well.


Time to Market, Yes PowerApps is essentially a closed market,  there is no way to sell the apps you create in PowerApps, they are intended solely for your organization, so your market is your co-workers. 

UPDATE: As of May 2017, you can add your app to, more information is available here

Being the only developer for my department, all design, development, testing, and support falls on my shoulders, this is both good and bad. The average time it takes to gather requirements, to design, to develop, compile user feedback and make improvements depends on the application, for me this typically takes any where from 3 months to over a year before the app can be put into production.
All the while you have to keep up with your other duties, design in new requirements on existing apps where appropriate, take support calls etc... Typical right!

In PowerApps you connect to your data stores through connectors. There are many connectors already available in the PowerApps Portal.

*Not all connectors are shown here, there are many more connectors available and more being developed.

If one of the existing connectors does not meet your needs, then you can create a custom connector by following the guidelines here:

If your data source is an On Premise source you can create a Gateway that will reside on your OnPremise server, at the time of this post only SQL Server and SharePoint are supported.

PowerApps is a NoCode Solution, well sort of.
You can add functionality to your app through Excel style formulas, there are many out the box formulas available, please see: for available functions.

You can create really robust data centric applications fairly quickly, what would have took me at least 3 months in C#, took about 10 days in PowerApps,  I ported 4 apps at the same time in a single weekend, not bragging here, just pointing out the power of PowerApps.

Granted the apps I mentioned above are ports of two of my existing InfoPath forms and one managed code solution I developed with Visual Studio LightSwitch. For the LightSwitch port I connected to my Azure SQL DB instead of the existing OnPremise SQL Server DB, the new PowerApps app UI now interfaces a custom ASP.NETCore WebApi I developed and published to Azure.

The fourth app happened at the last minute, not a recommended design approach, but I wanted to play with the CDS(Common Data Service).

 I had already gathered the requirements on how the PowerApps should work, that's partly the reason why I was able to develop these PowerApps apps so quickly, but even still, I was really impressed at how much I was able to accomplish in a short amount of time.

Depending on your company, you have to consider company policies, data management policies, Legal requirements due to Privacy Management Compliance Policies, does your app contain or surface personally identifiable information, some of my app designs have had to go through architecture review boards made up of various technology leaders from other departments including the IT and Legal departments.

Custom code is the number one support ticket according to IT, therefore if you can develop with an out of the box technology the more likely it is your app will be approved, you will not have to have your app go through the architecture review board process.

PowerApps is now Generally Available within the O365 environment. You will need to check with your IT department as to it's availability within your organization.

As mentioned in the last paragraph Custom code generates the most support tickets according to my IT department. One issue is that if you are on vacation or if you leave the company, you have to make sure another developer is able to take over your source code, in reality this does not always happen, especially if you are a one man team or if custom development is farmed out.

No plans yet but if I were to leave the company, it would be relatively easy for someone to pick up where I left off with PowerApps.

Why not Out of The Box Ready Made Solutions
If this meets your needs, great!
We use out of the box applications all the time.
In my experience more often than not, custom development is necessary. Out the box solutions may be missing some critical functionality required by your business and extending these types of apps can take a really long time, you may not have access to the source code, you might have to involve third party developers, depending on your data you have make sure the dev(s) have network access, proper permissions, you may need to make sure NDA's are signed and properly filed, development can be prohibited by the licensing, prohibited by licensing fees, contracts, there are a number of other reasons as to why you cannot modify the Out the box solution whenever you want.

How complex does your app really need to be?  Not all apps need to use managed code solutions with months and months of design and development time behind them.

How do I get started with PowerApps? 

You have to have an O365 Account.

You can build your UI using PowerApps and connect to almost any data source, SharePoint, SQL Server in the cloud or on Premise through a gateway, you can surface data using the prebuilt connectors or through your own custom API, Social Networks like Facebook, Twitter, Yammer, Slack, use the Entities feature in your PowerApps Console etc...
I say almost anything because the list is still growing and it all depends on whether or not you have the proper permissions to the data source of course.

Also if you work with SharePoint, most of my development these days is done in SharePoint, Microsoft announced at Ignite that PowerApps will replace InfoPath and
Flow will replace SharePoint Designer, but PowerApps and Flow are not limited to just SharePoint as mentioned above.

Is PowerApps a replacement for Visual Studio LightSwitch?
In my opinion NO. PowerApps is significantly different from LightSwitch, it's more like InfoPath but without the Post-backs and PowerApps is not limited to surfacing data from just SharePoint.

Another thing is you have to use the Visual Studio IDE to build LightSwitch apps. Building PowerApp apps with Visual Studio is not available at this time, and I have no clue if ever will be.

PowerApps are developed in either the browser on the PowerApps portal, or through a desktop application available for download from the Microsoft store.

Another big difference I see is that your PowerApps production apps are only available from within your organization, there is no way to make your apps available in one of the online app stores for download by 3rd parties at the time of this writing.

There is a PowerApps management console for mobile you can install on either your iPad and/or iPhone, this is available from both the Apple App store or Google Play. The management app provides you access to all your organizations apps that are made available to you in one place, that way you don't have to install each individual application.

I say the apps your organization makes available to you because admins have the ability to setup compliance rules, limit the apps to specific groups and or personnel or enable the app(s) for the entire organization.

Some features are still a work in progress!
Support for SharePoint libraries is not available at this time and I've had some issues with surfacing Images from SharePoint, QR Codes etc... According to the user forums, support is coming, no ETA though.
More information about what works and what does not work can found in the Community forums and the PowerApps website.


Microsoft PowerApps
Microsoft Flow

Thursday, December 22, 2016

Microsoft PowerApps and Flow - TIPS

I will update this post as time goes on.

TIP #1 - Limit the data surfaced to the current user.

NOTE: Context Variables are scoped to a single screen, if you need the variable to be scoped to your entire application, use a Collection Variable instead.

Use the Filter Function and a Context Variable, you can even use the text value of a Textbox instead of a Context Variable if you want.

1. Set a Context variable to be created when the Home or First Screen of your app is made visible, then set the value of this Context variable to User().FullName, User = Current Logged in User. 

ex. In the Advanced tab of your screen properties set the OnVisible property to 
UpdateContext({CurrentUser: User().FullName})

In my humble opinion: The OnVisible property would also be a good place to refresh your datasource connection so that you are seeing the latest and greatest, you can have multiple functions set in this property, just make sure you put a ; at the end of each function, except the last function.

ex: UpdateContext({CurrentUser: User().FullName}) ; Refresh(DataConnection)

2. In your forms Properties section, under the Advanced tab, set Items to 
Filter(SharePointList, Initiator = CurrentUser)

At the time of this post, PowerApps does not support SharePoint Person or Group fields, therefore I manually created and set an Initiator field in my SharePoint List.
You can change the Initiator by triggering a Workflow every time a new row is inserted into your list but for now I set the field manually.

Now your Form or Gallery control will only show the records that the current user submitted. 
Alternate ex. Use the alternate for the Created By Person field, Filter(SharePointList, Author.DisplayName = CurrentUser)

Note: This throws the following informational message but seems to still work in my case.

TIP #2 - PowerApps Web Studio

The Web Studio is only available for Microsoft Edge, Chrome or IE11 at this time.

TIP #3 - Reset a dropdown control to it's default by changing it's Reset property with a Context Variable.

A Context Variable is scoped to the current screen.

1. Set the OnVisible property of the screen to UpdateContext({resetDropdown: true})

2. Set the Reset property of the dropdown control to the value of the context variable, resetDropdown

3. Add another button to update the Context value to a different value so that it can be reset when you navigate back to the screen below. UpdateContext({resetDropdown: false})

TIP #4 - Reset a dropdown control to it's default by changing it's Reset property with a Collection Variable.

A Collection Variable is globally scoped to the current app.

1. Set the OnVisible property of the calling screen to ClearCollect(ResetDropDown,First(ResetDropDown).Value = false)

2. Set the Action OnSelect property of the calling button to ClearCollect(ResetDropDown,First(ResetDropDown).Value = true)

3. Set the Dropdown Controls' Reset property of the calling button to First(ResetDropDown).Value

4. Set the Back Button OnSelect property to ClearCollect(ResetDropDown,First(ResetDropDown).Value = false)

Initially setting the controls' Reset property to true does not trigger a Reset of the control. The Reset of the control must be triggered by updating it's Reset property.

TIP #5 - Use a Toggle Control to Filter your Gallery

Hope this is helpful!

- Keith

Friday, December 16, 2016

Remote Debugging my Raspberry Pi3 Over Wifi in Visual Studio

Microsoft PowerApps and Microsoft Flow

* This was originally posted on my Public SharePoint site but I'm in the process of moving away from that site due to the fact that Public SharePoint websites are being discontinued March 2017.
It was mentioned in the 2016 Microsoft Ignite video,, PowerApps will replace InfoPath and Flow will replace SharePoint Designer.
In my day job I develop a lot with InfoPath and SharePoint so I decided I had better start coming up to speed on these two new technologies from Microsoft, actually I'm still trying to come up to speed, there is a lot more you can do besides what I will ​show in this post.
For the marketing spiel about why you should consider PowerApps and Flow, I'll direct you to Microsoft's PowerApps website​, they do a much better job than I can. 
What is this about?
Let's walk through the process of building a Line of Business (LOB) Mobile Application to allow employees to submit Long Term Parking Requests. 
When an Employee goes on business travel they sometimes request that they be allowed to park their vehicle on company property. This can be for an extended period of time, in a lot of cases, months at a time​. Some companies have policies that prohibit long term parking without prior approval and the vehicle is therefore subject to towing. ​But if you let Security know, they will try to work with you, at least at my company we try to make accomodations. Normally a request is made in advance but there have been times an employee will forget to let Security know, in this case efforts will be made to track down the owner of the vehicle but if unsuccessful then the vehicle will be towed at the owners expense. There have also been times an employee forgets until the day of or after their departure, then they don't remember the correct number, who to contact, so they involve their manager and or coworkers, not a good situation to be in.  
It would be easier and less stressful if they could submit the request while waiting on their flight from the airport or from their hotel room and not have to worry about phone numbers. Traveling is hectic enough, so as a developer who has been in the same boat, I'm always thinking, how can I make things easier not just for me but for others with my software.
The app will be a phone app that will allow the user to submit a Long Term Parking Request to a SharePoint list, then Microsoft Flow will be used to send out a notification to Security that a new Parking Request has been submitted. 
  1. ​​O365 Account with Tenant Admin permissions - you can get an O365 Developer Account here or be given the ability by your IT Dept. to create apps for your company.
  2. How to create? PowerApps is now available directly from within a modern SharePoint list.

   You can also download the companion desktop app if you desire, this is only available for Windows at this time. Or you can create and edit your app directly in your web browser. Just be aware that if you create the app directly from your list, it will only create an app based on the phone form factor at this time. If you choose to create the app from either the Desktop app or within the PowerApps admin portal you can create your app from a number of predefined templates or choose a blank app for either the phone or tablet form factors.

3. Create a Sharepoint list named "LongTermParking" with the following schema:

*Make sure to set the Default value for ReadParkingPolicy to Yes

End User Requirements!

  1. The user will need to have PowerApps Mobile on their phone or tablet, this is a central hub for all Powereapps provided by your company.
    PowerApps Mobile is avaialble from either the Apple App Store​ or Google Play.​

Let's G​​et Coding Already!

PowerApps is a no code solution, well sort of. Let me explain
First you add your data source connections from a variety of pre built connectors such as SQL Server​​, Azure, Blogger, Social Media services like Twitter, FaceBook, Slack, and a whole lot more... or create a custom connection, or use the Common Data Service to build your Entities. 
Here is a subset of the available out of the box connections.

Again, If you need a connection not covered with the prebuilt solutions, you can supply your own custom connection (maybe another post on this?).
For this app, let's select both the ​Sharepoint Connector and the Office 365 Users Connector.  First select SharePoint and the next screen will ask if you want to Connect ​directly (Cloud services) or if you want to connect to your on premise Sharepoint using a Gateway. 
In this post I'm using my O365 account so I chose  Connect ​directly (Cloud services). Once you click connect, a connection will be created tied to your SharePoint tenant.
Now Add another Connection for the Office 365 Users.
You can select the Gateway option if you want but that's outside the scope of this post, this will allow you to connect to your Sharepoint on premise (Another Post?).

With our ​Sharepoint list "LongTermParking"​ ​​​created, open the PowerApps console and click the + New App button.
On the next screen select ​​the PowerApps Studio for Web button, then on the next screen, under Blank App, select the Phone layout button

When the Editor opens your presented with a blank layout screen,  you can customize the layout as you desire or you can select from a variety of provided layout templates then modify the template to your specs. 
I chose the first template, the one with only the Title Bar ​

Change the Screen Name.

 Click either the Home or Content Tab in the Ribbon and select the Screen name, change this to Home.

Make Our Controls Dynamic:

The way you add additional functionality to your app is by using the available out of the box Excel style formula's. 


If(IceCream.Selected.Value = "Vanilla", UpdateContext({ visible: true }),UpdateContext({ visible: false })); NewForm(IceCreamRequestForm) 

If the dropdown IceCream's selected value =  "Vanilla" , if not already created, create a context variable named visible and set it's value to true, otherwise set it's value to false, then if visible=true,  open and reset the fields in the form called IceCreamRequestForm. The IceCreamRequestForm visible property value is set to the value of the context variable "visible".
You can find out more about all the Formulas on the PowerApps Formula Reference page​​
More on this later.

​In the Ribbon select the Content Tab then the Data sources button

Select the connection to your Sharepoint tenant.

​You should now see something similar to

Click the Add data source to add Office365Users​ Connection., we will use this connection shortly to retrieve the current users Manager.

​Create​ the Request Form

  • ​​​In the screen editor click the grey area away from the screen layout, click the Property Panel Advanced Tab
  • Set the OnVisible Action to UpdateContext({agreed: false}), this creates a Context variable we use to control the Toggle Button's state
  • Add an HtmlText control to the screen, this is located in the Ribbon​ Insert Tab -> Text -> Html text​
  • With the HtmlText control selected click the Advanced tab of the Property Panel and change it's Text to "Company Parking Policy HERE" or whatever you want.
  • Directly under the HtmlText control​ add a TextBox with it's Text set to "I Agree" then place a Toggle Button to the right of the TextBox
  • With the Toggle Button selected, click the Property Panel's Advanced Tab, set the OnCheck Action to  Navigate(ParkingRequestForm,ScreenTransition.Fade)
  • ​Create a new screen by duplicating the current screen, click the elipsis button and select Duplicate screen
  • Delete all the contents of this new screen except the Title bar and Title
  • In the Ribbon select Insert->Forms->Edit Form 
  • In the Ribbon select the Home Tab -> Form1
  • Change Form1 to ParkingRequestForm
  • Select the ParkingRequestForm then click the Advanced Tab
  • Set the Datasource to ParkingRequest
  • Click the Options Tab to show all the available fields we can add to our form

  • Add the following fields to the form by clicking the ​ next to each of the following:

    EmployeeId/EmployeeName  - ​select the elipsis then Advanced options, unlock this field by clicking the Padlock.
    Note: When you unlock and change a fields default values,  it now becomes a custom card and the  changes to  
  • Each field is contained within a DataCard. there are two container elements within the DataCard, the DataCard Key which contains the field Display Name, ex. "EmployeeName" and the DataCard Value whch contains the Textbox.
    Change the Display Name to "Employee Name", you can style the other fields, I'll leave that up to you.Click the Textbox inside the DataCard Value
    Set the Data Default ​Value to User().FullName
    I set the Disabled value to true and deleted the Disabled Fill value and set the Color property to RGBA(0, 0, 0, 1). 
  • ​Click the Options tab to return to the screen shown above.
    Add Manager. ​Go to the Advanced options and then make sure you have selected the DataCard value for the Manager.
    Set ​​the Data Default value to Office365Users.Manager(EmployeeId).DisplayName
  • Add ContactNumber, VehicleLocation, StartDate, EndDate, Make, Model, Color, LicensePlate(Title), and Justification ​to the form and leave the defualts.
  • Note: ​In the screenshot you notice a Yellow Triangle appears, this tells you that there is an issue that needs to be addressed, in this case I had forgotten to change the OnVisible property function to reflect the forms new name.
  • After all the fields are placed on the form the way you like, add a button just after the end of the form as shown in the above screen shot
  • Change the buttons Text to "Submit" and it's OnSelect Action to SubmitForm(RequestForm)​ 
  • Change the OnSuccess Action of the form itself, select the form by either carefully clicking the side of the form, be careful you have not selected one of form fields or the easiest way in my opinion is to instead select the RequestForm from the Property Panel dropdown. 
  • Set the OnSuccess Action to Navigate(Home,ScreenTransition.Fade)
  • Save
  • Run
  • Submit a Request
If you open the ParkingRequest Sharpoint list you should now see your request.

Let's create a Flow to send a notification to Security about our vehicle.

You can create a Flow from​​ one of the following, the Flow portal page​ or create a Flow directly from the Sharepoint list which is what I'm going to do.
​​​Click the Flow button, then Create a New Flow
There are a number of available templates to choose from in Flow​​ and even more ​​on the Microsoft Flow Website​.
For our purposes choose the ​first option

Click the above ​then click Continue​​, now we see the templated Flow

The Flow as it is right now only looks up the information for the current user, we need to change the To: field to a designated Security address.
Change  Subject to New Long Term Parking Request
Change the Body to:
A new Long Term Parking Request was submitted by [Created By Display​ name] ​, 
[Vehicle Location]
Click on Advanced options and set the From field to ​[Display name]
We have to manually create the Link back to the request​​ here
https://{Link to your SharePoint tennant here}/Lists/ParkingRequests/DisplayForm.aspx?ID=ID

the Email will now contain a link to the current request

Display form


​We now have a working mobile phone PowerApps app, say that three times fast, to allow our co-workers the ability to make Long Term Parking Requests from any location.  The app is secured by our Company's O365 Account, we have email notification capability,  the data is easily accessed via SharePoint by Approved Personnel where it can be further processed as desired.​​

Possible Improvements

  1. ​Fix formatting issues of the field labels
  2. Setup a notification to alert the user that the end date they specified is near and they should let Security know if they need to change the date they will pickup their vehicle.
Hope you found this useful!
- Keith

​Microsoft PowerApps and Microsoft Flow are registered Trademarks of Microsoft Corporation

.NetCore 2.0, AzureAD and OpenIdConnect

.NetCore 2.0, AzureAD and OpenIdConnect If you develop with .NetCore you probably already know that there are some significant changes fr...