Power Apps
Power Apps
1) Canvas App :
Blank canvas
Drag and drop different controls on a screen
You can design a pixel perfect design with custom colors and theme
Create multiple screens for different functionalities and reusable components
If you are good with excel formulas, you might find it bit easy to work with Canvas app,
because Power Apps uses Power Fx functions/formulas
You can connect with more than 400 connectors
No code/low code
Reference: https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/getting-started
Reference: https://learn.microsoft.com/en-us/power-apps/maker/model-driven-apps/model-driven-
app-overview
Reference: https://learn.microsoft.com/en-us/power-apps/maker/portals/overview
in power apps, what is environment
A Power Apps Environment is a container that holds apps, data, flows, and other resources. It helps
in organizing, securing, and managing Power Platform solutions within a Microsoft tenant.
In Power Apps, an environment is a logical container that groups apps, data, and resources together.
It provides boundaries for data management, security, and governance within the Microsoft Power
Platform.
Default Environment → Automatically created for each tenant; shared by all users.
Production Environment → Used for live apps with full functionality.
Sandbox Environment → Used for development and testing.
Trial & Developer Environments → Temporary environments for personal testing or learning.
Each environment has specific security roles and policies to control access.
Each environment has its own Dataverse, apps, flows, and connectors.
Power Fx:
Operators and Identifiers
. (Dot) Operator in Power Fx
The dot (.) operator in Power Fx is used to access properties of objects, records, or controls.
It allows you to retrieve values from tables, collections, records, and controls efficiently.
1️. Accessing Control Properties
You can use the dot operator to access a control’s property, such as Text, Value,
Selected, etc.
TextLabel.Text = TextInput1.Text //This assigns the text entered in TextInput1 to TextLabel.
Button1.Fill //Retrieves the background color of Button1.
The in operator is used to check if a value exists in a table, collection, or list. It performs
case-insensitive matching, meaning it doesn't care about whether letters are uppercase or
lowercase.
"Bob" in Employees. Name //Returns true if "Bob" exists in the Name column of the
Employees table.
5 in [1, 2, 3, 4, 5] //Returns true because 5 is in the list.
LookUp(Employees, Name = "Bob") in Employees //Returns true if there is a record with
the name "Bob" in the Employees table.
The Exactin operator checks if a value exists in a table, collection, or list, but it performs
case-sensitive matching.
"bob" Exactin Employees. Name //Returns false if the Employees. Name column contains
"Bob", because Exactin requires an exact case match, and "bob" is different from "Bob".
Both ThisItem and ThisRecord are operators used to reference records in Power Fx, but they
are used in different contexts. Understanding the difference between them is important for
working effectively in Power Apps, especially when dealing with controls like Galleries,
Forms, and tables/collections.
Identifiers in Power Fx
In Power Fx, identifiers are names used to reference variables, controls, collections, data
sources, fields, and columns. They help uniquely identify elements within an app.
1. Simple Identifiers (No Spaces or Special Characters)
If an identifier does not contain spaces or special characters, use it directly.
Example: Accessing a Column in a Table
Employees. Name //Retrieves the Name field from the Employees table.
2. Escaped Identifiers (Containing Spaces or Special Characters)
If an identifier contains spaces, special characters, or starts with a number, enclose
it in single brackets [ ].
Example: Accessing a Column with Spaces
'[Employee Details]'.Salary // References the Salary column from the Employee
Details table.
3. Identifiers in Nested Tables
When working with nested tables or records, use the . (dot) operator to access fields.
Example: Accessing Nested Records
Employees.Manager.Name // Retrieves the Manager's Name from the Employees
table.
4. Identifiers in Collections
When working with collections, reference the collection name followed by field
names.
Example: Getting the First Record in a Collection
First(Employees).Name // Retrieves the Name of the first employee in the Employees
collection.
Power Fx Data Types
Power Fx supports a variety of data types for working with text, numbers, records, tables,
and more. Understanding these data types helps you build efficient Power Apps.
Table
Represents a collection of records (like a database table)
Employees = [
{ Name: "Alice", Age: 30 },
{ Name: "Bob", Age: 40 }
]
First(Employees).Name
Currency
Stores monetary values.
$100.50
Text(100.5, "$#,###.00") // Outputs "$100.50"
ImageControl.Image = https://example.com/image.jpg
Set(varEmployee,
{
Name: "Alice",
Age: 30,
Salary: 50000,
JoiningDate: Date(2020, 5, 10),
IsActive: true
}
)
Date Handling in Power Fx
Hour(Now()) // Returns: 14
Text(Now(), "hh:mm AM/PM") // "02:30 PM"
Text Handling in Power Fx
Left("Microsoft", 3) // "Mic" // Get the First 3 Characters
Mid("PowerFx", 3, 4) // "werF" // Extract Middle Part of a Text
Trim(" Hello ") //”Hello” // Remove Spaces
What is Blank()?
Blank() is the equivalent of null in other programming languages.
Blank() // Returns a blank (null) value
Set(MyVar, Blank()) //Clears the variable, setting it to "no value."
UpdateContext({MyInput: Blank()}) //Can be used to clear or reset inputs bound to context
variables.
If(MyVar = Blank(), "It's empty", "Has value")
If(IsBlank(MyVar), "It's empty", "Has value")
LookUp(Employees, ID = 1).Email
LookUp(Employees, ID = 1).Department
You can’t return multiple fields directly as values in the third argument (like LookUp(..., ...,
Name, Email))
LookUp(Employees, ID = 1, Name, Email) ❌
ClearCollect(
Employees,
{ FirstName: "Alice", LastName: "Smith" },
{ FirstName: "Bob", LastName: "Jones" }
);
ClearCollect(
EmployeesWithFullName,
AddColumns(
Employees,
"FullName", FirstName & " " & LastName
)
)
Nested AddColumns
AddColumns(AddColumns(Employees,Tax,salary*0.30),NetSalary,Salary-
Tax)
DropColumns
Removes one or more columns from a table.
DropColumns(SourceTable, "Column1", "Column2", ...)
DropColumns(Employees, "Email", "Phone")
Removes Email and Phone from each record in the Employees table.
RenameColumns
🔤 Renames columns in a table. Useful when working with SharePoint or
data sources that return unfriendly names.
RenameColumns(SourceTable, "OldName1", "NewName1", "OldName2",
"NewName2")
RenameColumns(Employees, "FullName", "Name", "Dept", "Department")
Renames FullName to Name, and Dept to Department.
ShowColumns
Selects only specific columns to keep — like a filter for columns.
ShowColumns(SourceTable, "Column1", "Column2", ...)
ShowColumns(Employees, "Name", "Email")
Keeps only Name and Email columns, drops everything else.
number of records in a table or collection in Power Apps, use the CountRows() function.
CountRows(CollectionName)
If(
IsBlank(LookUp(Employees, Name = "John")),
Collect(Employees, { Name: "John", Department: "IT", Salary: 6000 }),
Patch(Employees, LookUp(Employees, Name = "John"), { Department: "IT", Salary: 6000 })
)
🔹 What is RemoveIf?
RemoveIf() removes records from a collection or data source that match a condition.
Think of it like: "Delete all records where X is true."
RemoveIf(Source, Condition)
Source = your collection or data source (e.g. Employees)
Condition = a logical test (e.g. Department = "HR")
📌 Example 1: Remove all records in the HR department
RemoveIf(Employees, Department = "HR")
🧹 Deletes all employees who work in HR.
📌 Example 2: Remove a specific person by name
RemoveIf(Employees, Name = "Alice")
🔍 Deletes all records where the name is Alice.
📌 Example 3: Remove based on multiple conditions
RemoveIf(Employees, Department = "IT" && Salary > 6000)
📉 Deletes IT employees making more than 6000.
🔍 What is Filter?
The Filter() function lets you display or work with only the records that meet certain
conditions — super useful with galleries, collections, data tables, and more.
Filter(Source, Condition1 [, Condition2, ...])
Source = your collection or data source (like Employees, Products, Orders)
Condition = any logical test (like Department = "HR", Price > 100, etc.)
🔹 Example 1: Get all HR employees
Filter(Employees, Department = "HR")
🔍 Returns only employees whose department is HR.
🔹 Example 2: Filter products over $500
Filter(Products, Price > 500)
🛒 Great for showing premium items in a gallery.
🔹 Example 3: Multiple conditions (AND)
Filter(Employees, Department = "IT", Salary > 6000)
🧠 Returns IT employees earning more than 6000.
🔹 Example 4: Use with a gallery
Items: Filter(Employees, Department = "Sales")
💼 Shows only sales staff in your gallery.
Bonus: Use User().Email for personalization
Filter(Orders, CreatedBy = User().Email)
🔐 Shows only records created by the current user.
🔹 What is Search?
The Search() function filters a table based on a text search — like searching for a name, title,
or keyword.
✅ It’s case-insensitive, and it checks if the search text is contained within the specified
column(s).
🔹 What is Sort?
The Sort() function sorts a table or collection based on the values in a specific column.
Sort(Source, ColumnName, SortOrder)
Source: Your data source or collection (e.g., Employees, Products)
ColumnName: The column you want to sort by (e.g., "Name", "Salary")
SortOrder: Use Ascending or Descending
📌 Example 1: Sort employees by name (A to Z)
Sort(Employees, Name, Ascending)
➡️Names will appear in alphabetical order.
🔹 What is SortByColumns?
SortByColumns() sorts a table or collection by one or more column names (provided as text)
and allows for dynamic sorting (using variables).
1. Creating a Collection
👉 Using Collect()
Collect(Students, { Name: "Alice", Age: 20 }, { Name: "Bob", Age: 22 })
🟢 Creates a collection named Students with two records.
👉 Using ClearCollect()
ClearCollect(Students, { Name: "Charlie", Age: 25 })
🟢 Clears existing data in Students and adds one new record.
ClearCollect(Countries,”india”,”USA”,”UK”)
First(Countries).Value
Use UpdateIf to modify records.
UpdateIf(MyCollection, ID = 1, {Name: "Alice Cooper"})
7. Storing Nested Data
You can store tables within collections.
Collect(MyCollection,
{ID: 1, Name: "Alice", Skills: Table({Skill: "Power Apps"}, {Skill: "Power Fx"})}
)
Table vs. Collection in Power Fx