This post was originally published on the personal blog of Keith Craigo.
It was mentioned in the 2016 Microsoft Ignite video that 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.
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.
Requirements
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.
End User Requirements
Let's Get 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 connection options 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.
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.
Change the Screen Name
The way you add additional functionality to your app is by using the available out of the box Excel style formula's. For example:
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.
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 Eye Symbol changes to an X .
Each field is contained within a DataCard.
Create a Flow to Send a Notifcation 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] ,
Details:
[LicensePlate]
[Color]
[Make]
[Model]
[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:
Summary
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.