how to get started using microsoft powerapps (even if you’ve …powerappsfornewbies.com/prods/how...
TRANSCRIPT
-
How To Get Started Using Microsoft PowerApps
(Even If You’ve Never Used It Before)
By
Paul Barnett
https://powerappsfornewbies.com
https://powerappsfornewbies.com/
-
1
Contents Introduction ......................................................................................................................................... 2
Setting up a Sharepoint List............................................................................................................ 3
Create a PowerApps Application ................................................................................................... 4
The Components of the Screen.................................................................................................. 6
Data Cards ....................................................................................................................................... 6
Saving and Publishing your App ................................................................................................. 12
Using Excel as a Data Source ....................................................................................................... 13
Uploading Excel to OneDrive for Business .......................................................................... 14
Create the PowerApps Application ......................................................................................... 15
Making Changes ........................................................................................................................... 17
Adding and Saving a Record .................................................................................................... 19
Conclusion ......................................................................................................................................... 20
-
2
Introduction
First off let me start by saying that I have been a software developer, programmer or whatever
you want to call it, for about 20 years – not that you care, but I thought I’d mention it. I went to
University and studied computer science. I was bogged down with a lot of theory which I never
got to use. I like simple stuff, not endless algorithms, data structures, C++ pointers, SQL Codd
& Date theory etc. I took to MS Access quickly and spent around 10 years creating systems
for different companies. I liked the visual element of it and there were so many books available
at the time, it was easy to get to a reasonable standard quickly. The job market for MS Access
was booming also. If you had that skill in the 1990’s then you were in demand everywhere.
When I first saw PowerApps my first thought was that it was a poor man’s MS Access. I still
think that to be honest. Another term I heard is that ‘PowerApps is MS Access on steroids’. I
disagree – I think it is the other way around. You can do far more with MS Access and it is
more versatile. At the time of writing this, PowerApps is in its early days and Microsoft are
continuing to make improvements all the time. Having said all that, it is possible to create some
neat applications with PowerApps and as more and more people use it, it’s popularity will
continue to grow. As less and less companies are using MS Access now and everything is
moving to the cloud, it is possible that PowerApps will take over from where Access left off.
So, what do I like about PowerApps?
• Web based so no need to create multiple versions to sit on each PC
• When updating, you only need to update that one version and everyone will get it
• Nothing to install on a user’s PC
• Works on laptop, desktop, tablet and phone
As no programming language is available, it means you have to rely on using something called
‘Flow’ to get anything complicated done. Learning flow can be challenging, depending on what
you are trying to achieve.
Like MS Access, it is better to use PowerApps for creating simple applications. This will usually
take the form of a small number of screens and simple functionality. You can still create some
pretty powerful applications this way.
PowerApps allows you to use a variety of data sources. Some of the more common ones
include SQL Server, SharePoint and even Excel.
In this book, I will demonstrate how you can get up and running using a couple of data sources
– SharePoint and Excel. First let’s take a look at SharePoint.
I won’t be going into the ins and outs of SharePoint as I assume you have some knowledge
of how to set up a site, create lists etc. For those unfamiliar with SharePoint, it is a document
management system that allows you to store data in what are known as lists. Think of a list as
a table in a database system such as MS Access.
The PowerApps application I will show you is going to be used at an event to take course
bookings. People will have shown some interest beforehand so names can be entered into
the list beforehand or at the event itself. The mobile app will confirm whether the person
attended the event and paid for the course that was talked about.
-
3
Setting up a Sharepoint List
First, I will set up the data storage system using SharePoint.
You can use an existing site or create a brand-new site to hold data.
I am using a single list to hold data. The list is called ‘CourseBooking’.
Here is how I set it up.
For ‘CourseName’ I have used a Choice data type. I have entered 3 course names as the
choices.
-
4
Create a PowerApps Application
In SharePoint, if I click on the list called ‘CourseBooking’ a small toolbar gets shown above
the list.
There will be an option called ‘PowerApps’.
Click this option and select ‘Create an app’.
I give the app a name of ‘CourseBooking’ and click the ‘Create’ button.
You can also create the app within PowerApps and connect to the data source separately, but
I have shown you the quick way of doing it.
PowerApps will fire up and you should see a screen like the following:
PowerApps has automatically created an app based on the SharePoint list. It may not look
like much at the moment, but hold tight – all will be explained.
-
5
On the left-hand side of the screen, there is a panel which holds all the forms that are created
in PowerApps. You can of course create more forms. The middle of the screen is showing one
of the forms that was automatically created.
One of the forms created is called ‘EditForm’. Click on it to see how it looks.
This is the screen where we will enter our information.
To run it, click the ‘Preview the app’ button at the top right of the screen.
Now try entering some data.
Click the save button, which is actually the tick icon at the top right of the screen.
-
6
Now if you look back in your SharePoint list, you should see the record you just saved.
The Components of the Screen
There are two ways of creating and implementing screens in PowerApps. You can either use
what are known as forms. These are dragged onto a screen, you add the data source and
PowerApps goes away and fills out the fields on the form with controls – text boxes, labels,
date pickers etc.
When you click a save button, only a single command is required to save the data –
SubmitForm(formname). It’s a nice quick way of creating screens. The drawback for me is that
it does not offer much flexibility on moving controls around. You get a choice of the number of
columns you want to place the controls in on the screen and cannot do much beyond that.
The other way is to create a blank screen and to drag the controls on manually, without using
a form container to hold them. Doing things this way gives you flexibility to move the controls
where you like on screen. You are not confined to columns for positioning. If you do things this
way then you need to code the save mechanism yourself.
The example I have given in this book uses forms and requires limited code.
Data Cards
When PowerApps automatically creates a screen based on a list, it uses what are known as
cards to hold the field values. The card contains both the field label and the field itself. The
advantage of cards used in forms is that you don’t need to write any code to save or update
the data. Cards make it easy to create apps quickly with the minimum of fuss.
Cards are used in canvas apps and are the main elements of a ‘Display’ or ‘Edit’ form. The
form itself contains the complete record whereas the card shows a particular field from the
record.
-
7
Show the card and the elements in it
Clicking on the ‘Phone’ card and pressing the delete key on my keyboard will remove it.
Click on the form in the tree view on the left-hand side of the screen.
On the right hand side of the screen, you will see the form properties. This is where you can
set the data source, add fields from the data source and change properties of the form.
Card (container)
Label
Text Box
-
8
If you click on the ‘Edit fields’ option, you will be able to add or remove fields in the form, or
even change the position of them.
If you click the tick icon symbol at the top right of the form, you will see the routine used for
saving the data. It is called ‘SubmitForm(name of the form).
When we want to simulate a click of a button, we use the ‘OnSelect’ event.
The more you use PowerApps, the more you will use events such as ‘OnSelect’. The
dropdown lists all the events available to you for screens, forms and controls.
On the left-hand side of the screen, in the tree view, run the browse screen. You should see
any records you saved.
-
9
If no records are showing, then click on the screen and select the ‘OnVisible’ event.
Type in Refresh(name of the data source)
So, in this case it becomes…
What this does is refresh the data source that sits behind this screen so that the up to date
information is shown.
If you click the arrow head, you will be taken to the detail screen where you can view the data.
Clicking the + symbol will take you to the screen to add new records.
Refresh Sort Add
-
10
On the ‘Detail’ screen, you will be able to delete the record or edit it.
Ideally you would want to add a menu to navigate to the various screens.
To do this, go to the PowerApps menu and click ‘Insert’.
Select the option that says ‘Blank’.
Next, insert a button to the screen.
Change the text of the button to say ‘Add Record’.
-
11
Click on the button and choose the ‘OnSelect’ event from the dropdown box on the left.
Type in
The ‘Navigate’ command is used to move us from screen to screen.
When this button is clicked, it sends us to the screen for adding a new record.
You can also add a background image to any screen.
My menu ends up like this.
You could also add a button on any screen to navigate back to the menu.
-
12
Saving and Publishing your App
To save your changes, click on the ‘File’ menu option.
Then click the ‘Save’ button.
To publish the app, click the ‘Share’ option.
You will then be asked who you want to share the app with. Type in their name and click the
‘Share’ button. You may have to check their permissions to the SharePoint site if they cannot
add or see data in the app.
To view the app on a phone for example, the user would need to log into Office365 first.
Here is how the app looks on a mobile phone
-
13
Using Excel as a Data Source
In Office365, your Excel file should sit in your ‘OneDrive For Business’ account.
Here is the Excel file I have sitting on my computer drive.
When you use Excel as your data source for PowerApps, the data should be in a table
format.
So what I do is click and drag my mouse over the cells and columns so that they become
highlighted.
Select the menu option ‘Format as Table’.
-
14
Select a style option.
Give the table a name – I call mine ‘Bookings’.
Now save the document.
Uploading Excel to OneDrive for Business
Now I go to my ‘OneDrive for Business’.
Then I drag the Excel document from my computer into my ‘OneDrive for Business’ account.
Click on the file to open it up.
Hopefully it will look the same as the one you had on your computer drive.
-
15
Create the PowerApps Application
Go to the PowerApps homepage.
Any apps you have created will be listed here.
Click on ‘Create an app’ and select the canvas option.
Select the ‘OneDrive for Business’ option.
If your ‘OneDrive for Business’ is not set up, you may have to go and add a new connection.
It will be just a case of entering your Office365 email and password.
-
16
Otherwise click on the attachment’s icon.
It has found my Excel document immediately and entered it. This is probably because it is the
only Excel document I have sitting in ‘OneDrive for Business’.
Click on the Excel filename.
It then asks to choose a table.
Recall that I named my table ‘Bookings’ and it is shown here.
Click on the table and click the ‘Connect’ button at the bottom right of the screen.
PowerApps then starts to build the app.
-
17
Making Changes
I don’t like the way it says false at the top of each record in the gallery. This is because it is
showing the true or false value for whether or not people attended the taster class. Ideally, I
want to show the name at the top.
In SharePoint, the Title field was used to hold the name of the person. After I exported the
SharePoint list to Excel, I did not change this. Really though in Excel, you could rename the
field to something like ‘FullName’.
So now if I click on the label that is showing the word ‘False’.
At the top it shows
This needs to be changed to show the name (Title).
-
18
And voila, the name is now showing.
You can change the data in the other labels also if you want to.
Whatever you change in the first item will cascade to the other records. You can see I changed
the label in the first item to show the name and it has repeated to the other records.
Another way to do this is to click on the first item to select the record.
Then on the right, click on the ‘Fields’ option.
You can then select what data you want for the three labels on screen.
-
19
Adding and Saving a Record
The forms work pretty much like the other example I showed you with SharePoint as the data
source. You will probably need to change some controls to be the correct one as PowerApps
does not seem to figure out correctly the correct control for some values. For example, what
should be toggle buttons are shown as text boxes.
Otherwise if I enter a name and save it, the data writes perfectly back to the Excel data source
sitting in ‘OneDrive for Business’.
The name entered and saved in PowerApps is written back to Excel.
-
20
Conclusion
I hope I have given you an insight into what is possible with Microsoft PowerApps. It is possible
to create simple, yet powerful applications quickly. Of course, there is much more to learn in
terms of functionality etc.
I have given examples using both SharePoint and Excel as data sources. You may prefer
some other data source such as SQL Server. The mechanism is pretty much the same.
With PowerApps you can target the business needs of your organisation. You may find apps
sitting around in older technologies such as MS Access, which could be prime candidates for
converting into PowerApps.
I wish you well on your learning journey in the PowerApps universe.
Thank you for reading.
Take your learning to a new level
Get my PowerApps for Newbies Video Course with
Fantastic Office 365 Bonus
https://powerappsfornewbies.com/powerapps-course/
https://powerappsfornewbies.com/powerapps-course/https://powerappsfornewbies.com/powerapps-course/