How to Add a Loading Spinner in Power Apps
While a screen loads its data, show that something is happening. The modern Spinner control is a spinning ring with an optional label; make it visible only while a loading variable is true.
Low-Code and No-Code Development Platforms
View All TagsWhile a screen loads its data, show that something is happening. The modern Spinner control is a spinning ring with an optional label; make it visible only while a loading variable is true.
A screen's OnVisible property runs each time the screen is shown. It's the place to load what that screen needs and to set its starting values, instead of loading everything when the app starts.
Formulas joined with ; run one after the other: the second request waits for the first. When two loads don't depend on each other, Concurrent starts them together, so the screen waits only as long as the slowest one.
A context variable holds a value for one screen: whether something is loading, which item is selected, a table of rows. UpdateContext creates it or changes it. Other formulas on the screen then use it by name, and recalculate when it changes.
A collection is a table that your app keeps in memory and can change: add rows, remove them, edit them. ClearCollect empties a collection and fills it again in one step, which makes it the usual way to load data into one.
Functions such as Filter, AddColumns and ForAll work through a table one record at a time, and inside them ThisRecord is the current record. Put one of those functions inside another, and ThisRecord means the inner one only. As gives a record its own name, so you can reach it from anywhere in the formula.
Sometimes a gallery needs a value that isn't a column of its data: a status worked out from another list, a total, a label. AddColumns adds it as a new column, calculated once for each row, and the gallery's controls read it like any other column.
Filter gives you every matching row; LookUp gives you the first one. Use it when you need one record, or one value from it: the job title of a competency, a person's response to a question, the item with a given ID.
When one value decides between several results (a status to a label, a level to a color) Switch says it once: here's the value, here are the matches, here's what each one gives. It's tidier than a chain of If tests that repeat the same value.
A badge is a small colored label for a short piece of information: a status, a count, a category. The modern Badge control follows the app's theme and has a property, Intent, that picks a color for what the badge means.