Intro

I recently completed a PoC for a customer using Power Apps, which eliminated a multi-paper-page and multi-pdf-excell-spreadsheet process into the one app.

The process was something like this:

  • Arrive at a manhole cover with a poorly formatted or incomplete address which required inspection (could require physically searching for the manhole cover)
  • On a piece of paper, Inspect cover, filling out 64+ fields of specification for condition of the cover
  • Take photos of the cover, as well as inside the street (?) drain (?) (whatever it’s called)
  • Once done, transfer information into a PDF
  • Once PDF complete, transfer information into an excel spreadsheet

I discussed this with the enterprise architect of the business, where we threw some ideas around about replacing that entire process with a single powerapp running on a tablet the staff could use.

Upon completeing and delivering the PoC, I realised I had learned an absolute tonne about Power Apps, things which are mandatory requirements and not necissarily obvious. I have since dubbed these things the “The six Power Apps commandments” that must be followed.

1. Pre-process your data

As the saying goes, “…to have good wine, you need good grapes” and well with basically anything IT related you need good data. To make things easy for everyone, ensure:

  • Your data is structured in a table format (use a sharepoint list at a minimum, more on that later)
  • Your table columns have primitive types (string, int)
  • If in excel, don’t have conditional formatting, or anything at all, use a blank table. Actually, don’t use excel at all.
  • When adding as a datasource, let common data service (CDS) handle the translation and “figuring-out-what-can-go-where” -> which leads to:

2. Let the wizard do it’s thing

Anyone who ever had to do anything with a windows SBS server, especially 2003/2008 era, will remember the CEICW wizard. If anything networking-related went wrong with the server, run the wizard.

Well the same is with Power Apps. Everything is wizard driven (no/low code), and it’s in your best interest to let the wizard or menus do their things. Don’t try and force anything to do something it can’t or doesn’t or shouldn’t; don’t force a button to do something on an action apart from onSelect. A gallery expects a datatype table, don’t try to foce a difference datatype.

Something isn’t working or is behaving strange? Verify what you’re passing it (see point 1 above)

3. Don’t update properties directly

This is probably the biggest thing that caught me out initially, admittedly I just opened a new canvas app and didn’t read anything, but still.

Say you have a picture, and 2 buttons, one to hide the picture and one to show the picture, like so:

For the hide button onSelect property, you might try something like this:

And guess what? From a syntax perspective, that looks fine. There’s no errors or red X in the page, but it just simply won’t do anything.

Every control/item works off of variables. You must reference variables.

This mean’s you have to do something like this, for every single control property:

You must set a variable, and reference that variable in the control property. Don’t edit/set any property directly.

4. Use existing apps or templates to bootstrap development

Once I got through the entire thing, had my data preprocessed perfectly and my app behaving exactly as expected, only then it occured to me that I could bootstrap an app from my sharepoint list into basically my app minus 2 pages. This would have saved me many hours of work.

When creating a new app, please click on one of the below buttons:

Power Apps has this incredible skill of working out what you want. If you point the above screenshot at an excel spreadsheet or a sharepoint list or some other tabular format data, it will populate a feature-heavy app in about 10 seconds that contains most of the functionality you want:

In the below example, I’ve created a new app by selecting “sharepoint” from the above screenshot, and as you can see it’s created me 3x pages:

  • list view
  • detailed view
  • edit view

There’s a ridiculous amount of functionality that’s been created for me automatically:

  • Grab records from a table, and display in a gallery. Showing information about each record.
  • Click-through for individual records to detailed pages, showing columns from my table
  • The ability to add/edit/delete columns for each record
  • The ability to save the work you’ve done, which then refreshed the gallery and tables with the new information

Literally the 3 things 99.9% of cases will want to do. Immediately in-front of you, for you to edit as you will.

If they don’t fit? When creating a new app, browse the gallery, which has thousands of pre-canned templates which do all sorts of stuf. At worse case, you can reverse-engineer the formulas and logic the use for yourself.

5. Use a reliable data source

The architect from above sent me a bunch of dummy data, examples etc. and as I said the end result they used was an excel spreadsheet. I subsequently stored this spreadsheet in my onedrive-business instance and that was that.

I had no end of issues with connectivity and reliability with this setup, I wasted hours upon hours on this. Intermittent connectivity, slow updates, resource locks etc.

At a minimum, use a sharepoint list. Above that, use SQL or some other relational databse. Do not use onedrive or other cloud storage services like that.

6. Use a Power Apps forums and stackoverflow - but break your problem into multiple, smaller problems

Lastly, when you get stuck, use the Power Apps forums and stackoverflow. Both sites are filled with unlimited knowledge of people who’ve tried the same thing.

However, don’t try to search “I’m making the next instagram in Power Apps how do I do this” because that just won’t work. Instead search something like “How do I create a multi-page form?” or “How do I filter on a combobox?” or “How do I reference pictures from sharepoint?”

Keep breaking your problem down into smaller problems until they ideally reference a single control, and try to do one thing with that control. Then another thing, until you end up with formulas that chain logic together, like so:

Anything else I’ve missed? Let me know in contact details at bottom of this page.