Power Apps User Guide 1713593903
Power Apps User Guide 1713593903
Venkatesh CR
Power Apps trainer & Consultant
1
Power platform tools :
Business Model
2
Power Apps Advantages :
Power apps Data's input with logical condition (Ex : Min character, Lookup field )
Filter Data's
3
Data source
Ex : Imagine you're building a tool or an app using Power Apps. This tool needs to store and use information, like customer
details, product lists, or employee records. But where does this information come from?
That's where data sources in Power Apps come into play. Think of data sources as different places where your app can find
and store information.
So, when you're building your app in Power Apps, you choose which data sources it should use. Then, you can pull in
information from these sources, display it in your app, and even update it if needed. This makes Power Apps really flexible
because it can work with data from lots of different places, all within the same app you're creating.
4
Delegation Warning
5
Operators
1. Arithmetic Operators: 3. Logical Operators:
- Addition (+) - And (&&)
- Subtraction (-) - Or (||)
- Multiplication (*) - Not (!)
- Division (/)
- Modulus (%) 4. Text Operators:
- Concatenation (&)
2. Comparison Operators:
- Equal to (==)
- Not equal to (!=)
- Greater than (>)
- Less than (<)
- Greater than or equal to (>=)
- Less than or equal to (<=)
6
Controls
• Edit form – Edit and create records in a data source using a form.
• Gallery – Show a list of records that can contain multiple types of data.
• Combo box - Allows users to make selections from provided choices. Supports search and
multi-select.
7
Controls
Display form – Display records in a data source using a form.
Drop down – Show the first item in a list until a chevron is selected.
Image – Show an image from, for example, a local file or a data source.
Vertical container – Determines the position of the child components so that you never have
to set X, Y for a component inside the container.
8
Modern Controls
Info button (preview) – Use this control to provide additional information to users.
Progress bar – Displays the progress, can be configured as determinate showcasing exact
progress or indeterminate for ongoing progress.
Tabs or tab list – Select a tab to move screens or take action on app.
9
Power Apps Formulas & Functions
Microsoft Power Fx language borrows heavily from the Excel formula language. We seek to
take advantage of Excel knowledge and experience from the many makers who also use Excel.
Types, operators, and function semantics are as close to Excel as possible.
If Excel doesn't have an answer, we next look to SQL. After Excel, SQL is the next most
commonly used declarative language and can provide guidance on data operations and
strong typing that Excel doesn't.
10
Low Code Platform Explanation :
11
Variable
❑ Numbers Value
❑ Text (Strings)
❑ True / False (Booleans)
❑ Record
❑ Table
❑ Funtions
Variable Name
These functions are fundamental for storing and managing data temporarily within an app, enabling dynamic
behavior and interaction between different elements.
13
Collect , Clear collect , Clear Function
14
Collect , Clear collect , Clear Function
Collect ( Collectionname, Items)
Ex : Collect (Data,
{ City: "London",Country: "United Kingdom",Population: 8615000} )
15
Filter Function
16
Search Function
17
Lookup Function
18
Form control Functions
Editform : EditForm is used to display and edit existing data from a data source
Syntax : EditForm ( FormName)
Newform : NewForm is used to display a form for adding new data to a data source.
Syntax : NewForm ( FormName)
Submitform : SubmitForm is used to submit data entered in a form to a data source.
Syntax : SubmitForm ( FormName)
Resetform : ResetForm is used to reset the data entered in a form to its default state.
Syntax : ResetForm ( FormName)
19
ThisItem and Parent Function
ThisItem
ThisItem is used to reference the currently selected item in a data source.
- Syntax: ThisItem
- Example: ThisItem.Name
This will retrieve the value of the "Name" field from the currently selected item in a
gallery or form.
Parent
Parent is used to reference the parent control or container of a control within the app.
- Syntax: Parent
- Example: Parent.Width
This will retrieve the width of the parent control/container of the control where the function is
used.
20
If & Switch Function
If
In Power Apps, the **If** function is used for conditional logic. It evaluates a condition and
returns one value if the condition is true and another value if the condition is false.
- Syntax: If (Condition, ValueIfTrue, ValueIfFalse)
- Example: If(Sales > 1000, "High", "Low")
This will return "High" if the sales value is greater than 1000, otherwise it will return "Low".
Switch
Syntax: Switch(Value, Value1, Result1, Value2, Result2, ..., DefaultValue)
- Example: Switch(Grade, "A", "Excellent", "B", "Good", "C", "Average", "D", "Poor", "Fail")
This will return "Excellent" if Grade is "A", "Good" if Grade is "B", "Average" if Grade is "C",
"Poor" if Grade is "D", and "Fail" if none of the specified conditions match.
These functions are fundamental for implementing conditional logic and multi-condition
branching in Power Apps.
21
Navigation Function
Navigate
- Navigate is used to move to a different screen within the app.
- Syntax: Navigate(ScreenName [, Transition [, UpdateContextRecord]])
- Example: Navigate(DetailsScreen)
This will navigate to the screen named DetailsScreen.
Back
Back is used to return to the previous screen.
- Syntax: Back()
- Example: Back()
This will return to the screen that was previously visited.
22
Table Function
Table
- Table function is used to create a table, which is a collection of records with the
same structure.
Example: Table( {Name: Text, Age: Integer, Email: Text} ) creates a table with columns
Name, Age, and Email.
23
Patch Function
Patch
Patch function is used to modify or create records in a data source.
24
Distinct & Choice Function
Distinct
Distinct is used to retrieve unique values from a data source or collection.
- Syntax: Distinct(DataSource, ColumnName)
- Example: Distinct(MyDataSource, "Category") returns a list of unique values from the
"Category" column in MyDataSource.
Choice
Choices is used to retrieve the options available for a specific column in a data source or
collection.
- Syntax: Choices(DataSource, ColumnName)
- Example: Choices(MyDataSource, "Status") returns a list of available choices for the "Status"
column in MyDataSource.
25
Sort & Notify Function
Sort
- Sort is used to sort a data source or collection based on one or more columns.
- Syntax: Sort (DataSource, ColumnName [, SortOrder])
- Example: Sort(MyDataSource, "Name", Ascending) sorts MyDataSource based on the "Name"
column in ascending order.
Notify
26
Add column and Show column
Add Column
AddColumns is used to add new columns to a data source based on calculations or existing
data.
- Syntax: AddColumns(DataSource, NewColumnName, Calculation)
- Example: AddColumns(MyDataSource, TotalPrice, Quantity * UnitPrice)
This will add a new column named TotalPrice to MyDataSource, calculated by multiplying the
Quantity and UnitPrice columns.
Show Column
ShowColumns is used to display specific columns from a data source while hiding others.
- Syntax: ShowColumns(DataSource, Column1, Column2, ...)
- Example: ShowColumns(MyDataSource, Name, Age)
This will display only the "Name" and "Age" columns from MyDataSource, hiding all other
columns.
27
Aggregation Functions and Syntax
Average
The Average function calculates the arithmetic mean of a set of numbers.
- Syntax: Average(DataSource, Column)
- Example: Average(MyDataSource, Price)
This will calculate the average price from the Price column in the MyDataSource.
Sum
The Sum function calculates the total sum of a set of numbers.
- Syntax: Sum(DataSource, Column)
- Example: Sum(MyDataSource, Quantity)
This will calculate the total quantity from the Quantity column in the MyDataSource.
28
Aggregation Functions and Syntax
Min
The Min function returns the minimum value from a set of numbers.
- Syntax: Min(DataSource, Column)
- Example: Min (MyDataSource, Age)
This will return the minimum age from the Age column in the MyDataSource.
Max
The Max function returns the maximum value from a set of numbers.
- Syntax: Max (DataSource, Column)
- Example: Max(MyDataSource, Age)
This will return the maximum age from the Age column in the MyDataSource.
29
Aggregation Functions and Syntax
Count
Count: The Count function is used to count the number of records in a table or collection.
- Syntax: Count(DataSource)
- Example: Count(MyDataSource)
This will count the total number of records in the MyDataSource table or collection.
CountA
CountA: The CountA function counts the number of items in a table, collection, or record that
are not blank.
- Syntax: CountA(DataSource)
- Example: CountA(MyDataSource)
This will count the total number of non-blank items in the MyDataSource table or collection.
30
Aggregation Functions and Syntax
CountIf
CountIf: The CountIf function counts the number of records in a table or collection that
meet specified criteria.
- Syntax: CountIf(DataSource, Condition)
- Example: CountIf(MyDataSource, Status = "Active")
This will count the number of records in the MyDataSource table or collection where the
Status column equals "Active".
CountRows
CountRows: The CountRows function counts the number of rows in a table or collection.
- Syntax: CountRows(DataSource)
- Example: CountRows(MyDataSource)
This will count the total number of rows in the MyDataSource table or collection.
31
Remove & RemoveIF Functions
Remove
- Remove is used to remove a specific item from a collection.
- Syntax: Remove(Collection, Item)
- Example: Remove(MyCollection, {Name: "John", Age: 30}) removes the item with Name "John"
and Age 30 from MyCollection.
RemoveIF
- RemoveIf is used to remove items from a collection based on a condition.
Syntax : RemoveIf(Collection, Condition)
- Example: RemoveIf(MyCollection, Age > 30) removes all items from MyCollection where Age
is greater than 30.
32
UpdateIF & Round Functions
UpdateIF
- UpdateIf is used to update values in a collection based on a condition.
- Syntax: UpdateIf(Collection, Condition, Changes)
- Example: UpdateIf(MyCollection, Age > 30, {Status: "Senior"}) updates the Status to "Senior"
for all items in MyCollection where Age is greater than 30.
Round
- Round is used to round a number to a specified number of decimal places.
- Syntax: Round(Number, NumberOfDecimals)
- Example: Round(3.14159, 2) rounds 3.14159 to 2 decimal places, resulting in 3.14.
33
Date Functions and Syntax
Now
Now: Returns the current date and time.
- Syntax: Now ()
Today
Today: Returns the current date without the time component.
- Syntax: Today()
DateAdd
DateAdd: Adds a specified number of units (days, months, years, etc.) to a date.
- Syntax: DateAdd(StartDate, Number, Unit)
- Example: DateAdd(Today(), 7, Days) adds 7 days to the current date.
34
Date Functions and Syntax
DateDiff
DateDiff: Calculates the difference between two dates in specified units.
- Syntax: DateDiff(StartDateTime, EndDateTime, Unit)
- Example: DateDiff(StartDate, EndDate, Days) calculates the number of days between two
dates.
Year
Year: Extracts the year from a date.
- Syntax: Year(Date)
Month
Month: Extracts the month from a date.
- Syntax: Month(Date)
35
Date Functions and Syntax
Day
Day: Extracts the day from a date.
- Syntax: Day(Date)
DateValue
DateValue: Converts a string to a date value.
- Syntax: DateValue(DateString)
- Example: DateValue("2022-04-15")
36
Date Functions and Syntax
Text
Text: Converts a date to a string using a specified format.
- Syntax: Text(Date, Format)
- Example: Text(Today(), "dd/mm/yyyy") formats the current date as "dd/mm/yyyy".
DateTimeValue
DateTimeValue: Converts a string to a datetime value.
- Syntax: DateTimeValue(DateTimeString)
- Example: DateTimeValue("2022-04-15T14:30:00")
37
FirstN & LastN Functions and Syntax
FirstN
- FirstN is used to retrieve the first N records from a data source.
- Syntax: FirstN(DataSource, N)
- Example: FirstN(MyDataSource, 5) returns the first 5 records from MyDataSource.
LastN
- LastN is used to retrieve the last N records from a data source.
- Syntax: LastN(DataSource, N)
- Example: LastN(MyDataSource, 3) returns the last 3 records from MyDataSource.
These functions are commonly used for data manipulation in Power Apps, especially when
dealing with collections or data sources
38
First & Last Functions and Syntax
First
- First is used to retrieve the first record from a data source.
- Syntax: First (DataSource)
- Example: First(MyDataSource) returns the first record from MyDataSource
Last
- Last is used to retrieve the last record from a data source.
- Syntax: Last(DataSource)
- Example: Last(MyDataSource) returns the last record from MyDataSource.
These functions are commonly used for data manipulation in Power Apps, especially when
dealing with collections or data sources
39
Text Functions and Syntax
Concatenate
- Concatenate is used to join multiple strings together.
- Syntax: Concatenate(Text1, Text2, ...)
- Example: Concatenate("Hello", " ", "World") returns "Hello World".
Left
- Left is used to extract a specified number of characters from the beginning of a string.
- Syntax: Left(Text, NumberOfCharacters)
- Example: Left("PowerApps", 5) returns "Power".
40
Text Functions and Syntax
Right
- Right is used to extract a specified number of characters from the end of a string.
- Syntax: Right(Text, NumberOfCharacters)
- Example: Right("PowerApps", 4) returns "Apps".
Len
- Len is used to get the length of a string.
- Syntax: Len(Text)
- Example: Len("PowerApps") returns 9.
41
Text Functions and Syntax
Lower
- Lower is used to convert a string to lowercase.
- Syntax: Lower(Text)
- Example: Lower("PowerApps") returns "powerapps".
Mid
- Mid is used to extract a specified number of characters from a string, starting at a specified
position.
- Syntax: Mid(Text, StartPosition, NumberOfCharacters)
- Example: Mid("PowerApps", 6, 4) returns "Apps".
42
Text Functions and Syntax
Upper
- Upper is used to convert a string to uppercase.
- Syntax: Upper(Text)
- Example: Upper("PowerApps") returns "POWERAPPS".
These functions are useful for manipulating and formatting text within Power Apps, allowing
for dynamic text processing and display.
43
GroupBy Function
GroupBy
GroupBy is used to group records in a data source based on one or more columns.
GroupBy is often used in combination with other functions like Sum, Count, Max, or Min to
perform aggregate operations on the grouped data. It's helpful for organizing and analyzing
data in a structured manner within Power Apps
44
Task : Employee Travel Request
Chorus ID : NUMBER
Destination : TEXT
45
Task : Order details
1. Order Details : Each order in the list will have its own entry, containing key details such as:
- Order Number: A unique identifier for the order.
- Order Date: The date when the order was placed.
- Customer/Supplier: The name or identifier of the customer or supplier associated with the order.
- Order Type: Indicates whether the order is a sales order or a purchase order.
- Order Status: The current status of the order (e.g., pending, processing, shipped, completed).
- Total Amount: The total amount or value of the order.
- Currency: The currency in which the order amount is expressed.
2. Order Items : The list can include a sub-list or related items to capture details about individual items included in the order.
Each order item entry may contain information such as:
- Product/Service Name: The name or description of the product or service.
- Quantity: The quantity of the product or service ordered.
- Unit Price: The price per unit of the product or service.
- Total Price: The total price of the order item (quantity multiplied by unit price).
- SKU/Code: The stock-keeping unit or code associated with the product.
46
Task : Order details
3. Shipping/ Delivery Details : Include fields to capture shipping or delivery information, such as:
- Shipping Address: The address to which the order should be shipped or delivered.
- Shipping Method: The method or carrier used for shipping.
- Expected Delivery Date: The anticipated date of delivery for the order.
4. Payment Information : Capture details related to payment for the order, such as:
- Payment Method: The method of payment used for the order (e.g., credit card, bank transfer).
- Payment Status: The status of payment processing (e.g., pending, paid, overdue).
- Payment Due Date: The date by which payment for the order is due.
47
48