Expression Cheatsheet
81 expressions — click to copy the example
text1 & text2TextPopularConcatenates two text strings (use & operator)
FirstName & " " & LastNameText(value, format)TextPopularConverts a value to text with optional format
Text(Today(), "dd/mm/yyyy")IsBlank(value)TextPopularReturns true if the value is blank or empty string
If(IsBlank(TextInput1.Text), "Empty", "OK")Now()Date & TimePopularReturns the current date and time
Text(Now(), "dd/mm/yyyy hh:mm")Today()Date & TimePopularReturns the current date (no time)
Text(Today(), "dd/mm/yyyy")DateAdd(date, n, unit)Date & TimePopularAdds an interval to a date
DateAdd(Today(), 30, TimeUnit.Days)DateDiff(date1, date2, unit)Date & TimePopularReturns the difference between two dates
DateDiff(StartDate, EndDate, TimeUnit.Days)Filter(table, condition)CollectionsPopularReturns rows matching the condition
Filter(Employees, Department = "HR")Sort(table, column)CollectionsPopularSorts a table by a column (ascending)
Sort(Products, Name)LookUp(table, condition)CollectionsPopularReturns the first record matching a condition
LookUp(Users, Email = User().Email)Search(table, text, col)CollectionsPopularFinds records where a column contains text
Search(Contacts, SearchInput.Text, "Name")CountRows(table)CollectionsPopularReturns the number of rows in a table
CountRows(Filter(Tasks, Status = "Open"))Collect(col, record)CollectionsPopularAdds records to a collection
Collect(MyCart, {Product: "Item A", Qty: 1})ClearCollect(col, table)CollectionsPopularClears and repopulates a collection
ClearCollect(LocalItems, SharePointList)Remove(col, record)CollectionsPopularRemoves a specific record from a collection
Remove(MyCart, ThisItem)Patch(source, record, changes)CollectionsPopularCreates or modifies a record in a data source
Patch(Employees, LookUp(Employees, ID=1), {Name: "Alice"})ForAll(table, formula)CollectionsPopularEvaluates a formula for each record in a table
ForAll(Items, Collect(Names, {Name: ThisRecord.Name}))Distinct(table, column)CollectionsPopularReturns unique values from a column
Distinct(Products, Category)IsEmpty(table)CollectionsPopularReturns true if the table has no records
If(IsEmpty(MyCart), "Empty cart", "Items in cart")Sum(table, column)CollectionsPopularReturns the sum of a numeric column
Sum(Orders, TotalPrice)If(condition, true, false)LogicPopularReturns one of two values based on a condition
If(Score >= 50, "Pass", "Fail")Switch(val, case1, r1, ...)LogicPopularReturns a value based on matching cases
Switch(Status, "Active", Green, "Inactive", Red, Gray)Coalesce(val1, val2, ...)LogicPopularReturns the first non-blank value
Coalesce(User.Department, "Unknown")IfError(value, fallback)LogicPopularReturns fallback if the value results in an error
IfError(Patch(DS, defaults, record), Notify("Error", NotificationType.Error))With({alias: expr, ...}, formula)LogicPopularEvaluates a formula in the context of named aliases. Avoids repeating long expressions, improves readability. Think of it as local variables scoped to a single expression.
With(
{
fullName: FirstName & " " & LastName,
age: DateDiff(BirthDate, Today(), TimeUnit.Years)
},
fullName & " (" & age & " years old)"
)With() — avoid re-evaluating expensive callsLogicPopularWith() is ideal when you need to use the result of a LookUp() or complex formula multiple times without calling it twice.
With(
{ record: LookUp(Accounts, accountid = Gallery1.Selected.accountid) },
If(
record.Status.Value = "Active",
Patch(Accounts, record, { LastSeen: Now() }),
Notify("Account is inactive", NotificationType.Warning)
)
)Navigate(screen, transition)NavigationPopularNavigates to another screen
Navigate(HomeScreen, ScreenTransition.Fade)Set(variable, value)NavigationPopularSets a global variable
Set(CurrentUser, User().FullName)UpdateContext({key: val})NavigationPopularSets a local context variable
UpdateContext({IsMenuOpen: !IsMenuOpen})Notify(message, type)NavigationPopularShows a banner notification
Notify("Saved!", NotificationType.Success)SubmitForm(form)NavigationPopularValidates and submits a form
SubmitForm(Form1)NewForm(form)NavigationPopularSets a form to create a new record
NewForm(Form1)EditForm(form)NavigationPopularSets a form to edit the selected record
EditForm(Form1)Len(text)TextReturns the number of characters in a text string
Len("Hello") // 5Left(text, n)TextReturns the first n characters from the left
Left("Hello World", 5) // "Hello"Right(text, n)TextReturns the last n characters from the right
Right("Hello World", 5) // "World"Mid(text, start, n)TextReturns n characters starting at a position
Mid("Hello World", 7, 5) // "World"Lower(text)TextConverts text to lowercase
Lower("HELLO") // "hello"Upper(text)TextConverts text to uppercase
Upper("hello") // "HELLO"Trim(text)TextRemoves leading and trailing spaces
Trim(" Hello ") // "Hello"Concatenate(...)TextJoins multiple text values together
Concatenate("Hello", " ", "World") // "Hello World"Substitute(text, old, new)TextReplaces occurrences of a substring
Substitute("Hello World", "World", "PA") // "Hello PA"Find(findText, inText)TextReturns the position of text within text (1-based)
Find("World", "Hello World") // 7StartsWith(text, start)TextChecks if text begins with a given string
StartsWith("Hello", "He") // trueEndsWith(text, end)TextChecks if text ends with a given string
EndsWith("Hello", "lo") // trueSplit(text, separator)TextSplits text into a single-column table
Split("a,b,c", ",") // table with a, b, cValue(text)TextConverts a text string to a number
Value("42") // 42Year(date)Date & TimeExtracts the year from a date
Year(Today()) // 2026Month(date)Date & TimeExtracts the month from a date (1–12)
Month(Today()) // 4Day(date)Date & TimeExtracts the day of the month from a date
Day(Today()) // 12Hour(datetime)Date & TimeExtracts the hour from a datetime (0–23)
Hour(Now())Weekday(date)Date & TimeReturns the day of the week (1=Sunday by default)
Weekday(Today())Date(year, month, day)Date & TimeCreates a date value from year, month, day
Date(2026, 12, 31)SortByColumns(table, col, order)CollectionsSorts with explicit sort order
SortByColumns(Items, "Name", SortOrder.Ascending)First(table)CollectionsReturns the first record of a table
First(SortByColumns(Items, "Date")).NameLast(table)CollectionsReturns the last record of a table
Last(Gallery1.AllItems).ValueFirstN(table, n)CollectionsReturns the first n records of a table
FirstN(Sort(Items, Date), 5)Clear(collection)CollectionsRemoves all records from a collection
Clear(MyCart)AddColumns(table, col, formula)CollectionsReturns a table with a new calculated column
AddColumns(Products, "Total", Price * Quantity)GroupBy(table, col, group)CollectionsGroups table rows by a column value
GroupBy(Sales, "Region", "Items")Ungroup(table, col)CollectionsReverses a GroupBy operation
Ungroup(GroupedSales, "Items")Average(table, column)CollectionsReturns the average of a numeric column
Average(Scores, Value)Max(table, column)CollectionsReturns the maximum value in a column
Max(Sales, Amount)Min(table, column)CollectionsReturns the minimum value in a column
Min(Temperatures, Value)And(cond1, cond2)LogicReturns true if both conditions are true (also: &&)
And(Age >= 18, IsVerified)Or(cond1, cond2)LogicReturns true if either condition is true (also: ||)
Or(IsAdmin, IsManager)Not(condition)LogicReverses a boolean value (also: !)
Not(IsBlank(TextInput1.Text))IsError(value)LogicReturns true if the value is an error
If(IsError(Value(TextInput1.Text)), "Invalid", "OK")Round(number, digits)MathRounds to a specified number of decimal places
Round(3.14159, 2) // 3.14RoundUp(number, digits)MathAlways rounds up
RoundUp(3.01, 0) // 4RoundDown(number, digits)MathAlways rounds down (truncates)
RoundDown(3.99, 0) // 3Abs(number)MathReturns the absolute value
Abs(-42) // 42Mod(number, divisor)MathReturns the remainder after division
Mod(10, 3) // 1Power(base, exp)MathReturns base raised to an exponent
Power(2, 8) // 256Sqrt(number)MathReturns the square root
Sqrt(144) // 12Int(number)MathRounds down to the nearest integer
Int(3.9) // 3Rand()MathReturns a random number between 0 and 1
Round(Rand() * 100, 0) // random 0–100RandBetween(min, max)MathReturns a random integer in a range
RandBetween(1, 6) // dice rollBack()NavigationNavigates back to the previous screen
Back()Launch(url)NavigationOpens a URL or launches another app
Launch("https://example.com")ResetForm(form)NavigationResets a form to its default state
ResetForm(Form1)