← Cheat sheets

Power Apps (Power Fx) cheat sheet

Every entry is a real Power Fx function, operator, or reference. Examples assume a canvas app. Where a function behaves differently against a large data source, the delegation note tells you so — that is usually what separates a demo from a shipped app.

/

App & navigation

Set
Set a global variable
Set(gblUser, User().FullName)
Available app-wide
UpdateContext
Set screen-scoped variables
UpdateContext({locShowPanel: true})
Scoped to one screen
Context variables do not cross screens. Use Set or Navigate context for that.
Navigate
Move to another screen
Navigate(scrDetail, ScreenTransition.Cover)
Switches screen
Navigate (with context)
Pass data to the next screen
Navigate(scrDetail, None, {locId: ThisItem.ID})
Sets locId on arrival
Back
Return to the previous screen
Back()
Goes back one
Launch
Open a URL or app
Launch("https://learn.microsoft.com")
Opens in browser
Notify
Show a banner message
Notify("Saved", NotificationType.Success)
Green banner
Reset
Reset a control to default
Reset(txtSearch)
Clears the input
Select
Trigger another control’s OnSelect
Select(btnSave)
Runs btnSave.OnSelect
Param
Read a launch parameter
Param("recordId")
Value from the URL
Exit
Close the running app
Exit()
Returns to app list

Creating & changing records

Patch (update)
Update an existing record
Patch(Tasks, ThisItem, {Status: "Done"})
Updated record
Patch (create)
Create a new record
Patch(Tasks, Defaults(Tasks), {Title: txtTitle.Text})
New record
Patch (bulk)
Update many records at once
Patch(Tasks, colEdits)
All updated
Prefer Patch over SubmitForm when you control the payload — fewer surprises, better performance.
Defaults
Get a blank record for a source
Defaults(Tasks)
Empty record
Remove
Delete a specific record
Remove(Tasks, galTasks.Selected)
Record deleted
RemoveIf
Delete records matching a condition
RemoveIf(Tasks, Status = "Archived")
Matches deleted
Update
Replace a record wholesale
Update(Tasks, oldRec, newRec)
Record replaced
UpdateIf
Change fields on matching records
UpdateIf(Tasks, Priority = "Low", {Status: "Closed"})
Matches changed

Forms

Form behavior lives in functions; mode and errors live in properties on the form control.

SubmitForm
Save the form to its source
SubmitForm(frmEdit)
Record saved
NewForm
Put a form into new-record mode
NewForm(frmEdit)
Blank form
EditForm
Put a form into edit mode
EditForm(frmEdit)
Editable form
ViewForm
Put a form into read-only mode
ViewForm(frmEdit)
Read-only
ResetForm
Discard unsaved changes
ResetForm(frmEdit)
Form cleared
frm.Mode
Read the current form mode
frmEdit.Mode = FormMode.New
true / false
Mode is a property, not a function. There is no FormMode() function.
frm.Error
Read the last submit error
frmEdit.Error
Error text or blank
frm.LastSubmit
Get the record just saved
frmEdit.LastSubmit.ID
New record’s ID

Collections & local storage

Collect
Add rows to a collection
Collect(colCart, {Item: "Pen", Qty: 2})
Row added
ClearCollect
Clear, then refill a collection
ClearCollect(colStaff, Filter(Staff, Active))
Collection reloaded
Clear
Empty a collection
Clear(colCart)
Now empty
SaveData
Persist a collection on the device
SaveData(colCart, "cart")
Saved offline
Mobile/desktop player only, with a size limit. Not available in the browser.
LoadData
Reload a saved collection
LoadData(colCart, "cart", true)
Restored offline

Filtering, search & sort

This is where delegation matters most. Non-delegable functions silently cap at the row limit (default 500).

Filter
Return rows matching a condition
Filter(Staff, Department = "IT")
Matching rows
Delegable against most sources when the column and operator are supported.
Search
Substring search across columns
Search(Staff, txtFind.Text, "Name", "Email")
Matching rows
Delegable on SharePoint and Dataverse for text columns.
LookUp
Return the first matching record
LookUp(Staff, ID = locId)
One record
Sort
Order by a single formula
Sort(Staff, LastName)
Ordered rows
SortByColumns
Order by named columns
SortByColumns(Staff, "LastName", SortOrder.Ascending)
Ordered rows
First / Last
Get the first or last record
First(Sort(Orders, Created, SortOrder.Descending))
Newest order
FirstN / LastN
Get the first or last N records
FirstN(Orders, 10)
Top 10
Distinct
Unique values from a column
Distinct(Staff, Department)
Single-column table
Returns a column named Result.
CountRows
Count rows in a table
CountRows(Filter(Tasks, !Done))
A number
Not delegable — counts only the rows already retrieved.
CountIf
Count rows matching a condition
CountIf(Tasks, Status = "Open")
A number

Conditional logic

If
Return a value by condition
If(Score >= 50, "Pass", "Fail")
"Pass" / "Fail"
Switch
Match one value against many
Switch(Status, "A", "Active", "I", "Inactive", "Unknown")
The matched result
IsBlank
Test for blank
IsBlank(txtName.Text)
true / false
A zero-length string is not blank. Use IsBlank(Trim(x)) or x = "" for empty input.
IsEmpty
Test a table for zero rows
IsEmpty(colCart)
true / false
IsBlankOrError
Test for blank or error
IsBlankOrError(LookUp(Staff, ID = locId))
true / false
Coalesce
First non-blank value
Coalesce(txtNick.Text, txtName.Text, "Guest")
First with content
IfError
Catch and replace an error
IfError(Value(txtQty.Text), 0)
Safe fallback
And &&
All conditions true
And(Active, Approved)
true / false
Or ||
Any condition true
Or(IsAdmin, IsOwner)
true / false
Not !
Invert a condition
Not(IsBlank(txtName.Text))
true / false

Text

Concatenate &
Join text values
"Hi, " & txtName.Text
Joined string
The & operator is the idiomatic way to concatenate.
Left / Right
Characters from one end
Left("PowerStack", 5)
"Power"
Mid
Characters from a position
Mid("PowerStack", 6, 5)
"Stack"
Len
Count characters
Len(txtCode.Text)
A number
Upper / Lower
Change case
Upper("po-123")
"PO-123"
Proper
Title-case each word
Proper("jane doe")
"Jane Doe"
Trim
Trim ends + collapse inner spaces
Trim(" a b ")
"a b"
Trim also collapses repeated interior spaces. TrimEnds touches only the ends.
TrimEnds
Trim leading/trailing spaces only
TrimEnds(" a b ")
"a b"
Substitute
Replace text by match
Substitute("a-b-c", "-", "/")
"a/b/c"
Replace
Replace text by position
Replace("2026", 1, 2, "19")
"1926"
StartsWith / EndsWith
Test a prefix or suffix
StartsWith(txtFile.Text, "PO-")
true / false
Find
Position of one string in another
Find("@", txtEmail.Text)
Index or blank
Split
Break text into a table
Split("a,b,c", ",")
Single-column table
Concat
Join a table column into text
Concat(colTags, Value, ", ")
"x, y, z"
IsMatch
Test against a regex pattern
IsMatch(txtZip.Text, "\d{5}")
true / false
Char
Character from a code point
Char(10)
A line break

Date & time

Now
Current date and time
Now()
A datetime
Today
Current date at midnight
Today()
A date
DateAdd
Add a span to a date
DateAdd(Today(), 7, TimeUnit.Days)
One week out
DateDiff
Span between two dates
DateDiff(StartDate, EndDate, TimeUnit.Days)
A number
DateValue
Parse text into a date
DateValue("2026-06-13")
A date
DateTimeValue
Parse text into a datetime
DateTimeValue("2026-06-13 09:30")
A datetime
Text (format)
Format a date as text
Text(Now(), "dd mmm yyyy")
"13 Jun 2026"
Date
Build a date from parts
Date(2026, 6, 13)
A date
Time
Build a time from parts
Time(9, 30, 0)
A time
Weekday
Day-of-week number
Weekday(Today())
1 to 7
Year / Month / Day
Pull a part from a date
Month(Today())
A number

Math & aggregation

Aggregations over large sources are mostly non-delegable — they run on the rows already pulled, not the whole table.

Sum
Total a column
Sum(Orders, Amount)
A number
Average
Mean of a column
Average(Orders, Amount)
A number
Min / Max
Smallest or largest value
Max(Orders, Amount)
A number
Count
Count numeric values in a column
Count(Orders.Amount)
A number
CountA
Count non-blank values in a column
CountA(Orders.Notes)
A number
Round
Round to N decimals
Round(12.345, 1)
12.3
RoundUp / RoundDown
Round away from / toward zero
RoundUp(12.31, 1)
12.4
Mod
Remainder after division
Mod(17, 5)
2
Abs
Absolute value
Abs(-8)
8
Rand
Random decimal 0–1
Rand()
e.g. 0.5634
RandBetween
Random whole number in range
RandBetween(1, 100)
e.g. 42

Table shaping

AddColumns
Add a calculated column
AddColumns(Staff, "Full", First & " " & Last)
Table with column
DropColumns
Remove columns
DropColumns(Staff, "Email", "Phone")
Trimmed table
RenameColumns
Rename columns
RenameColumns(Staff, "First", "FirstName")
Renamed table
ShowColumns
Keep only named columns
ShowColumns(Staff, "Name", "Department")
Selected columns
Pair with Filter to cut down delegated payload size.
GroupBy
Group rows by columns
GroupBy(Sales, "Region", "Rows")
Grouped table
Ungroup
Flatten a grouped table
Ungroup(grouped, "Rows")
Flat table
ForAll
Evaluate a formula per row
ForAll(colEdits, Patch(Tasks, ThisRecord))
Runs per row
ForAll is not a loop with side-effect order guarantees — keep each iteration independent.
With
Name temporary values inline
With({tax: 0.1}, total + total * tax)
Computed value
Sequence
Generate a numeric table
Sequence(5)
1, 2, 3, 4, 5
Concurrent
Run actions in parallel
Concurrent(Refresh(A), Refresh(B))
Faster load
Table
Build an inline table
Table({n: 1}, {n: 2})
Two-row table

Data conversion

Value
Text to number
Value("123.45")
123.45
Text
Number to formatted text
Text(1234.5, "#,##0.00")
"1,234.50"
JSON
Serialize a value to JSON
JSON(colCart, JSONFormat.Compact)
JSON text
ParseJSON
Parse JSON into an untyped object
ParseJSON(txtPayload.Text)
Untyped object
Index fields then coerce with Value/Text/Boolean — untyped values are not usable directly.
Boolean
Text to boolean
Boolean("true")
true
GUID
Generate or parse a GUID
GUID()
A unique id
ColorValue
Hex string to a color
ColorValue("#742774")
A color

Records & scope references

These are operators and references, not functions — but you use them constantly.

ThisItem
Current row inside a gallery
ThisItem.Title
Field value
ThisRecord
Current row in ForAll / Filter
Filter(Orders, ThisRecord.Amount > 0)
Field value
Self
The current control
Self.Fill
Own property
Parent
The containing control
Parent.TemplateHeight
Parent property
As
Alias a record scope
ForAll(Orders As O, O.Amount * 1.1)
Avoids name clashes
Use As when nesting galleries or ForAll so inner and outer rows do not collide.

Connectors (real patterns)

SharePoint and Dataverse are added as data sources, then queried with the normal table functions. There is no SharePoint.GetItems() or Dataverse.Retrieve() in Power Fx — those are Power Automate connector actions.

Office365Users.MyProfileV2
Rich profile of the current user
Office365Users.MyProfileV2().jobTitle
Profile field
Returns more than User() — title, department, manager, and so on.
Office365Users.SearchUserV2
Search the directory
Office365Users.SearchUserV2({searchTerm: txtFind.Text}).value
Matching users
Office365Outlook.SendEmailV2
Send an email as the user
Office365Outlook.SendEmailV2("a@x.com", "Hi", "Body")
Email sent
SharePoint list
Query a list like any table
Filter('My List', Status.Value = "Open")
Matching items
Add the list as a data source first. Choice columns need .Value.
Dataverse table
Query a table like any table
LookUp(Accounts, accountid = locId)
One row
User
Basic current-user info
User().Email
Current email