Power Apps

PowerApps is a suite of apps, services, connectors and data platform that provides a rapid application development environment to build custom apps for your business needs. Using PowerApps, you can quickly build custom business apps that connect to your business data stored either in the underlying data platform (Common Data Service for Apps) or to various online and on-premises data sources (SharePoint, Excel, Office 365, Dynamics 365, SQL Server, and so on).

It builds strong business logic and workflow capabilities to transform your manual business processes to digital, automated processes. Further, apps will built using PowerApps have a responsive design, and can run seamlessly in browser or on mobile devices (phone or tablet). PowerApps "democratizes" the custom business app building experience by enabling users to build feature-rich, custom business apps without writing code.

PowerApps also provides an extensible platform that lets pro developers programmatically interact with data and metadata, apply business logic, create custom connectors, and integrate with external data.

PowerApps Coding for the image screen


There’s two ways you can approach this.

The first way is to group controls then assign click events to the group’s OnSelect event.

The second way is to lay a transparent rectangle on top of the group and use the rectangles OnSelect event.

I prefer the second way because it doesn’t impact my code as much if the controls in the group change and it also allows me to have more flexibility of the shape of the region I want to make clickable.  See this article I wrote for more information about the transparent rectangle approach.

General coding guidelines

If possible, avoid logic in the OnVisible event in your PowerApp’s first screen.  Instead, try to use inline expressions in control properties.

Limit your use of collections, try to use them only when absolutely necessary.

Limit your use of context variables, try to use them only when absolutely necessary.

Avoid passing context variables between screens when a global variable is more appropriate (and much easier to debug)!

Use ClearCollect instead of Clear;Collect().

Use CountIf instead of Count(Filter()).

Avoid lengthy expressions whenever possible!

Each semi-colon should represent a line break.

Update all necessary context variables in a single UpdateContext call

Like this:

Not this:

Use proper indentation

For long single line formulas, try to insert line breaks in reasonable places: before/after parentheses, commas, and colons.

Update:  Avoid using unnecessary DataCards \ Canvases.  Especially if they have nested galleries, which will not work in the future.


Don’t use multiple variables when you could just use a single one.

We could just use 1 variable here instead.


Avoid nesting in other operators too.  For example in the ForAll function.

If statement syntax

Don’t ‘nest’ secondary logical tests by explicitly writing If after the initial statement.

Do write secondary logical tests by simply writing out the logical test (w/o the ‘If’).

Update: Expensive calls

Do not make expensive calls before navigating to the next page.  Try to make the loading of the next page instant and then in the background on the next page make the calls in the OnVisible page property.  Use a loading dialog if necessary to let the user know progress is happening behind the scenes.