Power Apps Functions
Power Apps Functions
Controls Color.ColorName
Controls Exit( [Signout] )
Controls PDF (Screen or control name [,{Size, DPI, Margin, Orientation, ExpandContainers}])
Date/Time Today()
Date/Time UTCNow()
Date/Time UTCToday()
Date/Time Weekday( DateTime [, WeekdayFirst ] )
#VALUE!
The Exit function exits the currently running app. The user is returned to the list of apps. The user
can then select another app to open.
Launches a webpage or a canvas app and provides access to launch parameters.
Navigate function if you want to show a different screen when a user selects that button.
#VALUE!
The PDF function allows you to select a screen or portions of a screen for export to a PDF object
(blob).
The Refresh function retrieves a fresh copy of a data source. You'll see changes that other users
made.
Resets a control to its default value, discarding any user changes.
The Revert function refreshes an entire data source or a single record in that data source. You'll see
changes that other users made.
#VALUE!
#VALUE!
#VALUE!
The Clear function deletes all the records of a collection.
The ClearCollect function deletes all the records from a collection.
The Coalesce function evaluates its arguments in order and returns the first value that isn't blank or
an empty string.
The Collect function adds records to a data source.
The Index function returns a record of a table based on its ordered position in the table
#VALUE!
#VALUE!
Use the Patch function to modify records in complex situations, such as when you do updates that
require no user interaction or use forms that span multiple screens.
Use the Remove function to remove a specific record or records from a data source.
Use the Remove function to remove a specific record or records from a data source.
Use the RemoveIf function to remove a record or records based on a condition or a set of
conditions. Each condition can be any formula that results in a true or false and can
reference columns of the data source by name. Each condition is evaluated individually for each
record, and the record is removed if all conditions evaluate to true.
Generate a table of sequential numbers.
#VALUE!
The SetProperty function simulates interactions with input controls as if the user had entered or set
a value on the control. This function is only available if you are writing tests in the Power Apps
Test Studio. The following properties can be set using the SetProperty function.
#VALUE!
#VALUE!
#VALUE!
The Date function converts individual Year, Month, and Day values to a Date/Time value. The
time portion is midnight.
The DateAdd function adds a number of units to a date/time value. The result is a new date/time
value. You can also subtract a number of units from a date/time value by specifying a negative
value.
The DateDiff function returns the difference between two date/time values. The result is a whole
number of units.
The DateTime function combines the Date and Time functions into a single function, taking both
date and time arguments and returning a Date/Time value that has both date and time components.
function converts a time string (for example, "12:15 PM") to a date/time value.
function converts a date string (for example, "10/01/2014") to a date/time value.
The Day function returns the day component of a Date/Time value, ranging from 1 to 31.
The Hour function returns the hour component of a Date/Time value, ranging from 0 (12:00 AM)
to 23 (11:00 PM).
The Minute function returns the minute component of a Date/Time value, ranging from 0 to 59.
The Month function returns the month component of a Date/Time value, ranging from 1 to 12.
The Second function returns the second component of a Date/Time value, ranging from 0 to 59.
The Time function converts individual Hour, Minute, Second, and optionally Millisecond values to
a Date/Time value. The result has no date associated with it.
function converts a date and time string (for example, "January 10, 2013 12:13 AM") to
a date/time value.
The TimeZoneOffset function returns the number of minutes between the user's local time and
UTC (Coordinated Universal Time).
The Weekday function returns the weekday of a Date/Time value. By default, the result ranges
from 1 (Sunday) to 7 (Saturday). You can specify a different range with an Microsoft Excel
Weekday function code or a StartOfWeek enumeration value:
The Year function returns the year component of a Date/Time value, starting with 1900.
The EditForm function changes the Form control's mode to FormMode.Edit. In this mode, the
contents of the Form control's Item property are used to populate the form. If
the SubmitForm function runs when the form is in this mode, a record is changed, not
created. FormMode.Edit is the default for the Form control.
The NewForm function changes the Form control's mode to FormMode.New. In this mode, the
contents of the Form control's Item property are ignored, and the default values of the
Form's DataSource property populate the form. If the SubmitForm function runs when the form is
in this mode, a record is created, not changed.
The ResetForm function resets the contents of a form to their initial values, before the user made
any changes. If the form is in FormMode.New mode, the form is reset to FormMode.Edit mode.
The OnReset behavior of the form control also runs. You can also reset individual controls with
the Reset function but only from within the form.
Use the SubmitForm function in the OnSelect property of a Button control to save any changes in a
Form control to the data source.
The ViewForm function changes the Form control's mode to FormMode.View. In this mode, the
contents of the Form control's Item property are used to populate the form.
The SubmitForm and ResetForm functions have no effect when in this mode.
The Count function counts the number of records that contain a number in a single-column table.
The CountA function counts the number of records that aren't blank in a single-column table. This
function includes empty text ("") in the count.
The CountIf function counts the number of records in a table that are true for a logical formula.
The formula can reference columns of the table.
The CountRows function counts the number of records in a table.
The Filter function finds records in a table that satisfy a formula. Use Filter to find a set of records
that match one or more criteria and to discard those that don't.
The First function returns the first record of a table.
The FirstN function returns the first set of records of a table; the second argument specifies the
number of records to return.
The Last function returns the last record of a table.
The LastN function returns the last set of records of a table; the second argument specifies the
number of records to return.
The LookUp function finds the first record in a table that satisfies a formula. Use LookUp to find a
single record that matches one or more criteria.
The Search function finds records in a table that contain a string in one of their columns. The string
may occur anywhere within the column; for example, searching for "rob" or "bert" would find a
match in a column that contains "Robert". Searching is case-insensitive. Unlike Filter and LookUp,
the Search function uses a single string to match instead of a formula.
#VALUE!
#VALUE!
#VALUE!
The And function returns true if all of its arguments are true.
The Blank function returns a blank value. Use this to store a NULL value in a data source that
supports these values, effectively removing any value from the field.
Use the Boolean function to convert other types to a Boolean value. A Boolean value is true, false,
or blank.
The If function tests one or more conditions until a true result is found. If such a result is found, a
corresponding value is returned. If no such result is found, a default value is returned. In either
case, the returned value might be a string to show, a formula to evaluate, or another form of result.
The IsBlank function tests for a blank value or an empty string.
The IsEmpty function tests whether a table contains any records.
#VALUE!
Tests whether a value is numeric.
The Not function returns true if its argument is false; it returns false if its argument is true.
The Or function returns true if any of its arguments are true.
The Switch function evaluates a formula and determines whether the result matches any value in a
sequence that you specify. If a match is found, a corresponding value is returned. If no match is
found, a default value is returned. In either case, the returned value might be a string to show, a
formula to evaluate, or another form of result.
The Abs function returns the non-negative value of its argument. If a number is
negative, Abs returns the positive equivalent.
The Average function calculates the average, or arithmetic mean, of its arguments.
The Average function calculates the average, or arithmetic mean, of its arguments.
Converts a string of text or other types to a number.
Converts a string of text or other types to a number.
The Max function finds the maximum value.
The Max function finds the maximum value.
The Min function finds the minimum value.
The Min function finds the minimum value.
The Rand function returns a pseudo-random number that's greater than or equal to 0 and less than
1. For example, Rand() might return 0.43147 and could return 0 but not 1.
The RandBetween function returns a pseudo-random integer (whole number with no decimal
portion) that is between two numbers, inclusive. For example, RandBetween( 1, 3 ) may
return 1, 2, or 3.
The default name for the current record in a Gallery or form control.
#VALUE!
The default name for the current record in ForAll and other record scope functions.
The Concatenate function concatenates a mix of individual strings and a single-column table of
strings. When you use this function with individual strings, it's equivalent to using the & operator.
The Concat function concatenates the result of a formula applied across all the records of a table,
resulting in a single string. Use this function to summarize the strings of a table, just as
the Sum function does for numbers.
The Distinct function evaluates a formula across each record of a table and returns a one-column
table of the results with duplicate values removed. The name of the column is Value.
The EndsWith function tests whether one text string ends with another.
The Find function looks for a string within another string and is case sensitive. To ignore case, first
use the Lower function on the arguments.
Extracts the left, middle, or right portion of a string of text.
Returns the length of a string of text.
Converts letters in a string of text to all lowercase, all uppercase, or proper case.
Extracts the left, middle, or right portion of a string of text.
Converts letters in a string of text to all lowercase, all uppercase, or proper case.
The Replace function identifies the text to replace by starting position and length.
Extracts the left, middle, or right portion of a string of text.
#VALUE!
The StartsWith function tests whether one text string begins with another.
The Substitute function identifies the text to replace by matching a string. If more than one match
is found, you can replace all of them or specify one to replace.
Converts any value and formats a number or date/time value to a string of text.
Converts any value and formats a number or date/time value to a string of text.
Converts any value and formats a number or date/time value to a string of text.
The Trim function removes all spaces from a string of text except for single spaces between words.
The TrimEnds function removes all spaces from the start and end of a string of text but leaves
spaces between words intact.
Converts letters in a string of text to all lowercase, all uppercase, or proper case.
Example
#VALUE!
Choices( Accounts.'Primary Contact' )
Choices( Accounts.primarycontactid )
#VALUE!
#VALUE!
Launch( "https://bing.com" )
#VALUE!
Notify( "Hello, World", NotificationType.Warning, 4000 )
Notify( "Hello, World", NotificationType.Success, 0 )
#VALUE!
Select(button1)
Select(Gallery1, 1, ChildControl1)
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
Abs( -55 )
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
Employees As Employee
#VALUE!
#VALUE!
#VALUE!
ThisItem.'First Name' & " " & ThisItem.'Last Name'
#VALUE!
Filter( Employees, StartsWith( ThisRecord.Employee.'First Name', "M" ) )
Filter( Employees, StartsWith( 'First Name', "M" ) )
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
Len( Author.Text )
Lower( Author.Text )
#VALUE!
Proper( Author.Text )
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
Upper( Author.Text )
Index
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Formula
If(App.Width < 720, 20, 30)
if(isblank(parent.text), select(button))
&& or And, || or Or, ! or Not
date add(today(),number of days)
is null() and is empty(), is blank()
If(MyValue < 0, Error("MyValue must be a positive number."))
pdf( screen name, file name.pdf)
If(Toggle1.Value = true, ShowControl, HideControl)
Parent.property
Text(thisitem.ColumnName, “DD/MM/YYYY”)
If( Value(TextBox1.Text) >= 0, Color.Black, Color.Red )
If( Value(Label1.Text)
["Seattle", < 0, Red,"Johannesburg",
"Tokyo", "London", Black ) "Rio de Janeiro"]
Comboboxname = Comboboxname.Value
Comboboxname in Comboboxname.selected items
thisitem.choicecolumnname.Value
choicecolumnname.value
dropdownname.selected.value
choices(database.choicecolumnname)
Icon.car
homescreen.size<>1
remove(datasource, thisitem)
Remove(datasource, galleryname.selected)
if(thisitem.isselected, green color, white color)
Datasource.lastsubmit.ID
datasource.selected.thumbnail
last(datasource).ID
Galleryname. Allitemscount
if(user().fullname=‘Mohamed Mougi’, true, false)
tablist name.selected or lookup(database, iD=tablist.selected.id)
Thisitem.firstname & “ “ & thisitem.lastname
Concat(Thisitem.multichoicecolumn.value, “,”)
If(Form1.Unsaved, "Please Submit the Form", "Submitted")
SubmitButton.DisplayMode = If(IsBlank( Form.Error ) || Form.Valid, DisplayMode.Edit, DisplayMode.Disabled)
if(!isblank(errormessage.text), disabled, edit)
if (parent.mode=formmode.new, true, false)
If(User().Email in ["[email protected]", "[email protected]"], DisplayMode.Edit, DisplayMode.View)
If(Form1_2.Mode = FormMode.New, false, true)
If(Form1_2.Mode = FormMode.New, true, If(Form1_2.Mode = FormMode.Edit, true, false))
If(Form1.Mode = FormMode.New || Form1.Mode = FormMode.Edit, false, true)
ResetForm(Form1_2); ViewForm(Form1_2)
If(Form1.Valid, SubmitForm(Form1), Notify("Please correct the errors in the form.",NotificationType.Warning))
If(Form1.Valid= false ,Notify("All required fields must be filled",NotificationType.Error), UpdateContext({showConfirmation
new form(formname); navigate(success/Failure screen)
formname.updates
formname.lastsubmit
formname.mode<>formmode.view
formname.lastsubmit.id
FormName.unsaved
displaymode.view
Formname.Mode
FormMode.Edit
If( formname.Unsaved, "Accounts form has unsaved changes.", "Contacts form has unsaved changes.")
Coalesce(Gallery2.Selected)
value(textinputname.text) >= number y
Buttonname.selected.value = “text”
CardName.Default.
parent.DisplayName
elementname.size
parentname.size
FormMode.Edit(view/new)
Filter(database, (SearchBox.Text in Column1 || SearchBox.Text in Column2 || ...)
Filter(database, choicecolumn.value=dropdown.selected.value)
Filter(database, choicecolumn.value=textinput1.text)
Filter(database, columnname = ComboBox1.Selected.Value)
Filter(database, columnname = Dropdown1.Selected.Value)
Filter(database, columnname= "text")
Filter(database, createdby.email = user().email)
Filter(database, DateValue >= DatePicker1.SelectedDate)
Filter(database, inputtext.text in multichoice column)
Filter(database, lookupcolumn.value = textinput1.text)
Filter(database, or(textbox.text in column1, textbox.text in column2))
Filter(database, personcolumn.displayname = textinput1.text)
Filter(database, personcolumn.email = user().email)
Filter(database, startswith(columnname, "text"))
Filter(database, StartsWith(ColumnName, TextInput1.Text))
Filter(database, startswith(columnname, trim(textinput1.text)))
Filter(database, StartsWith(columnname1, TextInput1.Text) && Contains(columnname2, TextInput2.Text))
Filter(database, startswith(columnname1, trim(textinput1.text) and column name2 = "Text"))
Filter(database, startswith(columnname1, trim(textinput1.text) or startswith(columnname1, trim(textinput1.text)))
Filter(database, Value >= Slider1.Value)
Filter(database, yes/No column=True(False))
Filter(datasource , “target” exactin column name)
Filter(datasource, “target” in columnname)
filter(Sharepoint name, id=5000)
filter(Sharepoint name, id=textinput1.value)
Search(database, “Search Item”, “ColumnName”)
Search(database, TextBoxName.Text, “ColumnName”)
Search(database,TextBoxName.Text, “column name1”, “ColumnName2”)
if we want to make the font Size dynamic, choose font size from the property and then apply this formula
To automatically select a button if the text box is empty, set the onchange property