You are on page 1of 3091

Contents

Get started
What is Power Apps?
Sign up for 30-day trial version
Sign up for Community Plan
What's new?
Learning catalog
Learning catalog
Business Decision Maker
App maker
Developer
Administrator
Functional consultant
Solution architect
Find and run apps
In a browser
On a phone (canvas)
On a phone (model-driven)
On a SharePoint Online page (canvas)
In Microsoft Teams (canvas)
From AppSource
Use model-driven apps
Overview
Unified Interface
Navigation and basics
Basic navigation
Use grid filters
View your profile
Find your admin or support person
Set personal option
Use a screen reader
Keyboard shortcuts
Work with records and activities
Create a record
Add activities to the timeline
FAQ about activities
View and create email through the Activities grid
Send email using the enhanced email experience
Insert an email template
Use the lookup field on a record
View a profile card
Assign or share records
Share records using Access Team
Add a connection role
Deactivate accounts or contacts
Track your progress with dashboards and charts
Add Power BI dashboards
Collaboration
Use OneDrive for Business
Take notes by using OneNote
Collaborate using SharePoint
Search records
Compare search options
Relevance Search
Quick Find
Advanced Find
Import and export data
Import data
Export data to Excel Online
Export data to Excel
Export to a dynamic worksheet
Export to a static worksheet
Export to an Excel PivotTable
Merge duplicate records
Reports
Work with reports
Create a report using the Report Wizard
Add an existing report
Edit the default filter of a report
Troubleshoot reports
Automate processes
Work with business processes
Use flows
Use Dynamics 365 App for Outlook
Create apps
Overview
Sign in to Power Apps
Canvas apps
What are canvas apps?
System requirements, limits, and configuration
Keyboard shortcuts
Explore sample apps
Create a canvas app from a sample
Expense Report app
Help Desk app
Meeting Capture app
Crisis communication app
Create your first app
1 - Create an app from a template
2 - Create an app using data
From Common Data Service
From SharePoint
From Excel
From Azure SQL Database
2 - Make basic customizations
1 - Galleries
2 - Forms
3 - Cards
Create an app from scratch
From Common Data Service
From Excel
Design and build an app
Connect to data
Connections Overview
Popular connectors
Common Data Service
Overview
Improvements
Cloud storage
Dynamics 365
Dynamics AX
Excel
Microsoft Translator
Office 365 Outlook
Office 365 Users
Oracle database
Power BI
SharePoint
SQL Server
Twitter
Add a connection
Manage connections
Prepare Excel data
Delegation
Manage gateways
Understand gateways
Understand data sources
Understand tables and records
Understand record references
Design the interface
Add and configure controls
Add and configure a screen
Add a screen
Add a scrolling screen
Configure Office 365 screens
Calendar-screen overview
Calendar-screen reference
Email-screen overview
Email-screen reference
Meeting-screen overview
Meeting-screen reference
People-screen overview
People-screen reference
Show a table of items
Add a gallery
Add a variable-height gallery
Add and configure a form
Add a form
Understand forms
Understand form layout
Understand cards
Add a list
Add a list box, a drop-down list, or radio buttons
Create dependent drop-down lists
Add a chart
Add multimedia
Add Power BI data
Working with gallery
Control reference
List of controls and properties
Add picture
Attachments
Audio
Barcode scanner
Button
Camera
Card
Check box
Column chart
Column
Combo box
Container (experimental)
Data table
Date picker
Display form
Drop down
Edit form
Export
Gallery
HTML text
Icon
Image
Import
Line chart
List box
Microphone
PDF viewer (experimental)
Pen input
Pie chart
Power BI tile
Radio
Rating
Rich text editor
Screen
Shape
Slider
Stream Video
Label
Text input
Timer
Toggle
Video
Web barcode scanner (experimental)
Common properties
Accessibility
Color and border
Core
Image
Size and location
Text
Configure app functionality
Get started with formulas
Understand variables
Understand behavior formulas
Show dates and times
Create a collection
Show the current user
Connect lists using lookups
Add a flow
Create a rule in canvas apps
Formula reference
Overview
Abs
Acceleration
Acos
Acot
AddColumns
And
App
Asin
Assert
AsType
Atan
Atan2
Average
Back
Blank
Calendar
Char
Choices
Clear
ClearCollect
Clock
Coalesce
Collect
Color
ColorFade
ColorValue
Compass
Concat
Concatenate
Concurrent
Connection
Count
Cos
Cot
CountA
CountIf
CountRows
Data types
DataSourceInfo
Date
DateAdd
DateDiff
DateTimeValue
DateValue
Day
Defaults
Degrees
Disable
Distinct
Download
DropColumns
EditForm
Enable
EndsWith
Errors
EncodeUrl
Exit
Exp
Filter
Find
First
FirstN
ForAll
GroupBy
GUID
HashTags
Hour
Identifiers
If
IfError
IsBlank
IsEmpty
IsMatch
IsNumeric
IsToday
IsType
JSON
Language
Last
LastN
Launch
Left
Len
Ln
LoadData
Location
LookUp
Lower
Match
MatchAll
Max
Mid
Min
Minute
Mod
Month
Navigate
NewForm
Not
Notify
Now
Operators
Or
Param
Patch
Pi
PlainText
Power
Proper
Radians
Rand
Refresh
Relate
Remove
RemoveIf
RenameColumns
Replace
Reset
ResetForm
Revert
RGBA
Right
Round
RoundDown
RoundUp
SaveData
Search
Second
Select
Set
SetFocus
SetProperty
ShowColumns
Shuffle
Sin
Sort
SortByColumns
Split
Sqrt
StartsWith
StdevP
Substitute
SubmitForm
Sum
Switch
Table
Tan
Text
Time
TimeValue
TimeZoneOffset
Today
Trace
Trim
TrimEnds
Ungroup
Unrelate
Update
UpdateContext
UpdateIf
Upper
User
Validate
Value
VarP
ViewForm
Weekday
With
Year
Create an app in a solution
Create an app with relational data
Install the data
Overview of the canvas app
1 - Create the order gallery
2 - Create the summary form
3 - Create the detail gallery
Build a global app
Make an app accessible
Create an accessible app
Find accessibility issues
Use color for accessibility
Show or hide content from assistive technologies
Announce dynamic changes with live regions
Experimental and preview features
Save and publish an app
Share an app and its dependencies
Share an app
Share Excel data
Share app resources
Embed an app in Power BI
Embed an app in Teams
Manage an app
Edit an app
Delete an app
Restore a previous version
Change app name and tile
Manage screens
Change screen size and orientation
Create responsive layout
Test an app with Test Studio
Test Studio Overview
Working with Test Studio
Customize a SharePoint list form
Make basic changes
Understand SharePoint forms integration
Integrate with other technologies
SharePoint Online
Overview
Set up SharePoint Online lists
Generate an app
Create a flow for approvals
Create an app from scratch
Create a Power BI report
Publish the Power BI report
Embed the Power BI report
Create a flow for alerts
Walk through the completed scenario
Cognitive Services
Transform your InfoPath forms to Power Apps
For developers
Canvas apps for enterprise developers, partners, and ISVs
Build and certify custom connectors
Integrate with websites and other technologies
Develop offline-capable apps
Let customers test drive your apps
Create a component
Components overview
Component library
Behavior formulas
Embed canvas apps in your applications
Model-driven apps
What are model-driven apps?
Explore sample apps
Create your first app
Design and build an app
Understand model-driven app components
Define data for an app
Common field properties
Overview of special field properties
Translate localizable text
Design the interface
Use app designer to build an app
Create an app
Create a site map for an app
Add or edit app components
Add the team entity as a lookup option
Work with forms
Use the new form designer
Create or edit forms
Add, move or delete fields
Add, move or delete components
Add, move or delete sections
Add, move or delete tabs
Configure header properties
Add and configure sub-grid component
Add and configure quick view component
Configure lookup component
Using the tree view
Type of forms
Create or edit a main form
Create or edit quick create forms
Create a quick view form
Create a card form
Form editor overview
Form properties overview
Sub-grid properties overview
Tab properties overview
Design considerations for main forms
How main forms appear
Control access to forms
Add a field to a form
Show or hide form elements
Change navigation within a form
Add form navigation for related entities
How-to guides: Forms
How to use the main form and its components
How to open the form editor
How to add iFrames to forms
How to optimize form performance
How to work with sections in a form
How to configure Bing maps in a form
How to assign form order
How to configure event handlers in a form
How to disable auto-save in a form
How to add a tab for SharePoint documents
Embed a canvas app on a model-driven form
Add an embedded canvas app
Edit an embedded canvas app
Customize the screen size and orientation
Perform predefined actions on the host form
ModelDrivenFormIntegration control
Share an embedded canvas app
Embedded canvas app guidelines
Migrating embedded canvas from public preview
Embed a Power BI report on a form
Work with views
Access a view definition
Create and edit views
Choose and configure columns in views
Create or edit filters in app views
How to guides: Views
How to make grids editable
How to sort records in a view
How to edit filter criteria and sort order
How to set managed properties for views
How to Specify a default view
How to delete or deactivate a view
Apply business logic in an app
Create a business rule for a form
Apply data visualizations in an app
Create a system chart
Create or edit dashboards
Configure interactive experience dashboards
Set properties for a chart or list
Use system controls for data visualizations
Set up the Notes control
Set up timeline control
FAQs for timeline control
Quick view control properties
Additional controls for Dynamics 365 for phones and tablets
Timer control overview
Use custom controls for data visualizations
Use Excel and Word templates
Use themes to apply organization branding
Create guided help for your app
Add reporting to your app
Report considerations
RDL sandboxing
Use Power BI
Customize Power BI content packs
Validate and publish an app
Share an app
Manage an app
Manage app properties
Specify properties for Unified Interface apps
Delete an app
Advanced app making and customization
Privileges for customization
Create or edit web resources
Web resource properties
Change custom entity icons
Distribute an app using solutions
Enable customizable help
Create guided help
Transition to Unified Interface
Transition quick start
Use an existing environment to transition quick start
Unified Interface Playbook
Approaching a Unified Interface transition
Checklist: Unified Interface transition
FAQs: Unified Interface transition
Accessibility in Power Apps app designer
Customize Dynamics 365 App for Outlook
For developers
Portals
What is Power Apps portals?
Release updates
Design and build a portal
Portal templates
Create a starter portal
Create a portal with Dynamics 365 environment
Provision a portal using the older portal add-on
Power Apps portals Studio anatomy
Supported web browsers for portal designer
Create and manage webpages
Compose a page
Work with templates
Edit CSS
Manage existing portals
Advanced portal administration
Overview
Portal details
Download public key of portal
View portal error logs
Reset a portal
Change base URL of a portal
Enable maintenance mode
Add a custom domain name
Import metadata translation
Power BI integration
Set up Power BI integration
Add a Power BI report or dashboard to a web page in portal
Run Portal Checker
Renew portal authentication key
Set up IP address restriction
Update to Power Apps portals domain
Clear the server-side cache
Migrate portal configuration
About portal lifecycle
Upgrade a portal
Cookies used by portal
Advanced portal configuration
Overview
Configure site settings
Portal authentication
Configure portal authentication
Set authentication identity
Azure AD B2C provider settings for portals
Configure OAuth2 provider settings
Configure OpenID provider settings
Configure WS-Federation provider settings
Configure SAML 2.0 provider settings
Migrate identity providers to Azure AD B2C
Search
About search
Improve search by using faceted search
Search within file attachments
Enable multiple-language support
Create and manage web files
Manage web links
Create and manage page templates
Manage content snippets
Create a redirect URL
Use shortcuts to place child nodes
Behavior and format of the date and time field
View activities in a portal timeline
Rate a webpage
Enable header and footer output caching on a portal
Add chart on a web page in portal
Work with entity forms
Work with entity lists
Manage websites
Create and manage website bindings
Work with web forms
Define web form properties
Web form steps
Define web form steps
Define a load form and load tab step type
Add a redirect step type
Add a conditional step type
Add custom JavaScript
Configure web form metadata
Configure a web form subgrid
Add geolocation
Implement GDPR in portals
Create and run advertisements
Gather feedback by using polls
Create and manage publishing states
Advanced portal customization
Work with Liquid templates
Overview
Store content by using web templates
Understand Liquid operators
Available Liquid types
Available Liquid conditional operators
Available Liquid objects
Available Liquid tags
Available Liquid tags
Control flow tags
Iteration tags
Variable tags
Template tags
Common Data Service entity tags
Available Liquid filters
Create advanced templates
Create a custom page template
Use hybrid navigation to render page hierarchy
Render the entity list for a page
Render an RSS feed by using a custom page template
Render a site header and primary navigation bar
OAuth 2.0 implicit grant flow
Manage webpages
User management and security in portal
Configure contacts
Invite contacts
Create web roles
Assign entity permissions
Control webpage access
Create website access permissions
Document storage in portals
Configure notes
Azure storage
Enable Azure storage
Add the Azure Storage web resource to a form
Manage SharePoint documents
Known issues
Power Apps portals FAQ
Legacy Adxstudio Portals v7 FAQ
Common Data Service
What is Common Data Service?
Work with entities
Entity overview
Create an entity
Create a custom entity that has components
Entities and metadata
Types of entities
Create and edit entities
Edit an entity
Create and edit virtual entities
Virtual entity OData v4 data provider
Define alternate keys using Power Apps portal
Define alternate keys using solution explorer
How to guides: Entity
How to create entities using Power Apps portal
How to create entities using solution explorer
How to import or export data
How to open entity data in Excel
How to define alternate keys
How to define status reason transitions
How to delete a custom entity
How to display custom icons
How to edit system entity messages
How to configure an entity for feedback/ratings
Azure Cosmos DB SQL API Data Provider
How to work with virtual entity
Work with entity relationships
Entity relationships overview
Create one-to-many entity relationships overview
Create many-to-many entity relationships overview
Create an entity relationship
Create one-to-many entity relationships
Create one-to-many entity relationships using solution explorer
Create many-to-many entity relationships using Power Apps portal
Set managed properties for entity relationships
Visualize hierarchical data
Define and query hierarchically related data
Configure connection roles
How-to guides: Relationships
How to create many-to-many relationships using Power Apps portal
How to create many-to-many relationships using Power Apps solution explorer
How to set managed properties for relationships
How to query and visualize hierarchically related data
How to define and query hierarchically related data
How to configure connection roles
Work with fields
Types of fields
Global option sets overview
Autonumber fields
Set managed properties for fields
Behavior and format of the Date and Time field
How-to guides: Fields
How to create fields
How to manage fields
How to create fields using Power Apps portal
How to create fields using Power Apps solution explorer
How to create an option set using Power Apps portal
How to create global option sets using solution explorer
How to define calculated fields
How to define rollup fields
How to map entity fields
How to delete fields
Apply business logic
Create a business rule for an entity
Work with solutions
Use solutions
Use a solution to customize
Solution publisher overview
Use segmented solutions
How managed solutions are merged
Use solution checker
Common issues and resolutions: solution checker
Best practices
How to
Create solution patches
Create a solution
Update or upgrade solutions
Import solutions
Export solutions
Use environment variables
View solution layers
View solution history
Set managed properties in metadata
Advanced topics
Create solution patches
Work with dataflows
Create and use dataflows
Add data to an entity using Power Query
Connect Azure Data Lake for dataflow storage
Use an on-premises data gateway
License requirements for entities
Complex entities and licensing
Restricted entities requiring Dynamics 365 licenses
SharePoint, OneNote, and OneDrive integration
Create a Power BI report
Translate customized entity and field text
Import translated entity and field text
Export to data lake
Security in Common Data Service
API limits overview
For developers
AI Builder
Use AI Builder in Power Apps
Learn from others
Webinars
Blog
Forums
Troubleshoot
Performance tips for canvas apps
Common issues and resolutions
Get a session or app ID
Troubleshoot startup issues for Power Apps
Troubleshoot Power Query
Support
What is Power Apps?
2/6/2020 • 3 minutes to read • Edit Online

Power Apps is a suite of apps, services, connectors and data platform that provides a rapid application
development environment to build custom apps for your business needs. Using Power Apps, you can quickly build
custom business apps that connect to your business data stored either in the underlying data platform (Common
Data Service) or in various online and on-premises data sources (SharePoint, Excel, Office 365, Dynamics 365, SQL
Server, and so on).
Apps built using Power Apps provide rich business logic and workflow capabilities to transform your manual
business processes to digital, automated processes. Further, apps built using Power Apps have a responsive design,
and can run seamlessly in browser or on mobile devices (phone or tablet). Power Apps "democratizes" the custom
business app building experience by enabling users to build feature-rich, custom business apps without writing
code.
Power Apps also provides an extensible platform that lets pro developers programmatically interact with data and
metadata, apply business logic, create custom connectors, and integrate with external data.
For more information, see the Power Apps channel on YouTube.

Power Apps for app makers/creators


Using Power Apps, you can create three types of apps: canvas, model-driven, and portal. More information:
Overview of creating apps in Power Apps.
To create an app, you start with make.powerapps.com.
Power Apps Studio is the app designer used for building canvas apps. The app designer makes creating
apps feel more like building a slide deck in Microsoft PowerPoint. More information: Generate an app from
data
App designer for model-driven apps lets you define the sitemap and add components to build a model-
driven app. More information: Design model-driven apps using app designer

Power Apps for app users


You can run apps that you created, or that someone else created and shared with you, in browser or on mobile
devices (phone or tablet). More information: Find and run apps

Power Apps for admins


Power Apps admins can use:
Power Apps admin center (admin.powerapps.com) to create and manage environments, users, roles, and
data-loss prevention policies.
Power Platform admin center (admin.powerplatform.microsoft.com) to manage environments, get real-
time, self-help recommendations and support for Power Apps and Power Automate, and view Common
Data Service analytics.
More information: Administer Power Apps
Power Apps for developers
Developers are app makers who can write code to extend business app creation and customization. Developers can
use code to create data and metadata, apply server-side logic using Azure functions, plug-ins, and workflow
extensions, apply client-side logic using JavaScript, integrate with external data using virtual entities and webhooks,
build custom connectors, and embed apps into your website experiences to create integrated solutions. More
information: Power Apps for developers

Power Apps and Dynamics 365


Dynamics 365 applications, such as Dynamics 365 Sales, Dynamics 365 Customer Service, Dynamics 365
Marketing also use the underlying data platform (Common Data Service) used by Power Apps to store and secure
data. This enables you to build apps using Power Apps and Common Data Service directly against your core
business data already used within Dynamics 365 without the need for integration. More information: Dynamics
365 and Common Data Service

Try Power Apps for free


You can try Power Apps for free by signing up either for a 30 day trial or community plan.

Purchase Power Apps


If you have decided to purchase Power Apps, see here for detailed information: Purchase Power Apps.

Power Apps US Government plans


Power Apps US Government consists of several plans for US government organizations to address the unique and
evolving requirements of the United States public sector. The Power Apps GCC environment provides compliance
with federal requirements for cloud services, including FedRAMP High, DoD DISA IL2, and requirements for
criminal justice systems (CJI data types). More information: Power Apps US Government
Explore Power Apps for free for 30 days
3/5/2020 • 5 minutes to read • Edit Online

You can explore all Power Apps capabilities for free by signing up for a Power Apps trial plan that expires after
30 days. If you don't have any license for Power Apps, the trial plan provides temporary access to these and
other features:
Extend the capabilities of Office 365 (SharePoint Online, Teams, Excel and more).
Create and run canvas apps that connect to Common Data Service and a wide range of more than 200 other
data sources, including premium connectors and on-premises data.
Create and run model-driven apps.
Create automated workflows with Power Automate.
Create and manage environments and Common Data Service databases.
If you have a Power Apps license or a license through Office 365, you already have access to some of these
features; the trial license temporarily expands your access to include all features in the previous list. To find out
what capabilities each type of license offers, see the pricing page.

NOTE
If you're an administrator, see Purchase Power Apps for your organization or Power Apps in your organization Q&A.
Beginning January 2020, self-service purchase, subscription, and license management capabilities for Power Platform
products (Power BI, Power Apps, and Power Automate) are available for commercial cloud customers in the United
States. For more information, including steps to enable or disable self-service purchasing in your organization, see
Self-service purchase FAQ.

Identify your current license


To find out which license or licenses you already have, try to sign in to Power Apps with your work or school
credentials.
If you can't sign in, you don't have any Power Apps licenses, and you'll need to start a trial if you want
any access to Power Apps.

IMPORTANT
You can't sign in by using a personal email address, such as one that ends in outlook.com, hotmail.com, or
gmail.com. For more information, see What email address can I use? later in this topic.

If you can sign in, select the gear icon near the upper-right corner, and then select Plans.
Upgrade an existing license
To start a free, 30-day trial of Power Apps Plan 2 from an existing license, sign in to Power Apps, and then try
any feature that requires Plan 2. (For example, select the gear icon near the upper-right corner, select Admin
center, and then select New environment near the upper-right corner.) Then follow the prompts to complete
the sign-up process.

Get a license from scratch


Regardless of whether you have a license for Power Apps, you can start a free, 30-day trial of Power Apps Plan
2 by following these steps:
1. Open the Power Apps site, and then select Sign up free.
If you're using a phone, open the menu in the upper-right corner first, and then select Sign up free.
2. Near the middle of the screen, select Pricing, and then select Start free trial.
3. In the dialog box that appears, type or paste your work or school email address, and then select Submit.

IMPORTANT
For more information, see What email address can I use? later in this topic.

4. If a dialog box indicates that Power Apps recognizes your organizational credentials, follow the prompts
to finish signing in.

Otherwise, follow the prompts to check your email, verify your email address, provide more information
if necessary, and select Start.

FAQ
What email address can I use?
You can use a work or school address to sign up for a trial license. If you use another kind of address, you might
experience one of the symptoms in this table.
SYMPTOM / ERROR MESSAGE CAUSE AND WORKAROUND

Personal email addresses (e.g. nancy@gmail.com) Power Apps doesn't support email addresses provided by
consumer email services or telecommunications providers.
You receive a message like the following during signup:
To complete signup, try again using an email address
You entered a personal email address: Please enter assigned by your work or school.
your work email address so we can securely store
your company's data.

or

That looks like a personal email address. Enter


your work address so we can connect you with others
in your company. And don’t worry. We won’t share
your address with anyone.

.gov or .mil addresses Power Apps doesn't support .gov or .mil addresses at this
time.
You receive a message like the following during signup:

Power Apps unavailable: Power Apps is not available


for users with .gov or .mil email addresses at this
time. Use another work email address or check back
later.

or

We can't finish signing you up. It looks like


Microsoft Power Apps isn't currently available for
your work or school.

Email address is not an Office 365 ID Your organization signs in to Office 365 and other Microsoft
services with IDs other than email addresses. For example,
You receive a message like the following during signup: your email address might be Nancy.Smith@contoso.com,
but your ID is nancys@contoso.com.
We can't find you at contoso.com. Do you use a
different ID at work or school? Try signing in with To complete signup, use the ID that your organization has
that, and if it doesn't work, contact your IT
department. assigned to you for signing in to Office 365 or other
Microsoft services. If you don't know what this is, contact
your IT administrator.

What happens when my trial expires?


You'll be prompted to request an extension of the trial or purchase a plan 30 days after the trial starts. You can
find details about all plans on the pricing page.
If you don't extend the trial or purchase a plan but you still have another kind of license, you can still use all the
features of Power Apps that your other license provides. Any data in Common Data Service will remain as it is,
and any app or flow that uses Common Data Service will continue to run as it did if your license supports them.
If you try to use features that Plan 2 supports but your existing license doesn't (for example, modify a schema
or entities in Common Data Service), you'll be prompted to purchase a plan.
More questions?
Try the Power Apps community.
Power Apps Community Plan: a free development
environment for individual use
3/20/2020 • 5 minutes to read • Edit Online

If you want to build skills and learn more about Power Apps, Power Automate, and the Common Data Service, the
Power Apps Community Plan is the right plan for you. The Power Apps Community Plan gives you a free
development environment for individual use, where you can:
Learn to build business apps and workflows with the full functionality of Power Apps and Power Automate.
Connect to any data source by using our 100+ out of the box connectors or by creating your own custom
connectors.
Explore how you can use the Common Data Service to build powerful business apps with the common data
model and the SDK.
Export the solutions you create in your individual environment, and list them on AppSource so your customers
can test-drive them.

Who can sign up for the Power Apps Community Plan?


Anyone with a work or school account can sign up for the Power Apps Community Plan. But we especially
recommend this plan if you:
Want to build skills and learn more about Power Apps, Power Automate, and the Common Data Service.
Are interested in building business apps and workflows to distribute on AppSource.

Where can I sign up for the Power Apps Community Plan?


Sign up on the Power Apps Community Plan website. If you are an existing user of Power Apps with Office 365 or
Dynamics 365, you can also create an environment for individual use.
After signing up for the Community Plan, you will be redirected to the Power Apps site and will land in your
individual environment. The environment is named with your name, for example 'John Doe's environment'. If
there is already an environment with that name, the individual environment will be named as 'John Doe's (1)
environment'. The following image shows how the environment appears.

Get the Community Plan with Visual Studio Dev Essentials


If you are a Visual Studio Dev Essentials user, Power Apps is included in your benefits. Visit My benefits and click
or tap the Power Apps tile to sign up for the Power Apps Community Plan.
Which features are included in the Power Apps Community Plan?
With the individual environment, you get the following functionality:

FUNCTIONALITIES ENVIRONMENT FOR INDIVIDUAL USE

Key features

Create and run apps Yes. You can create unlimited apps

Share apps* No

Use the Common Data Service Yes

Model your data using the Common Data Service Yes

Enterprise-grade administration of the environment and user Yes


policies

Connectivity

Connect to Office 365, Dynamics 365, and other connectors Yes

Connect to cloud-based services like Azure SQL, Dropbox, Yes


Twitter, and many more

Use premium connectors like Salesforce, DB2 and many more Yes

Access on-premises data using an on-premises gateway Yes

Create custom connectors to connect to your own systems Yes. You can create unlimited custom connectors

Common Data Service

Create and run applications on the Common Data Service Yes

Model your data in the Common Data Service Yes

Create a database in the Common Data Service Yes

Create and use dataflows No


FUNCTIONALITIES ENVIRONMENT FOR INDIVIDUAL USE

Management

Add co-workers as environment makers and admins No

Add co-workers to the database roles No

Supports data policies established by the Office 365 Yes


administrator

Establish data policies for the individual environment Yes

*You can't share apps, flows, connections, etc. with any other users of your tenant. You also can't add any other user
as an environment admin or maker, or to the database roles from the admin center.

What are the capacity limits for the individual environment?


CAPACITY

Flow runs/month 750

Database size 200 MB

File storage 2GB

You cannot apply add-ons to the quantities that we include. If you hit capacity limits, we recommend purchasing
Power Apps Per User Plan. Learn more about it from the Power Apps pricing page.

NOTE
The capacity of the individual environment, whether or not it's used, doesn't contribute to your company's overall quota.

Publishing to AppSource
Do you have an app you would like to share with customers? We now support a Power Apps Test Drive solution
on AppSource.com as a way for you to share apps and flows with customers, and generate leads for your business.
For more information, see Let customers test drive your apps on AppSource.

Frequently Asked Questions


Q: What should I do if reach the capacity limits of the environment?
A: There is a limited capacity provided because this environment is meant for individual use, not for a team or
production use. The capacity provided is:

CAPACITY

Flow runs/month 750

Database size 200 MB


CAPACITY

File storage 2GB

If you reach one or more capacity limits, we recommend you purchase a plan that supports production use. Learn
more about our plans and their limits on the Power Apps pricing page.
Q: Can I transfer the apps, flows, and other resources created in the individual environment, to another
environment?
A: Yes, you should be able to export the resources from this environment to other environments. For more
information, see Environment and tenant app migration.
Q: Will my Power Apps Community Plan subscription ever expire?
A: You can use your Power Apps Community Plan subscription perpetually for free. If you are actively using an
individual environment, then you won't lose access to any of the resources or functionality in that environment.
You may, however, notice a delay when accessing your Common Data Service Database for the first time after a
long period of inactivity. This delay does not impact the data or entities stored in the Common Data Service.
Q: Can I get or create multiple individual environments?
A: No, you can only have one individual environment, which is created for you by Power Apps when you sign up
for the Community Plan.
Q: What's the difference between Power Apps Plan Trial and Power Apps Community Plan; and which one should
I sign up for?
A: Both Power Apps Plan Trial and Power Apps Community Plan are free, but are created for different purposes:
Power Apps Plan Trial gives you Power Apps Plan 2 for 30 days. This is meant for trying out Power Apps,
Common Data Service, and Power Automate. Once your trial expires, you can purchase a plan. If you are already
using Power Apps with Office 365 or Dynamics 365, this is the right plan to try out the premium functionalities of
Power Apps, which are available with Power Apps Per User Plan.
Power Apps Community Plan gives you access to Power Apps premium functionalities, Common Data Service,
and Power Automate for individual use. This plan is primarily meant for learning purposes or creating business
solutions to be distributed for AppSource Test Drive. This plan is perpetually available, but only for learning and
building your skills on Power Apps, Common Data Services, and Power Automate.
Q: Can I sign up with my personal account?
A: No, you can only sign up with your work or school account. We currently do not support signing up with a
personal account.
Q: Can I delete my individual environment?
A: You can't delete this environment on your own. Your tenant admin has permissions to delete the environment.
What's new in Power Apps?
2/19/2020 • 2 minutes to read • Edit Online

This topic provides resources where you can learn about the new features that have recently released, new features
that will be releasing over the next few months, and known limitations.

Weekly releases
For information about the new features, fixes, and improvements released in the past few weeks, see Released
versions for Microsoft Power Apps.
To know more about how to browse information in the weekly release notes, read this blog post.

NOTE
Releases are rolled out over several days. New or updated functionality might not appear immediately.

Release plan
For information about new features releasing over the next few months that you can use for planning, see:
2019 release wave 2 plan
2020 release wave 1 plan

Known limitations
For information about known limitations, see Common issues and resolutions.
Learning catalog for Power Apps
2/20/2020 • 2 minutes to read • Edit Online

Find the right online training, in person workshops, and events for your role as a user of Power Apps.
Business and Technical Decision Makers
Do you decide whether to invest in new technologies?
Business and Technical Decision Makers learning catalog
Get Started
App Creation
Exam
App makers
Are you interested in quickly creating custom business apps without writing code?
Application Makers learning catalog
Get Started
App Creation
Developers
Do you need to write code to integrate with other data sources, extend core system functionality, or build a complex
application?
Developer learning catalog
Build
Extend
Exam
Administrators
Do you need to keep systems and data flowing, provisioned, and secure round-the-clock?
Administrators learning catalog
Functional consultants
Are you an implementation expert for a business domain?
Functional Application Consultant learning catalog
Get started
App creation
Exam
Solution architects
Do you design solutions that meet your customers' needs and budgets?
Solution Architects learning catalog
Get started
Exam
Business and technical decision makers learning
catalog
2/19/2020 • 3 minutes to read • Edit Online

Do you decide whether to invest in new technologies?


The following catalog is organized from core knowledge to specific domains, and from most basic to most
advanced. If content exists in multiple formats, we'll let you know, so that you can choose the training format that
best meets your needs.

Get started
CONTENT DESCRIPTION FORMAT LENGTH

Introduction to Power Apps Learn about the value and Free, self-paced online 18 minutes
capabilities of Power Apps, learning path
and ways other
organizations have leverage
this technology to build
simple applications for their
business.

Automate a business This learning path introduces Free, self-paced online 3 hours 11 minutes
process using Power you to Power Automate, learning path
Automate teaches you how to build
workflows, and how to
administer flows.

Tutorial: Create a business This tutorial shows you how Free, self-paced online 14 minutes to read
process flow to standardize to create a business process learning path
processes flow with Power Apps.

App Creation
CONTENT DESCRIPTION FORMAT LENGTH

Create a canvas app in Do you want to create apps Free, self-paced online 2 hr 11 min
Power Apps to help make your business learning path
more efficient? Then, this
path is for you. It introduces
you to Power Apps, helps
you create and customize an
app, and then manage and
distribute it.

Create a model-driven This learning path introduces Free, self-paced online 2 hr 35 min
application in Power Apps you to creating a model- learning path
driven app in Power Apps
that uses Common Data
Service.
CONTENT DESCRIPTION FORMAT LENGTH

Get started with Power Power Automate is an online Free, self-paced online 58 minutes
Automate workflow service that learning path
automates actions across
the most common apps and
services.

Manage permissions and Do you need to manage Free, self-paced online 1 hr 23 min
administration for Common user access rights? In this learning path
Data Service learning path, you will learn
how to manage permissions
associated with
environments and entities.
You will also learn about
different administrative
portals and how to access
each.

Master advanced techniques Do you want to make sure Free, self-paced online 2 hr 30 min
for Power Apps canvas apps your app is the best it can learning path
be? This learning path will
help you use advanced
formulas and perform
custom updates. It will also
focus on performance checks
and testing.

Use advanced data options Do you want to improve the Free, self-paced online 2 hr 21 min
and connectors in Power user's experience in your learning path
Apps canvas app? Do you want to
use custom connectors to
connect to data? This
learning path will help you
do both things. It will also
focus on working with data
source limits.

Use basic formulas to make Do you want to use Free, self-paced online 2 hr 16 min
better Power Apps canvas formulas to improve learning path
apps functionality and change a
behavior in your Power Apps
canvas app? This learning
path can help you
accomplish your goal.

Use the UI and controls in a The app user experience Free, self-paced online 1 hr 58 min
canvas app in Power Apps often defines the success of learning path
your app. This learning path
will focus on how to provide
the best app navigation, and
build the best UI using
themes, icons, images,
personalization, different
form factors, and controls.
CONTENT DESCRIPTION FORMAT LENGTH

Work with data in a Power Do you need to connect an Free, self-paced online 2 hr 14 min
Apps canvas app app to access data? Then learning path
this learning path is for you.
It will focus on how to
connect to data sources. It
also will show you how to
use filtering, conditions, and
other functions to shape
your data and write data to
your data source.

Microsoft Power Platform Learn about the Instructor-led in person or 2 days


Fundamentals components of Power online training, cost varies
Platform, ways to connect by region and partner
data, and how organizations
can leverage this technology

Exam
CONTENT DESCRIPTION FORMAT LENGTH

Microsoft Power Platform This exam measures your Exam, cost varies by region
Fundamentals ability to understand the
business value of Power
Platform; understand the
core components of Power
Platform; demonstrate the
business value of Power BI;
and demonstrate the
business value of Microsoft
Flow.
App maker learning catalog
2/20/2020 • 3 minutes to read • Edit Online

Are you interested in quickly creating custom business apps without writing code?
The following catalog is organized from core knowledge to specific domains, and from most basic to most
advanced. If content exists in multiple formats, we'll let you know, so that you can choose the training format that
best meets your needs.

Get started
CONTENT DESCRIPTION FORMAT LENGTH

Introduction to Power Apps Learn about the value and Free, self-paced online 18 minutes
capabilities of Power Apps, learning path
and ways other
organizations have leverage
this technology to build
simple applications for their
business.

Automate a business This learning path introduces Free, self-paced online 3 hours 11 minutes
process using Power you to Power Automate, learning path
Automate teaches you how to build
workflows, and how to
administer flows.

Tutorial: Create a business This tutorial shows you how Free, self-paced online 14 minutes to read
process flow to standardize to create a business process learning path
processes flow with Power Apps.

Create a canvas app in Do you want to create apps Free, self-paced online 2 hr 11 min
Power Apps to help make your business learning path
more efficient? Then this
path is for you. It introduces
you to Power Apps, helps
you create and customize an
app, and then manage and
distribute it.

Create a model-driven This learning path introduces Free, self-paced online 2 hr 35 min
application in Power Apps you to creating a model- learning path
driven app in Power Apps
that uses Common Data
Service.

App Creation
CONTENT DESCRIPTION FORMAT LENGTH
CONTENT DESCRIPTION FORMAT LENGTH

Introducing Button Flows There are many repetitive Free, self-paced online 5 minutes to read
tasks that we all wish we learning path
could run with just a tap of a
button. For example, you
may need to quickly email
your team to remind them
to join the daily team sync,
or you may want to start a
new Visual Studio Online
build of your code base after
you've been notified that
there are no more checkins
planned for the day. Button
flows allow you to
accomplish these and many
other tasks simply by
tapping a button on your
mobile device.

Manage permissions and Do you need to manage Free, self-paced online 1 hr 23 min
administration for Common user access rights? In this learning path
Data Service learning path, you will learn
how to manage permissions
associated with
environments and entities.
You will also learn about
different administrative
portals and how to access
each.

Master advanced techniques Do you want to make sure Free, self-paced online 2 hr 30 min
for Power Apps canvas apps your app is the best it can learning path
be? This learning path will
help you use advanced
formulas and perform
custom updates. It will also
focus on performance checks
and testing.

Use advanced data options Do you want to improve the Free, self-paced online 2 hr 21 min
and connectors in Power user's experience in your learning path
Apps canvas app? Do you want to
use custom connectors to
connect to data? This
learning path will help you
do both things. It will also
focus on working with data
source limits.

Use basic formulas to make Do you want to use Free, self-paced online 2 hr 16 min
better Power Apps canvas formulas to improve learning path
apps functionality and change a
behavior in your Power Apps
canvas app? This learning
path can help you
accomplish your goal.
CONTENT DESCRIPTION FORMAT LENGTH

Use the UI and controls in a The app user experience Free, self-paced online 1 hr 58 min
canvas app in Power Apps often defines the success of learning path
your app. This learning path
will focus on how to provide
the best app navigation, and
build the best UI using
themes, icons, images,
personalization, different
form factors, and controls.

Work with data in a Power Do you need to connect an Free, self-paced online 2 hr 14 min
Apps canvas app app to access data? Then learning path
this learning path is for you.
It will focus on how to
connect to data sources. It
also will show you how to
use filtering, conditions, and
other functions to shape
your data and write data to
your data source.
Developer learning catalog
2/19/2020 • 3 minutes to read • Edit Online

Do you need to write code to integrate with other data sources, extend core system functionality, or build a
complex application?
The following catalog is organized from core knowledge to specific domains, and from most basic to most
advanced. If content exists in multiple formats, we'll let you know, so that you can choose the training format that
best meets your needs.

Build
CONTENT DESCRIPTION FORMAT LENGTH

Introduction to developing So you want to be a Power Free, self-paced online 2 hours


with the Power Platform Platform developer! This learning path
learning path is the first step
in learning about the
platform tools and the
ecosystem of the Power
Platform.

Extend
CONTENT DESCRIPTION FORMAT LENGTH

Extending the Power Create client scripting, Free, self-paced online 4 hours
Platform Common Data perform common actions learning path
Service with client script, and
automate business process
flow with client script is
covered in this learning path.
Learn about what client
script can do, rules, and
maintaining scripts. Discover
when to use client script as
well as when not to use
client script.
CONTENT DESCRIPTION FORMAT LENGTH

Extending the Power Getting started with Free, self-paced online


Platform user experience extending the Power learning path
Model Driven apps Platform Common Data
Service can be
overwhelming. This learning
path looks at the tools and
resources needed for
extending the Power
Platform. We'll start with
looking at the SDKs, the
extensibility model, and
event framework. This
learning path also covers
when to use plug-ins.
Configuration of plug-ins as
well as registering and
deploying plug-ins.

Extend Dynamics 365 The ability to easily surface Free, self-paced online 3 hours
portals and interact with Common learning path
Data Service data on an
externally facing web site is
the core benefit for
implementing a Dynamics
365 portal. This learning
path describes how to
transform a content portal
into a full web app
interacting withCommon
Data Service. We will explain
how to secure data access
based on the authenticated
user role and relationship to
the data. We will also cover
the options available to
customizers and developers
to extend the portal
functionality and integrate
with Office 365 and Power
platform components.
CONTENT DESCRIPTION FORMAT LENGTH

Work with portals in Dynamics 365 portals are Free, self-paced online 1 hour
Dynamics 365 designed for interaction with learning path
the internal and external
audiences. There are
additional requirements for
content management and
design, as well as the need
to secure the content. This
learning path describes how
portal components work
within context of Dynamics
365 to deliver the content
and Common Data Service
for Apps data to external
and internal audiences. We
will cover the topics of user
authentication and how to
secure access to different
parts of the portal content
based on the target
audience and relationship to
the content.

Work with Common Data Learn about working with Free, self-paced online 2 hours
Service Web API the Common Data Service learning path
Web API

Integrate Common Data Gain an in-depth overview Free, self-paced online 2 hours
Service Azure solutions of options available within learning path
Common Data Service to
integrate data and events to
Azure.

Access Common Data The ability to easily surface Free, self-paced online 1 hour
Service data in Dynamics and interact with Common learning path
365 portals Data Service data on a
website is one of the core
benefit for implementing a
Dynamics 365 Portal. This
module will focus on the
techniques and methods to
display and interact with
Common Data Service data
on the Dynamics 365 Portal.
CONTENT DESCRIPTION FORMAT LENGTH

Microsoft Power Apps + In this course, Power Apps Instructor-led in person or 3 days
Dynamics 365 Developer Developers will build on their online training, cost varies
existing knowledge of the by region and partner
Power Platform, Microsoft
stack, and standard
development tools and
practices. Power Apps
Developers will learn how to
estimate effort and scope;
validate requirements and
design technical architecture;
create data models;
determine implementation
tools; and document their
technical design. Broad
topics will include
implementing user security
and accessibility; managing
environments; extending the
Common Data Service;
creating and using web
resources; and working with
plug-ins.

Exam
CONTENT DESCRIPTION FORMAT LENGTH

Microsoft Power Apps + This exam measures your Exam, cost varies by region
Dynamics 365 Developer ability to accomplish the
following technical tasks:
create a technical design;
configure Common Data
Service (CDS); create and
configure Power Apps;
configure business process
automation; extend the user
experience; extend the
platform; and develop
integrations.
Administrators learning catalog
2/19/2020 • 2 minutes to read • Edit Online

Do you need to keep systems and data flowing, provisioned, and secure round-the-clock?
The following catalog is organized from core knowledge to specific domains, and from most basic to most
advanced. If content exists in multiple formats, we'll let you know, so that you can choose the training format that
best meets your needs.

Administration
CONTENT DESCRIPTION FORMAT LENGTH

Manage permissions and Do you need to manage Free self-paced online 1 hr 23 min
administration for Common user access rights? In this learning path
Data Service learning path you will learn
how to manage permissions
associated with
environments and entities.
You will also learn about
different administrative
portals and how to access
each.
Functional application consultant learning catalog
2/24/2020 • 4 minutes to read • Edit Online

Are you an implementation expert for a business domain?


The following catalog is organized from core knowledge to specific domains, and from most basic to most
advanced. If content exists in multiple formats, we'll let you know, so that you can choose the training format that
best meets your needs.
For functional consultants, our job-task analysis research showed that everyone must understand the core content
set as well as a domain area.

Get Started
CONTENT DESCRIPTION FORMAT LENGTH

Introduction to Power Apps Learn about the value and Free, self-paced online 18 minutes
capabilities of Power Apps, learning path
and ways other
organizations have leverage
this technology to build
simple applications for their
business.

Automate a business This learning path introduces Free, self-paced online 3 hours 11 minutes
process using Power you to Power Automate, learning path
Automate teaches you how to build
workflows, and how to
administer flows.

Tutorial: Create a business This tutorial shows you how Free, self-paced online 14 minutes to read
process flow to standardize to create a business process learning path
processes flow with Power Apps.

Get started using Common Do you want to learn how to Free, self-paced online 4 hr 16 min
Data Service build solutions that can learning path
leverage a standardized data
structure and work with
other solutions sharing the
same data model? Do you
want to extend the standard
model to support custom
solutions? This learning path
will explain the concepts
behind and benefits of
Common Data Service.
Creating an environment,
entities, fields and options
sets are also discussed.

Get started with Power Power Automate is an online Free, self-paced online 58 minutes
Automate workflow service that learning path
automates actions across
the most common apps and
services.
App Creation
CONTENT DESCRIPTION FORMAT LENGTH

Create a canvas app Do you want to Free, self-paced online 2 hr 11 min


in Power Apps create apps to help learning path
make your business
more efficient? Then,
this path is for you. It
introduces you to
Power Apps, helps
you create and
customize an app,
and then manage and
distribute it.

Create a model- This learning path Free, self-paced online 2 hr 35 min


driven application in introduces you to learning path
Power Apps creating a model-
driven app in Power
Apps that uses
Common Data
Service.

Create relationships, Do you need to Free, self-paced online 2 hr 21 min


business rules, create data learning path
calculations, and relationships, business
rollups in Common rules, calculations, and
Data Service rollups in Common
Data Service? These
modules help you use
Common Data Service
to build powerful
business solutions
that will transform
your operations,
processes, and your
entire organization.

Manage permissions Do you need to Free, self-paced online 1 hr 23 min


and administration for manage user access learning path
Common Data Service rights? In this learning
path, you will learn
how to manage
permissions
associated with
environments and
entities. You will also
learn about different
administrative portals
and how to access
each.
CONTENT DESCRIPTION FORMAT LENGTH

Master advanced Do you want to make Free, self-paced online 2 hr 30 min


techniques for Power sure your app is the learning path
Apps canvas apps best it can be? This
learning path will help
you use advanced
formulas and perform
custom updates. It
will also focus on
performance checks
and testing.

Use advanced data Do you want to Free, self-paced online 2 hr 21 min


options and improve the user's learning path
connectors in Power experience in your
Apps canvas app? Do you
want to use custom
connectors to connect
to data? This learning
path will help you do
both things. It will
also focus on working
with data source
limits.

Use basic formulas to Do you want to use Free, self-paced online 2 hr 16 min
make better Power formulas to improve learning path
Apps canvas apps functionality and
change a behavior in
your Power Apps
canvas app? This
learning path can help
you accomplish your
goal.

Use the UI and The app user Free, self-paced online 1 hr 58 min
controls in a canvas experience often learning path
app in Power Apps defines the success of
your app. This
learning path will
focus on how to
provide the best app
navigation, and build
the best UI using
themes, icons, images,
personalization,
different form factors,
and controls.
CONTENT DESCRIPTION FORMAT LENGTH

Work with data in a Do you need to Free, self-paced online 2 hr 14 min


Power Apps canvas connect an app to learning path
app access data? Then this
learning path is for
you. It will focus on
how to connect to
data sources. It also
will show you how to
use filtering,
conditions, and other
functions to shape
your data and write
data to your data
source.

Microsoft Power This training provides Instructor-led in cost varies by region 5 days
Platform + Dynamics a high-level overview person or online and partner
365 Core of the capabilities of training
Microsoft Dynamics
365 and the Power
Platform and provides
a foundation for other
Microsoft Dynamics
365 and Power
Platform training
offerings. High-level
topics include
application
configuration
automation
opportunities,
integration, testing
and deployment.

Exam
CONTENT DESCRIPTION FORMAT LENGTH

Microsoft Power Platform + This exam measures your Exam cost varies by region
Dynamics 365 Core ability to accomplish the
following technical tasks:
perform discovery, planning
and analysis; manage user
experience design; manage
entities and data; implement
security; implement
integration; and perform
solutions deployment and
testing.
Solution architect learning catalog
2/19/2020 • 2 minutes to read • Edit Online

Do you design solutions that meet your customers' needs and budgets?
The following catalog is organized from core knowledge to specific domains, and from most basic to most
advanced. If content exists in multiple formats, we'll let you know, so that you can choose the training format that
best meets your needs.

Get started
CONTENT DESCRIPTION FORMAT LENGTH

Becoming a solution The Solution Architect leads Free, self-paced online 1 hr 43 min
architect for Dynamics 365 successful implementations learning path
and Power Platform and focuses on how
solutions address the
broader business and
technical needs of
organizations. This module
covers what it takes to get
started as a Solution
Architect and as key
member of the overall
project team.

Exam
CONTENT DESCRIPTION FORMAT LENGTH

Microsoft Power Apps + This exam measures your Exam, cost varies by region
Dynamics 365 Solution ability to accomplish the
Architect following technical tasks:
perform solution envisioning
and requirement analysis;
architect a solution; and
implement the solution.
How do I find and run apps?
12/2/2019 • 2 minutes to read • Edit Online

No need to manually work on a task to get your work done. With Power Apps, you can create and use a canvas
app or model-driven app to get your work done quickly. Once you create an app, you can share the app with your
organization.
Canvas apps give you a lot of control over the user experience of the app. An app maker can use templates to
create a canvas app, or they can configure the app any way they like. A canvas app, like its name, is a blank canvas,
so you can create an app to fit the needs of users in your organization.
Because canvas apps can essentially be anything, there isn’t much help documentation on how to use an app once
it’s created. If you need help using a canvas app, contact your app maker or Power Apps admin.
Model-driven apps use the Unified Interface that provides a responsive and accessible design. You can run the app
on a web browser or on popular mobile devices. The app has multiple components including dashboards, forms,
views, charts, and business processes that together help make the app easy to use.
This section provides information about how to find and run canvas and model-driven apps from various places. It
also provides information on how to navigate and work within a model-driven app: Use model-driven apps.

What's required to run apps?


Ensure that you're using a supported device platform and browser.
To run canvas apps, download and install Power Apps from the App Store or Google Play.
To run model-driven apps:
on a phone, download and install Dynamics 365 for phones from the App Store or Google Play.
on a tablet, download Dynamics 365 for tablets from the App Store, Google Play, or Microsoft Store.
Run an app in a web browser
12/10/2019 • 2 minutes to read • Edit Online

When you create an app, or someone shares an app with you, you can run that app on the Dynamics 365 mobile
app or in a web browser on a tablet. In this topic, you'll learn how to run a canvas or model-driven app in a web
browser on a tablet from the Dynamics 365 Home page.
For full functionality and optimized experience, we strongly recommend that you use the Dynamics 365 for
phones and tablets mobile app. If you don't have the Dynamics 365 for phones and tablets app installed, you can
still use the web browser on your tablet, as long as your device has sufficiently high screen resolution. For more
information: What's supported.

NOTE
Using the web browser on your phone to run your model-driven apps isn't supported; you must use the Dynamics 365 for
phones app.

To follow this quickstart, you need:


A Power Apps license. This is available with a Power Apps plan, such as the Power Apps Plan 2 trial, or any of
the Microsoft Office 365 or Dynamics 365 plans that include Power Apps.
Access to an app that you built or that someone else built and shared with you.
Access to a supported web browser and operating system.
For canvas apps, see: System requirements, limits, and configuration values
For model-driven apps, see: Supported web browsers and mobile devices

Sign in to Dynamics 365


Sign in to Dynamics 365 at https://home.dynamics.com.

Find an app on the Home page


The Home page may show several types of business apps, but you can find a specific app by typing part of its
name in the search box. You can also filter the list to show only apps created by a specific source, such as Power
Apps. To do this, select Filter and then select the source.
If you've recently installed the app, it might not immediately appear in the list of apps. Select Sync to show all your
apps. This process may take up to a minute.
Run an app from a URL
You can save an app's URL as a bookmark in your tablet's browser and run it by selecting the bookmark, or you
can send a URL as a link through email. If someone else created an app and shared it with you in an email, you can
run the app by selecting the link in the email. When running an app using a URL, you may be prompted to sign in
using your Azure Active Directory credentials.

Connect to data
If an app requires a connection to a data source or permission to use the device's capabilities (such as the camera
or location services), you must give consent before you can use the app. Typically, you're prompted only the first
time.

Close an app
To close an app, sign out of the Dynamics 365 Home page, or open another app.

Next steps
In this topic, you learned how to run a canvas or model-driven app in a web browser. To learn how to:
run a canvas app on a mobile device, see Run a canvas app on a mobile device
run a model-driven app on a mobile device, see Run a model-driven app on a mobile device
use a model-driven app, see Use model-driven apps
Run a canvas app on a mobile device
12/3/2019 • 2 minutes to read • Edit Online

When you create an app, or someone shares an app with you, you can run that app on Windows, iOS, Android, or
in a web browser. In this topic, you'll learn how to run a canvas app on a mobile device. Apps running on a mobile
device can take advantage of the device's capabilities, such as location services and camera.
To follow this procedure, if you're not signed up for Power Apps, sign up for free before you begin, and then
download Power Apps from the App Store or Google Play onto an iPhone, iPad, or Android device running a
supported operating system. Also, make sure you have access to a canvas app that you created or that someone
else created and shared with you.

Open Power Apps and sign in


Open Power Apps on your mobile device and sign in using your Azure Active Directory credentials.

If you have the Microsoft Authenticator app installed on your mobile device, simply enter your username when
prompted, and then approve the notification sent to your device.

Find the app


To make it easier to find the app, open the PowerApps menu, and then select a filter.
The following filters are available:
All apps: Displays all apps to which you have access, including apps you created and apps that others
shared with you.
My Apps: Displays apps that you've run at least once.
Sample apps: Displays sample apps from Microsoft that showcase real application scenarios with fictitious
data to help you explore design possibilities.
Favorites: Displays apps that you've marked by tapping the ellipsis (...) on the app tile, and then tapping
Favorite. To remove an app from this list, tap the ellipsis (...) on the app tile, and then tap Unfavorite.

After you filter your apps, you can sort the filtered list by the date the apps were most recently opened or
modified, or alphabetically by name. These preferences are retained when you close and reopen Power Apps.

If you know the name of the app you want to run, you can tap the search icon at the top of Powerapps, and then
type part of its name in the search box.

If you filtered your apps, it will search the filtered list.

Run an app
To run a canvas app on a mobile device, tap the app tile. If someone else created a canvas app and shared it with
you in an email, you can run the app by tapping the link in the email.
If this is the first time you're using Power Apps, a screen shows the swipe gesture to close the app.
Give consent
If an app requires a connection to a data source or permission to use the device's capabilities (such as the camera
or location services), you must give consent before you can use the app. Typically, you're prompted only the first
time.

Pin an app to the home screen


You can pin an app to the home screen of your device for quick access. Tap the ellipsis (...) on the app tile, tap Pin
to Home, and then follow the instructions that appear.
Close an app
To close an app, use your finger to swipe from the left edge of the app to the right. On Android devices, you can
also press the Back button and then confirm that you intended to close the app.

Next steps
In this topic, you learned how to run a canvas app on a mobile device. You can also run model-driven apps on a
mobile device.
Run a model-driven app on a mobile device
Run a model-driven app on a mobile device
12/10/2019 • 2 minutes to read • Edit Online

After the app is created and then shared with you, you can run that app on the Dynamics 365 mobile app or in a
web browser on tablet. In this topic, you'll learn how to run a model-driven app on a mobile device.
To follow this procedure, if you're not signed up for Power Apps, sign up for free before you begin. Also, make
sure you have access to an app that you created or that someone else created and shared with you.

Run the model-driven app


Model-driven apps don't run in the Power Apps mobile app. Instead, you run a model-driven app on a mobile
device using the Dynamics 365 mobile app. If you don't have the Dynamics 365 for phones and tablets app
installed, you can still use the web browser on your tablet, as long as your device has sufficiently high screen
resolution. However, for full functionality and optimized experience, we strongly recommend that you use the
Dynamics 365 for phones and tablets mobile app.

NOTE
Using the web browser on your phone to run your model-driven apps isn't supported; you must use the Dynamics 365 for
phones app.

Use the mobile app


Install the Dynamics 365 for phones or Dynamics 365 for tablets app from your device’s app store. More
information: Install Dynamics 365 for phones and tablets

Run in your tablet's browser


Go to the Dynamics 365 home page or enter the app URL directly into your tablet's web browser and follow the
directions on your screen to load the app. More information: What's supported

Next steps
In this topic, you learned how to run a model-driven app on a mobile device. For information about:
using a model-driven app, see Use model-driven apps
running a canvas-app on a mobile device, see Run a canvas app on a mobile device
Run a canvas app from a SharePoint page
12/2/2019 • 2 minutes to read • Edit Online

You can add a Power Apps canvas app to a SharePoint Online page using the Power Apps web part. Then users
can run the app from the SharePoint Online page. More information: Office: Use the Power Apps web part
Add an app to Microsoft Teams
12/3/2019 • 2 minutes to read • Edit Online

Microsoft Teams is a chat-based collaboration platform built on Office 365 technologies. You can customize the
Teams experience by adding Power Apps canvas apps to your channels in Teams. In this topic, you learn how to add
the Product Showcase sample app to a Teams channel, and then open the app from that channel.

If you're not signed up for Power Apps, sign up for free before you begin.

Prerequisites
To follow this procedure, you need an Office 365 subscription and a channel in Teams.

Sign in to Power Apps


Sign into Power Apps at https://make.powerapps.com.

Add an app
1. In Microsoft Teams, select a team, and a channel under that team. In this example, it's the General channel
under the Business Development team.
2. Choose + to add a tab.

3. In the Add a tab dialog box, choose PowerApps.

4. Choose Sample apps > Product Showcase > Save.


The app is now available to use in the channel.

NOTE
You must share your own apps before you add them to Teams (sample apps are shared by default).
Open an app
1. In Microsoft Teams, choose the team and the channel that contains the app.

2. Choose the Product Showcase tab.

The app opens in the channel.

Known issues
In the desktop app for Microsoft Teams:
Apps must load content such as images and .pdf files over a secure (https) connection.
Not all sensors, such as Acceleration, Compass, and Location, are supported.
Only these audio formats are supported: AAC, H264, OGG Vorbis, and WAV.
Clean up resources
To remove the app from the channel, choose the Product Showcase tab > Remove.

Next steps
In this topic, you added the Product Showcase sample app to a Teams channel, and then opened the app from that
channel. To learn more about Power Apps, continue to the Power Apps tutorials.
Power Apps Tutorials
Discover apps via AppSource
3/4/2020 • 2 minutes to read • Edit Online

The apps you build and publish with Power Apps are discovered and used in Dynamics 365 on the web. It displays
all of your apps -- the apps that you've specifically chosen to use (that is, by launching from a share email or
opening from AppSource) or that an admin has provisioned for you. This includes all of your apps from Power
Apps, as well as Dynamics 365 applications from Microsoft. You can search for apps, filter by environment, and pin
the apps you use most frequently to the top of the page.

Find apps via the AppSource organization gallery


Microsoft AppSource is now embedded in the Dynamics 365 home page and throughout the common navigation.
It now includes a private gallery of apps available to you within your company. Select Get more apps from the
home page or task pane, and navigate to the My Organization tab to see apps that are available to you.

Apps built with Power Apps and shared with a security group or the entire company with User permission will
appear here, instead of cluttering your home page by default. When you get an app from AppSource, it will then
appear on the home page and be easily accessible throughout the experience.
Use model-driven apps in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

A model-driven app has multiple components including dashboards, forms, views, charts, and business processes
that together help make the app easy to use. This section provides information on how to navigate around in a
model-driven app, work with records, import/export data, and automate processes using Power Automate.

IMPORTANT
Because canvas apps provide a lot of control over the user experience and can essentially be anything, there isn’t much help
documentation on how to use a canvas app. If you need help using a canvas app, contact your app maker or Power Apps
admin.

Related topics
Enhanced user experience with the Unified Interface
Basic navigation in a model-driven app
See also
Find and run apps
What is a model-driven app?
What is a canvas app?
Enhanced user experience with the Unified Interface
for model-driven apps
1/29/2020 • 2 minutes to read • Edit Online

The Unified Interface for model-driven apps provides a consistent and accessible user experience across devices—
whether on a desktop, laptop, tablet, or phone. The apps scale by reflowing the components on the screen. The
responsive design adapts to your environment based on screen size, so the more available space that you have, the
more information can be displayed.

For an overview of Unified Interface in model-driven apps, watch this video: Introduction to Unified Interface

NOTE
The legacy web client will be deprecated and customers must transition to Unified Interface before October 1, 2020. For
more information, see Blog: Announcing the timeline to move to Unified Interface. To learn more on how to transition, see
Quick start for transitioning.

Navigation
The menu options let you swiftly navigate the different apps in the system. They provide quick access to recently
viewed records and pinned favorites.
Legend:
1. App selector: Open this menu to move between apps.
2. Collapse/expand button: Select this to collapse the navigator to allow more room for the main part of the
page. If the navigator is already collapsed, select this button to expand it again.
3. Recent records: Expand this entry to view a list of records you were recently using. Select an record here to
open it. Select the push-pin icon next to a record listed here to added to your favorites (pinned records).
4. Favorite records: Expand this entry to view and open your favorite (pinned) records. Use the Recent records
list to add records here. Select the remove-pin icon next to a record listed here to remove it from this list.
5. Entity navigator: This area lists each entity and dashboard available for the current work area. Select any
entry here to open the named dashboard or list-view for that entity.
6. Work-area selector: Open this menu to move to another work area. The current work area is named here.
For more information, see Basic navigation in a model-driven app.

Dashboards and charts


You can access all the system and user dashboards from within your Unified Interface apps. The interactive
dashboards are now available for all record types with richer interactive dashboard capabilities. For more
information, see Track your progress with dashboards and charts.

Timeline control
The timeline view helps you collaborate with your team by tracking customer communication in a record on a
single page in an easy-to-read view. You can see everything from posts and voice attachments, to emails and
notes. It provides a quick way to see the entire communication thread. For more information, see Add an
appointment, email, phone call, notes or task activity to the timeline.

Business process
The business process flow has been improved by the docking mechanism. You can dock the business process
stage on your screen to help you stay focused on the task at hand in your business process flow. This is especially
useful when the stage of the process has complex steps to complete. For more information, see Work with
business processes.

Accessibility
The improved accessibility experience lets you use screen readers to translate on-screen information into audible
sound and print to a Braille reader so that more people can use the app. For more information, see Use a screen
reader.

Create a Unified Interface app


If you have requirements to create your own experience on Unified Interface, you can create a model-driven app
using the app designer. See Overview of building model-driven apps.

Unified Interface Community


Go to the Unified Interface Community site to get help with planning and executing a smooth transition to the
Unified Interface and engage with experts and peers on blogs, webinars, videos, events, and more.
Basic navigation in a model-driven app
3/12/2020 • 7 minutes to read • Edit Online

This introduction explains how to find and open an app, and how to work with its common user interface elements
including lists, forms, and business processes.

Navigating among apps, areas, and entities


A model-driven app is built out of applications (apps), areas, and entities.
Apps provide a collection of functionalities for accomplishing a specific class of activity, such as managing
your accounts and contacts. Use the app-selector menu to navigate between the apps that are available to
your organization.
A work area is a subdivision of an app, dedicated to a specific feature. Each work area provides a targeted
collection of entities for working in that area. In some cases, the same entity appears in more than one area
(or even more than one app). The Contact and Account entities, for example, appear in a variety of apps and
work areas. Use the work-area menu to navigate between work areas for your current app.
Entities represent a specific type of data, such as a contacts and accounts. Entities use a structured data
format, which defines the collection of fields available to the entity. Each entity consists of a collection of
individual records. For example, for the Contact entity, each record describes a single person, and each
record includes a collection of fields such as first name, last name, and email address. Entities normally
present two views: a list view, which is typically a table listing available records; and a form view, which
shows all available data and settings for a single record. Use the side navigator to move between entities in
your current work area.
Move between apps
Use the app-selector menu to switch between apps.

The apps you see listed in your app-selector menu will depend on which apps you have access to.
Move between entities, records, and work areas
It's easy to get around and get back to your favorite or most-used records. The following illustration shows the
primary navigation elements.
Legend:
1. App selector: Open this menu to move between apps.
2. Collapse/expand button: Select this to collapse the navigator to allow more room for the main part of the
page. If the navigator is already collapsed, select this button to expand it again.
3. Recent records: Expand this entry to view a list of records you were recently using. Select a record here to
open it. Select the push-pin icon next to a record listed here to add it to your favorites (pinned records).
4. Favorite records: Expand this entry to view and open your favorite (pinned) records. Use the Recent records
list to add records here. Select the remove-pin icon next to a record listed here to remove it from this list.
5. Entity navigator: This area lists each entity and dashboard available for the current work area. Select any
entry here to open the named dashboard or list view for that entity.
6. Work-area selector: Open this menu to move to another work area. The current work area is named here.

Working with list views


Usually, when you first open an entity, you'll see the list view, which shows a list of records belonging to that entity,
formatted as a table. For example, if you open the Accounts entity, you'll see a list of accounts.
Legend:
1. Select records: Select one or more records by placing a check mark in this column. Depending on where
you're working, you might be able to apply a single operation to all the selected records at once by using
buttons in the command bar.
2. Open a record: Select any record in the list to open its record view, which shows all the details about the
record. Usually you select from the Name column to open a record from the current entity. Some entities
provide links to records from related entities in other columns (such as a related contact).
3. Sort or filter the list: Select to sort the list by values in that column or filter the list by values in that column.
An arrow in the column heading indicates which column is being sorted and in which direction.
4. Command bar: Use the commands in the command bar to operate on records in the list and perform related
actions. Some commands (such as Delete) require that you first select one or more target records by placing a
check mark in the leftmost column, while others operate on the entire list. You can export the list to an Excel
workbook (possibly based on a template), open charts and dashboards, and more, depending on the type of
records you're working with.
5. Search the view: Enter text in the search field above the list to show only those records in the current view that
contain your text.
6. Filtering and paging: Select a letter to show only those records whose names start with that letter. If the list
contains more records than can be shown on one page, use the paging arrows at the bottom of the list to move
forward and backward through the pages.

Working with record views


Record views show all the details about a single record and sometimes also provide special features for working
with it. Usually you'll open a record view by selecting a record that appears in a list view, but you can also open a
record view by following a link from a related record.
Legend:
1. Tabs: Most record views are divided into tabs. Each tab provides a collection of related fields from the record.
When tabs are available, they're listed below the record name. Select any tab name to go to that tab. The
current tab is shown underlined.
2. Related: Nearly all types of records show a Related tab after you've saved them at least once. This tab is
actually a drop-down list that you can use to find other types of records that use or reference the displayed
record. When you choose an entity name from the Related drop-down list, a new tab named for that entity
opens, showing a list of all related records of that type. The Related tab remains available, and you can still use
it to find other types of records that reference the current one.
3. Command bar: Use the commands in the command bar to operate on the current record or perform a task
related to the record. The available commands vary based on the record type, but you can typically use the
command bar to save your changes, delete the record, refresh the page, email a link to the record, reassign the
record owner, or export the record by using a Word template.
4. Heading bar: Some record views display a few especially important fields in the heading bar, opposite the
record name. These are typically fields that are fundamental to working with records of the current type (such
as a the record name or record owner).
5. View and edit all field values: In the main body of the record view, you'll find all of the fields related to the
current tab, form view, and record type. Fields marked with a red asterisk are required, and you can't save the
record without their having valid values. Fields marked with a blue plus sign are especially important or
recommended, but aren't strictly required. Fields showing a lock icon are read-only and can't be edited.

Record set navigation


Navigate through multiple records by using preset views and queries. The record-focused navigation improves
productivity by allowing users to jump from record to record in the list and easily navigate back without losing
their working list.
Reference panel
The reference panel is a great way to get work done without moving away from the screen you're on. You can look
up other related items—such as cases or opportunities for an account—within the context of the record you're
viewing, without having to navigate to other screens.

Watch this video to learn more about the reference panel:

Notifications
There are three types of notifications that are shown on a form: informational, warning, and error. Notifications are
always available at the top of the form, just above the header.
When you select the error notification, it will take you to the field on the form where the error occurred.
Legend:
1. Info: The notification is informational.
2. Warn: The notification is a warning.
3. Error: The notification is an error.
Single notification
If there is only one notification, you'll see a single line.

Multiple notifications
If there are multiple notifications, you'll see the number of notifications. Select the chevron to view each message.
Use grid filters
2/7/2020 • 3 minutes to read • Edit Online

Grids in the Unified Interface have been improved to increase the amount of data you can see on your screen. Now
you can choose from many different filtering options for a column; the type of data in the column determines
which filter options are available. For example, the Full Name column in the Contacts grid has different filter
options than the Activity Type column in the Activities grid.

Grid and filter navigation


When you filter data on a grid, the main grid page remembers the filter, sort order, and the page state when you
navigate away and then return to the page. This works the same when data is filtered on quick find, column
filtering, page number, and more.
The page jump bar uses the first sorted field. If no change has been made to the sort order, the jump bar uses the
primary field.

When you select the hierarchy icon, you navigate to the hierarchy view.

You can also open primary field and lookup fields in a new tab or window.
Preview: New grid filters and search option
This section is for early-access features. You can opt in early to enable these features in your environment. This will
allow you to test these features and then adopt them across your environments. For information about how to
enable these features, see Opt in to 2020 release wave 1 updates.

NOTE
Don't change the default display format for time, number, currency, time, or date, because this causes an issue. For more
information, see Known issue.

Lookup field column


When you filter on a lookup column, you can select from a list of records to filter by rather than manually typing in
the data. For example, on a Primary Contact lookup column, you can select the contact name from the list of
records to filter by.

Date filter
The robust Date filter includes many different values to choose from, such as On to search by an exact date, or
Next X fiscal year or In fiscal period to search by year or quarter.

Filter the list of activities


You can filter the list of activities to see only the ones you're interested in. For example, you can further limit the
activities you are seeing in a view by using the activity type filter. The activity type filter allows you to filter activities
based on the type, such as email, task, phone call, and so on.

Known issue
If you change the default display format for number, currency, time, or date and then filter data on a grid, the filter
won't show your selected display format. The filters will still be displayed in the system default format, and in some
cases filtering might not work at all.
To fix the issue, set the display format for number, currency, time, and date back to the default setting.
1. In the upper-right corner, select the gear icon , and then select Personalization Settings.
2. On the Formats tab, change the number, currency, time, and date value back to the default setting.

We're working on this issue, please check back for information about the availability of a fix.
Use search on a grid
When you use the Search this view option on a grid page, the system searches for data in the view that you're
currently in. In the following example, you perform a search on the Contacts grid.
1. Go to the Contacts grid, and then select My Active Contacts from the list of views.

2. Select Search this view to search for data in the view you're in.
The system searches for data in the My Active Contacts view and displays search results by using the same set of
columns that are used in your current view.

Use the quick-find search experience


To switch back to the old quick-find search experience that uses an entity's quick-find view definition to perform
searches, you'll need admin permissions.
1. In the upper-right corner, select the gear icon , and then select Advanced Settings.
2. Go to Settings > Administration > System Settings.
3. On the General tab, under Set up Quick Find, select Yes for Use quick find view of an entity for
searching on grids and sub-grids.
11/18/2018 • 2 minutes to read • Edit Online

View your user profile


Your user profile displays useful information about you to your entire organization; for example, your contact
information, your organization, and your security role. Depending on your security role, you might be able to make
changes to your user profile.
1. In the upper-right corner of the screen, select Settings > Personalization Settings.
2. Scroll down to the very bottom of the Set Personal Options dialog box, and then choose View your user
information.
3. Select the different areas such as Summary, Details, or Administration to see details about your profile.
Find your administrator or support person
10/26/2019 • 2 minutes to read • Edit Online

You may occasionally run across issues that require consultation with your administrator. If you don’t know who
your administrator is, you can use Advanced Find to find your administrator.
1. Open your app.
2. On the command bar select the Advanced Find button.
3. On the Advanced Find page, in the Look for list, select Users.
4. Point to Select, and then select Security Roles from the list.
5. Under Fields, select Names.
6. Enter System Administrator in the box that says Enter Text. At this point, your screen should look like
this:

7. Choose the Results button on the ribbon.


You should see a list of one or more system administrators.
Set personal options
12/3/2019 • 5 minutes to read • Edit Online

Change your display settings in an app to suit your preferences. For example, you can choose the page that you
want to see as soon as you sign in to the app. You can also personalize many other options such as language,
currency, and time zone.

To set personal options


1. Select the Settings button in the upper-right corner of the screen.
2. Select Personalization Settings.
3. Fill in the information, as required.
4. When you’re done, select OK.

General tab options


OPTIONS DESCRIPTION

Select your home page and settings for Get Started


panes

Default Pane Select the default home pane (page) that you want to see
when you sign in. By default, the Default based on user role
option is selected, which shows the default pane based on the
app you are using.

Default Tab Select the default tab that you want to see for the selected
default pane. For example, select the Accounts tab for the
Service pane.

Set the number of records shown per page in any list of


records

Records Per Page Select the maximum number of records you want to see in a
list on a page. You can set a value from 25 to 250.

Select the default mode in Advanced Find

Advanced Find Mode By default, every time you open the Advanced Find Mode
dialog box, the query details are hidden. To see the query
details every time, select Detailed.

Set the time zone you are in

Time Zone Select the time zone that you want to display for your region.

Select a default currency


OPTIONS DESCRIPTION

Currency Choose the default currency value to use in financial


transactions. Select the Lookup button to search for a
currency.

Support high-contrast settings

Enable high contrast Select this check box to enable high-contrast levels in your
app display. Tip: Set this option if you are using high contrast
settings in your browser or operating system.

Set the default country/region code

Enable country/region code prefixing Select this check box to enable the default calling code for
your region.

Country/Region Code Prefix Enter the value of your region’s calling code in the text box.
For example, enter +1 for the United States.

View your user information Select this link to view details about you. These details are
displayed to your entire organization and include your contact
information and security role. For more information, View your
user profile.

Synchronization tab options


OPTIONS DESCRIPTION

Synchronize Dynamics 365 items with Outlook or


Exchange

filters Choose the records to synchronize between Dynamics 365


and Dynamics 365 for Outlook or Exchange (using server-side
synchronization).

synchronized fields View the fields that are synchronized between Dynamics 365
and Dynamics 365 for Outlook so you can see where the data
is coming from.

Manage your offline filters and take your information


offline in Dynamics 365 for Outlook

offline filters Choose a subset of Dynamics 365 data that you want to work
with when you go offline with Dynamics 365 for Outlook.

Activities tab options


OPTIONS DESCRIPTION

Default view

Default Calendar Select the default view for your calendar.


OPTIONS DESCRIPTION

Start Time Select your default work hours.

Formats tab options


OPTIONS DESCRIPTION

Current Formats

Customize Choose this option to add a new region and formats.

Format preview Shows the current region and its formats for Number,
Currency, Time, and Date.

Email Templates tab options


OPTIONS DESCRIPTION

Create and modify personal email templates

New Create an email template with custom values (such as a date


or signature), so you don’t have to enter the same
information, repeatedly, when you send an email.

On the command bar, select New and enter values for the
template.

Email Signatures tab options


OPTIONS DESCRIPTION

Create and modify personal email signatures

New Create an email signature to save time and be consistent in


your responses. The owner of an email signature can be a user
or a team.

On the command bar, select New and enter values for the
signature.

Email tab options


OPTIONS DESCRIPTION

Select if other users can send emails for you

Allow other users to send email on your behalf. Select this option to allow other users of Dynamics 365 to
send email on your behalf. Caution: If you select this option,
other users can send email on your behalf with or without
your consent. Your email name will appear as the sender.
OPTIONS DESCRIPTION

Select the email messages to track in Dynamics 365

Track Select the email messages that you want to automatically


track in Dynamics 365.

Options:

- All Email messages


- Email messages in response to Dynamics 365 email
- Email messages from Dynamics 365 Leads, Contacts and
Accounts
- Email messages from Dynamics 365 records that are email
enabled

Configure Folder Tracking Rules Set up folders to automatically track incoming email.

Automatically create records in Dynamics 365

Create Select this option to allow Dynamics 365 to create leads or


contacts automatically from the information in tracked email
messages.

Show emails as conversation on Timeline Select this to list emails in a conversation thread, the way
many email applications work when viewing emails in a
conversation.

View your Mailbox Select this link to see your mailbox details.

Privacy tab options


NOTE
This tab isn’t available if your system administrator has selected the privacy preference for the entire organization in System
Settings. Talk to your administrator.

OPTIONS DESCRIPTION

Select your error notification preference

Options: Specify what you want Dynamics 365 to do when an error


occurs. Based on your selection, the error reports are shared
- Ask me for permission to send an error report to Microsoft. with and used by Microsoft for product improvements.
- Automatically send report to Microsoft without asking me
for permission. We recommend that you send the error reports to Microsoft
- Never send an error report to Microsoft about Dynamics so that Microsoft can use the information for product
365. improvements.

Languages tab options


OPTIONS DESCRIPTION

Select the language you prefer to see Dynamics 365


displayed in

Base Language Shows the base language. The base language is set during the
Dynamics 365 installation process. You can’t edit this option.

User Interface Language Select the language that you want to see for labels and dialog
boxes in the Dynamics 365 user interface.

Help Language Select the language for Help. To add an additional language
other than the base language, your admin must install the
required language packs and enable them. Talk to your
administrator.
Use a screen reader
11/4/2019 • 5 minutes to read • Edit Online

Screen readers make model-driven apps accessible to people who have low or no vision or might need extra
support for a temporary scenario, such as eye fatigue. Commonly used screen readers such as Narrator, JAWS,
and NVDA are supported.
Learn more about working with Microsoft Narrator
Learn more about working with JAWS
Learn more about working with NVDA

Basic tasks using a screen reader


Open an app
1. On the navigation bar, use the Tab key to move to the app drop-down control and press Enter to open the site
map.
2. Press the Tab key until you hear the name of the application you want to open—for example, “Sales.” Press
Enter to open the app.
Use scan mode in Narrator
You can use scan mode to quickly navigate apps using the arrow keys and common keyboard shortcuts. Quickly
jump to headings, links, landmarks, form fields, controls, and tables in this mode. Turn scan mode on and off by
pressing Caps lock+Spacebar. More information: Using scan mode
Find your way around the app
Navigation bar
When you open an app, a vertical bar with subarea icons is displayed on the left. You can either use the Tab key to
move through these icons until you hear the name of the subarea you want, such as “Accounts,” or you can use the
site map control. For example, press the Tab key until you hear “Accounts” and then press Enter to open the
Accounts view.
Grids
Screen readers navigate grids more reliably and consistently, and announce row and column headings, as well as
the position within the grid. When you first open a grid, the default tab stop is the view selector.
Whenever you enter a cell within the grid from outside of the grid, Narrator announces the name of the table, the
row and column counts, and the position of your cursor within the table.
If your cursor is within the table header, quickly navigate between headers by using the Tab key or Shift+Tab.
Narrator will announce the name of each header as you enter the header cell. It also announces the type of cell (for
example, “column header”), the location of the column (for example, “column 1 of 6”), and whether the column is
sorted or selected. If you press Enter in a table header, it will sort the table by that column. Narrator announces the
sort order, and you can press Enter again to change the order.
When you move out of the last column in the table, the cursor moves to the second row of the grid, and from this
point, you must use the Up and Down arrow keys to navigate between the non-header cells. If you instead press
the Tab key again, your cursor will move to the next interactive element, typically the table filter list. When moving
between non-header row cells, Narrator announces the column name, the location of the column, and text within
the cell.
Forms
Multiple navigation modes are available for navigating a form using Narrator, with the most common modes
being landmarks, headings, and form fields. To change the navigation mode, press Caps lock+Up arrow. Hold the
Caps lock key down while pressing the Up arrow key to cycle through the modes until you hear the mode you
want to use. Then use Caps lock + the Left/Right arrow keys to navigate through the various items. For example, if
you want to go to the Last Name field in the Contact Information section of a contact, do the following:
1. Press and hold the Caps lock key and press the Up arrow key until you hear “Landmarks.”
2. Press and hold the Caps lock key and press the Right arrow key until you hear “Contact information.”
3. Change the mode by pressing and holding the Caps lock key and pressing the Up arrow key until you hear
“Form Fields.”
4. Navigate to the Last Name field by using Caps lock + the Left/Right arrow keys until you hear “Last Name.”
Narrator also announces the control type, value, state, and any special instructions for the field.
You can also use the Tab key to quickly navigate to interactive elements on the form. Some form fields have an icon
that will perform the default action when you press Ctrl+Enter. For example, an email form field might have an
envelope icon that opens an email editor.
Dashboards/charts
You can navigate through the dashboard charts using the Tab key and Caps lock + arrow keys. Press the Tab key
to quickly go to the interactive elements and use Caps lock + an arrow key for navigation of non-interactive
elements, such as headings, landmarks, and items.

NOTE
You must have the latest Windows 10 Update installed to have all of the accessibility features available for charts.

Interactive dashboard streams


You can use the Tab key or Shift+Tab keys to move between interactive dashboard streams, such as found in the
Accounts dashboard, or just change the navigation mode until you hear “Headings” and then use the Tab key to
quickly move between dashboard streams.
To navigate through each element of a dashboard stream, use the Up/Down arrow keys. Narrator will read the
type of control and the title of the control.
Business process flows
You can navigate a business process flow, such as the one found at the top of the Lead form, by pressing the Tab
key to move forward, and Shift+Tab to move backward between the entities. Use the Enter key on the Move to
the Left or Move to the Right buttons to display additional entities in the process flow. Narrator reads the entity
type, stage, status, title, element number out of total elements, and whether it is currently selected.
Dialog boxes
When a dialog box opens, Narrator announces the title. For dialog boxes with input fields, the Close button has the
default focus, allowing you to close the dialog box by pressing Enter. For dialog boxes that require user action, the
focus is on the primary action button, such as Delete or OK.
You can navigate through the controls by using the Tab key. The cursor will loop through each element in the
dialog box, and you can press Esc to close it.
Use keyboard shortcuts in Power Apps
3/10/2020 • 7 minutes to read • Edit Online

Keyboard shortcuts give you an alternate way to do common tasks instead of using your mouse or tapping with
your finger. They help in seamless navigation of the interface. The following keyboard shortcuts apply across apps.

NOTE
The keyboard shortcuts described here refer to the United States keyboard layout. Keys on other keyboard layouts might not
correspond exactly to the keys on a US keyboard.

Form shortcuts
TASK UNIFIED INTERFACE

Complete the command for the active option or button Enter

Cancel a command, or close a selected list or dialog box Esc

Save Ctrl+S

Save and Close N/A

Cancel edits and close (Close) Esc

Delete the record (when forms are in edit mode) N/A

Save and then open a new form (Save and New) (when forms N/A
are in edit mode)

Open the lookup menu with the most recently used items in Down arrow
alphabetical order

Open a lookup drop-down list Enter

Close a lookup drop-down list Esc

Open a record found in lookup with forms in edit mode Enter

Add an article to an email N/A

Apply an email template (when editing an email message) N/A

Form navigation shortcuts


TASK UNIFIED INTERFACE

Move to the next option, option group, or field Tab


TASK UNIFIED INTERFACE

Move to the previous option, option group, or field Shift+Tab

Move between options in an open list, or between options in a Arrow keys


group of options

Go to the Command Bar N/A

Go to the landmark section of a page Ctrl+[

Editable grids (views)


If your administrator has enabled editable grids (views), you can edit data directly in a grid (view ). The following
table lists the keyboard shortcuts:

TASK UNIFIED INTERFACE

When the focus is on a column header, sort by column Enter key

When the focus is on a column header, open filter dialog Spacebar

When the focus is on the cells, move to the next field Right arrow (→) key

When the focus is on the cells, move to the previous field Left arrow (←) key

When the focus is on the column header, move to the next Tab
column header

When the focus is on the column header, move to the Shift+Tab


previous column header

Move to the cell above Up arrow (↑) key

Move to the cell below Down arrow (↓) key Or Enter, when cell is not in edit mode

Go to edit mode for Text, Number, and Simple fields when the Type the value directly to overwrite the existing value Or
focus is on a field Spacebar to continue modifying the existing value Or F2 to
select the existing value

Go to edit mode for Date and Time fields Type the value directly Or F4 or Alt+↓ to display the date/time
picker

Go to edit mode for drop-down (Lookup, Option Set) fields Spacebar to open the list

Go to edit mode for Two Options fields Spacebar to switch between the two options Or F4 Or Alt+↓
to open the list

Move between entries in an open drop-down list Up/Down (↑/↓) Arrow keys

Select an option in an open drop-down list Enter

Close an open drop-down list Esc


TASK UNIFIED INTERFACE

Cancel your edits Esc

Navigate to and open the lookup record Enter when the focus is on (→) icon

Move to the next page (if any) Page down key

Move to the previous page (if any) Page up key

Move to the column header when the focus is in the grid Shift+Tab

Move to the Save button when the focus is on the column Tab
header (if any unsaved data)

Move to the Refresh button when the focus is on the column Tab
header

Interactive dashboard shortcuts


Interactive dashboards enable new functionality, such as filtering, sorting, and quick actions.

TASK UNIFIED INTERFACE

Activate a dashboard element (simulate left-click) Enter Or Spacebar

Move to the next element Tab

Move to the previous element Shift+Tab

Move to the next item within a dashboard element Down (↓) arrow key

Move to the previous item within a dashboard element Up (↑) arrow key

Close a menu Escape

Select a check box or radio button Spacebar

Modify the date range filter Ctrl+Alt+D

Show the visual filter pane Ctrl+Alt+V

Move to the global command bar Ctrl+Alt+A

Global filter shortcuts


TASK UNIFIED INTERFACE

Open a menu Enter Or Spacebar Or Down (↓) arrow key

Activate a button Enter Or Spacebar


TASK UNIFIED INTERFACE

Move to the next element Tab

Move to the previous element Shift+Tab

Open a tree view control Right (→) arrow key

Close a tree view control Left (←) arrow key

Move to the next tree view node Up (↑) arrow key

Move to the previous tree view node Down (↓) arrow key

Move to the first tree view node Home

Move to the last tree view node End

Perform the default action for the tree view node Enter

Remove a filter Delete

Dashboard stream control shortcuts


TASK UNIFIED INTERFACE

Move to the first command on the active dashboard stream's Ctrl+Alt+Q


command bar

Move to the next element Tab

Move to the previous element Shift+Tab

Activate a button Enter Or Spacebar

Activate the Sort by field button and open flyout Enter Or Spacebar Or Down (↓) arrow key

Move to the next item Down (↓) arrow key

Move to the previous item Up (↑) arrow key

Move to the first item Home

Move to the last item End

Move to the next stream Ctrl+F6

Move to the previous stream Ctrl+Shift+F6

Close a menu Escape

Change the state of a check box Spacebar


Common controls
Chart shortcuts
TASK UNIFIED INTERFACE

Move to the first element in a chart Tab

Move to the next data point Right (→) arrow key OR Down (↓) arrow key

Move to the previous data point Left (←) arrow key OR Up (↑) arrow key

Move to the See More button in a Tag chart Tab

Move back from the See More button to the tags in a Tag Shift+Tab
chart

Filter the dashboard when the focus is on a data point in an Enter Or Spacebar
interactive dashboard

Date -Time control shortcuts


TASK UNIFIED INTERFACE

Open the date picker flyout Enter Or Spacebar Or Down (↓) arrow key

Activate the option and close the flyout Enter Or Spacebar

Move to the next item Down (↓) arrow key

Move to the previous item Up (↑) arrow key

Move to the first item Home

Move to the last item End

Close the date picker flyout Escape

Move to the next element Tab

Move to the previous element Shift+Tab

Select the calendar Enter Or Spacebar

Activate a button Enter Or Spacebar

Search results shortcuts


TASK UNIFIED INTERFACE

Move to the next search result Up (↑) arrow key

Move to the previous search result Down (↓) arrow key


TASK UNIFIED INTERFACE

Move to the list of available views Right (→) arrow key

Move from the list of available views to search results Left (←) arrow key

Navigate between buttons Tab

Navigating submenus
If you use a screen reader, follow these steps to access any of the submenus that are displayed when you hover the
mouse over a navigation link.
1. Navigate between the menu options using standard link navigation.
2. Activate the link by selecting Enter or the space key as you usually would. A list of submenus will be displayed.
3. To access these submenu options, use the assistive technology (AT) shortcut key to navigate to the next button.
For example, if you use the NVDA screen reader, you would use the “b” shortcut key (NVDA+b). To navigate
through all the options, select the key repeatedly.

IMPORTANT
Several areas in the user interface (UI) have auto-collapse built in for menus. This includes the Navigation Bar and Form
Navigation. Both expand when selected, but after 30 seconds of inactivity, the items collapse.

Navigating through stages of a process


If you’re in a record—for example, a lead—this section shows you the keyboard shortcuts to navigate through the
different stages in the sales process to qualify the lead, and how to make selections in those stages. For example, if
you want to move easily from the Qualify stage through to the Close stage, try these keyboard actions:
After you select a stage, get to the fields by selecting the Down (↓) arrow.
If a stage is collapsed, select Enter to expand it.

NOTE
The process name is an icon at the bottom of the page, not the top.

Keyboard shortcuts in Windows: If you are using the Windows operating system, select the following link
and choose the version number from the drop-down list. You can view all the shortcuts that are applicable to
a Windows environment. See Windows keyboard shortcuts.
Keyboard shortcuts in Mac: If you are using a Mac operating system, select the following link to view all
the shortcuts that are applicable to a Mac environment. See Mac keyboard shortcuts.
Create a new record
2/6/2020 • 2 minutes to read • Edit Online

Create a new record using the + option on the command bar


The Create a new record command or Quick create makes it fast and easy to enter almost any type of
information into the system. The command is on the nav bar, so it’s available whenever you need to enter new
information into the system. You can also save a record and create a new one directly from the Quick create form.

NOTE
The Quick create option is only available for records that are enabled by your admin.

1. On the navigation bar, select the plus sign , and then select the item you want.

2. Fill in the fields, and then select Save and Close. Or, to save and create another record, select the down
arrow and then select Save & Create New.
NOTE
An asterisk next to the field on the screen means the field is required. If you select Save and Close before entering
required fields an error message will be displayed or if you have entered information and select Cancel a warning will be
displayed.
A plus sign next to the field on the screen means your organization recommends that you fill in the field.

Create a new record using the New button


1. From the left navigation pane, select a record type. For example, select Contacts to create a new contact
record.
2. On the command bar, select +New.

3. Fill in the appropriate details for new contact and then select Save and Close.
NOTE
If you have unsaved changes and try to go to another record or form, a Unsaved changes dialog box will pop-up. If
you select Save and continue, it will attempt to save your information and open the page you wanted to go to. If
you choose to save and continue and there is an error on a field, the dialog will close and you will remain on the page
to fix the error before you can navigate away.

Preview: Use the Save or Save & Close option when editing a record
Use the Save or Save & Close button on command bar when you edit an existing record. Before this release, the
Save option was only available on the bottom right corner.

NOTE
This is an early access feature. You can opt in early to enable this feature in your environment, which will allow you to test
these features and then adopt them across your environments. For information on how to enable these features, see Opt in
to 2020 release wave 1 updates.

1. From the left navigation pane, select the record type that you want to edit. For example, select Accounts.
2. Open the account record that you want to edit and make your changes to the record.
3. To save your changes, on the command bar, select Save or Save & Close. The Save option is still available
on the bottom right corner.
Add an appointment, email, phone call, note, or task
activity to the timeline
3/10/2020 • 6 minutes to read • Edit Online

Add Activities in the Timeline wall to keep track of all your communications with a customer or contact. For
example, you can take notes, add posts, add a task, send email, add phone call details, or set up appointments. The
system automatically timestamps every activity and shows who created it. You and other people on your team can
scroll through the activities to see the history as you work with a customer.
Activities that you add from within a record appear in the Timeline wall of the record.
If the Regarding field of an activity is set, the activity appears in the record it is associated with.
You can also choose the filter pane to filter the activities by record type and date.
When a new activity is created, you will get a What you missed notification in the Timeline wall.
An email with an attached image will be shown inline with the body of the email.

Legend:
1. Search Records
2. Take notes
3. Add info and activities
4. Filter
5. More commands
6. Activity status
7. Activity icons
8. Date and time

Add an activity from the nav bar


The fastest way to add an activity is to use the shortcut on the nav bar and then link it to a record. For example,
you can create a phone call activity and then link it to a contact in the system using the Regarding field.

1. On the top nav bar, select New > Activities > choose the type of activity you want to add.

2. Fill in the required information. Use the Regarding field to associate the activity with a record.
3. When you're done, select Save and Close or Save & Create New.

Add an activity from within a record


You can also open a record and then add an activity to the record.

Add a phone call


1. Open the record that you want to add the activity to. For example, open a contact record.

2. In the Timeline section, select Add info and activities > Phone Call.
3. Fill in the Subject of the call.
In the Description area, provide a summary of the conversation with the customer.
The Call To field is automatically populated with the record you added the phone call activity to. You can
select a different record if needed.
4. By default, the direction is set to Outgoing. You can change it to Incoming by selecting Outgoing.
5. When you're done filling in the form, select Save and Close to save the phone call activity.
Add a task
1. Open the record that you want to add the activity to. For example, open a contact record.

2. In the Timeline section, select Add info and activities > Task.
3. The Owner field is set to the current user by default. If you want to reassign the task, select the lookup icon,
and then select another user or team.
4. When you're done filling in the task information, select Save and Close to save .
Add an email
To add an email activity to a record, you must first save the record you are adding the activity to.
1. Open the record that you want to add the activity to. For example, open a contact record.

2. In the Timeline section, select Add info and activities > Email.
3. Fill in the subject of the email and use the space provided to write the email.
4. To add an attachment to the email, save the email. Then, on the command bar select Attach File > Choose
File and then select the file that you want to attach to the email.

NOTE
An email with an attached image will be shown inline with the body of the email.

5. To use a template for the email body, on the command bar, select Insert Template, and then select the
template. For more information on inserting an email template, see Insert an email template.
6. When you're done composing in the email, on the command bar select Send.
List emails in a conversation view
1. To list emails in a conversation view, go to Settings > Personalization Settings.
2. on the Email tab and select Show email as a conversation on Timeline. For more information on
personal settings, see Set personal options. Once enabled, you can open any form that has a timeline and
your emails will be grouped into conversation threads with the latest email at the top.

Add an appointment
To add an appointment activity to a record, you must first save the record you are adding the appointment activity
to.

NOTE
Recurring appointments are not supported on the Dynamics 365 App for Outlook, Dynamics 365 for phones app, and when
you run the model-driven apps web client on your mobile phone web browser.

1. Open the record that you want to add the activity to. For example, open a contact record.

2. In the Timeline section, select Add info and activities > Appointment.
3. Fill in the Subject of the appointment and set the Start Time and End Time.
4. When you're done filling in the appointment details, select Save and Close to save the appointment.
Add notes
You can also easily add notes in the activities area.
1. Open the record that you want to add the activity to. For example, open a contact record.
2. In the Timeline section, select the Enter a note area.
3. Add a title for the note and add the notes details.
4. To add attachments to the note select Add an attachment.
5. When you done, select Add Note to save it.

NOTE
You can also add a note by selecting Add info and activities > Note.

Edit or delete a note


To edit or delete the note once it has been created, select the note and then select Edit this note or Delete
note.

Add a post
1. Open the record that you want to add a post to. For example, open a contact record.

2. In the Timeline section, select Add info and activities > Post.
3. Enter details of the post in the text field.
4. When you're done, select Add to save the post.
Once you save the post, it will appear at the top of the timeline wall.

Refresh the Timeline


You can refresh the timeline wall to see the most up to date information.
In the Timeline section, select and then select Refresh Timeline.

Use the filter pane


Quickly filter activities, notes or posts in the timeline wall by record type or activity type and date using the filter
pane. You can select multiple filters and filter options at the same time. You can filter and see activity due date,
modified date, or by the status of the activity.
In the Timeline section, select Open Filter Pane and select how you want to filter the activities.

NOTE
When you zoom out in the browser, the filter pane and the timeline records are displayed in two columns. When the timeline
is displayed on more than one column, the filter pane is displayed as a column alongside the timeline records. To learn more,
see Filter pane appears in two column mode.
Manage Activities
Manage activities directly from the timeline wall including assigning an activity to another person, deleting or
closing an activity, add an activity to a queue, opening an associated record or editing notes and posts.
See also
Set up timeline control
FAQs for timeline control
FAQs about Activities and the Timeline Wall
Timeline section in the Customer Service Hub app
Frequently Asked Questions about Activities and the
Timeline Wall
2/3/2020 • 2 minutes to read • Edit Online

Is a title required when adding a new note?


No. When adding a note to an activity, the title field is marked as a mandatory field but is not required. This is a
known issue in the legacy Web Client.

For an appointment, when I choose the option to Save as Draft it


doesn't show that the appointment has been saved as a draft.
When you save an appointment in the legacy Web Client as a draft the title does not display [DRAFT] to indicate
that the appointment has been saved as a draft.

Can I add activities to read only records?


Yes. You can add activities to entities that are read only such as, notes, phone calls, tasks, and more.

Are HTML tags supported in Notes?


No. When creating a note activity for any record or entity, HTML tags are not supported. For example, if you add
<TAG> </TAG> to a note field it will be displayed as <TAG_XXX="XX"> </TAG> .

How can I improve performance on timeline wall?


Timeline Wall performance can be improved by optimizing how much data is returned by a specific entity record.
1. Configure entity forms to only show activities that are in use. This can be done at the form level to only show
useful activities. For example, if you don’t use tasks for cases you can configure the timeline wall on the case
form to not show tasks.
2. Reduce the number of default records that are shown by the timeline wall. By default, it is set to return 10,
beyond 10 it can cause performance issues. It is recommended to not exceed the default.

Activity Wall is not supported in Print Preview.


When you select the Print Preview option in Dynamics 365 the Timeline Wall will not show in the available list.
You will see Notes but it will not show tasks or emails.

Why I can't see other users activities and records in the My activities
stream in the dashboard?
My activities stream in the dashboard shows the records and activities that are owned by you (user). For example,
user A see records and activities that are owned by A, and user B see records and activities that are owned by B.

See also
Set up timeline control
FAQs for timeline control
Add an appointment, email, phone call, note, or task activity to the timeline
Timeline section in the Customer Service Hub app
Preview: View and create email through the Activities
grid
3/14/2020 • 2 minutes to read • Edit Online

View and create email through the Activities grid is an early-access feature. You can opt in early to enable these
features in your environment. This will allow you to test these features and then adopt them across your
environments. For information on how to enable these features, see Opt in to 2020 release wave 1 updates.
Dynamics 365 model-driven apps let you interact with customers through email. The email functionality allows you
to:
View and respond to emails.
Utilize common email toolbar functionality and rich text editor controls.
View and insert images inline using drag-and-drop or copy-and-paste functionality.
Create email in a pop-up window.
Preview templates before applying them.

View your email


To view your email:
1. In the model-driven app's sitemap, select Activities.
2. Select the All Activities drop-down, and then select My Received Emails.

3. Select the email you want to view to open it. The email will open, where you can then reply to the sender
and recipients or forward it.
Create email
The following steps detail how to create an email.
1. In the model-driven app's sitemap, select Activities.
2. On the command bar, select Email. A new email window opens.

The From field is automatically populated based on the currently logged-in user.
3. Write your email directly in the composer or select Insert Template to search for and apply a template. For
more information on inserting an email template, see Insert an email template.
4. To compose your email in a full-screen window, select the expand icon.

The message box has a rich text editor that enables you to create rich and well-formatted content for the
emails with emphasis. The editor brings common word processor features like:
Copy formatting
Font and size
Bold, italic, and underline
Background color for text and text color
Bulleted and numbered list
Decrease and increase indent
Block quote
Text alignment (align left, center, and right)
Link and unlink
Text strikethrough
Image
Text direction from right to left and left to right
Undo and redo
Remove format
Table

5. When you're done, select Send.


See also
Set up enhanced email
Insert an email template
Preview: Send email using the enhanced email
experience
2/15/2020 • 2 minutes to read • Edit Online

Send email using the enhanced email experience is an early-access feature. You can opt in early to enable these
features in your environment. This will allow you to test these features and then adopt them across your
environments. For information on how to enable these features, see Opt in to 2020 release wave 1 updates.
The enhanced email experience in model-driven apps allows you to compose an email without leaving the record
that you’re working on. With the enhanced email experience, you can:
Navigate to different pages without losing the email content.
Minimize the email window to get back to the records you were working on.
Expand the email editor pop-up window to see more email options.
Simultaneously open three email compose pop-up windows.
Search for and apply a predefined template to an email you're composing.
Insert attachments to email.

IMPORTANT
System administrators must enable the enhanced email experience before you can use it.
Preview features aren’t meant for production use and may have restricted functionality. These features are available
before an official release so that customers can get early access and provide feedback.
We expect changes to this feature, so you shouldn’t use it in production. Use it only in test and development
environments.
Microsoft doesn't provide support for this preview feature. Microsoft Dynamics 365 Technical Support won’t be able
to help you with issues or questions. Preview features aren't meant for production use and are subject to a separate
supplemental terms of use.

Compose an email using the enhanced experience:


1. In the Timeline section of records such as account or contact, select + and then under Activities, select
Email.
A new email pop-up window opens.
The From and To fields are automatically populated based on the user and the account and contact of the
original record.
2. Write your email from scratch or select Insert Template to search for and apply a template. For more
information on inserting an email template, see Insert an email template.
3. Select Attach file if you want to add attachments.
4. Select Insert signature to search for and add your signature.
5. When you're done, select Send.

IMPORTANT
The enhanced email experience is available only for email activities created from the Timeline section of a model-driven
app.
The enhanced email pop-up window opens only when the height and width of your screen size is at least 400 x 650 pixels
or greater. If lower, you will be taken to the standard form instead of the enhanced email experience.

See also
Set up enhanced email
Insert an email template
Preview: Insert an email template
2/6/2020 • 2 minutes to read • Edit Online

Insert an email template is an early-access feature. You can opt in early to enable these features in your
environment. This will allow you to test these features and then adopt them across your environments. For
information on how to enable these features, see Opt in to 2020 release wave 1 updates.
You can use an email template—a preformatted email message—to quickly create and send email messages. You
can insert the template while composing an email by selecting Insert Template on the command bar. The list of
available templates is displayed in the Email templates window. In the Recently used section, the four most
recently used templates by you are displayed. The All templates section displays a list of all out-of-the-box email
templates (global and entity specific), in alphabetical order. Global templates are shown as the type User. If you've
created a custom email template, it will also be available here. For information about creating a custom email
template, see Create templates for email.
You can see templates of a particular language by selecting a language from the Language list. You can either
search for a template or browse through the list and select it. When you select an email template, a preview is
displayed on the right side of the window. The preview shows you the content so you can pick the template that
best meets your needs. After inserting an email template, you can modify the content as needed, and then send
the email.

NOTE
The search does not support regular expressions and it works on the template name only.

To insert an email template


1. In the email editor, select Insert Template on the command bar.

The Email templates window opens.


2. To see templates of a different locale, select a language from the Language list. The templates are loaded
as per the selected language.
3. Browse for the template you want. Select the template, and preview the content of the template.
4. Optionally, you can select the down arrow on the name of the template to see a description of its content.
5. Select Apply template to insert the content in the email.

If you try to insert an email template on a device with smaller screen size, you'll only see an option to search and
select a template.
See also
Set up enhanced email
Compose and send email using the enhanced email experience
Use the lookup field on a record
3/4/2020 • 3 minutes to read • Edit Online

Lookup helps you to choose records from a related entity. When you select a related entity and enter search
criteria, such as a name or email address, lookup automatically begins to resolve the partial text and displays any
matching records. If no records are displayed after you have typed the full text of your search criteria, a message is
displayed specifying that there are no records.
For example, you might search for the name Adrian Dumitrascu. When you type ad, possible matching records
are automatically populated and displayed.

NOTE
An administrator can define the criteria that lookup uses for resolving partial search text.

Also, you can create a new record by selecting the New button. You must have sufficient permissions to view the
New button and create a record. When you select the lookup field, the five most recently used records are
displayed along with five favorite records. Which records are displayed depends on your view history and the
favorites you’ve pinned.
For example, if you have only three records in your history, lookup will display those three, along with seven of
your favorite records. If you have not pinned any favorites, only the most recently viewed records will be displayed.

Types of lookups
Lookups are classified into the following:
Simple lookup: Select a single record in a field from a single entity.
PartyList-type fields: Use to select multiple records from multiple entities in a lookup. Use partylist-type
fields to select multiple records. This allows you to add each record by performing a new search, multiple
times. Every time you select a record, you will be able to perform a new search for another record.
Regarding-type fields: Use to select a single record from multiple entities in a lookup.

Search in a lookup field


To search a lookup, select the textbox and type your search criteria. If recent records are enabled for your lookup,
your recent records will be displayed when you select the textbox.

NOTE
The default search result for lookup search is, begins with. This means results include records that begin with a specific word.
For example, if you want to search for Alpine Ski House, type alp in the search box; if you type ski, the record will not show
up in the search result.
For a wildcard search use asterisks: For example, type *ski or *ski*.

Browse in a lookup field


To browse a lookup, select the lookup icon (magnifying glass). A full list of items will be shown in the dropdown.

Most recently used record type images


The most recently used list of records shows an image to help distinguish between record types.
NOTE
Recent records are not filtered by search term or selected view.

Record type selection list


When results span multiple record types, you can see how many types of records there are and select them from
the list.

Create a new record if you don’t find an existing record


If you do not find a record, select New in the lookup area to create a new record.
Replace an existing record from a lookup field
You can replace an existing record while using simple and regarding-type lookups. Search for a record. Then select
the record, and replace it with a new record.
Change a view in a lookup field
Selecting Change View lets you determine:
How you want to view records such as Contacts Being Followed, Contacts Lookup View, or Active
Contacts.
What you want to view in the records, such as name, email, or telephone number. For example, if you want
to view only the contacts that you follow, select Change View > Contacts being followed. Only the
contacts that you are following will be displayed, as illustrated here.

IMPORTANT
The Change View option will not be visible if your administrator hasn't configured the option to appear in your views.

Choose from multiple records


When lookup has more records in a field than can fit in the available display area, the display area is collapsed—
that is, the records that do fit the display area are shown next to the number of records that are not shown. To view
all records, select the number. The following images show the difference between collapsed and non-collapsed
fields.
Collapsed:

Non-collapsed:
View the profile card for a contact or user
11/4/2019 • 2 minutes to read • Edit Online

Use the profile card to get quick information about a contact or user. When you select a contact or user field in
model-driven apps in Dynamics 365, such as Dynamics 365 Sales and Dynamics 365 Customer Service, you can
find information related to them on their profile card. For more information about profile cards, see Profile cards in
Office 365.

NOTE
Profile card is available for the Contact and User entity. For information, see Enable the profile card (for admins).
The profile card in Common Data Service is not displayed if multi-factor authentication is turned on for Office Delve
service in Azure Active Directory.

View a contact's profile


1. Go to Activities.
2. Select an existing activity or create a new one.
3. Hover over the Call To field when it has a contact record.
You can view details of the contact inline which includes the contact picture, name, title and account.
4. To view more details, select Show more to expand the contact's profile.

View a user's profile


1. Go to Accounts.
2. Select an account record.
3. Hover over the owner field when it has a user record. You can view the details of the user inline.
4. To view more details like emails and shared files with the user, select Show more to expand the contact's
profile.

FAQs
Where can I see profile cards in Dynamics 365?
Profile cards can be seen on contact and user records. You can only view them when they are in a lookup.
Where is information shown in the profile card coming from?
The information shown on the contact profile card is fetched from Common Data Service (and not Microsoft
Exchange). This means the contact details are coming from Dynamics 365.
The information shown on the user profile card is fetched from Office 365 (Azure Active Directory). For more
information, see Profile cards in Office 365 (admin section).
How can I customize the fields shown on the profile card?
Currently, the list of fields displayed on the profile card are not open for customization.
Why is the Start chat option on the profile card disabled (greyed out)?
The Start chat and the Send Email options on the profile card will open your default instant message and email
apps. The Start chat option is enabled if the person you are trying to contact in the same Azure Active Directory
environment as you or is a federated contact.
Assign or share records
1/29/2020 • 2 minutes to read • Edit Online

If you would like another person in your organization to handle a customer record, you can assign the record to
that person. You can also assign a record to a team, or to yourself.
Use the Share option if you want to keep ownership of the record but let someone else work on it with you.
1. From the left navigation pane, select a record type. For example, Contacts.
2. From the list of records, select the record that you want to reassign.
3. On the command bar, select Assign.

NOTE
If you want to keep ownership of the record but let someone else work with it, select Share. Then use the tooltips to
guide you through the Share option.

4. In the assign dialog box, in the Assign to area, choose Me or User or Team.

If you select User or Team, in the Look for Records box, enter the name of the user or team. If you need to
create a new record, select + New.
5. When you're done, select Assign.

Use advanced find to reassign records


Use advanced find to search for records and then reassign them to someone else. For more information on
advanced find, see Create, edit, or save an Advanced Find search.
1. On the command bar, select Advanced Find.

2. From the list of records, select the records that you want to reassign and then select the assign option.

Reassign all records (for admins)


A admin can reassign all record for a user from the admin Setting area.
1. Go to Settings > Security.
2. Select Users and select a user name to open the user's profile.
3. On the command bar, select REASSIGN RECORDS.

4. On the Reassign Records dialog box choose how to want to reassign all the records and then select OK.

NOTE
The Reassign Records option will reassign all records regardless of their status. Inactive and active records will be reassigned
to the other user or team. This will also deactivate all activated processes including business rules and workflows when the
record is reassigned to another user or team. The new owner must active the processes which must be used.
Share records using Access Team
2/20/2019 • 2 minutes to read • Edit Online

Access Team grant access to records via sharing records. Access Team members have privileges defined by their
individual security roles and by roles from the teams they are members of.

NOTE
Before you can share records using Access Team, your admin will need to set-up an Access Team template. For more
information, see About team templates.

1. To give a user permission to access a record, from the site map, select the record type. For example, Accounts.
2. From the list of records, open the record that you want to provide another user access to.

3. In the Access Team Members section, select More Commands (… ) > Add User.

4. In the search box type in the user name to find the user and then select Add.

Remove a user from Access Teams


You can easily remove a user’s access to a record just as easily add you added them.
1. Open the record that you want to remove the user from.
2. Under Access Team Members sub-grid, select Remove user.
Add a connection role to link records to each other
10/9/2019 • 2 minutes to read • Edit Online

Connections enable you to easily associate users, contacts, quotes, sales orders, and many other entity records with
each other. The records in the association can be assigned particular roles that help define the purpose of the
relationship.
It's a quick way to create multiple connections and roles for a particular record. For example, a contact may have
many relationships with other contacts, accounts, or contracts. In each relationship a contact may play a different
role.
Connection roles are directly associated to a connection. To use a connection role, you must first add a connection
to your record.
Before you can add connection roles, it needs to be enabled by your admin. For more information see, Configure
connection roles.
1. To add or manage connections, select the record you want to manage like an opportunity.
2. Select the Related tab and then select Connection. This will open the connection grid with the list of
connections for the record.

3. Select Connect and then choose To Another or To Me.


4. On the Name field, enter or find the name of the record for the connection.
5. On the As this Role field select the lookup icon and then choose New Connection Role. Or, use the search
to find an existing role that you want to associate to the connection and then select Save.

NOTE
If you have entered information before creating a new connection role, a warning dialog will be displayed asking if you
would like to cancel and continue working on the connection or to go ahead and leave the current record you are
working on.

6. To create a new connection role, on the New Connection Role screen enter a name and then choose a
Connection Role Category.
7. When you are done, select Save & Close.

Manage Connection Roles


To manage a connection role, select the connection role from a connection entity. This will open the connection role
entity record. You can edit the name, select a connection role category, and add a description.

You can also manage the connection role types that you want associate to the connection role.
1. Open the connection role and then select Manage Record Type on the command.
2. This will open a list of connection role types that you can add or remove for this connection role.
Deactivate or activate an account or contact
12/3/2019 • 2 minutes to read • Edit Online

In a model-driven app, you can deactivate an account or contact rather than deleting it. This ensures the integrity of
the audit trail associated with that record.
A deactivated account or contact becomes inactive, which means it cannot be edited or used in establishing new
relationships with other records. However, all relationships created with the deactivated item are still available.
If later you need to reactivate a deactivated account, it's easy to do so.

Deactivate an account or contact


1. From the menu on the left, go to Accounts or Contacts.
2. Select the active account or contact that you want to deactivate, on the command bar select Deactivate, and
then confirm the deactivation.

Activate an account or contact


1. From the menu on the left, go to Accounts or Contacts.
2. Go to the System Views list.
3. Select Inactive Accounts or Inactive Contacts.
4. Select the inactive accounts or contacts you want to activate.
5. Select Activate, and then confirm the activation.
Track your progress with dashboards and charts
12/3/2019 • 2 minutes to read • Edit Online

Dashboards take a collection of app data and provide insights to show key performance indicators (KPI) and other
important data in easy-to-read interactive charts and graphs. Dashboards are available for all record types.

To see a different dashboard layout, select the down arrow next to the name of the dashboard, and then
select the layout you want.
To choose a default dashboard, display the dashboard you want, and then select Set as Default at the top
of the screen.

Create a new dashboard


1. To create a new dashboard, select Create a Dynamics 365 Dashboard.
2. Choose a dashboard layout and select Create.

3. Type in a name for the dashboard.


4. Add what you want to each area of your dashboard. For example, let's add a chart.

5. Select the Record Type for the chart.


6. Select a View that the data in the chart will display.
7. Choose the chart and then select Add.
8. Continue adding components to the dashboard and when you are done, select Save.
The dashboard that you created will appear in the drop-down menu of available dashboards.
Use charts
Charts provide you with a quick view of how you’re tracking to your goals. They’re also interactive, so you can click
or tap an area of a chart to get more info.
Hover your mouse over the chart to see a tooltip that provides quick information about that area of the
chart.
Click on the area of a chart to see a grid view with more details about the data in the chart.
To expand a chart, select the Expand Chart button.
To view records in the chart or refresh the chart, select and then choose an action: Refresh or View
Records.

Change the chart view


Changing the chart view shows you a different breakdown of your data, such as opportunities opened within a
specific time period. You can change a chart view by selecting the View selector on the Grid page.
For example, choose "All Opportunities," then select a different view, and both chart and grid will get refreshed.
Known issues
In the chart designer, adding a order by on certain calculated fields are not supported and will cause an error. The
calculated fields causing this are using another calculated fields, a related entity field, or a local field on the entity.
Add or edit Power BI visualizations on your
dashboard
12/16/2019 • 3 minutes to read • Edit Online

Create rich, interactive reports and real-time visualizations with Power BI dashboards and tiles that you add to your
personal dashboards.

NOTE
To add Power BI visualizations to personal dashboards in your model-driven app, you must:
Enable Power BI visualizations for your organization in Settings > Administration > System Settings > Reporting tab
> Allow Power BI visualization embedding.
Have a Power BI account and have access to at least one Power BI dashboard.
Avoid adding Power BI visualizations to system dashboards; it's not supported.

Create a personal Power BI dashboard


Follow these steps to add a Power BI dashboard to your model-driven app. If you are connecting to the Power BI
service, you need an account and to have selected your Common Data Service instance as a data source. For more
information about registering and connecting data sources, see Microsoft Power BI.
1. Open your app and go to Dashboards.
2. Select New and then select Power BI Dashboard.

3. In the Power BI Dashboard Properties dialog select the workspace and then select the Power BI
dashboard that you want to embed in your dashboard. Select Enable for mobile if you want to make the
dashboard available for Dynamics 365 for tablets and Dynamics 365 for phones.
4. Select Save to save your dashboard.

Embed Power BI tiles on your personal dashboard


Follow these steps to add one or more Power BI tiles to your personal dashboard. If you are connecting to the
Power BI service, you need an account and to have selected your Common Data Service instance as a data source.
For more information about registering and connecting data sources, see Microsoft Power BI.
1. Open your app and go to Dashboards.
2. Select an existing personal dashboard or select New to create one.
3. On the dashboard, select an area where you want the tile to appear, and then select Power BI Tile on the
toolbar.

4. In the Power BI Tile dialog, select the workspace and then select the Power BI tile that you want to display
on your dashboard. Select Enable for mobile if you want to make the tile available for Dynamics 365 for
tablets and Dynamics 365 for phones.
Select another area of the dashboard and repeat this step to add another Power BI tile, or other component,
such as a chart or list, to your dashboard.
5. Select Save to save your dashboard.
Things you can do with Power BI embedded tiles in personal dashboards
To show the features available with a Power BI visualization, hover over the upper-right of the visualization to
reveal the following capabilities.
1. Select the Refresh button to refresh the tile’s underlying report data.

2. Select the Open in Power BI button to open the Power BI dashboard that contains the visualization in
a new browser tab.

3. Select the Enlarge button to expand the visualization and increase the viewing area for the
visualization, like the Sales Pipeline tile displayed here.

Share a personal dashboard that contains Power BI visualizations


To share your personal dashboard that contains Power BI visualizations you must configure sharing in both
Common Data Service and Power BI, and the user or group must have the same credentials and appropriate level
of access in both services. To share your personal dashboard in your app go to, Dashboards. In the list of
dashboards, select the personal dashboard you want, and then select SHARE DASHBOARD. For more
information about sharing a dashboard in Power BI, see Power BI: Share a dashboard with colleagues and others.

Privacy notice
By enabling the embedding of Power BI tiles and dashboards, when a user embeds a Power BI tile or dashboard,
that user’s Azure Active Directory authorization token for Common Data Service is used to authenticate with the
Power BI service with an implicit grant, providing a seamless “single-sign on” experience for the end user.
An administrator can disable embedding of Power BI tiles and dashboards at any time to stop use of the Dynamics
365 authorization token for authenticating with Power BI service. Any existing tiles or dashboards will stop
rendering for the end user.
The Azure component or service that is involved with embedding of Power BI tiles is detailed in the following
section.
Note: For more information about additional Azure service offerings, see the Microsoft Azure Trust Center.
Azure Active Directory
This service provides the authentication token exchanged with Power BI service for API and UI authentication.
Use OneDrive for Business
3/3/2020 • 2 minutes to read • Edit Online

Create and manage private documents from within Common Data Service apps by using OneDrive for Business.
More information: What is OneDrive for Business?
Before you can use OneDrive for Business, it must be enabled by your system administrator. More information:
Find your administrator or support person
Enable OneDrive for Business

The first time you view your documents


1. Open a record and go to the Document Associated Grid view. For example, open a contact record.
2. On the open record, select the Related tab, and then select Documents.

3. Select Document Location > OneDrive.

4. After OneDrive for Business is enabled, you'll see the following dialog box when you go to the Documents
tab to view documents in Common Data Service and upload a file to OneDrive, or when you attempt to
create a new document or folder.
5. Select Change folder location to pick a new location to store OneDrive documents, or select Continue to
accept the default folder location.

View existing OneDrive documents


1. Open a record and go to the Document Associated Grid view. For example, open a contact record.
2. On the open record, select the Related tab, and then select Documents.

3. Select Document Location to filter the document list.

4. Select a location as described in the following table.

DOCUMENT LOCATION DESCRIPTION

OneDrive Documents stored in OneDrive for Business


DOCUMENT LOCATION DESCRIPTION

Documents on Default Site Documents stored in your default SharePoint site

Shared with me Documents that others shared with you that are associated
with this record

All Locations All document locations associated with this record

5. After you select a location, you'll see the documents saved in that location.

Create a new document and save it to OneDrive


1. Open a record and go to the Document Associated Grid view. For example, open a contact record.
2. On the open record, select the Related tab, and then select Documents.

3. Select Document Location, and change the location to OneDrive.


4. Select New, and then choose a document type such as PowerPoint or Word.

5. Enter a document name, and then select Save.

Things to consider
Be aware of the following regarding OneDrive for Business in Common Data Service:
OneDrive storage folders are created in the user's current Common Data Service language. If the language
changes, new folders will be created in the new language. Old folders will remain in the previous language.
There might be a delay between when the documents are shared in OneDrive and when they're available to
other users.
Take notes by using OneNote
3/3/2020 • 2 minutes to read • Edit Online

Use OneNote to take or review notes, ideas, plans, and research from the Document Associated Grid view of a
record in Common Data Service.
Before you can use OneNote, it must be enabled by your system administrator. More information:
Find your administrator or support person
Set up OneNote integration

Start a new OneNote notebook


1. Open a record and go to the Document Associated Grid view. For example, open a contact record.
2. On the open record, select the Related tab, and then select Documents.

3. Select Document Location, and select the location where you want to save the notebook. For more
information, see View existing OneDrive documents.
4. Select New, and then select OneNote.

5. Enter a name for the notebook, and then select Save. A new notebook is created and opened.
Open an existing OneNote notebook
1. Open a record and go to the Document Associated Grid view. For example, open a contact record.
2. On the open record, select the Related tab, and then select Documents.

3. Select Document Location, and select the location of your notebook. For example, choose OneDrive if
your notebook is stored on OneDrive. More information: View existing OneDrive documents
4. Select your notebook to start adding notes.
Collaborate using SharePoint
3/3/2020 • 3 minutes to read • Edit Online

With Common Data Service, you can store your documents on SharePoint and manage them from within your
app. The documents that you create in your app are stored on SharePoint, and are automatically synced to your
desktop and mobile devices.
Before you can use SharePoint to store documents, it must be enabled by your system administrator. More
information:
Find your administrator or support person
Manage your documents using SharePoint

Where do you access the documents from?


1. For record types that support document management, open the record, select the Related tab, and then
select Documents.

2. Select Document Location > Documents on Default Site 1. When SharePoint is enabled, the location is
set to Documents on Default Site 1 by default.

Create a new document and save it to SharePoint


1. Open a record and go to the Document Associated Grid view. For example, open a contact record.
2. On the open record, select the Related tab, and then select Documents.

3. Select Document Location, and change the location to Documents on Default Site 1.
4. Select New, and then choose a document type such as Word, Excel, or PowerPoint.

5. Enter a document name, and then select Save.

Create a new folder in the default SharePoint site location


1. Open a record and go to the Document Associated Grid view. For example, open a contact record.
2. On the open record, select the Related tab, and then select Documents.

3. Select Document Location, and change the location to Documents on Default Site 1.
4. Select New, and then choose Folder.

5. Enter a folder name, and then select Save.

Upload an existing document to SharePoint from your app


1. Go to the record you want to create the document for, select the Related tab, and then select Documents.
2. Select Upload.

3. Choose the file you want to upload. You can choose only one file at a time.
The document is created in the current document location you're in.

NOTE
You can upload a file of up to 50 MB. If your internet connection is slow, you might get an error while uploading large
files.

4. If files with the same name exist in SharePoint, select whether you want to overwrite the files.
5. Select OK.

Manage SharePoint locations


You can create new or edit existing SharePoint locations from your app in Common Data Service.
Edit a location
1. Open a record, select the Related tab, and then select Documents.
2. Select Edit Location, and then select a SharePoint site location.
The Edit Location dialog box appears.

3. The display name, parent site, and folder name are automatically populated. Enter details about the new
location, and then select Save.
Add a new location
1. Open a record, select the Related tab, and then select Documents.
2. Select Add Location.
The Add Location dialog box appears.

3. The display name, parent site, and folder name are automatically populated. Change the details if required,
and then select Save.

Files tab FAQ


Why was the location to access documents moved?
We moved the command to make documents easier to find with fewer clicks.
Has the Documents tab gone away?
No, it hasn’t gone away. Users can still access the documents associated with the record in question the old way,
simply by selecting the Related menu and then the Documents link.
With the change, will subfolders in SharePoint still be created automatically?
Yes. The behavior is similar to that of the Documents link under the Related menu. When a user selects the
Files tab for the first time, the corresponding SharePoint subfolder is created by the system.
Is there a way to add the Files tab to other entities, or remove it?
Yes. To add or remove the Files tab, follow the steps in this article: Add the SharePoint documents tab to the
main form for an entity
Compare search options in Common Data Service
1/28/2020 • 2 minutes to read • Edit Online

There are three ways to search records in Common Data Service:


Relevance Search
Quick Find (single-entity or multi-entity)
Advanced Find

NOTE
Multi-entity Quick Find is also called Categorized Search.

The following table provides a brief comparison of the three options.

FUNCTIONALITY RELEVANCE SEARCH QUICK FIND ADVANCED FIND

Enabled by default? No. An administrator must Yes Yes


manually enable it.

Single-entity search scope Not available in an entity Available in an entity grid. Available in an entity grid.
grid. You can filter the search
results by an entity on the
results page.

Multi-entity search scope There is no maximum limit Searches up to 10 entities, Multi-entity search not
on the number of entities grouped by an entity. available.
you can search. Note: While
there is no maximum limit
on the number of entities
you can search, the Record
Type filter shows data for
only 10 entities.

Search behavior Finds matches to any word Finds matches to all words in Query builder where you can
in the search term in any the search term in one field define search criteria for the
field in the entity. in an entity; however, the selected record type. Can
words can be matched in also be used to prepare data
any order in the field. for export to Office Excel so
that you analyze,
summarize,or aggregate
data, or create PivotTables to
view your data from different
perspectives.

Searchable fields Text fields like Single Line of All searchable fields. All searchable fields.
Text, Multiple Lines of Text,
Lookups, and Option Sets.
Doesn't support searching in
fields of Numeric or Date
data type.
FUNCTIONALITY RELEVANCE SEARCH QUICK FIND ADVANCED FIND

Search results Returns the search results in For single-entity, returns the Returns search results of the
order of their relevance, in a search results in an entity selected record type with the
single list. grid. For multi-entity, returns columns you have specified,
the search results grouped in the sort order you have
by categories, such as configured.
accounts, contacts, or leads.

Wildcards (*) Trailing wildcard supported Leading wildcard supported. Not supported.
for word completion. Trailing wildcard added by
default.
Using relevance search to search for records
2/1/2020 • 7 minutes to read • Edit Online

What is relevance search?


Relevance search delivers fast and comprehensive results across multiple entities, in a single list, sorted by
relevance. It uses a dedicated search service external to Common Data Service (powered by Azure) to boost search
performance.
Relevance search brings the following enhancements and benefits:
Improves performance by using external indexing and Azure search technology.
Finds matches to any word in the search term in any field in the entity, compared to quick find where all
words from the search term must be found in one field.
Finds matches that include inflectional words like stream, streaming, or streamed.
Returns results from all searchable entities in a single list sorted by relevance, so the better the match, the
higher the result appears in the list. A match has a higher relevancy if more words from the search term are
found in close proximity to each other. The smaller the amount of text where the search words are found, the
higher the relevancy. For example, if you find the search words in a company name and address, it might be
a better match than finding the same words in a long article, far apart from each other.
Highlights matches in the results list. When a search term matches a term in a record, the term appears as
bold and italicized text in your search results.

NOTE
Certain words that are very commonly used in a language (like the or a) are ignored during search, because they
don't help uniquely identify records. Because they're ignored during search, these words are also not highlighted
in results.
Highlighted terms are often returned as a portion of the full value in a field because only the matched terms are
highlighted.

Includes search results for text in a document that's stored in Common Data Service, including text in notes,
email attachments, or appointments. The following file formats are supported for search: PDF, Microsoft
Office documents, HTML, XML, ZIP, EML, plain text, and JSON.
Enables you to search for records that are shared with you and records that you own.

NOTE
Hierarchical security models aren't supported. Even if you see a row in Common Data Service because you have
access to it through hierarchical security, you won't see the result in relevance search.

Lets you also search for option sets and lookups. For example, let's say you want to find a retail store
account that has Pharmaceuticals in the name. When you search for Pharmaceutical Retail, you'll find
the result because there's a match to the Industry field, which is a searchable option set.
NOTE
Relevance search is text-based, and can search only on fields of type Single Line of Text, Multiple Lines of Text,
Option Sets, or Lookups. It doesn't support searching in fields of Numeric or Date data type.

Allows you to use syntax in your search term to get the results you want. For example, type car silver 2-
door to include matches for any word in the search term in the search results. Type car+silver+2-door to
find only matches that include all three words. Type car|silver|2-door to get results that contain car or
silver or 2-door, or all three words. For more information about syntax you can use in your search queries,
see Simple query syntax in Azure Cognitive Search.

NOTE
Relevance search is configured to require matches to any (instead of all) of the criteria in a query, which might bring
about results that are different from your expectations. This is especially true when Boolean operators are included in
the query.

Enable relevance search


Relevance search is disabled by default. Your administrator needs to enable it for the organization, thus allowing all
users in the organization to use it. After relevance search is enabled, you might have to wait up to an hour or more,
depending on the size of your organization, before you start seeing relevance search results for your apps. Smaller
changes in indexed data can take up to 15 minutes to show up in your system.

Switch between relevance search and categorized search


If your organization has turned on both search options (relevance search and categorized search), you can switch
between the two.
1. To switch between search types, on the navigation bar, select Search.
2. On the left, select the drop-down menu to switch between Relevance Search or Categorized Search.

Set a default search experience


If your organization has turned on both search options, you can select a default search experience in your personal
settings.
1. In the upper-right corner of the page, select Settings, and then select Personalization Settings.
2. On the General tab, in the Select the default search experience section, for the Default Search
Experience, select your default experience.

Start a search
1. From the top nav bar, select Search.

2. Enter your search words in the search box, and then select Search.

Filter records with facets


With Common Data Service, you can now refine your search results by using facets and filters. Facets and filters let
you drill into and explore the results of your current search without having to repeatedly refine your search terms.
Facets are available in the leftmost pane. Immediately after you perform a search, the following global facets are
available for four common fields:
Record Type
Owner
Created On
Modified On
Record Type facets
To narrow your search results to a specific entity, select the entity under the Record Type section.

When you filter on a specific record type, you can include activities and notes that are related to the selected record
in your search results. To do that, select the Related Notes & Activities check box. The activities and notes will
appear in top-level results.

Search results that are found in email attachments or appointment entities are shown in the search results under
their parent record, either Email or Appointment.
When you refine by record type, the facet scope switches to the selected entity, and up to four facets that are
specific to the entity are shown. For example, if you select the Account entity, you'll see the Primary Contact facet
in addition to the global facets.
In the Set Personal Options dialog box, you can also choose other facets from the ones that your system
administrator or customer has made available to you. The user setting overrides the default setting. More
information: Configure facets and filters for the search
Text-based facets
All lookups, option sets, and record types are text-based facets. For example, the text-based facet Owner consists of
a list of field values and their corresponding counts.

Filters in these facets are sorted in descending order by count. The top four facet values are displayed by default.
When there are more than four facet values, you'll see a SHOW MORE link that you can select to expand the list
and see up to fifteen top facet values. Select each value to filter the search results to show only records where the
field has the value you've selected. For example, if you select Jim Glynn, the search results will show all records
where the owner is Jim Glynn. When you select a lookup or option set facet value, search results are filtered to
only include records with the value that you specified.
Date and Time facets
Like other facets, you can use date and time facets to filter and see search results for a specific time. To select a
range of values, drag the slider or select one of the vertical columns.

Configure facets and filters


NOTE
A system customizer can set the default experience for all entities, but you can configure your own facets and filters.

1. In the upper-right corner, select Settings, and then select Personalization Settings.

2. On the General tab, in the Select the default search experience section, for the Facets and Filters field,
select Configure.

3. In the Configure Facets and Filters dialog box, specify the facets you'd like to see for an entity. Your
system administrator or customizer can set a default experience for all entities, but you can set your own
here.
In the Select Entity drop-down list, select an entity you want to configure facets for. This drop-down
list contains only the entities that are enabled for relevance search.
For the selected entity, select up to four facet fields. By default, the first four "facet-able" fields in the
Quick Find view for the selected entity are selected in the list. At any time, you can only have four
fields selected as facets.
You can update multiple entities at one time. When you select OK, the changes for all entities that you've
configured are saved. To revert to the default behavior for an entity that you previously configured, select
Default.
NOTE
If a system customizer deletes a field or makes it no longer searchable, and you've saved a facet for that field, it
will no longer show up as a facet.
You'll only see the fields that exist in the default solution and that are configured as searchable by your
system customizer.
Using quick find to search for records
2/1/2020 • 2 minutes to read • Edit Online

Single-entity quick find


Single-entity quick find is used to find records of only one type. This search option is available from within a view.

Multiple-entity quick find (categorized search)


Multiple-entity quick find is also known as categorized search.
1. To start a categorized search, from the top nav bar, select Search.

2. Type your search words in the search box, and then select Search. Categorized search returns results
grouped by entity types, such as accounts or contacts.

With categorized search, you can search for records that begin with a specific word or use a wildcard character.
Begins with: Results include records that begin with a specific word. For example, if you want to search for
"Alpine Ski House," type alp in the search box; if you type ski, the record won't show up.
Wildcard: For example, *ski or *ski*.
NOTE
Using a wildcard at the beginning of your quick find (single or multiple-entity) search query might result in slower
performance.

Filter categorized search results


To filter results by a record type, choose a record type from the Filter with list.

To search all record types, choose None from the Filter with list.
Create, edit, or save an Advanced Find search
1/28/2020 • 2 minutes to read • Edit Online

Find the records you want in your app by using the Advanced Find search option. You can also use Advanced Find
to prepare data for export to Office Excel so that you analyze, summarize, or aggregate data, or create PivotTables
to view your data from different perspectives.
1. On the command bar, click the Advanced Find button.
2. Specify what to search for.
a. In the Look for list, select a record type.
b. Click Select to define search criteria: field (for example, Account Name or City), the query relational
operator (part of an expression such as "is equal to" or "contains" that defines how a specified
attribute should be compared with a value.), and the values to locate (for example, "Seattle" or
"Email").
You can select fields from the current record type, or from related records. For example, an account
might have many related contact records.
At the bottom of the Select list, the Related section shows related record types. For example, most
record types have a related Notes record type. To select fields from a related record type, select field
and a new Select link appears.
3. Specify the columns to include in the search results.
a. Select Edit Columns, and then select Add Columns.
b. Select the record type that includes the columns you want to add.
c. Select the columns you want to add, and then select OK.
4. Specify the sort order.
a. Select Edit Columns.
b. Select Configure Sorting.
c. Specify the column to sort on, specify the sort order, and then select OK.
d. Select OK.
5. Select Results.
Import data
12/3/2019 • 2 minutes to read • Edit Online

Whether your data is stored in a spreadsheet, on your phone, or in an email program, here’s how to import the
data to your app. For example, you might want to import your customer contact list from an Excel spreadsheet into
the app so you can keep track of all your customer information in one place.

Step 1: Get your import file ready


First, export your data into an Excel file. These file formats are supported:
Excel workbook (.xlsx)
Comma-separated values (.csv)
The maximum file size allowed for .zip files is 32 MB. For the other file formats, the maximum file size allowed is 8
MB.
Export data from an email program
1. Export your data into a comma-separated values file (.csv).
To find specific steps to export contacts from your email program, open the program’s Help, and search for
“export.” Look for topics that include “exporting contacts” or “exporting your address book” or “export
wizard” in the title.
2. Save the file in a location where you can easily find it later.
Export data from a spreadsheet
1. Open the spreadsheet.
2. If necessary, edit any column name in the spreadsheet to exactly match the corresponding name shown
here.

WARNING
If the spreadsheet doesn’t include all the column names listed, that’s OK. However, if a column name does exist, it
must match exactly with the corresponding name in the list or the import won’t work. Spaces are required. Note that
the word “Email” doesn’t contain a hyphen.

COLUMN NAME IN SPREADSHEET (SPELLING MUST MATCH EXACTLY)

First Name

Middle Name

Last Name

Business Phone

Mobile Phone
COLUMN NAME IN SPREADSHEET (SPELLING MUST MATCH EXACTLY)

Job Title

Business Street

Business City

Business State

Business Postal Code

Business Country/Region

Email Address

3. Save the file.


Export data from your phone
Use a USB cable or an app to export your data such as contacts from your phone to your computer.
To find specific steps to export contacts for your brand of phone, search for “export contacts from my phone” in
your favorite search engine (like Bing).
To find an app, search your phone’s online store.

Step 2: Import the file


1. On the command bar, select Import from Excel or Import from CSV.

2. Browse to the folder where you saved the file that contains the export of your contacts. Select the file, select
Open, and then select Next.

TIP
You can import only one file at a time. To bring in more files, run the wizard again later.

3. Review the file name and verify that the field and data delimiters are correct using the Review Mapping
option. If everything looks good, select Finish Import.

Step 3: Check that the import is successful


After the wizard finishes, check your data (for example, list of contacts) to make sure they imported correctly.
1. From the main menu, go to Contacts.
2. Scroll through the contact list. Check that each person is listed and verify the contents of the fields for
accuracy.
Import double-byte characters
If you are importing data that includes double-byte characters for east asian languages, make sure the file is
encoded as UTF -8 BOM. Plain UTF -8 may not be enough.
1. Open the CSV file using Visual Studio Code.
2. In the bottom bar, click the label UTF-8 (pop-up opens).
3. Select Save with encoding.
You can now pick UTF -8 BOM encoding for that file.
Export your data to Excel Online
11/18/2018 • 2 minutes to read • Edit Online

You can quickly do an ad-hoc analysis of your data that is in your app by exporting the data from the app to Excel
Online.
When you make changes to your data in Excel Online, you can save the updated information in the app. Remember
to keep the existing format of the Excel cells to prevent problems during import. Any information added to the
spreadsheet, such as graphs, charts, or colors, will not be saved.

Prerequisites
This feature requires that you have an Office 365 subscription or a subscription to an online service such as
SharePoint Online or Exchange Online.
You need a Microsoft account.

Open app data in Excel Online


The option to open data in Excel Online isn’t available in all record types. If you don’t see the option, it’s not
available for that record.

NOTE
Updated data in an app won’t immediately be reflected in Excel Online if the same view was opened in the last two minutes in
Excel Online. After that time frame, any updated data should show in Excel Online.

To open a list of records in an app, on the command bar select the Export to Excel menu and then select Open in
Excel Online.

Save your data and import it back to the app


1. Once you are done making any changes, select Save.

NOTE
The data for ad-hoc analysis with Excel Online is stored temporarily. Any additions, such as charts, calculations,
and columns, won’t be saved back to the app from the ad-hoc analysis in Excel Online.
The file import might fail if you make a lot of changes. If you need to make a lot of changes to your data and
import it back to the app, it’s recommended that you export the worksheet in Excel instead.
By design, you can’t do a File > Save As in Excel Online. If you do, you’ll get a Can’t Save Workbook error
message.
2. On the Data Submitted for Import dialog box, select Close.
Export data to Excel
12/2/2019 • 2 minutes to read • Edit Online

Do you need to analyze your data from and convert that data into actionable items that help you drive more sales?
Now you can do this when you export your data to Excel or Excel Online. Also, analyzing large datasets is not a
problem because you can export up to 100,000 rows of data.
You can choose to export static worksheets or dynamic worksheets, which you can import back in to the app. If you
need more advanced functions, you can export a dynamic PivotTable, which makes it very easy to organize and
summarize data.
You can export data to a standard Excel file that you can use on any device such as your phone, tablet, or desktop
computer. The data is exported in the same format that you see in the app. Text will remain text, numbers will
remain numbers, and dates will remain dates. However, when you export data from the app to Excel, some cell
formats might change. The following table summarizes how you’ll see the data in apps and how the cell format
changes when you export the data to Excel.

Cell format when data is exported from model-driven apps


DATA FORMAT IN MODEL-DRIVEN APPS CELL FORMAT IN EXCEL

Text, Ticker Symbol, Phone, Options set, and Look Up Shows as Text and option set becomes drop-down list

Email, URL Shows as General

Number Shows as Number without group separator

Currency Shows as Number and does not include dollar sign ($)

Date only, Date and Time Shows as Date only

Calculated and Roll-up fields Editable in Excel but can’t be imported back to Power Apps

Secured fields Editable in Excel but can’t be imported back to Power Apps

See which type of export works best for you


TASK LEARN MORE

Do an ad-hoc or what if analysis without modifying app data. Export to Excel Online
Or, quick bulk edit to multiple records.

Get a snapshot of the data at the current data and time or Export to an Excel static worksheet
you want to share it with others.

Get the most up-to-date information and be able to refresh it Export to an Excel dynamic worksheet
in Excel and match what you see in the app at any time.

View app data in a pivot table. Export to an Excel PivotTable


When you export data in Excel (.xlsx format) and then add or modify columns, you can’t import the data back into
Dynamics 365. This is not supported for the .xlsx file format.
If you’re using Excel 2010, you might get this error message when you export data from the Accounts area:
The file is corrupt and cannot be opened.

The error message occurs due to a setting in Excel. To fix the issue, do this:
1. Open Excel 2010.
2. Go to File > Options.
3. Go to Trust Center > Trust Center settings.
4. Select Protected view and then clear the check boxes for the first two options.
5. Select OK and then close the Options dialog box.
Export to an Excel dynamic worksheet
12/3/2019 • 2 minutes to read • Edit Online

Export your app data to an Office Excel worksheet so users can have the latest information. Imagine the CEO of
your company getting the critical information they need without having to navigate in an app, but instead merely
opening the Excel link on their desktop. You can export up to 100,000 records at a time.

Export data to an Excel dynamic worksheet


You can’t export data to a dynamic worksheet in Excel for all record types. If you don’t see the option, it’s not
available for that record.
1. Open a list of records in the app and select the arrow to the right of Export to Excel.
2. Select Dynamic Worksheet.
3. In the Select Columns for Dynamic Excel dialog box, select the column settings and then select Export.
4. Select Save and then save the .xlsx file. Make note of the location where you saved the file.

NOTE
If you’re going to edit the data file later, it’s recommended that you save the file before you open it. Otherwise, you
might get this error message: Excel cannot open or save any more documents because there is not enough
available memory or disk space.
To fix the issue:
1. Open Excel and go to File > Options > Trust Center Settings Center Settings > Protected View.
2. In Protected View, clear all three items.
3. Select OK > OK.
We still strongly recommend that you save and then open the data file rather than disabling protected view, which
might put your computer at risk.

5. Open Excel and then open the .xlsx file you saved in the previous step.
6. If you see the security warning External Data Connections have been disabled, select Enable Content.
7. To refresh data in the file, on the Data tab, select Refresh from Power Apps.

NOTE
If you have a phone number that starts with + or – (for example +1-123-456-7890), when you refresh the dynamic
worksheet, the phone number field will not display the number correctly.
To avoid the issue, use a space or parentheses (), like this: +1 123-456-7890 or +1 (123)-456-7890.

Tips
You can email a dynamic Excel file or store it as a shared file if the recipients are in the same domain as you.
When recipients open the dynamic file, they’ll see data they have permission to view in the app, so the data
they see may be different from what you see.
Some system views, such as Accounts: No Campaign Activities in Last 3 Months, can be exported only to a
static Excel worksheet.
In Power Apps, currency values are exported to Excel as numbers. To format the data as currency after you
have completed the export, see the Excel Help topic titled “Display numbers as currency."
The date and time values that you see in the app show up only as Date when you export the file to Excel, but
the cell actually shows both the date and time.
If you’re going to make changes and import the data file back into the app, remember that secured,
calculated, and composite fields (such as Full Name) are read-only and can’t be imported into the app. You’ll
be able to edit these fields in Excel, but when you import the data back into the app, these fields will not be
updated. If you want to update these fields, such as a contact’s name, then it’s recommended that you use
that view to export your data, update it in Excel, and import it back to the app for changes.
Export to an Excel static worksheet
11/18/2018 • 2 minutes to read • Edit Online

When you want to present information about the data in your app to an individual who doesn’t have access to the
app, or you have data that doesn’t change often, consider exporting the app data to an Office Excel static
worksheet.
You can export up to 100,000 records at a time. By default, a model-driven app lists up to 50 records per page.
Choose the Page arrows at the bottom of the list to view any additional pages.

Export data to an Excel static worksheet


You may have the option to export data to an Excel static worksheet in all record types. However, in some cases the
format might be legacy, or the data might not be filtered by what you see in the app.
1. Open a list of records in the app, select the arrow to the right of Export to Excel, and then choose Static
worksheet (Page only).
2. By default, an exported worksheet includes the fields that are displayed in the list, using the same field order,
sorting, and field widths. To make changes to the columns in an Advanced Find View, choose Edit
Columns.
3. Choose Save and then save the .xlsx file. Make note of the location where you saved the file.

NOTE
If you’re going to edit the data file later, it’s recommended that you save the file before you open it. Otherwise, you
might get this error message: Excel cannot open or save any more documents because there is not enough
available memory or disk space.
To fix the issue do this:
1. Open Excel and go to File > Options > Trust Center > Settings Center Settings > Protected View.
2. In Protected View, clear all three items.
3. Select OK > OK.
We still strongly recommend that you save and then open the data file rather than disabling protected view, which
might put your computer at risk.

4. Open Excel and then open the .xlsx file you saved in the previous step.
By default, an exported worksheet includes the fields that are displayed in the list, using the same field order,
sorting, and field widths.

Tips
You can email a static exported worksheet to anyone or store it in a shared file. Anyone who opens the file
will see all the data in the file.
You can’t change the columns for a system view, such as All Active Accounts. You must either customize
the view, which requires the System Administrator or System Customizer security role, or use Advanced
Find to create your own view based on the current view.
In model-driven apps, currency values are exported to Excel as numbers. Ater you have completed the
export, see the Excel Help topic “Display numbers as currency" to format the data as currency.
The date and time values that you see in the app show up only as Date when you export the file to Excel, but
the cell actually shows both the date and time.
If you’re going to make changes and import the data file back into the app, remember that secured,
calculated, and composite fields (such as Full Name) are read-only and can’t be imported into the app. You’ll
be able to edit these fields in Excel but when you import the data back into the app, these fields will not be
updated. If you want to update these fields, such as a contact’s name, then it’s recommended that you use
that view to export your data, update it in Excel, and import it back to the app for changes.
Export to an Excel PivotTable
12/3/2019 • 2 minutes to read • Edit Online

You can export app data to an Office Excel PivotTable to see patterns and trends in data. An Excel PivotTable is a
great way to summarize, analyze, explore, and present your app data. You can export up to 100,000 records at a
time.

Export data to an Excel PivotTable


The option to export data to an Excel PivotTable isn’t available in all record types. If you don’t see the option, it’s
not available for that record.
1. Open a list of records in your app, select the arrow to the right of Export to Excel, and then select
Dynamic PivotTable.
2. In the Select Columns for Pivot Excel dialog box, select the column settings and then select Export.
By default, the PivotTable Field List includes only fields that are displayed in the Select Columns for
Pivot Excel list.
3. Select Save and then save the .xlsx file. Make note of the location where you saved the file.

NOTE
If you’re going to edit the data file later, it’s recommended that you save the file before you open it. Otherwise, you
might get this error message: Excel cannot open or save any more documents because there is not enough
available memory or disk space.
To fix the issue:
1. Open Excel and go to File > Options > Trust Center.
2. Select Trust Center Settings and then select Protected View.
3. Under Protected View, clear the check boxes for all three items.
4. Select OK > OK.
We still strongly recommend that you save and then open the data file rather than disabling protected view, which
might put your computer at risk.

4. Open Excel and then open the .xlsx file you saved in the previous step.
5. If you see the security warning External Data Connections have been disabled, select Enable Content.
6. To refresh data in the file, on the Data tab, select Refresh from Power Apps.
7. Drag the fields from the PivotTable Field List to the PivotTable. For more information, see Excel Help.

Tips
In Power Apps, currency values are exported to Excel as numbers. After you complete the export, see the
Excel Help topic “Display numbers as currency" to format the data as currency.
The date and time values that you see in the app show up only as Date when you export the file to Excel, but
the cell actually shows both the date and time.
If you’re going to make changes and import the data file back into the app, remember that secured,
calculated, and composite fields (such as Full Name) are read-only and can’t be imported into the app. You’ll
be able to edit these fields in Excel, but when you import the data back into the app, these fields won’t be
updated. If you want to update these fields, such as a contact’s name, it’s recommended that you use that
view to export your data, update it in Excel, and import it back to the app for changes.
Merge duplicate records
11/5/2019 • 2 minutes to read • Edit Online

Duplicate records can creep into your data when you or others enter data manually or import data in bulk.
Common Data Service helps you address potential duplicates by providing duplicate detection for active records
such as, accounts and contacts. When you merge a record any related or child records will also be merged. Your
administrator may also set up duplicate detection rules for other situations.
For example, let's say you enter a contact record, Jim Glynn, along with a mobile phone number. The duplicate
detection rule discovers that you already have a similar record, and displays this dialog box.

You're not sure if this is a new record (one that happens to have the same name as an existing contact) or a
duplicate, so you select Ignore And Save.
Next, you go to the All Contacts list and see that now you have two records with the same name. After reviewing
the records, you determine that they're duplicates that need to be merged.

Common Data Service includes duplicate detection rules for accounts and contacts. These rules are automatically
turned on, so you don’t have to do anything to set up duplicate detection for these record types.

NOTE
If available on your system, you may also be able to check for duplicates of other record types, in addition to contacts and
accounts. Check with your system administrator. Find your administrator or support person

Merge duplicate records


1. Select the duplicate records, and then select Merge.
2. In the Merge Records dialog box, select the master record (the one you want to keep), and then select any
fields in the new record that you want to merge into the master record. Data in these fields may override the
existing data in the master record. Select OK.

NOTE
There are a few situations when duplicates may be found:
When a record is created or updated.
When you're using Dynamics 365 for Outlook and you go from offline to online.
When you import data using the Import Data wizard.
Duplicates aren't detected when you merge records, save an activity as completed, or change the status of a record,
such as activating or reactivating a record.
Work with reports
12/3/2019 • 2 minutes to read • Edit Online

Reports help you monitor your progress towards your business goals by helping you see how you’re doing. You
can also track trends - which can give you an advantage over your competitors.
For more information on organizing and creating reports, see: Customize and organize reports.

Run a report
1. From the left navigation pane, select the reports area.
2. Choose the report you want > Run Report.

NOTE
In Report Viewer dialog box, you can leave the search criteria as is, or change it as needed.

Share a report with other users or teams


1. From the left navigation pane, select the reports area.
2. In the list of reports, select the report you want to share.
3. On the command bar, select Share.

4. On the Share Report dialog box, select Add User/Team.


5. In the Look Up Records dialog box, find the users or team record that you want to share the report with,
and select the check box next to the record.
6. Choose Select to add the user or team record to the Selected records box and then select Add.

7. In the Share Report dialog box, select the type of share access that you want. The available permissions
are: Read, Write, Delete, Append, Assign, or Share. This will add the user or team record to the Selected
records box.
Share a report with your organization (for admins)
If the report would be useful for all users, make it available to the organization.
1. From the left navigation pane, select the reports area.
2. In the list of reports, select the report you want to share.
3. On the command bar, select select Edit.
4. On the Actions menu, select Make Report Available to Organization.

Download a report
1. From the left navigation pane, select the reports area.
2. In the list of reports, select the report you want to share.
3. On the command bar, select select Edit.
4. On the Actions menu, select Download Report.
The RDL file contains the fetchXML that the report is based on.
5. Open the report once the download is complete.
See Also
Create a report using the Report Wizard
Add a existing report
Edit report filter
Troubleshoot problems with data not displaying in a report
Create a report using the Report Wizard
12/3/2019 • 2 minutes to read • Edit Online

Use the Report Wizard to create reports with charts and tables that allow you to easily analyze your data.
All reports that are created using the Report Wizard are Fetch-based reports. Note that all reports generated with
the Report Wizard print in landscape mode.

Create a new report


1. From the left navigation pane, select the reports area.
2. On the command bar select New.

3. A Report:New Report screen will appear. For Report Type leave the default selection to, Report Wizard
Report and select the Report Wizard button.
4. In the next screen, leave the default selections and then select Next.

5. On the Report Properties screen, enter a name for the report and then choose the record to include in the
report and then select Next.
6. On the Select Records to Include in the Report screen choose the filters to determine which records are
included in your report. For example, if you only want to see results for records modified in the last 60 days,
you can set that filter in this screen. If you don’t want the data filtered, select Clear.

7. On the Lay out Fields screen, choose the layout of your report. Select Click here to add a grouping and
choose how you want your data grouped.
8. Select the Record type and the Column for the data you want to have grouped in the report. When you
are done with your selections, select OK.

9. Select Click here to add a column to columns of data related to the record type you chose in the previous
step.
10. On the Add Column screen choose the data you want to have displayed for the column and then select
OK.

11. Repeat the previous step for any additional columns that you want to add. When you are done, on the Lay
Out Fields screen, slect Next.
12. On the Format Report screen choose how to format your report and then select Next.

13. Review the summary of your report and select Next and then select Finish. You can now see this report in
the list of report in the system.
See Also
Work with reports
Add a existing report
Edit report filter
Troubleshoot problems with data not displaying in a report
Add a report from outside Power Apps
12/3/2019 • 2 minutes to read • Edit Online

If you’ve created a custom report outside of the system, you can easily add it to Power Apps.
For information about how to create a custom report, see Reporting and Analytics Guide.
1. From the left navigation pane, select the reports area.
2. On the command bar select New.
Add a file created in another application
a. In the Source section, in the Report Type box, select Existing File.

b. In the File Location box, enter the path and file name of the file to add, or choose Browse to locate
the file.
You can can upload many other file types such as an excel file but for this to run like a SQL Server
Reporting Services report or Report Wizard created report, the file needs to be an .RDL file. For
more information, see Report writing environment using SQL Server Data Tools.
-OR
Add a link to a webpage
a. In the Source section, in the Report Type box, select Link to Webpage.
b. In the Webpage URL box, enter the URL of the webpage.
3. Specify the properties for the report.
a. In the Details section, specify a meaningful name and description for the report.
b. The Parent Report text box displays the parent report of the current report, if one exists.
c. Categories. Choose the Select or change the values for this field button, and then specify
the categories to include in this report.
d. Related Record Types. To have the report appear in the Reports list on a page for specific record
types, choose the Select or change the values for this field button, and then select record
types.
e. Display In. To specify where reports should be visible, choose the Select or change the values for
this field button, and then select one or more of the options.
If no values are selected, the report won’t be visible to end users.
4. Choose Save or Save and Close.
See Also
Work with reports
Create a report using the Report Wizard
Edit report filter
Troubleshoot problems with data not displaying in a report
Edit the default filter of a report
6/27/2019 • 2 minutes to read • Edit Online

When a report is a SQL Server Reporting Services report, is enabled for prefiltering, and has a default filter, you
can change the default filter to display the data you expect to see in the report. This filter is used each time any
user runs the report.
1. From the left navigation pane, select the reports area
2. Choose a report and on the commbar bar, select Edit Default Filter.

3. Modify the filter criteria.


The criteria are grouped by record types that you can use in the filter, such as Accounts or Contacts.
To edit an existing row
a. Select the query relational operator and select an operator, or Select the underlined value and enter
a new value.
b. Select the query relational operator, and select an operator.
To add a criteria row:
a. Select Select, and specify the field to filter on.
b. Select the query relational operator, and select an operator.
c. Select Enter Value, and enter a value to filter on. For some values, you can select the Select or
change the values for this field button to open the Select Values dialog box and select the
value you want.
To group criteria
You must select two or more rows for the same record type. However, rows with field values from different
record types, such as Account and Contact record types, cannot be grouped.
a. For each row you want to group, in detailed mode, select the Options menu button for that row,
and then choose Select Row.
b. On the Filter toolbar, select Group AND or Group OR.
c. To remove a row from a group, select the Options menu button for that row, and then select
Delete.
d. To select a group, select the Options menu button for that group, and then select Select Group.
e. To add a criteria clause to a group, select the Options menu button for that group, select Add
Clause, and then select the field, query relational operator, and value.
f. To unselect a group that has been previously selected, select the Options menu button for that
group, and then select Deselect Group.
g. To ungroup a group, select the Options menu button for that group, and then select Ungroup.
h. To change a Group AND group to a Group OR group, or a Group OR group to a Group AND
group, select the Options menu button for that group, and then select Change to OR or Change
to AND.

TIP
To clear all criteria and start over, on the Filter toolbar, select Clear, and then select Confirm.
To delete a row, select the Options menu button for that row, and then select Delete.

4. When you are done, select Save Default Filter.


See Also
Work with reports
Create a report using the Report Wizard
Add a existing report
Troubleshoot problems with data not displaying in a report
Troubleshoot problems with data not displaying in a
report
6/27/2019 • 2 minutes to read • Edit Online

There are several possible reasons why data that you expect to be in a report does not appear:
Insufficient security permissions. If you don't have permission in Common Data Service to view a
record, it will not appear in the report.
Data is not entered. The person entering data may have left fields empty.
Data does not match the criteria for the report. Many reports include a default filter that displays only
active records, or you may have selected criteria that don’t have any matching record. Try changing the
report filter. For more information, see Edit the default filter of a report
You may be viewing a cached copy of the report. By default, data in Common Data Service reports is
pulled from the database each time you run a report. However, your system administrator may have
changed a report to run from the cache. If data you entered recently is not included in the report, you may
have an older version of the report from the cache. To refresh the report, on the Report toolbar, select the
Refresh button.
You may not have permission to read records in a sub-report. If you do not have permission to read
record types that are included in a sub-report, you will get an error message saying that the sub-report
could not be displayed.
Your Microsoft Internet Explorer privacy settings may block required cookies. For chart reports, if
instead of seeing the chart, you see a red letter X, your privacy settings may be blocking a cookie that is
required for the chart control. To fix this problem, in your browser, enable cookies for the server that is
running Reporting Services.
See Also
Work with reports
Create a report using the Report Wizard
Add a existing report
Edit report filter
Work with business processes
2/5/2020 • 2 minutes to read • Edit Online

Business processes help everyone follow best practices, even for situations that don't occur very often. Where
available, business processes provide a step-by-step timeline for the stages of a process at the top of the relevant
record. You open the menu for the active stage, enter each field of required and business-critical data, and then
select the next stage when you're ready to work with it. Some business processes can be completed in the time it
takes to make a single phone call, while others might take several weeks.
As you work on a new customer record, the business process flow helps you see each step that you need to take to
create the new record and fill out the required information according to your organizations business process.

The process bar can also be docked to the right side of the screen for easy reference as you work with a customer
record.
What if your business processes looks different from these examples?
The system comes with business processes for common tasks. However, most organizations customize these
processes to match the way they do things. Or, you might have added processes to the system that have been
customized for your industry or business goals. In other words, what you see here may not exactly match the
process bars you see on your system. But regardless, the process bars work the same for everyone. You enter data
in the fields, and then move the customer to the next stage.
For more information on to how to apply custom business logic with business rules and flows, see Apply custom
business logic with business rules and flows in model-driven app.
Use Power Automate to automate processes
11/9/2019 • 2 minutes to read • Edit Online

Power Automate lets you create automated processes between your favorite apps and services. From within your
app, you can run a Flow on one or more records.
Also, you can open Power Automate from your app to view, edit, or create new flows. More information: Get
started with Power Automate

Manage your flows


Connect with Power Automate from your app to manage your flows.

NOTE
To manage and run Power Automate from your app, Power Automate must be enabled in System Settings for you
organization. More information: Flows in your organization

1. On the command bar, select Flow.

2. The following options appear:


Select Create a flow to open a new browser tab and direct you to the Power Automate site. On the
Power Automate page, select Continue to use an existing template or X to close, choose, or create a
different one.
Select See your flows to open a new browser tab and direct you to the Power Automate site where
any flows in the Flow environment are displayed.
Select Login to flow to connect with Power Automate and display available flows for you to run.
This only appears if you aren’t currently signed in to Power Automate.
For information about creating a flow, see Get started with Power Automate
Use Dynamics 365 App for Outlook
12/2/2019 • 2 minutes to read • Edit Online

Use the Dynamics 365 App for Outlook to manage your Dynamics 365 data using Outlook on the desktop, web, or
phone. When Dynamics 365 App for Outlook is installed, depending on which version of the app you have
installed, you'll see a Common Data Service pane or window next to a selected Outlook email message, or when
you're composing an email message or setting up a meeting or appointment.

What Dynamics 365 App for Outlook offers?


With Dynamics 365 App for Outlook, you can:
View information about Common Data Service contacts and accounts while you’re working in Outlook. You
can view this info in the context of an email message, meeting, or appointment. For example, view phone
numbers, company name, last and next activities, and recent records.
Link email messages, meetings, and appointments to a record with a single click. For example, link an email
message to a specific account or contact. Dynamics 365 App for Outlook also supports custom entities.
Open records directly to find or enter more detailed information.
Add a phone call, task, or appointment activity.
Create a new record for any entity (record type).
Track Outlook contacts in Common Data Service.
For information on using Dynamics 365 App for Outlook, see Dynamics 365 App for Outlook User Guide.
See also
Customize Dynamics 365 App for Outlook
Overview of creating apps in Power Apps
12/10/2019 • 2 minutes to read • Edit Online

Power Apps is a high-productivity development platform for business apps, and it has four major components:
Canvas apps start with your user experience, crafting a highly tailored interface with the power of a blank
canvas and connecting it to your choice of 200 data sources. You can build canvas apps for web, mobile, and
tablet applications.
Model-driven apps start with your data model – building up from the shape of your core business data and
processes in the Common Data Service to model forms, views, and other components. Model-driven apps
automatically generate great UI that is responsive across devices.
Portals start to create external-facing websites that allow users outside your organization to sign in with a wide
variety of identities, create and view data in Common Data Service, or even browse content anonymously.
Common Data Service is the data platform that comes with Power Apps and allows you to store and model
business data. It's the platform on which Dynamics 365 applications are built; if you’re a Dynamics customer,
your data is already in the Common Data Service.
It's easy and simple to try building out your first app. We have a 30-day trial plan and a free community plan; find
out which one is best for you and get started.

Canvas apps
Canvas apps give you the flexibility to arrange the user experience and interface the way you want it. Allow your
creativity and business sense to guide how you want your apps to look and feel.
You can start to build your app from Microsoft tools where your data lives, such as:
From a SharePoint list
From a Power BI dashboard
Creating a canvas app is easy; with Power Apps, you can find or create your app in several ways:
From data
From a sample
From a Common Data Service source
From a blank canvas
Via AppSource

Model-driven apps
When you create a model-driven app, you can use all of the power of the Common Data Service to rapidly
configure your forms, business rules, and process flows. You create a model-driven app from the Power Apps site.
Getting started with model-driven apps is simple, and you can begin with these topics:
Create an app
Create and design forms
Create or edit views
Create or edit a system chart
Create or edit dashboards
Add security
Add business logic

Common Data Service


The Common Data Service allows you to securely store and manage data within a set of standard and custom
entities, and you can add fields to those entities when you need them.
Getting started with the Common Data Service is easy. For example, you can start with these items:
Create a custom entity
Manage fields
Create custom option sets
Create a business rule

Canvas and model-driven artifacts


While we merge the experiences of canvas and model-driven apps, these artifacts will be relevant for either canvas
apps or model-driven apps.

ARTIFACT APP TYPE

Entity > Views Model-driven

Entity > Forms Model-driven

Entity > Dashboards Model-driven

Connections Canvas

Gateways Canvas

Custom connectors Canvas

Apps > Import Canvas

After you build your app, you can share it with your team members.
Sign in to Power Apps for the first time
12/3/2019 • 3 minutes to read • Edit Online

When you sign in to Power Apps, the site offers you a variety of options for creating your own apps, opening apps
that you or others have created, and performing related tasks. These tasks range from the most simple, such as
identifying the license or licenses that give you access, to more advanced capabilities, such as creating custom
connections to specific data sources.
You can select options in three general areas:
the header along the top of the page

the navigation bar along the left edge of the page

the large icons that feature prominently in the middle of the page

For best results, start by ensuring that the home page is set to the right environment.

Choose an environment
Whether you're creating an app, a flow, a data connection, or an entity in Common Data Service, much of what you
do in Power Apps is contained in a specific environment. Environments create boundaries between different types
of work; for example, an organization might have separate environments for different departments. Many
organizations use environments to separate apps that are still being developed from those that are ready for
widespread use. You might have access to multiple environments or only one and, if you have appropriate
permissions, you might be able to create your own environments.
To verify which environment you're in, find the environment switcher near the right side of the header.

If you create an app in one environment, you won't be able to see it from another environment. In addition, people
who want to run your app must have access to the environment in which you created it.

IMPORTANT
Make sure that you're in the right environment before you create an app, a flow, or a similar component. You can't easily
move components from one environment to another.

For more information, see Environments overview.

Choose an app type


In Power Apps, you can create and run these types of apps:
Canvas apps support designing custom UI and connecting to data from a variety of sources.
Model-driven apps have a standard UI and connect to data only in Common Data Service. However, you can
more easily create other elements such as views, dashboards, and different types of business logic.
If you choose an environment that has a Common Data Service database, you can build canvas or model-driven
apps from the same Home page.

Play or edit an app


If you've created an app (or someone else has created one and shared it with you), you can play or edit it from the
Home page or the Apps page.
On the Apps page, you can filter the list of apps based on criteria such as whether you opened it recently.

You can also search for an app by typing one or more characters in the search bar, which appears near the upper-
right corner. When you find the app you want, select the banner icon to play or edit the app.

Create an app
From the Home page, you can create apps in several ways:
generate a canvas app automatically from a set of data
customize a pre-built sample of a canvas app
build a canvas app from a blank screen
create your own model-driven app
customize a pre-built sample for a model-driven app

Learn more
You can find more information about either canvas apps or model-driven apps in two ways:
In the left navigation bar, select Learn.
In the header, select the question-mark icon.

Both options show links to this documentation set, the Power Apps Community (where you can share information
with users in other organizations), and the Power Apps blog (where the newest features are announced).

Other common tasks


By selecting options in the header and left navigation bar, you can do more than create and open apps.
From the header
Select the down arrow to download mobile and other clients in which you can run apps.
For more information, see Find and run apps.
Select the gear icon to perform tasks such as connecting to data sources, identifying your Power Apps
license or licenses, and opening the page where you can perform administrative tasks.
For more information, see these topics:
Overview of canvas-app connectors
Build and certify custom connectors for canvas apps
Manage an on-premises data gateway
Administer Power Apps
Licensing overview
Overview of building a model-driven app
From the left navigation bar
Extend the functionality of your apps by performing these tasks:
Manage entities, option sets, and data integration in Common Data Service.
Configure business logic in Power Automate.
Author, package, and maintain solutions.
What are canvas apps in Power Apps?
12/3/2019 • 2 minutes to read • Edit Online

Design and build a business app from a canvas in Microsoft Power Apps without writing code in a traditional
programming language such as C#. Design the app by dragging and dropping elements onto a canvas, just as you
would design a slide in PowerPoint. Create Excel-like expressions for specifying logic and working with data. Build
apps that integrate business data from a wide variety of Microsoft and third-party sources. Share your app so that
users can run it in a browser or on a mobile device, and embed your app so that users can run it in SharePoint,
Power BI, or Teams.
If you don't need a custom design and your data is in Common Data Service, you can automatically generate a
model-driven app from your business data and processes. This type of app can model forms, views, and other
components, and the default UI automatically adjusts to phones, laptops, and other devices. For more information
about this type of app, see Overview of building a model-driven app.

Build an app
To get started, automatically generate an app from one of these sources, among others:
a sample app
a template
Common Data Service
SharePoint
Excel
Sign in to Power Apps, and then select Start from data or a sample app, such as Service Desk or Budget
Tracker.

After you generate an app automatically, customize its default appearance and behavior based on your users'
workflows. For example, change which types of data appear, how they're sorted, or even whether users specify a
number by typing it or adjusting a slider. Add and customize screens, galleries, forms, and other controls.
After you've generated an app or two automatically and gained some experience with customization, create an app
from scratch based on Common Data Service, Excel, or another data source. By working from the ground up, you
gain flexibility in app design, flow, and controls, and you can incorporate a larger variety of data sources.
Share and run an app
When you finish the app and save it to the cloud, share it with others in your organization. Specify which users or
groups can run the app and whether they can also customize and share it with additional people in the
organization.
Run your own apps - and any apps shared with you - on Windows, in a web browser, or on an iOS or Android
device.

Learn more
Explore the step-by-step, conceptual, and reference topics in the navigation pane on the left.
Check out the webinars that you can access on-demand to help you leverage the features and functions of
Power Apps.
Review coding standards for maximizing app performance and keeping apps easier to maintain.

Share your experience


Read and post in the Power Apps Community, where anyone who uses Power Apps can post a question and
others can answer. Before you post a question, search the community to see whether your question has already
been answered.
Submit an idea for how we can improve Power Apps in Power Apps Ideas.
Create a support ticket to get technical assistance. If you're a Power Apps administrator for your organization,
you can also open a support ticket in the Power Apps admin center.

Next steps
Sign up for a free license.
Sign in to Power Apps.
Open a sample app.
System requirements, limits, and configuration values
for canvas apps
3/20/2020 • 3 minutes to read • Edit Online

This topic contains device platform and web browser requirements, as well as limits and configuration values for
canvas apps.

Supported platforms for running canvas apps using the Power Apps
mobile app
MINIMUM REQUIRED RECOMMENDED

iOS 12 or later iOS 12 or later

Android 7 or later Android 7 or later

Windows 8.1 or later (PC only) Windows 10 Fall Creators Update with at least 8 GB of RAM)

NOTE
We currently don't support new features on Windows platform for Power Apps mobile app. Features such as the Improved
Common Data Service option and guest access are not available on this platform. We recommend using a web player on
Windows to leverage the full set of capabilities. Updates to the Power Apps mobile app for Windows platform will be
announced in future.

Supported browsers for running canvas apps


BROWSER OPERATING SYSTEM

Google Chrome (latest version) Windows 7 SP1, 8.1, and 10


(recommended) Android 5 or later
iOS 8 or later
macOS

Microsoft Edge (latest version) Windows 10


(recommended)

Microsoft Internet Explorer 11 (with Compatibility View off) Windows 7 SP1, 8.1, and 10

Mozilla Firefox (latest version) Windows 7 SP1, 8.1, and 10


Android 5 or later
iOS 8 or later
macOS

Apple Safari (latest version) iOS 8 or later


macOS
Supported browsers for Power Apps Studio
BROWSER OPERATING SYSTEM

Google Chrome (latest version) Windows 7 SP1, 8.1, and 10


(recommended) macOS

Microsoft Edge (latest version) Windows 10


(recommended)

Microsoft Internet Explorer 11 (with Compatibility View off) Windows 7 SP1, 8.1, and 10

Request limits
These limits apply to each single outgoing request:

NAME LIMIT

Timeout 180 Seconds

Retry attempts 4

NOTE
The retry value may vary. For certain error conditions, it's not necessary to retry.

IP addresses
Requests from Power Apps use IP addresses that depend on the region of the environment that the app is in. We
don't publish fully qualified domain names available for Power Apps scenarios.
Calls made from an API connected through an app (for example, the SQL API or the SharePoint API) come from
the IP address specified later in this topic.
You should use these addresses if, for example, you must whitelist IP addresses for an Azure SQL database.

IMPORTANT
If you have existing configurations, please update them as soon as possible before September 30, 2018 so they include and
match the IP addresses in this list for the regions where your Power Apps apps exist.

REGION OUTBOUND IP

Asia 13.75.36.64 - 13.75.36.79, 13.67.8.240 - 13.67.8.255,


52.175.23.169, 52.187.68.19, 127.0.0.1

Australia 13.70.72.192 - 13.70.72.207, 13.72.243.10, 13.77.50.240 -


13.77.50.255, 13.70.136.174, 127.0.0.1

Brazil 191.233.203.192 - 191.233.203.207, 104.214.19.48 -


104.214.19.63, 13.65.86.57, 104.41.59.51, 127.0.0.1
REGION OUTBOUND IP

Canada 13.71.170.208 - 13.71.170.223, 13.71.170.224 -


13.71.170.239, 52.237.24.126, 40.69.106.240 -
40.69.106.255, 52.242.35.152, 127.0.0.1

Europe 13.69.227.208 - 13.69.227.223, 52.178.150.68, 13.69.64.208


- 13.69.64.223, 52.174.88.118, 137.117.161.181, 127.0.0.1

India 104.211.81.192 - 104.211.81.207, 52.172.211.12,


40.78.194.240 - 40.78.194.255, 13.71.125.22,
104.211.146.224 - 104.211.146.239, 104.211.189.218,
127.0.0.1

Japan 13.78.108.0 - 13.78.108.15, 13.71.153.19, 40.74.100.224 -


40.74.100.239, 104.215.61.248, 127.0.0.1

South America 191.233.203.192 - 191.233.203.207, 104.214.19.48 -


104.214.19.63, 13.65.86.57, 104.41.59.51, 127.0.0.1

United Kingdom 51.140.148.0 - 51.140.148.15, 51.140.80.51, 51.140.211.0 -


51.140.211.15, 51.141.47.105, 127.0.0.1

United States 13.89.171.80 - 13.89.171.95, 52.173.245.164, 40.71.11.80 -


40.71.11.95, 40.71.249.205, 40.70.146.208 - 40.70.146.223,
52.232.188.154, 52.162.107.160 - 52.162.107.175,
52.162.242.161, 40.112.243.160 - 40.112.243.175,
104.42.122.49, 127.0.0.1

United States (Early Access) 13.71.195.32 - 13.71.195.47, 52.161.102.22, 13.66.140.128 -


13.66.140.143, 52.183.78.157, 127.0.0.1

Required services
This list identifies all services to which Power Apps Studio talks and their usages. Your network must not block
these services.

DOMAIN(S) PROTOCOLS USES

api.bap.microsoft.com https Environment permissions management


api.businessappdiscovery.microsoft.com

management.azure.com https RP

msmanaged-na.azure-apim.net https Runtime of Connectors/Apis

login.microsoft.com https ADAL


login.windows.net
login.microsoftonline.com
secure.aadcdn.microsoftonline-p.com

graph.microsoft.com https Azure Graph - For getting user info


graph.windows.net (e.g., profile photo)

gallery.azure.com https Sample and Template apps


DOMAIN(S) PROTOCOLS USES

*.azure-apim.net https Api Hubs - Different sub-domains for


each locale

*.powerapps.com https create.powerapps.com,


make.powerapps.com,
content.powerapps.com, and
make.powerapps.com

*.azureedge.net https create.powerapps.com,


make.powerapps.com,
content.powerapps.com, and
make.powerapps.com

*.blob.core.windows.net https Blob storage

*.flow.microsoft.com https create.powerapps.com,


make.powerapps.com,
content.powerapps.com, and
make.powerapps.com

*.dynamics.com https Common Data Service

vortex.data.microsoft.com https Telemetry

localhost https Power Apps Mobile

NOTE
If you're using a VPN, it must be configured to exclude localhost from tunneling for Power Apps Mobile.

Size limits
You can find information about size limits on text, hyperlinks, images, and media in Data types.

Power Apps per app plan


The information is now available in Power Apps per app plan section in the Power Platform admin guide.
Keyboard shortcuts for canvas apps
2/21/2020 • 3 minutes to read • Edit Online

NOTE
Shortcuts might vary based on keyboard layout.

File
SHORTCUT ACTION

Ctrl+O (or Alt+F) Open a file.

Ctrl+Shift+S (or Alt+P) Save the app with a different name.

Ctrl+S Save the app with the same name or for the first time.

Ctrl+Shift+P Save the app and activate the publish dialog.

F12 Download the app file (.msapp).

Alt+F Open the File menu.

Ribbon
SHORTCUT ACTION

Enter Run the selected command.

Tab Move between commands on the selected tab and then to the
next tab.

Ctrl+F6 Navigate to the next landmark.

Ctrl+Shift+F6 Navigate to the previous landmark.

Alt+I Select the Insert tab.

Editing
SHORTCUT ACTION

Ctrl+A Select all.

Ctrl+X Cut.
SHORTCUT ACTION

Ctrl+C Copy.

Ctrl+V Paste.

Ctrl+Z Undo command.

Ctrl+Y Redo command.

Ctrl+M Add a screen.

Ctrl+= or Ctrl+Shift+= Zoom in.

Ctrl+- or Ctrl+Shift+- Zoom out.

Ctrl+0 Fit canvas to page.

Shift+Enter Break a line in a formula.

Preview
SHORTCUT ACTION

F5 Open Preview mode.

Esc Close Preview mode, a dialog box, or a flyout pane.

Canvas
SHORTCUT ACTION

Tab Select the next control.

Ctrl+Click or Shift+Click Select multiple objects at once.

Right arrow Nudge the selected control to the right.

Left arrow Nudge the selected control to the left.

Up arrow Nudge the selected control up.

Down arrow Nudge the selected control down.

Tree view
NOTE
These shortcuts require the Tree view pane to have focus.
SHORTCUT ACTION

F2 Rename a control.

Esc Cancel renaming a control.

Ctrl+G Group/ungroup controls.

Ctrl+] Bring a control forward.

Ctrl+[ Send a control backward.

Ctrl+Shift+] Bring to front.

Ctrl+Shift+[ Send to back.

Resize
SHORTCUT ACTION

Shift+Left arrow Decrease width.

Ctrl+Shift+Left arrow Decrease width slightly.

Shift+Down arrow Decrease height.

Ctrl+Shift+Down arrow Decrease height slightly.

Shift+Right arrow Increase width.

Ctrl+Shift+Right arrow Increase width slightly.

Shift+Up arrow Increase height.

Ctrl+Shift+Up arrow Increase height slightly.

Text format
SHORTCUT ACTION

Ctrl+B Cycle through levels of bold.

Ctrl+I Turn italic on or off.

Ctrl+U Add or remove underline.

Alternate behavior
SHORTCUT ACTION

Alt or Ctrl+Shift 1. Before selecting a control, hide design elements so that you
can interact with controls as the app's user would.
2. After initiating a resize or reposition of a control, holding
down these keys overrides any snap points.

Like an Excel spreadsheet, canvas apps are live and operating even when they are being edited. There is no need to
change to preview mode in order to exercise your app, making the edit and test cycle much faster. But this poses a
problem: how do we differentiate selecting a button control so that it can be resized from selecting a button control
to exercise the logic in our app?
When in design mode, by default selecting an object is for editing: moving, resizing, changing properties, and
otherwise configuring the object. This default can be overridden by holding down the Alt or Ctrl+Shift keys before
initiating the selection which treats the selection as if a user of the app had done it.
In the following animation, a button control is first selected for editing. Adorners appear around the control and the
formula bar shows the OnSelect property, ready to be edited. The button is then released. With the Alt key first
depressed, the button control is again selected, but this time the OnSelect property is evaluated and the
notification is displayed, just as if the button was selected in a running app.

The Alt key can also be used after a control has been selected to override snap points for moving and resizing. The
next animation shows the resize of a data card within an Edit form control. Initially, the resizing is restricted to
specific snap points. Later, without releasing the mouses button, the Alt key is depressed in addition to the mouse
button. The addition of the Alt key overrides the snap points and any width can be obtained with the mouse.
Other
SHORTCUT ACTION

F1 Open documentation.

Shift+F10 Open a shortcut menu in, for example, Tree view.


Create a canvas app from a sample in Power Apps
1/23/2020 • 2 minutes to read • Edit Online

In this quickstart, you'll create a canvas app from a sample so that you can explore design possibilities and
discover concepts that you can apply as you develop your own canvas apps.
Each sample showcases a real-world scenario but uses fictitious data.
If you don't have a license for Power Apps, you can sign up for free.

Open a sample app


1. Sign in to Power Apps.
2. Select All templates.
3. Choose a sample app from the list of sample apps, such as Cost Estimator.

4. Update the app name and select Create to create the app.

NOTE
Some sample apps may be available in only phone or tablet layouts. Read create responsive layouts in canvas apps
for more details regarding layouts. If the sample app you selected has phone and tablet as layout options, select a
layout of your choice.

5. Open Preview mode by pressing F5 (or by selecting the play button near the upper-right corner).

Each sample represents a different scenario with a variety of screens and other controls. If you opened the
Cost Estimator sample, you can use the default app to perform these tasks:
Create an appointment for estimating the cost of installing a flooring product in a room of a particular
size.
Capture details such as address and square footage, and calculate the price based on discounts and tax
rates.
Filter a list of appointments to show those for which estimates have been created, for which estimates
haven't been created, or all appointments.
6. When you finish exploring the app, close Preview mode by pressing Esc (or by clicking or tapping the close
icon near the upper-right corner, under the title bar for Power Apps).

Save the app


1. Near the upper-left corner, select File tab.
2. In the Settings page, review the default settings.

3. Near the left edge, click or tap Save.

Next steps
In this quickstart, you created a sample that uses fictitious data. For more help learning how to create an app, you
can also automatically generate an app based on data in other sources such as Common Data Service, SharePoint,
or Excel.
Generate an app
Install and configure the Expense Report sample for
canvas apps in Power Apps
12/3/2019 • 8 minutes to read • Edit Online

Step-by-step instructions for installing and configuring the Expense Report sample. You can also preview the
sample app here.
Estimated time to complete these steps: 10-15 minutes

TIP
Watch this video for a demonstration of how to use the Expense Report sample app.

Track expense reports from submission to approval. Tally line items as individual expenses accrue and submit for
approval when ready. This app requires a small amount of setup to make it your own.

TIP
Watch this video to see how to use the Expense Report sample.

Prerequisites
Sign up for Power Apps.

Create the Expenses list


This list stores the expense reports.
1. Open a web browser, and navigate to https://admin.microsoft.com.
2. Log in with an account that has permission to create lists.
3. Navigate to the site collection where you want the Expenses list to reside.
4. Click the gear icon in the top right portion of the web page.
5. Click Add an app.
6. In the Find an app textbox, enter Custom.
7. Click the search icon.
8. Click the Custom List app.
9. In the Name textbox, enter Expenses.

IMPORTANT
If you choose a different name for the list, make sure you write it down because you will need to substitute it for
Expenses everywhere you see it during the installation and configuration process.

10. Click Create.


Create Cost Center column
1. Click the Expenses list.
2. Click the gear icon in the top right portion of the web page.
3. Click List settings.
4. Click Create column.
5. In the Column name textbox enter Cost Center.
6. In the type of information in this column is radio button list, select Choice.
7. In the Type each choice on a separate line textbox, enter the following values, each on a separate line:
Microsoft
Contoso
8. In the Default value textbox, enter Microsoft.
9. Click OK.
Create Comments column
1. Click Create column.
2. In the Column name textbox, enter Comments.
3. In the type of information in this column is radio button list, select Multiple lines of text.
4. Click OK.
Create Status column
1. Click the Expenses list.
2. Click the gear icon in the top right portion of the web page.
3. Click List settings.
4. Click Create column.
5. In the Column name textbox enter Status.
6. In the type of information in this column is radio button list, select Choice.
7. In the Type each choice on a separate line textbox, enter the following values, each on a separate line:
Open
Pending
Approved
8. In the Default value textbox, enter Open.
9. Click OK.
Create ApproverName column
1. Click Create column.
2. In the Column name textbox, enter ApproverName.
3. In the type of information in this column is radio button list, select Person or Group.
4. In the Require that this column contains information radio button list, select Yes.
5. Click OK.
Create DateSubmitted column
1. Click Create column.
2. In the Column name textbox, enter DateSubmitted.
3. In the type of information in this column is radio button list, select Date and Time.
4. In the Require that this column contains information radio button list, select Yes.
5. Click OK.
Create StartDate column
1. Click Create column.
2. In the Column name textbox, enter StartDate.
3. In the type of information in this column is radio button list, select Date and Time.
4. In the Require that this column contains information radio button list, select Yes.
5. Click OK.
Create EndDate column
1. Click Create column.
2. In the Column name textbox, enter EndDate.
3. In the type of information in this column is radio button list, select Date and Time.
4. In the Require that this column contains information radio button list, select Yes.
5. Click OK.

Create the LineItems list


This list stores the line items that are associated with each expense report.
1. Navigate to the same site collection where you created the Expenses list.
2. Click the gear icon in the top right portion of the web page.
3. Click Add an app.
4. In the Find an app textbox, enter Custom.
5. Click the search icon.
6. Click the Custom List app.
7. In the Name textbox, enter LineItems.
IMPORTANT
If you choose a different name for the list, make sure you write it down because you will need to substitute it for
LineItems everywhere you see it during the installation and configuration process.

8. Click Create.
Create Category column
1. Click the LineItems list.
2. Click the gear icon in the top right portion of the web page.
3. Click List settings.
4. Click Create column.
5. In the Column name textbox enter Category.
6. In the type of information in this column is radio button list, select Choice.
7. In the Type each choice on a separate line textbox enter the following values, each on a separate line:
Food & Beverage
Transportation
Business needs
8. In the Default value textbox, enter Food & Beverage.
9. Click OK.
Create Cost column
1. Click Create column.
2. In the Column name textbox enter Cost.
3. In the type of information in this column is radio button list, select Number (1, 10, 100).
4. In the Require that this column contains information radio button list, select Yes.
5. Click OK.
Create Date column
1. Click Create column.
2. In the Column name textbox enter Date.
3. In the type of information in this column is radio button list, select Date and Time.
4. In the Require that this column contains information radio button list, select Yes.
5. Click OK.
Create Description column
1. Click Create column.
2. In the Column name textbox enter Description.
3. In the type of information in this column is radio button list, select Multiple lines of text.
4. In the Require that this column contains information radio button list, select Yes.
5. In the Specify the type of text to allow radio button list, select Plain text.
6. Click OK.
Create ReportID column
1. Click Create column.
2. In the Column name textbox enter ReportID.
3. In the type of information in this column is radio button list, select Lookup (information already on this
site).
4. In the Require that this column contains information radio button list, select Yes.
5. In the Get information from dropdown list, select the Expense list you created.
6. In the In this column dropdown list, select ID.
7. Click OK.
Edit Title column
1. Click the Title column link.
2. In the Require that this column contains information radio button list, select No.
3. Click OK.

Download the Expense Report app


1. In a web browser, navigate to the following link:
https://pappsfeprodwestuscontent.blob.core.windows.net/sampleapps/myexpenses/docs/MyExpenses(SP_L
ist).zip.
2. Download the Expense Report Power Apps Sample package, and save it to your machine.

Create connections
1. In a web browser, navigate to make.powerapps.com.
2. Sign in by providing the same credentials that you used to sign up.
3. In the menu on the left, select Connections.
Create an Approvals connection
1. Click + New connection.
2. In the Search textbox, enter Approvals.
3. Select Approvals in the list.
4. Click Create.
Create an Office 365 Outlook connection
1. Click + New connection.
2. In the Search textbox, enter Office 365 Outlook.
3. Select Office 365 Outlook in the list.
4. Click Create.
5. In the popup window, select the account you logged in with.
Create a SharePoint connection
1. Click + New connection.
2. In the Search textbox, enter SharePoint.
3. Select SharePoint in the list.
4. Click Create.
5. In the popup window, select the account you logged in with.

Import the app


1. In a web browser, navigate to https://make.powerapps.com.
2. Sign in by providing the same credentials that you used to sign up.
3. In left navigation bar, select Apps, and then select Import package(preview).
4. Select Upload, and then select the package that you downloaded earlier.
5. For the App and Flow resource types, set IMPORT SETUP to Create as new.
6. For the SharePoint and Outlook connections, set IMPORT SETUP to Select during import.

7. Select the red icon for the SharePoint Connection.


8. In the connections list, select the item with your username.

9. Select Save.
10. Select the red icon for the Approval Connection.
11. In the connections list, select the item with your username.
12. Select Save.
13. Select the red icon for the Office 365 Outlook Connection.
14. In the connections list, select the item with your username.

15. Select Save.

TIP
When you're done, it will look like this:
16. Select Import, and then wait until the process is complete.

Configure the app to use the SharePoint lists


1. In the web browser, select Apps.
2. Select the ellipsis (...) next to the Expense Report app.
3. Select Edit on the web > Allow.
Delete connections
1. On the View tab, select Data sources.
2. In the Data pane, select the ellipsis (...) next to Expenses, and then select Remove.
3. Repeat the previous step to remove the LineItems data source.
Expenses list
1. On the View tab, select Data sources.
2. In the Data pane, select Add data source > New connection > SharePoint > Create.
3. In the Recent sites list, select the SharePoint site where you created the Expenses list.

TIP
If the site doesn't appear in the list, type or paste the URL to the SharePoint site in the textbox, and then select Go.

4. In the Search box at the top of the list, type or paste Expenses.
5. Select the checkbox next to Expenses, and then select Connect.
LineItems list
1. On the View tab, select Data sources.
2. In the Data pane, select SharePoint.
3. In the Recent sites list, select the SharePoint site where you created the LineItems list.

TIP
If the site doesn't appear in the list, type or paste the URL to the SharePoint site in the textbox, and then select Go.

4. In the Search box at the top of the list, type or paste Line Items.
5. Select the checkbox next to LineItems, and then select Connect.
6. Select File > Save > Publish > Publish this version.

Modify the flow


1. In left navigation bar, select Flows.
2. If prompted to sign in, provide the same credentials that you used to sign up.
3. Near the top of the screen, select My flows.
4. Next to the ApproveExpense flow, select the pencil icon.

5. Expand the Get items action.


6. Change the Site Address and List Name to match the Expenses list that you created in SharePoint.

TIP
You don’t need to type it manually; you can select it in the drop-down lists.

7. Expand the Condition.


8. Expand the If yes section.
9. Expand the Change item status to Approved action.
10. Change the Site Address and List Name to match the Expenses list that you created in SharePoint.
TIP
You don’t need to type it manually; you can select it in the drop-down lists.

11. Expand the If no section.


12. Expand the Change item status to Open action.
13. Change the Site Address and List Name to match the Expenses list that you created in SharePoint.

TIP
You don’t need to type it manually; you can select it in the drop-down lists.

14. Select Update flow.

Play the app


1. In the web browser, select Apps.
2. Select the ellipsis (...) next to the Expense Report app, and then select Open.

Next steps
Customize a SharePoint list form
Add and configure a control
Edit and manage permissions for a SharePoint list or library
Install and configure the Help Desk sample in Power
Apps
1/16/2020 • 6 minutes to read • Edit Online

Step-by-step instructions for, in Power Apps, installing and configuring the Help Desk sample for canvas apps.
Estimated time to complete these steps: 10-15 minutes

TIP
For a demonstration of this process, please watch this video.

Overview of the sample


Help Desk provides a user-friendly experience to connect end users with support professionals. Quickly find
answers to your most important questions, track progress of open tickets, and review details of previous requests.
This app requires a small amount of setup to make it your own.

TIP
Watch this video to see how to use the Help Desk PowerApp Sample.

Prerequisites
Sign up for Power Apps.
Must have a valid SharePoint Online license and permission to create lists.
Create the HelpDesk SharePoint list
This list stores the Help Desk tickets.
1. Open a web browser and navigate to https://admin.microsoft.com.
2. Log in with an account that has permission to create SharePoint lists.
3. Navigate to the site collection where you want the HelpDesk list to reside.
4. Click the gear icon in the top right portion of the web page.
5. Click Add an app.
6. In the Find an app textbox, enter Custom.
7. Click the search icon.
8. Click the Custom List app.
9. In the Name textbox, enter HelpDesk.

IMPORTANT
If you choose a different name for the list make sure you write it down because you will need to substitute it for
HelpDesk everywhere you see it during the installation and configuration process.

10. Click Create.


Create Description column
1. Select the ellipsis next to the HelpDesk list and click Settings.
2. Click Create column.
3. In the Column name textbox enter Description.
4. In the type of information in this column is radio button list, select Multiple lines of text.
5. In the Require that this column contains information radio button list, select Yes.
6. In the Specify the type of text to allow radio button list, select Plain text.
7. Click OK.
Create Category column
1. Click Create column.
2. In the Column name textbox enter Category.
3. In the type of information in this column is radio button list, select Choice.
4. In the Type each choice on a separate line textbox enter the following values, each on a separate line:
LAPTOP / PC equipment issue
LAPTOP / PC software issue
5. In the Enforce unique values radio button list, select No.
6. In the Display choices using radio button list, select Drop-Down Menu.
7. In the Default value textbox, enter LAPTOP / PC equipment issue.
8. Click OK.
Create PercentComplete column
1. Click Create column.
2. In the Column name textbox enter PercentComplete.
3. In the type of information in this column is radio button list, select Number (1, 10, 100).
4. In the Require that this column contains information radio button list, select No.
5. Click OK.
Create Priority column
1. Click Create column.
2. In the Column name textbox enter Priority.
3. In the type of information in this column is radio button list, select Choice.
4. In the Type each choice on a separate line textbox enter the following values, each on a separate line:
HIGH
MEDIUM
LOW
5. In the Enforce unique values radio button list, select No.
6. In the Display choices using radio button list, select Drop-Down Menu.
7. In the Default value textbox, enter LOW.
8. Click OK.
Create TaskStatus column
1. Click Create column.
2. In the Column name textbox enter TaskStatus.
3. In the type of information in this column is radio button list, select Choice.
4. In the Type each choice on a separate line textbox enter the following values, each on a separate line:
NOT STARTED
IN PROGRESS
COMPLETED
DEFERRED
WAITING ON CSR
5. In the Enforce unique values radio button list, select No.
6. In the Display choices using radio button list, select Drop-Down Menu.
7. In the Default value textbox, enter NOT STARTED.
8. Click OK.
Create AssignedTo column
1. Click Create column.
2. In the Column name textbox enter AssignedTo.
3. In the type of information in this column is radio button list, select Person or Group.
4. In the Require that this column contains information radio button list, select No.
5. In the Allow multiple selections radio button list, select NO.
6. Click OK.
Edit 'Title' column
1. Click the Title column link.
2. In the Require that this column contains information radio button list, select No.
3. Click OK.

Download the app


1. Download the Power Apps package and save it to your machine.

Create connections
1. In a web browser, navigate to make.powerapps.com.
2. Sign in by providing the same credentials that you used to sign up.
3. In the menu on the left, select Data then Connections.
Create Office 365 Outlook connection
1. Click + New connection.
2. In the Search textbox, enter Office 365 Outlook.
3. Select Office 365 Outlook in the list.
4. Click Create.
5. In the popup window, select the account you logged in with.
Create SharePoint connection
1. Click + New connection.
2. In the Search textbox, enter SharePoint.
3. Select SharePoint in the list.
4. Click Create.
5. In the popup window, select the account you logged in with.
Create Office 365 Users connection
1. Click + New connection.
2. In the Search textbox, enter office 365 users.
3. Select Office 365 Users in the list.
4. Click Create.
5. In the popup window, select the account you logged in with.

Import the app


1. In a web browser, navigate to https://make.powerapps.com.
2. Sign in by providing the same credentials that you used to sign up.
3. In the menu on the left, select Apps.
4. Click Import package(preview).

5. Click the Upload button and select the PowerApp package you downloaded in previous steps.
6. For the App and Flow resource types, set IMPORT SETUP to Create as new.
7. For the SharePoint and Outlook connections, set IMPORT SETUP to Select during import.
8. Click the red icon for the SharePoint Connection.
9. In the connections list, click the item with your username.

10. Click Save.


11. Click the red icon for the Office 365 Outlook Connection.
12. In the connections list, click the item with your username.
13. Click Save.

TIP
When you are done, it will look like this.

14. Click Import and wait until the process is complete.

Configure the app to use the SharePoint list


1. Under Next steps, click Open app.
2. Click Allow when prompted for permission.
Delete connections
1. On the View tab, select Data sources.
2. In the Data pane, select the ellipsis (...) next to HelpDesk, and then select Remove.
HelpDesk list
1. On the View tab, select Data sources.
2. In the Data pane, select Add data source > New connection > SharePoint > Create.
3. In the Recent sites list, select the SharePoint site where you created the HelpDesk List.

TIP
If the site doesn't appear in the list, type or paste the URL to the SharePoint site in the textbox, and then select Go.

4. In the Search box at the top of the list, type or paste HelpDesk.
5. Select the checkbox next to HelpDesk, and then select Connect.
Update admin list
1. Select the app.
2. Select OnStart in the dropdown.
3. Expand the formula window and find the AdminList collection.
4. Replace user@microsoft.com with your HelpDesk administrator(s).
TIP
If you have more than one administrator, use a comma to delimit the list of administrators. Example:
"admin1@microsoft.com","admin2@microsoft.com". To ensure the addresses in the AdminList match the format
Power Apps expects, select View > Variables > Global > MyProfile and look at the 'Mail' column to see the expected
email format.

5. Select File > Save > Publish > Publish this version.

Modify the flow


1. In the menu on the left, click Flows.
2. If prompted to sign in, sign in by providing the same credentials that you used to sign up.
3. Select My flows in the top menu.
4. Next to the HelpDeskFlow Flow, click the pencil icon.

5. Expand the Get items action.


6. Change the Site Address and List Name to match the HelpDesk SharePoint list you created.

TIP
You don’t need to type it manually, you can choose it in the dropdown lists.

7. Expand the Switch.


8. Expand the NOT STARTED case.
9. Expand the Case not started action.
10. Change the To to match the HelpDesk admin email.
11. Click Update flow.

Play the app


1. In the web browser, click Apps.
2. Click the ellipsis (...) next to the Help Desk app.
3. Click Open.

TIP
Watch this video to see how to use the Help Desk PowerApp Sample.

Next steps
Customize a SharePoint list form
Add and configure a control
Edit and manage permissions for a SharePoint list or library
Set up and learn about the Meeting Capture sample
template in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Overview
In Power Apps, the Meeting Capture sample template is an all-in-one tool for capturing information from meetings
as they happen. If you run the app, you can view meeting details, capture notes, take pictures of whiteboards, draw
sketches and assign tasks. You can also export all of these items, send them to all meeting attendees, and schedule
followup meetings quickly and easily.

Where can I run the app?


You can run this sample app in your browser, on a tablet, or other device that has a similar form factor.

How do I open the template and run the app?


Preview Meeting Capture or watch these videos to find out more:
How to open the template.
How to run the app from start to finish.

How do I build the app myself?


Meeting Capture includes a lot of functionality commonly used in Power Apps. By watching these videos, you can
explore this functionality and find out how to implement it so you can implement the same functionality and
patterns in your own apps.
Export content from Power Apps to OneNote.
Find available meeting times for attendees.
Meeting Capture connects to these services in Office 365.
Office 365 Users
Office 365 Outlook
Planner
OneNote (Business)
Content Conversion
We hope you enjoy exploring Meeting Capture, and we look forward to hearing how you extend it for your
organization!

Next steps
Formula reference
Controls reference
Set up and learn about the Crisis Communication
sample template in Power Apps
3/26/2020 • 25 minutes to read • Edit Online

The Crisis Communication app provides a user-friendly experience to connect users with information about a crisis.
Quickly get updates on internal company news, get answers to frequently asked questions, and get access to
important information like links and emergency contacts. This app requires a small amount of setup to make it
your own.
In this walkthrough, you'll learn how to:
Create a location for your data.
Import both the Crisis Communication app and its admin app.
Create content for the app.
Import flows to send notifications to users.
Create a centrally managed Teams team to aggregate data and to effectively respond to issues.
Estimated time to complete these steps: 20–25 minutes.

NOTE
The Crisis Communication sample template is also available for the Power Apps US Government and Power Automate US
Government plans. The service URLs for Power Apps and Power Automate US Government versions are different from the
commercial versions. More information: Power Apps US Government service URLs and Power Automate US Government
service URLs

Demo: Crisis Communication app


Watch how to use the Crisis Communication solution.

Prerequisites
Sign up for Power Apps.
You must have a valid SharePoint Online license and permission to create lists.
You must have a public SharePoint site where you can store the data for the app.
Download the assets from aka.ms/CrisisCommunicationSolution.

IMPORTANT
For any feedback or issues related to the Crisis Communication app, please use the following links:
Feedback
Issues

Demo: Build and deploy the Crisis Communication app


Watch how to build and deploy the Crisis Communication app.
Create a home for your data
Data for the app is stored in SharePoint lists, so the first step is to create a new SharePoint site.
Create a SharePoint site
1. Sign in to Office online, and then select SharePoint.
2. Select Create site.

3. Select Team site.

4. Enter a name and description for your site.


5. Set Privacy settings to Public so that everyone in the company can get the necessary information.
6. Select Next.
7. Add additional owners for the site (optional).
8. Select Finish.
Create SharePoint lists for the app
The app uses multiple lists to store its data. You can use the DeploySPLists flow, available from the downloaded
assets package, to automatically create these lists.
Import the SharePoint list deployment flow
1. Go to flow.microsoft.com.
2. Select My flows from the left navigation pane.
3. Select Import on the command bar.
4. Upload the DeploySPLists.zip package from the GitHub repository.
5. Add a SharePoint connection for the new flow by selecting the Select during import link and completing
the form.

6. If you need to create a new SharePoint connection, select Create new in the Import setup pane.
7. Select New connection on the command bar.
8. Search for the name of the connection, for example SharePoint.
9. Select the connection you created.
10. Select Save.
11. Select Import.
Edit the SharePoint list deployment flow
1. After the import is done, go to My flows and refresh the list of flows.
2. Select the newly imported flow, DeploySPLists.
3. Select Edit on the command bar.
4. Open the Variable – Target Site for Lists card.
5. For Value, enter the name of your SharePoint site.
6. Open the Variable – App name card.
7. For Value, enter the name of your app; by default, the name is Crisis Communication.

8. Select Save.
Run the SharePoint list deployment flow
1. Go back to the detail screen for the DeploySPLists flow.
2. Select Run on the command bar.
3. Select Continue, and then select Run flow.

NOTE
You might receive an error stating that location services are required. If this occurs, allow location services to access Power
Automate and refresh the page before trying again.
The flow creates the following SharePoint lists in your SharePoint site.

DISPLAY TITLE PURPOSE DESCRIPTION

CI_LogosAssets To hold the logo and/or other images to The library for related logos and other
be referenced from the app. The logo image assets for the [App Name] app.
will be referenced in Power Apps by a
direct link or via the ID number of the
logo you want to use.

CI_configAdminSetup Used for feature configuration by the Admin configuration list for the [App
admin of the app. Name] app.
Note: This list should be read-only for
all members who aren't admins.

CI_Contacts Using the default Contacts Content The contacts list for the [App Name]
type to capture information about app.
contacts. (No people picker is included,
so this list might need to be manually
maintained to ensure its data is up to
date.)
Note: This depends on the global
contact list type's being a default
content type in the list.

CI_CompanyNews Collection of Company News items. A list for managing the news items that
appear in the [App Name] app. You can
use the Deprecated column to remove
news items from the app views, while
retaining them as a record.

CI_FAQ Frequently asked questions. The list of frequently asked questions


for the [App Name] app. You can use
the Deprecated column to remove
FAQ items from the app views, while
retaining them as a record.

CI_UsefulLinks Useful hyperlinks list. The list of useful hyperlinks for the [App
Name] app. You can use the
Deprecated column to remove
hyperlink items from the app views,
while retaining them as a record.

CI_Employee Tracking current employee presence The list of messages that indicate the
status. Examples: working from home, status of an employee's presence for the
out sick, on personal leave, and out [App Name] app. You can use the
on vacation. Note: The status coming Deprecated column to remove status
to work is assumed and not included in messages from the app views, while
the list options. retaining them as a record.

CI_HelpfulTips Helpful tips that users have contributed List for the management of shared tips
for their peers. for the [App Name] App. You can use
the Deprecated column to remove tips
from the app views, while retaining
them as a record.
NOTE
All these list columns should be considered as dependencies. Protect the lists from accidental schema changes (for
example, adding new columns is allowed, but deleting columns might break the app.)
Use caution when deleting list items; deleting list items deletes historical records. You can turn the deprecation value
toggle from No to Yes to drop records from contacts, news, FAQs, or links.

Import and set up the Crisis Communication app


After all SharePoint lists have been created, you can import the app and connect it to your new data sources.

NOTE
If you don't want to use the admin app, you can edit these same properties by editing the SharePoint lists manually.

Import the app


1. Sign in to Power Apps.
2. Select Apps from the left navigation pane.
3. Select Import on the command bar.
4. Upload the CrisisCommunication.zip file from the GitHub repository.

NOTE
If your tenant is in a GCC environment, upload CrisisCommunicationGCC.zip.

5. Complete the import setup for Microsoft Teams Connection and Office 365 Users Connection by
selecting the appropriate connections by using the Select during import hyperlink. You might have to
create a new connection, if it doesn't already exist.
6. Select Import.
Update the SharePoint connections
1. Go back to the Apps list.
2. Select More commands (...) for the Crisis Communication app.
3. Select Edit from the context menu.

4. Sign in or create any necessary connections, and then select Allow.


5. Go to the data sources in the left pane.

6. Remove existing SharePoint lists inside the app, because they don't point to your current SharePoint site.
7. Add the lists from your own SharePoint site. Start by searching for SharePoint in the search bar.

8. Select SharePoint, and then choose a connection.

9. Copy and paste the URL to your SharePoint site in the text field, and then select Connect.

10. Select all the SharePoint lists and libraries, and then select Connect.
11. Select Save, and then select Publish.
Optional: Enable location updates
This app allows you to record a user's location and store it in your SharePoint site whenever a user sets their status.
Your crisis management team can view this data in a Power BI report.

NOTE
Enabling location updates is optional. You can skip this section if you don't want to track user location.

To enable location updates


1. Search for the btnDateRange control.
2. Open the OnSelect property of the btnDateRange control in the formula bar.
3. Copy and paste the following snippet in the formula bar for the OnSelect property.

NOTE
The following snippet is intended to work with versions of the solution that are older than 2020.03.16.

UpdateContext({locSaveDates: true});
// Store the output properties of the calendar in static variables and collections.
ClearCollect(submittedDates,Sort(Filter(selectedDates,ComponentId=CalendarComponent.Id),Date,Ascending))
;
Set(varStartDate,First(submittedDates).Date);
Set(varEndDate,First(Sort(submittedDates,Date,Descending)).Date);
// Create a new record for work status for each date selected in the date range.
ForAll(
Filter(
RenameColumns(submittedDates,"Date","DisplayDate"),
ComponentId=CalendarComponent.Id,
!(DisplayDate in colDates.Date)
),
Patch('CI_Employee Status',Defaults('CI_Employee Status'),
{
Title: varUser.userPrincipalName,
Date: DisplayDate,
Date: DisplayDate,
Notes: "",
PresenceStatus: LookUp(colWorkStatus,Value=WorkStatusComponent.Selected.Value)

// To implement location, add a comma to the line above and uncomment the lines below for
latitude and longitude.
// Latitude: Text(Location.Latitude),
// Longitude: Text(Location.Longitude)
}
)
);
// Update existing dates with the new status.
ForAll(
AddColumns(
Filter(
RenameColumns(submittedDates,"Date","DisplayDate"),
ComponentId=CalendarComponent.Id,
DisplayDate in colDates.Date
),

// Get the current record for each existing date.

"LookUpId",LookUp(RenameColumns(colDates,"ID","DateId"),And(Title=varUser.userPrincipalName,Date=Display
Date)).DateId
),
Patch('CI_Employee Status',LookUp('CI_Employee Status',ID=LookUpId),
{
PresenceStatus: LookUp(colWorkStatus,Value=WorkStatusComponent.Selected.Value)
}
)
);
If(
IsEmpty(Errors('CI_Employee Status')),

// Update the list of work status for the logged-in user.


ClearCollect(colDates,Filter('CI_Employee Status',Title=varUser.userPrincipalName));
// Send an email receipt to the logged-in user.
UpdateContext(
{
locReceiptSuccess:
Office365Outlook.SendEmailV2(
// To: send an email to oneself
varUser.mail,
// Subject
Proper(WorkStatusComponent.Selected.Value) & ": " & varStartDate &
If(varStartDate<>varEndDate," - " & varEndDate),
// Body
WorkStatusComponent.Selected.DateRangeReceipt & ": " &
// Create a bulleted list of dates
"<ul>" &
Concat(submittedDates,"<li>" & Date & Char(10)) &
"</ul>"
)
}
);
If(
locReceiptSuccess,
Notify("You successfully submitted your work status. An email has been sent to you with a
summary.",NotificationType.Success,3000),
Notify("There was an error sending an email summary, but you successfully submitted your
work status.",NotificationType.Success,3000);
);

Navigate('Share to Team Screen',LookUp(colStyles,Key="navigation_transition").Value),

// Case: Error submitting work status


Notify(varString.WorkStatusError,NotificationType.Warning)
);
UpdateContext({locSaveDates: false})
Optional: Add additional work status messages
If you want to add more work status messages beyond work from home and out of office, you can do that by
completing the following steps. To begin, you need to update your SharePoint site.
1. Go back to your SharePoint site, and then select Site contents.
2. Select CI_Employee Status.
3. If the PresenceStatus column isn't present, select Add column.
4. Select Show/hide columns.

5. Select PresenceStatus.
6. Select Apply.
7. Select the PresenceStatus column.

8. Select Column settings, and then select Edit.


9. Add your additional work status messages in the Choices field.

NOTE
Record the name of your new choices; you'll use them in subsequent steps.

Now you need to make a few adjustments to the app itself to show your new work status messages.
1. Open the app in Power Apps Studio.
2. Select the Work Status screen.
3. Set the formula bar to the OnVisible function.

4. Edit the following template, and replace the values with your own.
```
,"<Name of option in SharePoint list; case sensitive>",
Table(
{
Icon: <Image file>,
DateRangeQuestion: "Select the dates you'll be <Name of status>.",
DateRangeReceipt: "You're currently <Name of status>.",
ShareToTeamEmail: "I'll be <Name of status> on these dates",
AutoReplyMessage: "I'll be <Name of status> on these dates"
}
)
```

1. Replace the /* TEMPLATE FOR ADDITIONAL WORK STATUS OPTIONS */ string with the template.
2. Select Save, and then select Publish.
Update the Request for help flow
This flow sends an adaptive card to a central Teams team, requesting help.

Before completing the following step, create a crisis management team in Teams. After you create the team, you
can get the ID for it and bring it into your flow. More information about creating a Teams team: Create a central
crisis management Teams team
1. Go to the Teams channel that you want to post all your help requests to.
2. Select More options (...) for the channel.
3. Select Get link to channel.
4. Copy the link and paste it in a text editor.

5. Extract the Team ID, which is everything after groupId= and before &tenantId= .
For example, in the following URL, the channel ID is
8bc7c0c2-0d4c-4fb8-af99-32da74c9237b

https://teams.microsoft.com/l/channel/19%3ab2fa9fc20f3042a9b63fc5890e1813f8%40thread.tacv2/General?
groupId=8bc7c0c2-0d4c-4fb8-af99-32da74c9237b&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47

6. Extract the Channel ID, which is everything after https://teams.microsoft.com/l/channel/ and before
/General .
For example, in the following URL, the channel ID is
19%3ab2fa9fc20f3042a9b63fc5890e1813f8%40thread.tacv2

https://teams.microsoft.com/l/channel/19%3ab2fa9fc20f3042a9b63fc5890e1813f8%40thread.tacv2/General?
groupId=8bc7c0c2-0d4c-4fb8-af99-32da74c9237b&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47
,
7. Go to flow.microsoft.com.
8. Select My flows from the left navigation pane.
9. Select More commands (...) for CrisisCommunication.Request, and then select Edit.
10. Open the Team Id card.
11. Paste the team ID into the Value field.
12. Open the Channel ID card.
13. Paste the channel ID into the Value field.

14. Scroll down to the Get Time actions and update the action for Convert time zone by using your choice of
source and destination times.
Optional: Configure a shared inbox
The CrisisCommunication.Request flow pulls requests from your inbox before sending them to Teams. If you'd
prefer to send request emails to a shared inbox, follow these steps.

NOTE
You can skip this section if you don't want to send request emails to a shared inbox.

1. Open the CrisisCommunication.Request flow in Edit mode.


2. Select More commands (...) from When an email arrives V3.
3. Select Delete.

4. Search for and select When a new email arrives in a shared mailbox (V2).
5. Enter the shared inbox address in Mailbox Address.
6. Open the Comments card.
7. Select Add a dynamic value for Value.
8. Search for and select Body.

9. Open the Get user profile card (V2) card.


10. Select Add a dynamic value.
11. Search for and select From.

Import and set up the admin app


To manage the app you imported, repeat the same steps for the admin app.
1. Sign in to Power Apps.
2. Select Apps from the left navigation pane.
3. Select Import on the command bar.
4. Upload the CrisisCommunicationAdmin.zip file from the GitHub repository.
5. Select Import.
Update SharePoint connections for the admin app
1. Go back to the Apps list.
2. Select More Commands (...) for Crisis Communication Admin App.
3. Select Edit from the context menu.

4. Sign in or create any necessary connections, and then select Allow.


5. Go to the data sources in the left pane.
6. Remove existing SharePoint lists inside the app, because they don't point to your current SharePoint site.

7. Add the lists from your own SharePoint site. Start by searching for SharePoint in the search bar.

8. Select SharePoint, and then choose a connection.


9. Copy and paste the URL to your SharePoint site in the text field, and then select Connect.

10. Select all SharePoint lists and libraries, and then select Connect.

11. Select Save, and then select Publish.

Create initial content for the app


At this point, you've successfully imported both the Crisis Communication app and its admin app. You can now
start creating the initial content. To start, open the Crisis Communication Admin app.
If you have a GCC environment, you need to enable GCC mode. More information: How to configure mobile
clients for GCC environments.
You use the admin app to customize all the information in the Crisis Communication app and also to configure key
settings for the accompanying flows.

NOTE
As a reminder—if you don't want to use the admin app, you can edit these properties by editing the SharePoint lists
manually.

Set up key parameters under Admin Settings


To initialize your app, you need to provide all of the required fields by navigating to Admin Settings.
Complete all the fields as shown in the following table, and then select Save.

LOGICAL NAME IN
FIELD NAME SHAREPOINT PURPOSE EXAMPLE

Admin email AdminContactEmail This is where email requests admin@contoso.com


are sent. They should be set
to your email address. If
you'd like to send
notifications to another
inbox, see optional shared
inbox configuration, earlier in
this article.

Logo URL Logo The logo of your app that https://contoso.com/logo.pn


appears in the upper-left g
corner.
LOGICAL NAME IN
FIELD NAME SHAREPOINT PURPOSE EXAMPLE

AAD group ID AADGroupID Used to send notifications to c0ddf873-b4fe-4602-b3a9-


users about internal 502dd944c8d5
company updates via the
Notify users on new crisis
communication news flow.
Follow the instructions below
to get the Azure Active
Directory (Azure AD) ID of
your group.

APP URL AppURL The location of the user app, https://apps.preview.powera


so that the Notify users on pps.com/play/?tenantId=
new crisis communication
news flow can redirect users
there after they select Read
more.

Government RSS Feed GovernmentRSSFeed Used to populate the world https://www.who.int/rss-


news feature in the app. feeds/news-english.xml
Useful if you want to provide
additional information to
your employees from a
trusted source.

Notification method PreferredSentNotification Used by the Notify users Email, Teams notification,
on new crisis push notification
communication news flow
to determine which
distribution channel it should
use when sending out
notifications. This field is
required.

Feature flags Feature1...8 Used to disable or enable


each feature in the
application.

NOTE
Teams notification and push notification are currently not supported in GCC.

Finding the Azure AD ID for your distribution group


1. Go to aad.portal.azure.com.
2. Select Azure Active Directory from the left navigation pane.
3. Select Groups.
4. Search for and select your distribution group.
5. Copy the Object Id field.
6. Paste the ID into the AAD group ID field in the admin app.
Set up emergency contacts
1. Go to Company Contacts.
2. Select Create new contact.
3. Complete the form by using the contact details.
List schema:

FIELD NAME LOGICAL NAME IN SHAREPOINT PURPOSE

Full name FullName The name of the contact.

E-mail E-mail The email address that's shown for the


contact.

Country Country The country for the contact. This field is


used to group the contacts; you can use
other values to group contacts by if
countries don't make sense for you.

Comments Comments Shows additional information about the


contact; useful to describe when to
reach out to this contact.

Deprecated Deprecated Use to hide an existing emergency


contact.

Set up initial company news


1. Go to Company News.
2. Select Create new post.
3. Complete the form.
List schema:

FIELD NAME LOGICAL NAME IN SHAREPOINT PURPOSE

Title Title The title of the update.

Details Details The full update. You can use HTML in


this field.

Blurb Blurb A short message about the update. This


is used in the Notify users on new
crisis communication news flow and
in the gallery of updates.

Deprecated Deprecated Use to hide an existing post.

Set up helpful tips


1. Go to Helpful tips.
2. Select New tip.
3. Complete the form.
List schema:

FIELD NAME LOGICAL NAME IN SHAREPOINT PURPOSE

Title Title The title of the helpful tip.

Resource URL ResourceURL A link to additional reading material.


(Optional)

Sub title SubTitle A subtitle for the tip. (Optional)

Description Description The full description of the helpful tip.

Deprecated Deprecated Use to to hide a helpful tip.

Set up links
1. Go to Links.
2. Select Create new link.
3. Complete the form.
List schema:

FIELD NAME LOGICAL NAME IN SHAREPOINT PURPOSE

Title Title The text of the link.

URL URL The URL of the link.

Description Description Additional details about the link.


(Optional)

Deprecated Deprecated Use to hide a link.


Set up FAQs
1. Go to FAQ.
2. Select Create new FAQ.
3. Complete the form.
List schema:

FIELD NAME LOGICAL NAME IN SHAREPOINT PURPOSE

Title Title The question in the FAQ.

Rank Rank The order of the question in the FAQ.

Answer Answer The answer to the question in the FAQ.

Deprecated Deprecated Use to hide a question in the FAQ.

Test and share the app


Now that you've successfully set up all the data, you can test the app to make sure it works.
1. Sign in to Power Apps.
2. Select Apps from the left navigation pane.
3. Select Crisis Communication to play the app.
After you've successfully tested the app, you can share it with everyone in your company.

Import and set up the notification flow


The app uses a flow to send notifications to end users whenever there is a new company update.
Import the news notification flow
1. Go to flow.microsoft.com.
2. Select My flows from the left navigation pane.
3. Select Import on the command bar.
4. Upload the CrisisCommunicationNewsNotification.zip package from the GitHub repository.

NOTE
If your tenant is in a GCC environment, upload CrisisCommunicationNewsNotificationGCC.zip.
5. Add connections for the new flow by selecting the Select during import link for each connection, and then
completing the form.

6. If you need to create a new connection, select Create new in the Import setup pane.
7. Select New connection on the command bar.
8. Search for the name of the connection; for example, PowerApps Notification (preview).

9. Select the connection you want.


10. If you're creating a connection to PowerApps Notifications (preview), you'll see the dialog box as
illustrated in the following image.

11. To get the ID, go to your Apps list.


12. Select More Commands (...) for the Crisis Communication app, and then select Details.
13. Copy the App ID.

14. Paste the app ID into the connection creation dialog box, and then select Create.

15. After you've created your new connection, go back to the Import setup pane and then select Refresh list.
16. Your new connection should now appear. Select it, and then select Save.
17. After you've finished adding all your connections, select Import.
Edit the news notification flow
1. After the import is done, go to My flows.
2. Select the newly imported flow, Notify users on new crisis communication news.

NOTE
If you uploaded the GCC package, the flow name is Notify users on new crisis communication news GCC.

3. Select Edit on the command bar.


4. Open the When a new item is posted card.
5. For Site Address, enter the name of your SharePoint site.
6. For List name, enter CI_CompanyNews.
7. Open the Get the admin config settings card.
8. For Site Address, enter the name of your SharePoint site.
9. For List name, enter CI_configAdminSetup.
10. Open the Initialize variable – Read more text card.
11. For Value, enter Read more (in your native language).
12. Select Save.

NOTE
You might receive an error if one of your connections hasn't been authorized yet. If this occurs, please open the card with the
unauthorized connection and reauthorize.

Optional: Sending notifications to more than 5000 users


The current Get group members action is limited to pulling 5000 users if you are using the Office license of
Power Automate. If you have a premium license and would like to distribute to up to 100000 users, you can follow
these steps to send to more users.
1. Select the ... menu for the Get group members card.

2. Select Settings.
3. Change the Threshold field to 100,000
4. Select Done
5. Select Save.
Test the news notification flow
To test the news notification flow, go to the admin app and create a new internal company update. Later, all of the
users in your distribution list will receive an update by your preferred notification method.

NOTE
If you run into errors, make sure that you've successfully entered the group ID of your distribution list in the settings for the
admin app.

Monitor office absences with Power BI


After you've deployed the app and people start to send notifications that they'll be out of the office for various
reasons (such as being sick or working from home), you can use a Power BI report to track how many people have
sent notifications and where they're located.
Note that you need to enable location tracking to make the map control work.

IMPORTANT
For the Power BI report to work, you must have at least one entry in the CI_Employee Status list.

We'll need some information from the CI_Employee Status SharePoint list we created earlier, so let's get to it first.
Open the list in your site, and then select List Settings under the Settings icon.
Make a note of the site name and list ID on the browser address bar, as shown in the following image.

At this point, we're ready to open the Power BI report. Open Power BI, and then open the Presence status
report.pbix file. Hover over the right-hand side of the CI_Employee Status data source until you see the ellipsis.
Select it, and then select Edit query.

After the Power Query editor is opened, right-click the CI_Employee Status data source, and then select
Advanced Editor.
This is where we use the site name and list ID from the SharePoint list.
Copy the new SharePoint site into the SharePoint.Tables string as shown in the following illustration and the list ID
in the three places where the GUID is highlighted, and then select Done.

If you see any connection errors after updating the connection information, you might need to update the
credentials used to connect to the SharePoint list.
To update the connection
1. On the File menu, select Options and settings, and then select Data source settings.
2. Select Edit permissions.

3. Ensure the Credentials type is set to Organizational account, and use the credentials to access the
SharePoint list.
Select Close & Apply to update the report to pull data from your SharePoint list.

We now have a Power BI report that shows both the geographical information for office absences for the current
day and a trend of such absences over several days. We can publish the report so other people in the organization
can see it.

Your report is now published. You can share it with others in your organization. You can also schedule the report
refresh frequency.

Integrate your app into Teams


Now that you have a functioning app that has been shared with everyone, you can deploy the app by creating a
crisis management team within Teams to respond to issues.
Deploy the app to the app bar
If you're a Teams admin, you can push the app to all your users in the Teams app bar.

1. Sign in to Power Apps.


2. Select Apps from the left navigation pane.
3. Select More commands (...) for the Crisis Communication app.
4. Select Add to Teams.

5. Select Download app.


6. Open Teams.
7. Go to Apps on the app bar.
8. Select Upload a custom app.
9. If you're a Teams admin, you'll be able to upload an app for your entire tenant. Select Upload for Contoso
(where Contoso represents the name of your tenant)..

10. Upload the file that you downloaded from Power Apps.
11. Go to the Teams admin center.
12. In the left navigation pane under Teams apps, select Setup policies.
13. Select Global (Org-wide setup).
14. Select Add apps.

15. Search for and select the Crisis Information app you uploaded.
16. Select Add.
17. Select Save.

NOTE
It can take up to 24 hours for users to see the app automatically pinned in their app bar.

Create a central crisis management team in Teams


To coordinate your crisis response, you'll want to create a central crisis management team in Teams and populate it
with all relevant information.
1. Go to Teams.
2. Select Teams from the left app bar.
3. Select Join or create a Team.
4. Select Create team, and then complete the remaining steps.

After you've successfully created your team, you can pin relevant information as tabs. For example, you might want
to pin the crisis management admin app or the Power BI report to your team.
To add the admin app as a tab
1. Select the + button.
2. Search for and select Power Apps.
3. Search for and select Crisis Information Admin.

4. Select Save.
To add the Power BI report as a tab
1. Select the + button.
2. Search for and select Power BI.
3. Search for and select your Power BI report.
4. Select Save.

FAQ
What licenses do I need to run this solution?
The solution in this app uses Office connectors, therefore a seeded Power Apps license from Office is
sufficient to run and play the user and admin apps. More information: Power Platform licensing overview
If you want to use the Power BI report (packaged as part of the solution), you'll need a Power BI license.
More information: Power BI pricing
Where should I go if I have feedback about the solution?
We'd love to hear about your experience deploying and customizing this solution. To share your experience,
go to aka.ms/crisis-communication-feedback.
It looks like I found a bug with the app; where should I go?
To file a bug with the solution, go to aka.ms/crisis-communication-issues.
What features aren't currently supported in GCC?
The Power Automate bot connector for Teams and the Push Notification connector are currently not
available for GCC. Use the email option to alert users about internal news updates instead.

Issues and feedback


For feedback about the Crisis Communication sample template, go to aka.ms/crisis-communication-feedback.
To report an issue with the Crisis Communication app, go to aka.ms/crisis-communication-issues.
Disclaimer: This app is a sample and may be used with Microsoft Power Apps and Teams for dissemination of
reference information only. This app is not intended or made available for use as a medical device, clinical support,
diagnostic tool, or other technology intended to be used in the diagnosis, cure, mitigation, treatment, or prevention
of disease or other conditions, and no license or right is granted by Microsoft to use this app for such purposes. This
app is not designed or intended to be a substitute for professional medical advice, diagnosis, treatment, or
judgement and should not be used as such. Customer bears the sole risk and responsibility for any use of this app.
Microsoft does not warrant that the app or any materials provided in connection therewith will be sufficient for
any medical purposes or meet the health or medical requirements of any person.
See also
Formula reference
Controls reference
Create a canvas app from a template in Power Apps
1/31/2020 • 2 minutes to read • Edit Online

Create a canvas app automatically based on a template for a specific scenario, such as tracking budgets and
scheduling vacations, and then run the app to understand its default behavior.
To create an app from a template, you need a cloud-storage account (such as DropBox, OneDrive, or Google
Drive) to store the template's sample data.
If you don't have a license for Power Apps, you can sign up for free.

Create an app
1. Sign in to Power Apps.
2. Select Apps from left navigation. Select the New app drop down menu and then select Canvas.

This opens Power Apps Studio in a new tab.


3. On the App templates tile, select Phone layout or Tablet layout.

4. In the list of templates, select a template, and then select Use (near the lower-right corner).
The Power Apps Studio opens in new tab and the app gets created.

NOTE
If Use button is disabled, ensure you have selected a data source for the app. You can select the data source by
selecting Choose at the bottom.

Run the app


An app from a template opens in the default workspace, where you'll spend most of your time customizing.
Before you make any changes to the app, explore how the app works in Preview mode.
1. Press F5 (or click or tap the right arrow in the upper-right corner) to open the app in Preview mode.

The app is populated with sample data to demonstrate the functionality of the app. For example, the Cost
Estimator app contains data for creating appointments and estimating the cost of installing a specific
flooring product in a room of a particular size.
2. Explore the app's default behavior by creating, updating, and deleting sample data, and then verify that the
data in your cloud-storage account reflects your changes.
For example, make an appointment, and create a cost estimate in the Cost Estimator app.
3. Return to the default workspace by pressing Esc (or by clicking or tapping the X icon near the upper-right
corner).

Next steps
1. Press Ctrl-S, give your app a name, and then click or tap Save to save your app to the cloud.
2. Share your app with other people in your organization.
IMPORTANT
Before you share an app, make sure that the people with whom you're sharing it have access to the data. For example, you
must share an Excel or other file in a cloud-storage account.
Create a canvas app from Common Data Service in
Power Apps
12/10/2019 • 2 minutes to read • Edit Online

In Power Apps, create a canvas app based on a list of sample accounts in Common Data Service. In this app, you
can browse all accounts, show details of a single account, and create, update, or delete an account.
If you're not signed up for Power Apps, sign up for free before you start.

Prerequisites
To follow this quickstart, you must be assigned to the Environment Maker security role, and you must switch to
an environment in which a database in Common Data Service has been created, contains data, and allows
updates. If no such environment exists and you have administrative privileges, you can create an environment
that meets this requirement.

Create an app
1. Sign in to Power Apps and, if necessary, switch environments as specified earlier in this topic.
2. Under Make your own app, hover over Start from data, and then select Make this app.

3. On the Common Data Service tile, select Phone layout.

4. Under Choose a table, select Accounts, and then select Connect.


5. If the Welcome to Power Apps Studio dialog box appears, select Skip.
Your app opens to the browse screen, which shows a list of accounts in a control called a gallery. Near the top of
the screen, a title bar shows icons for refreshing the data in the gallery, sorting the data in the gallery
alphabetically, and adding data to the gallery. Under the title bar, a search box provides the option to filter the
data in the gallery based on text that you type or paste.
By default, the gallery shows an email address, a city, and an account name. As you'll see in Next steps, you can
customize the gallery to change how the data appears and even show other types of data.

Save the app


You'll probably want to make more changes before you use this app or share it with others. As a best practice,
save your work so far before you proceed.
1. Near the upper-left corner, select the File tab.
2. In the App settings page, set the app name to AppGen, change the background color to deep red, and
change the icon to a checkmark.

3. Near the left edge, select Save and then, in the lower-left corner, select Save.

Next steps
In this quickstart, you created an app to manage sample data about accounts in Common Data Service. As a
next step, customize the gallery and other elements of the default browse screen to better suit your needs.
Customize a gallery.
Create a canvas app in Power Apps from a
SharePoint list
12/10/2019 • 3 minutes to read • Edit Online

In this topic, you'll use Power Apps to create a canvas app based on items in a SharePoint list. You can create the
app from within Power Apps or SharePoint Online. From within Power Apps, you can create the app based on a
list in an on-premises SharePoint site if you connect to it through a data gateway.
The app that you create will contain three screens:
In the browse screen, you can scroll through all items in the list.
In the details screen, you can show all information about a single item in the list.
In the edit screen, you can create an item or update information about an existing item.
You can apply the concepts and techniques in this topic to any list in SharePoint. To follow the steps exactly:
1. In a SharePoint Online site, create a list named SimpleApp.
2. In a column named Title, create entries for Vanilla, Chocolate, and Strawberry.
The principles of generating an app won't change even if you create a list that's far more complex, with many
columns of various types such as text, dates, numbers, and currency.

IMPORTANT
Power Apps doesn't support all types of SharePoint data. For more information, see Known issues.

Create an app from within Power Apps


1. Sign in to Power Apps.
2. Under Make your own app, hover over Start from data, and then select Make this app.

3. On the SharePoint tile, select Phone layout.


4. With the Connect directly option selected, select Create.

5. Under Connect to a SharePoint site, type or paste the URL for your SharePoint Online site, and then
select Go.
Include only the site URL (not the name of the list), as in this example:
https://microsoft.sharepoint.com/teams/Contoso

6. Under Choose a list, select SimpleApp, and then select Connect.


After a few minutes, your app opens to the browse screen, which shows the items that you created in your
list. If your list has data in more columns than just Title, the app will show that data. Near the top of the
screen, a title bar shows icons for refreshing the list, sorting the list, and creating an item in the list. Under
the title bar, a search box provides the option to filter the list based on text that you type or paste.

You'll probably want to make more changes before you use this app or share it with others. As a best
practice, save your work so far by pressing Ctrl-S before you proceed. Give your app a name, and then
select Save.

Create an app from within SharePoint Online


If you create an app of a custom list from the SharePoint Online command bar, the app appears as a view of that
list. You can also run the app on an iOS or Android device, in addition to a web browser.
1. In SharePoint Online, open a custom list, select PowerApps on the command bar, and then select Create
an app.

2. In the panel that appears, type a name for your app, and then select Create.

A new tab appears in your web browser that shows the app that you created based on your SharePoint list.
The app appears in Power Apps Studio, where you can customize it.

3. (optional) Refresh the browser tab for your SharePoint list (by selecting it and then, for example, pressing
F5), and then follow these steps to run or manage your app:
To run the app (in a separate browser tab), select Open.
To let others in your organization run the app, select Make this view public.
To let others to edit your app, share it with Can edit permissions.
To remove the view from SharePoint, select Remove this view.
To remove the app from Power Apps, delete the app.
NOTE
Apps created from the SharePoint list currently do not show in the Power Apps Mobile.

Next steps
In this topic, you created an app to manage data in a SharePoint list. As a next step, create an app from a more
complex list, and then customize the app (starting with the browse screen) to better suit your needs.
Customize a default browse screen
Create a canvas app from Excel in Power Apps
12/10/2019 • 2 minutes to read • Edit Online

In this topic, you'll create your first canvas app in Power Apps using data from an Excel table. You'll select an
Excel file, create an app, and then run the app that you create. Every created app includes screens to browse
records, show record details, and create or update records. By generating an app, you can quickly get a working
app using Excel data, and then you can customize the app to better suit your needs.
The Excel file must be in a cloud-storage account, such as OneDrive, Google Drive, or Dropbox. This topic uses
OneDrive for Business.
If you don't have a license for Power Apps, you can sign up for free.

Prerequisites
To follow this topic exactly, download the Flooring Estimates file in Excel, and save it in your cloud storage
account.

IMPORTANT
You can use your own Excel file, but the data must be formatted as a table. For more information, see Format a table.

Create the app


1. Sign in to Power Apps.
2. Under Make your own app, hover over Start from data, and then select Make this app.

3. Under Start with your data, click or tap Phone layout on the tile for your cloud-storage account.
4. If prompted, click or tap Connect, and provide your credentials for that account.
5. Under Choose an Excel file, browse to FlooringEstimates.xlsx, and then click or tap it.
6. Under Choose a table, click or tap FlooringEstimates, and then click or tap Connect.

Run the app


1. Open Preview by pressing F5 (or by clicking or tapping the play icon near the upper-right corner).

2. Toggle the sort order by clicking or tapping the sort icon near the upper-right corner.

3. Filter the list by typing or pasting one or more characters in the search box.
For example, type or paste Honey to show the only record for which that string appears in the product's
name, category, or overview.
4. Add a record:
a. Select the plus icon.

b. Add whatever data you want, and then select the checkmark icon to save your changes.

5. Edit a record:
a. Select the arrow for the record that you want to edit.

b. Select the pencil icon.

c. Update one or more fields, and then select the checkmark icon to save your changes.

As an alternative, select the cancel icon to discard your changes.


6. Delete a record:
a. Select the next arrow for the record that you want to delete.

b. Select the trash icon.

Next steps
Customize the default browse screen to better suit your needs. For example, you can sort and filter the list by
product name only, not category or overview.
Customize a default browse screen.
Preview: Create a canvas app from Azure SQL
Database
12/3/2019 • 4 minutes to read • Edit Online

[This topic is pre-release documentation and is subject to change.]


In this topic, you'll use data in your Azure SQL Database to create an app with Power Apps in minutes. You’ll have
a fully functional app with your data that you can customize to fit your business needs and share on any device.

IMPORTANT
This is a preview feature.
A preview feature may have limited availability and restricted functionality. A preview feature is available before an official
release so that customers can get early access and provide feedback.

Prerequisites
Your browser must have pop-ups enabled.
You need an Azure subscription.
If you don't have an Azure subscription, create a free account.
You need access to an existing SQL Database.
If you don't have an existing SQL Database, create a new database.
You need to allow Power Apps region IP addresses or Azure services access to SQL Database in firewall
settings.
The SQL Database table must have at least one column with text data type.
You need a valid Power Apps license or sign up for a 30 day trial license.

Create an app
1. Sign into Azure Portal.
2. Navigate to your SQL Database.
3. Select Power Apps.
NOTE
If you don't have a Power Apps license, you'll see a blue information bar with a link to start a trial. When you select to
start a trial, you'll be taken to a new tab where you'll be signed up for a license. Once complete, go back to the Azure
portal and refresh the blade to continue.

4. Type a name for the app such as “Site Inspection”, “Fundraiser”, or “Budget Tracker”.
5. Enter a SQL authentication password and if required, change the username.
6. Select a table from the dropdown list that you want to use to create the app.
7. Select Create.
The Power Apps Studio opens in a new tab. If the pop-up is blocked, update the browser to allow pop-ups
and try again. Once created, you'll have a 3-page app with data from your SQL Database.

Accessing your app


To access the created app again, go to make.powerapps.com.

App environment and region


The app you create with this method uses the default environment for the tenant and deploys to the region of this
environment. You can find the region of a deployed app or your tenant's default environment from the admin
center. To review all apps in a specific environment, go to make.powerapps.com, select the Environment from the
ribbon, and then select Apps on the left.

App access to SQL Database


You can configure Power Apps to connect to SQL Database using IP addresses or as an Azure service.
App access using IP address
Power Apps system requirements lists the IP addresses that Power Apps uses depending on the region of the app.
You can use either a Transact-SQL stored procedure or the Azure portal to configure this access:
Stored procedure sp_set_firewall_rule for SQL Database or SQL Server firewall rules
Azure portal for SQL Server firewall rules
App access as an Azure service
Power Apps can connect to the SQL Database Allow access to Azure services control using the Azure portal. To
configure this access, sign in to the Azure portal and navigate in the portal to SQL Server. Select Firewalls and
virtual networks and set the control Allow Azure services and resources to access this server to ON. Select
Save to submit changes.

IMPORTANT
If you leave the control set to ON, your Azure SQL Database server accepts communication from any subnet inside the Azure
boundary, that is originating from one of the IP addresses that is recognized as those within ranges defined for Azure data
centers. Leaving the control set to ON might be excessive access from a security point of view.

Limitations
The app name can include only letters, numbers, hyphens, parentheses, or underscores.
Power Apps requires SQL authentication to connect to SQL Database.
You can select only one table while you are creating a canvas app from the Azure portal. Customize the app
after the app is created if you want to add more tables and other data sources by adding more data connections.
Power Apps cannot connect to SQL Database using VNet Service Endpoints. For more information, read
allowing access through VNet Service Endpoints.

Other considerations
The access of the app to SQL Database is implicitly shared to all users that you share this app with. Ensure the
SQL authentication credentials have appropriate access for reading and writing data.
For example, you can create a separate app that connects to the same SQL Database with different SQL
authentication credentials to segregate read and read/write access.
Review throttling limits, delegatable functions and operations, known issues, and limitations of the SQL
Database connector this feature uses for performance considerations.
Create an app from make.powerapps.com when you need to create an app for a non-default environment and a
different region for the tenant using data from SQL Database.

Next steps
In this quickstart, you created an app using data from your SQL Database using the Azure portal. As a next step,
customize the app with controls, images, and logic to better suit your business needs.
Design the canvas app interface in Power Apps

See also
Share a canvas app in Power Apps
Add a data connection to a canvas app in Power Apps
Microsoft Learn: Customize a canvas app in Power Apps
Tutorial: Customize a gallery in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

In this tutorial, you'll customize a list of records, called a gallery, and make other changes in an app that was
generated automatically in Microsoft Power Apps. Users can manage data in the app even if you don't make
these changes, but the app will be easier to use if you customize it for your organization's needs.
For example, the gallery for this tutorial matches this graphic by default. The email address is featured more
prominently than other types of data, and users can sort and filter the gallery based on text in that address:

However, your users might be more interested in the account name more than the email address, so you'll
reconfigure the gallery to highlight, sort, and filter based on the key data for your organization. In addition, you'll
change the title of the default screen to differentiate it from the other screens in the app.

You'll also add a scroll bar so that users who don't have touch screens or mouse wheels can browse the entire
gallery.
Change the layout of the gallery
Change the type of data that appears in the gallery
Change the columns by which users can sort and search the data
Change the screen title
Show a scroll bar
This tutorial starts with an app that was generated from a specific data source. However, the same concepts apply
to any app that you generate in Power Apps, whether from a SharePoint list, an Excel table, or some other data
source.
If you're not signed up for Power Apps, sign up for free before you start.

Prerequisites
Generate an app from the Accounts entity of Common Data Service.

Open the generated app


1. Sign in to Power Apps, and then select Apps near the left edge.
2. Find the app that you generated, select the ellipsis icon (...) for it, and then select Edit.

3. If the Welcome to Power Apps Studio dialog box appears, select Skip.

Change the layout


1. In the left navigation pane, select BrowseGallery1.
When the gallery is selected, a selection box with handles surrounds it.

2. On the Properties tab of the right-hand pane, open the list of options under Layout, and then select the
option that shows only a title.
3. Next to Fields, select Edit, and then select the down arrow for the title box.
The name of this control will end in a numeral, such as Title1, but the numeral might differ based on other
actions you might have taken.
4. In the list of options, select Account name, and then close the Data pane.
The gallery shows the name of each account.

Change sort and search columns


1. Select the gallery as the previous section describes.
2. Near the upper-left corner, confirm that the property list shows Items.

The value of this property appears in the formula bar. You set this property to specify not only the data
source for the gallery but also the columns by which users can sort and search the data.
3. Copy this formula, and then paste it in the formula bar.
SortByColumns(Search(Accounts, TextSearchBox1.Text, "name"), "name", If(SortDescending1, Descending,
Ascending))

By using this formula, you ensure that:


If a user types one or more characters in the search bar, the gallery shows only those account names
that contain the text that the user typed.
If a user selects the sort icon, the gallery is sorted alphabetically by account name in either ascending
or descending order, depending on how many times the user selects the icon.
For more information about these and other functions, see the formula reference.
Test sorting and searching
1. Open Preview mode by pressing F5 (or by selecting the play button near the upper-right corner).

2. Near the upper-right corner of the browse screen, select the sort icon one or more times to change the
alphabetical sort order between ascending and descending.

3. In the search box, type k to show only those account names that contain the letter that you typed.
4. Remove all text from the search bar, and then close Preview mode by pressing Esc (or by selecting the
close icon near the upper-right corner).

Change the screen title


1. Select the title of the screen by clicking or tapping it.

2. Ensure that the property list shows Text and then, in the formula bar, replace Accounts with Browse
(retaining the double quotation marks).

The screen reflects your change.

Show a scrollbar
If your users might have neither touch screens nor mouse wheels, configure the gallery to show a scrollbar when
the user hovers over it with the mouse. That way, users can show all accounts even if the screen can't show them
all at once.
1. Select the gallery as the first procedure describes.
2. Set the gallery's Show scrollbar property to true.

Next steps
In this tutorial, you've customized the gallery and made other changes to the default screen for browsing records
in a generated app. You can also customize the default screens for displaying details and creating or updating
accounts. As the browse screen contains a gallery, the other two screens in the app contain forms. You can
change, for example, which types of data the forms show and in which order.
Customize forms
Customize a canvas-app form in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

In a canvas app, customize a Display form control and an Edit form control so that they show the data that
matters most and in the most intuitive order to help users easily understand and update the data.
Each form comprises one or more cards, each of which shows data from a particular column in the data source. By
following the steps in this topic, you can specify which cards appear in a form and move cards up and down within
a form.
If you're unfamiliar with canvas-pps, see What are canvas apps?.

Prerequisites
Generate an app from the Common Data Service, and then customize the gallery in that app.

Show and hide cards


1. Sign in to Power Apps, and then open the app that you generated and customized.
2. In the left navigation bar, type or paste D in the search bar to filter the list of elements, and then select
DetailForm1.

3. On the Properties tab of the right-hand pane, select Edit fields to open the Fields pane.

4. Hide a field, such as Description, by hovering over it, selecting the ellipsis (...) that appears, and then
selecting Remove.
5. Show a field by selecting Add field, typing or pasting the first few letters of the field's name in the search
box, selecting the field's check box, and then selecting Add.

Reorder the cards


1. In the Fields pane, drag the Account Name field to the top of the list of fields.
The cards in DetailForm1 reflect the change.

2. (optional) Reorder the other cards into this sequence:


Account Name
Number of Employees
Annual Revenue
Main Phone
Address 1: Street 1
Address 1: Street 2
Address 1: City
Address 1: ZIP/Postal Code
3. In the left navigation bar, type or paste Ed in the search bar, and then select EditForm1 to select it.
4. Repeat the steps in the previous procedure and this one so that the fields in EditForm1 match those in
DetailForm1.

Run the app


1. In the left navigation bar, type or paste Br in the search bar, and then select BrowseScreen1 to select it.
2. Open Preview mode by pressing F5 (or by selecting the Preview icon near the upper-right corner).

3. In the upper-right corner, select the plus icon to add a record in EditScreen1.

4. Add whatever data you want, and then select the checkmark icon in the upper-right corner to save your
changes and return to BrowseScreen1.

5. Select the arrow for the item that you just created to show details about that item in DetailScreen1.

6. In the upper-right corner, select the edit icon to update the record in EditScreen1.

7. Change the information in one or more fields, and then select the check mark in the upper-right corner to
save your changes and return to DetailScreen1.

8. Near the upper-right corner, select the trash-can icon to delete the record that you just updated and to
return to BrowseScreen1.

9. Close Preview mode by pressing Esc (or by selecting the close icon near the upper-left corner).

Next steps
Save and publish your app.
Customize a card in your app.
Customize a card in a canvas app
10/7/2019 • 2 minutes to read • Edit Online

Perform basic customization (without unlocking a card) by, for example, changing its control. Perform advanced
customization by unlocking the card and, for example, adding a control that isn't available for that card by default.
For an overview, see Understand data cards.

Prerequisites
Learn how to add and configure controls.
You can review this topic for general concepts only, or you can follow it step by step if you first complete the
procedures in these topics:
1. Generate an app.
2. Customize its gallery.
3. Customize its forms.

Customize a locked card


In this procedure, you'll replace a Text-input control with a [Slider](controls/control-slider.md control without
unlocking the card.
1. In the app that you generated and customized, select EditForm1 in the left navigation bar, and then select
Edit fields on the Properties tab of the right-hand pane.
2. In the list of fields, select the down arrow for Number of Employees, and then open the list under Control
type.

3. Select Edit Slider.


The screen reflects your change.
Unlock and customize a card
In this procedure, you'll unlock a card and update the Max property of the Slider control that you just added.
1. In EditForm1, select the Slider control in the Number of Employees card.

2. On the Advanced tab of the right-hand pane, select the lock icon to unlock the card.

3. Set the Max property of the Slider control to 10,000.


The Slider control shows a more accurate value.

Next steps
Now that you have a basic understanding of how to generate an app and customize a gallery, a form, and a card,
you can build your own app from scratch.
Create a canvas app from scratch using Common
Data Service
12/3/2019 • 4 minutes to read • Edit Online

Build a canvas app to manage data that's stored in Common Data Service, using standard entities (which are
built in), custom entities (which your organization creates), or both.
When you build an app from Common Data Service, you don't need to create a connection from Power Apps, as
you do with data sources such as SharePoint, Dynamics 365, or Salesforce. You need only to specify the entities
that you want to show or manage in the app.

Prerequisites
Before you create an app from scratch, familiarize yourself with Power Apps basics by generating an app and
then customizing that app's gallery, forms, and cards.
Switch to an environment in which a database has been created with sample data. If you have an appropriate
license, you can create an environment to meet this need.
To create an app, you must be assigned to the Environment Maker security role.

Open a blank app


1. Sign in to Power Apps.
2. Under Make your own app, select Canvas app from blank.

3. Specify a name for your app, select Phone, and then select Create.
You can build an app from scratch for tablets, but this topic shows building an app for phones.

Specify an entity
1. In the middle of the screen, select connect to data.
2. In the Data pane, select Common Data Service, select the Accounts check box, and then select
Connect.
3. Close the Data pane by selecting the close icon in the upper-right corner.

Add a list screen


1. On the Home tab, select the down arrow for New screen, and then select List.

2. In the left navigation bar, select BrowseGallery1, and then set the value of the Items property to this
formula:
SortByColumns(Search(Accounts, TextSearchBox1.Text, "name"), "name", If(SortDescending1,
SortOrder.Descending, SortOrder.Ascending))

This formula specifies that:


The gallery should show data from the Accounts entity.
The data should be sorted in ascending order until a user selects the sort button to toggle the sort
order.
If a user types or pastes one or more characters into the search bar (TextSearchBox1), the list will
show only those accounts for which the name field contains the characters that the user specified.
You can use these and many other functions to specify how your app appears and behaves.

3. Set the gallery's layout to show only the name of each account, and configure the title bar to show the
word Browse, as Customize a gallery describes.
4. In the left navigation bar, hover over Screen1, select the ellipsis icon (...), and then select Delete.
5. In the left navigation bar, hover over Screen2, select the ellipsis icon (...), and then select Rename.
6. Type or paste BrowseScreen, and then rename the gallery in that screen as BrowseGallery.

Add a form screen


1. Repeat the first step of the previous procedure, except add a Form screen instead of a List screen.
2. Set the form's DataSource property to Accounts and its Item property to BrowseGallery.Selected, as
the Advanced tab of the right-hand pane shows.

3. On the Properties tab of the right-hand pane, select Edit Fields to open the Fields pane.
4. Select Add field, and then select the check boxes for these fields:
Account Name
Address 1: Street 1
Address 1: City
Address 1: ZIP/Postal code
Number of Employees
Annual Revenue

NOTE
Outside of this scenario, you can create a custom field by selecting New field, providing the required information,
and then selecting Done. More information: Create a field.

5. Select Add.
6. Set the title bar's Text property to show Create/Edit.
The screen reflects your changes.

7. Rename this screen FormScreen.

Configure icons
1. On the BrowseScreen, set the OnSelect property of the circular icon near the top of the screen to this
formula:
Refresh(Accounts)

2. Set the OnSelect property of the plus icon to this formula:


NewForm(EditForm1); Navigate(FormScreen, ScreenTransition.None)
3. Set the OnSelect property of the first arrow pointing to the right to this formula:
EditForm(EditForm1); Navigate(FormScreen, ScreenTransition.None)

4. On the FormScreen, set the OnSelect property of the cancel icon to this formula:
ResetForm(EditForm1);Navigate(BrowseScreen, ScreenTransition.None)

5. Set the OnSelect property of the checkmark icon to this formula:


SubmitForm(EditForm1); Navigate(BrowseScreen, ScreenTransition.None)

6. On the Insert tab, select Icons, and then select the Trash icon.
7. Set the Trash icon's Color property to White and its OnSelect property to this formula:
Remove(Accounts, BrowseGallery.Selected); Navigate(BrowseScreen, ScreenTransition.None)

Test the app


1. In the left navigation bar, select BrowseScreen, and then open Preview by pressing F5 (or by selecting
the play icon near the upper-right corner).

2. Toggle the list between ascending and descending sort orders, and filter the list by one or more
characters in the account name.
3. Add an account, edit the account that you added, start to update the account but cancel your changes,
and then delete the account.

Next steps
Link this app to a solution so that you can, for example, deploy it to a different environment or publish it on
AppSource.
Open one or more sample apps, and explore different types of apps that you can create.
Create a canvas app from scratch based on Excel
data
12/10/2019 • 7 minutes to read • Edit Online

Create your own canvas app from scratch based on Excel data, formatted as a table, and then add data from
other sources if you want. By following this tutorial, you'll create an app that contains two screens. On one
screen, users can browse through a set of records. On the other screen, users can create a record, update one or
more fields in a record, or delete an entire record. This approach takes more time than creating a basic app from
Excel does, but app makers who have more experience can use it to build the best app for their needs.

Prerequisites
To follow the steps in this tutorial exactly, first create an Excel file using this sample data.
1. Copy this data, and then paste it into an Excel file.

STARTDAY STARTTIME VOLUNTEER BACKUP

Saturday 10am-noon Vasquez Kumashiro

Saturday noon-2pm Ice Singhal

Saturday 2pm-4pm Myk Mueller

Sunday 10am-noon Li Adams

Sunday noon-2pm Singh Morgan

Sunday 2pm-4pm Batye Nguyen

2. Format that data as a table, named Schedule, so that Power Apps can parse the information.
For more information, see Format a table in Excel.
3. Save the file under the name eventsignup.xlsx, close it, and then upload it to a cloud-storage account,
such as OneDrive.

IMPORTANT
You can use your own Excel file and review this tutorial for general concepts only. However, the data in the Excel file must
be formatted as a table. For more information, see Format a table in Excel.

Open a blank app


1. Sign in to Power Apps.
2. Under Make your own app, select Canvas app from blank.
3. Specify a name for your app, select Phone, and then select Create.
You can design an app from scratch for phones or for other devices (such as tablets). This topic focuses on
designing an app for phones.

Power Apps Studio creates a blank app for phones.


4. If the Welcome to Power Apps Studio dialog box opens, select Skip.

Connect to data
1. In the middle of the screen, select connect to data.
2. In the Data pane, select the connection for your cloud-storage account if it appears. Otherwise, follow
these steps to add a connection:
a. Select New connection, select the tile for your cloud-storage account, and then select Create.
b. If prompted, provide your credentials for that account.
3. Under Choose an Excel file, type or paste the first letters of eventsignup to filter the list, and then
select the file that you uploaded.
4. Under Choose a table, select the checkbox for Schedule, and then select Connect.
5. In the upper-right corner of the Data pane, close it by selecting the close icon (X).

Create the view screen


1. On the Home tab, select the down-arrow next to New screen to open a list of screen types, and then
select List.
A screen is added with several default controls, such as a search box and a Gallery control. The gallery
covers the entire screen under the search box.
2. At the top of the new screen, select the Label control, and then replace [Title] with View records.

3. In the left navigation bar, select BrowseGallery1.


A selection box with handles surrounds the gallery.
4. On the Properties tab of the right-hand pane, select the down arrow for the Layout menu.

5. Select Title, subtitle, and body.


6. In the formula bar, replace CustomGallerySample with Schedule, and replace both instances of
SampleText with Volunteer.
7. On the right edge of the formula bar, select the down arrow, and then select Format text.
The formula matches this example:

SortByColumns(
Search(
Schedule,
TextSearchBox1.Text,
"Volunteer"
),
"Volunteer",
If(
SortDescending1,
SortOrder.Descending,
SortOrder.Ascending
)
)

8. On the Properties tab of the right-hand pane, select Edit next to the Fields label.
9. In the Title2 box, select Volunteer, in the Subtitle2 box, select StartDay, and in the Body1 box, select
StartTime.
10. In the upper-right corner of the Data pane, close it by selecting the close icon (X).
Users can sort and filter the gallery by volunteer name based on the SortByColumns and Search functions in
that formula.
If a user types at least one letter in the search box, the gallery shows only those records for which the
Volunteer field contains the text that the user typed.
If a user selects the sort button (between the refresh button and the plus button in the title bar), the gallery
shows the records in ascending or descending order (depending on how many times the user selects the
button) based on the Volunteer field.
For more information about these and other functions, see the formula reference.

Create the change screen


1. On the Home tab, select the down arrow next to New screen, and then select Form.
2. In the left navigation bar, select EditForm1.
3. On the Properties tab of the right-hand pane, select the down arrow next to Data source, and then
select Schedule in the list that appears.
4. Under the data source that you just specified, select Edit fields.
5. In the Fields pane, select Add field, select the check box for each field, and then select Add.
6. Select the arrow next to the name of each field to collapse it, and then drag the Volunteer field up so that
it appears at the top of the list of fields.

7. In the upper-right corner of the Fields pane, close it by selecting the close icon (X).
8. Set the Item property of the form to this expression by typing or pasting it in the formula bar:
BrowseGallery1.Selected

9. At the top of the screen, select the Label control, and then replace [Title] with Change records.
Delete and rename screens
1. In the left navigation bar, select the ellipsis (...) for Screen1, and then select Delete.

2. Select the ellipsis (...) for Screen2, select Rename, and then type or paste ViewScreen.
3. Select the ellipsis (...) for Screen3, select Rename, and then type or paste ChangeScreen.

Configure icons on the view screen


1. Near the top of the ViewScreen, select the circular-arrow icon.

2. Set the OnSelect property for that icon to this formula:


Refresh(Schedule)

When the user selects this icon, the data from Schedule is refreshed from the Excel file.
For more information about this and other functions, see the formula reference.
3. In the upper-right corner of the ViewScreen, select the plus icon.

4. Set the OnSelect property for that icon to this formula:


NewForm(EditForm1);Navigate(ChangeScreen,ScreenTransition.None)

When the user selects this icon, ChangeScreen appears with each field empty, so that the user can create
a record more easily.
5. Select the right-pointing arrow for the first record in the gallery.

6. Set the OnSelect property for the arrow to this formula:


EditForm(EditForm1); Navigate(ChangeScreen, ScreenTransition.None)

When the user selects this icon, ChangeScreen appears with each field showing the data for the selected
record, so that the user can edit or delete the record more easily.

Configure icons on the change screen


1. On ChangeScreen, select the "X" icon in the upper-left corner.

2. Set the OnSelect property for that icon to this formula:


ResetForm(EditForm1);Navigate(ViewScreen, ScreenTransition.None)

When the user selects this icon, any changes that the user made in this screen are discarded, and the view
screen opens.
3. In the upper-right corner, select the checkmark icon.

4. Set the OnSelect property for the checkmark to this formula:


SubmitForm(EditForm1); Navigate(ViewScreen, ScreenTransition.None)

When the user selects this icon, any changes that the user made is this screen are saved, and the view
screen opens.
5. On the Insert tab, select Icons, and then select the Trash icon.
6. Set the new icon's Color property to White, and move the new icon so it appears next to the checkmark
icon.

7. Set the Visible property for the trash icon to this formula:
EditForm1.Mode = FormMode.Edit

This icon will appear only when the form is in Edit mode, not in New mode.
8. Set the OnSelect property for the trash icon to this formula:
Remove(Schedule, BrowseGallery1.Selected); Navigate(ViewScreen, ScreenTransition.None)

When the user selects this icon, the selected record is deleted from the data source, and the view screen
opens.

Test the app


1. Select the ViewScreen, and then open Preview by pressing F5 (or by selecting the Preview icon near
the upper-right corner).

2. Type or paste one or more letters in the search box to filter the list based on the name of the volunteer.
3. Select the sort icon one or more times to show the data ascending or descending order based on the
name of the volunteer.
4. Add a record.
5. Update the record that you added, and then save the changes.
6. Update the record that you added, and then cancel the changes.
7. Delete the record that you added.
8. Close Preview mode by pressing Esc (or by selecting the close icon in the upper-right corner).

Next steps
Press Ctrl-S to save your app in the cloud so that you can run it from other devices.
Share the app so that other people can run it.
Learn more about functions such as Patch, which you can use to manage data without creating a standard
form.
Link this app to a solution so that you can, for example, deploy it to a different environment or publish it on
AppSource.
Overview of canvas-app connectors for Power Apps
3/20/2020 • 7 minutes to read • Edit Online

Data is at the core of most apps, including those you build in Power Apps. Data is stored in a data source, and
you bring that data into your app by creating a connection. The connection uses a specific connector to talk to
the data source. Power Apps has connectors for many popular services and on-premises data sources, including
SharePoint, SQL Server, Office 365, Salesforce, and Twitter. To get started adding data to a canvas app, see Add
a data connection in Power Apps.
A connector may provide tables of data or actions. Some connectors provide only tables, some provide only
actions, and some provide both. Also your connector may be either a standard or custom connector.

Tables
If your connector provides tables, you add your data source and then select the table in the data source that you
want to manage. Power Apps both retrieves table data into your app and updates data in your data source for
you. For example, you can add a data source that contains a table named Lessons and then set the Items
property of a control, such as a gallery or a form, to this value in the formula bar:

You can specify the data that your app retrieves by customizing the Items property of the control that shows
your data. Continuing the previous example, you can sort or filter the data in the Lessons table by using that
name as an argument for the Search and SortByColumn functions. In this graphic, the formula to which the
Items property is set specifies that the data is sorted and filtered based on the text in TextSearchBox1.

For more information about how to customize your formula with tables, see these topics:
Understand data sources in Power Apps
Generate an app from Excel data
Create an app from scratch
Understand tables and records in Power Apps

NOTE
To connect to data in an Excel workbook, it must be hosted in a cloud-storage service such as OneDrive. For more
information, see Connect to cloud-storage from Power Apps.

Actions
If your connector provides actions, you must still select your data source as you did before. Instead of selecting a
table as the next step, however, you manually connect a control to an action by editing the Items property of the
control that will show your data. The formula to which you set the Items property specifies the action that
retrieves data. For example, the app won't retrieve any data if you connect to Yammer and then set the Items
property to the name of the data source. To populate a control with data, specify an action such as
GetMessagesInGroup(5033622).messages.
If you need to handle custom data updates for action connectors, build a formula that includes the Patch
function. In the formula, identify the action and the fields that you'll bind to the action.
For more information about how to customize your formula for custom updates, see these topics:
Patch
Collect
Update

NOTE
Power Apps doesn't work with dynamic schema. The phrase dynamic schema refers to the possibility that the same
action may return a different table with different columns. Conditions that may cause the columns in the tables to differ
include the action input parameters, the user or role that's executing the action, and the group in which the user is
working, among others. For example, SQL Server stored procedures may return different columns if run with different
inputs. For actions with dynamic schema, the connector documentation shows The outputs of this operation are
dynamic. as the return value. In contrast, Power Automate works with dynamic schema and might provide a work-
around for your scenario.

Popular connectors
This table has links to more information about our most popular connectors. For a complete list of connectors,
see All connectors.

Common Data Cloud storage **


Service

Dynamics 365 Dynamics AX

Excel Microsoft
Translator

Office 365 Outlook Office 365 Users

Oracle Power BI

SharePoint SQL Server

Twitter

** Applies to Azure Blob, Box, Dropbox, Google Drive, OneDrive and OneDrive for Business
Standard and custom connectors
Power Apps provides standard connectors for many commonly used data sources. If Power Apps has a standard
connector for the type of data source that you want to use, you should use that connector. If you want to connect
to other types of data sources, such as a service that you've built, see Register and use custom connectors.

All standard connectors


Standard connectors do not require special licensing. For more information, see Power Apps Plans.
You can ask questions about a specific connector in the Power Apps forums, and you can suggest connectors to
add or other improvements to make in Power Apps Ideas.

Security and types of authentication


As you author your app and create a connection to a data source, you may see that your choice of connector
allows you to use different ways to authenticate. For instance, the SQL Server connector allows you to use Azure
AD Integrated, SQL Server Authentication, and Windows Authentication. Each type of authentication has
different levels of security associated with it. It's important to understand what information and rights you share
with users who use your application. The primary example in this article is SQL Server, however the principles
apply to all types of connections.
Azure AD Integrated
This is a secure type of connection. For example, SharePoint uses this type of authentication. SQL Server also
allows for this type of authentication. When you connect, the Azure AD service identifies you separately to
SharePoint on your behalf. You do not have to supply a username or password. As an author you can create and
work with the data source with your credentials. When you publish your application and your application user
logs in, they do so with their credentials. If the data is appropriately secured on a back-end your users can only
see what they are authorized to see based on their credentials. This type of security allows you to change rights
for specific application users on the back-end data source after the application has been published. For instance
you can grant access, deny access, or refine what a user or set of users can see all on the back-end data source.
Open-standard authorization (OAuth)
This type of connection is also secure. For example Twitter uses this type of authentication. When you connect
you must supply your user name and password. As an author you can create and work with the data source with
your credentials. When you publish your application and your application user logs in, they must also supply
their credentials. Therefore this type of connection is secure as your users must use their own credentials to
access the data source service.
SQL User name and password authentication
This is type of connection is not very secure because it does not rely on end-user authentication. SQL Server
also allows for this type of authentication. In SQL Server this type of authentication is called SQL Server
Authentication. Many other database data sources provide a similar capability. When you publish your
application, your users do not need to supply a unique user name and password. They are using the user name
and password you supply when you author the application. The connection authentication to the data source is
Implicitly Shared with your users. Once the application is published, the connection is also published and
available to your users. Your end users can also create applications using any connection using SQL Server
authentication that is shared with them. Your users cannot see the user name of password, but the connection
will be available to them. There are certainly valid scenarios for this type of connection. For instance if you have
a read-only database that is available to everyone in the company, this type of connection may be valid.
Windows Authentication
This type of connection is not very secure because it doesn't rely on end-user authentication. Use Windows
authentication when you need to connect to a data source that is on-premises. An example of this type of
connection is to an on-premises server that has a SQL Server. The connection must go through a gateway. Since
it goes through a gateway, the connector has access to all of the data on that data source. As a result, any
information that you can access with the Windows credentials you supply are available to the connector. And
once the application is published, the connection is also published and available to your users. This means that
your end users can also create applications using this same connection and access the data on that machine.
Connections to the data source are also Implicitly Shared with users that the app is shared with. This type of
connection may be valid when your data source only lives on an on-premises server and the data on that source
is freely shareable.
Connect to Common Data Service
3/6/2020 • 2 minutes to read • Edit Online

Overview
You can securely store your business data in Common Data Service and build rich apps in Power Apps so that
users can manage that data. You can also integrate that data into solutions that include Power Automate, Power BI,
and data from Dynamics 365.
By default, the Common Data Service connector connects to data in your app's current environment. If your app
moves to another environment, the connector connects to data in the new environment. This behavior works well
for an app using a single environment or an app that follows an ALM process for moving from Development to
Test to Production.
When you add a data source with the Common Data Service connector, you can change the environment and then
select one or more entities. By default, the app connects to data in the current environment.

If you select Change, you can specify a different environment to pull data from it instead of or in addition to the
current environment.
The name of the selected environment appears under the entities list.

The Common Data Service connector is more robust than the Dynamics 365 connector and approaching feature
parity.
Common Data Service and the improved data source experience
If you created a canvas app with a Common Data Service connector prior to November 2019, then you might not
have the benefit of the most current version of the Common Data Service. Read Common Data Service connection
improvements for more details and to upgrade your connection.
Common Data Service and the improved data source
experience
3/6/2020 • 13 minutes to read • Edit Online

Overview
If you created a canvas app with a Common Data Service connector before November 2019, then you might not
have the benefit of the most current version of the Common Data Service.
The Improve data source experience and Common Data Service views option has following benefits:
1. Significant speed gains.
2. Increased reliability.
3. Access to Common Data Service views and File and Image field attributes.
The Improve data source experience and Common Data Service views option appears in the Advanced
settings section:

The Relational data, option sets, and other new features for Common Data Service now appears in the
Deprecated features section.

How do I upgrade?
Upgrade your app by inspecting the settings of the features and then by following the directions below:
Improve data source experience and Common Data Service views is On:
Either you already converted your canvas app to use this feature, or you started an app with default setting of On
for this feature. No further actions required.
You may also want to enable the Explicit Column Selection feature:
NOTE
Improve data source experience and Common Data Service views is not supported on Power Apps for Windows. You
must turn this feature Off when using Power Apps for Windows.

Relational data, option sets and other new features for Common Data Service is Off:
Check Deprecated features section under Advanced settings. If set to Off, continue with the following instructions
as a first step in the conversion.

IMPORTANT
If you don't see Relational data, option sets and other new features for Common Data Service in Advanced settings,
or if it’s already On, skip the following steps and continue to the next section.

Step 1: Turn Use display names feature On:


1. Turn Use display names feature On.
2. Wait for the health monitor to finish analyzing your app.
3. Save, close, and reopen your app.
4. Resolve all formula errors.
5. Save, close, and reopen your app.
Possible errors and suggestions:
It’s possible that some of the newly shown display names may conflict with the display names for other
entities, fields, or controls. For example, you may have a control and a field with the same name. You can
change the name of the control with a unique value to fix.
For any field and entity display name conflict, you may see a formula that expects an entity but resolves to a
locally scoped field name.
Use the square bracket with an @ symbol to indicate a global scope so it resolves to the entity; for example,
[@entityName].
Step 2: Turn Relational data, option sets and other new features for Common Data Service and Use
GUID data types instead of strings features On:
1. Turn Relational data, option sets and other new features for Common Data Service feature On.
2. Turn Use GUID data types instead of strings feature On.
3. Wait for the health monitor to finish analyzing your app.
4. Resolve all formula errors.
5. Save, close, and reopen your app.
Possible errors and suggestions:
It’s possible to have errors at this stage if you're using an option set field or hard-coded GUID text values.

Option Set values: If you're using an option set field with a text identifier for the option set value, use the
dot notation instead to reference the option set value. For example, change
Patch(Accounts, OptionSet1 = “12345”) to Patch(Accounts, OptionSet.Item1) where Item1 corresponds
to the 12345 value.
See the Detailed Examples section for more information.
GUIDs: If you're using a static GUID string such as 015e45e1044e49f388115be07f2ee116 , convert it to a
function that returns a GUID object; for example GUID(“015e45e1044e49f388115be07f2ee116”) .
Lookups: If you're using Lookup functions to get first-level lookup values such as
Lookup(Contacts, ‘contactID’ = ThisItem.ContactID”) , consider using ThisItem.PrimaryContacts (where
PrimaryContacts is the name of the entity) instead.
Improve data source experience and Common Data Service views is Off:
Use the following instruction to turn Improve data source experience and Common Data Service views
feature On:
1. Remove your existing Common Data Service data source connections.
2. Turn On the Improve data source experience and Common Data Service views feature.
3. Add the Common Data Service connection using the new data source selection experience.
4. Save your application.

NOTE
If your application is extremely large, adding your data source connections back may take a while. Don't close the application
during this process.

Converting canvas apps with the Dynamics 365 connector


To convert your app that uses the Dynamics 365 connector, you'll need to remove and add the connections to your
data sources. Use the steps below to convert your connections to your data sources.
1. Ensure the Improve data source experience and Common Data Service views feature is turned On.
2. Remove your existing Dynamics 365 data source connections.
3. Add the connections to your data sources to the Common Data Service using the new data source selection
experience.
NOTE
If you have connections to other environments (other than current), select the Entity category and then the More (...)
option to change the environment. You can then select an entity from a different environment to add to your
application. Cross-tenant connections don't work with the improved native connector. You'll need to use data
integration to access data cross-tenant.

4. Save your application.


Possible errors and suggestions:
It’s possible to have errors as you convert if: you aren't using Display Names, if you are using GUID strings, or if
you are using an option set field.
If control name conflicts, change the name of the control to be different and unique.
For field and entity display name conflicts, you may see a formula that is expecting an entity but is resolving to a
more locally scoped field name. Use the square bracket with an @ symbol to indicate a global scope so it
resolves to the entity; for example, [@entityName].
Option Set values: If you are using an option set field with a text identifier for the option set value, use the dot
notation instead to reference the option set value. For example, change Patch(Accounts, OptionSet1 = “12345”)
to Patch(Accounts, OptionSet.Item1) where Item1 corresponds to the 12345 value.
See the Detailed Examples section for more information.
GUIDs: If you are using a static GUID string such as 015e45e1044e49f388115be07f2ee116 , convert it to a function
that returns a GUID object; for example GUID(“015e45e1044e49f388115be07f2ee116”) .
Lookups: If you are using Lookup functions to get first-level lookup values such as
Lookup(Contacts, ‘contactID’ = ThisItem.ContactID”) , consider using ThisItem.PrimaryContacts (where
PrimaryContacts is the name of the entity) instead.
For any Polymorphic references, refer to the Detailed Examples section below.

Detailed Examples
Converting your app to use the new Option sets and Two options data types with supporting controls can be
challenging while upgrading an app to use the new Improved data source experience and Common Data Service
views feature.
Option Sets
Separate _myfield and _myfield_label fields were used for an Option set earlier. Now, there is a single myfield
that can be used both for locale-independent comparisons and to obtain the locale-specific label.
Removing and adding Option set Data cards
It's recommended to remove existing data cards and add them back to work with your Option set. For example, if
you are working with the Account entity and the Category Option set, you'll see that the DataField property of the
data card was set to _accountcategorycode_label . In the field list you can see that the data card has a type of String:
With the new Improved data source experience and Common Data Service views feature, you no longer see
_accountcategorycode_label . It's replaced by accountcategorycode . Your card is now be marked as custom and
you'll see errors. Remove the old data card and add the Option Set back. The new data card is Option Set aware.
Editing the Option Set Filter expressions to use new syntax
Previously, if you wanted to use an Option Set value in a Filter expression you would need to use the Value field.
For example:

Filter(Account,'Category Value' = "1")

You'll need to edit this formula. Option set text identifer is no longer used for the value. This expression should be
updated to look the following:

Filter(Account, Category= ‘Category (Accounts)’.’Preferred Customer’)

'Category(Accounts)' is the name of enum used in the Category field of the Accounts entity. This is a local option
set. You can read more about local and global option sets here: Global option sets.
Editing Option Set Patch statements to use new syntax
Following is an example of earlier Patch statement for Option Set:

Patch( Accounts, First(Accounts), { ‘Category Value’: 1 } ) )

You'll need to update your statements to follow this form:

Patch( Accounts, First(Accounts), { Category: ‘Category (Accounts)’.’Preferred Customer’ } )

Option Set disambiguation


If the display name of an Option set field and the name of the Option set are the same, you'll need to
disambiguate the formula. To continue using the Accounts Category Code example, the @ implies to use the
Option Set, not the field.

Filter(Accounts, 'Category Code' = [@’Category Code’].'Preferred Customer')

Two Options
Removing and adding Two Option set Data cards
You should remove existing data cards and add them back to work with your Two Option set. The data types were
earlier recognized as simple boolean - such as true/on and false/off with no labels:

With the new Improved data source experience and Common Data Service views feature, your card will now be
marked as custom and you'll see errors. Remove the old data card and add the Option Set back. You'll see an edit
control with two options by default after you add.
If you prefer the toggle switch for your boolean field, you can unlock the data card and replace the control in the
data card with a toggle instead. You'll also need to set these properties on the Toggle.

Toggle1.Default = ThisItem.’Do not allow Bulk Emails’


Toggle1.TrueText = ‘Do not allow Bulk Emails (Accounts)’.’Do Not Allow’
Toggle1.FalseText = ‘Do not allow Bulk Emails (Accounts)’.Allow
DataCard.Value = If( Toggle1.Value,
‘Do not allow Bulk Emails (Accounts)’.’Do Not Allow’,
‘Do not allow Bulk Emails (Accounts)’.Allow )
Refining Two Option Patch statements
Using the Patch function with Two option should work 'as is'. It supports direct use of true and false, similar to
Boolean. The only difference is being if you had put the value in a Label control earlier that showed true and false,
it will now show the Two option labels instead.
Polymorphic lookups
Following guidelines help to upgrade your application if it referenced polymorphic fields. Polymorphic lookups,
from the same field, support references to a restricted set of multiple entities. Similar to references in other
languages, a record reference is a pointer to a specific record in a specific entity. A record reference carries with it
the entity information allowing it to point to a record in several different other entities, which differs from a normal
lookup that can only point to records in one entity.
Access, Set, and Filter on the Owner field of a record
For instance, the Owner field in an entity can refer to a record in the Users entity or the Teams entity. The same
lookup field in different records could refer to records in different entities.

Po l ym o r ph i c w i t h Fi l t er an d Pat c h

Record references can be used just like a full record:


Filter( Accounts, Owner = First( Teams ) )
Patch( Accounts, First( Accounts ), { Owner: First( Users ) })

P o l y m o r p h i c w i t h a G a l l e r y d i sp l a y i n g O w n e r n a m e

Since a reference can point to different entities, you must be specific. You can't use ThisItem.Owner.Name, as the
name field in the Team entity is Team Name, and the name field in the User entity is Full Name. Power Apps
won’t know which type of lookup you're referring to, until you run the app.
To fix this issue:
1. Add the data sources for the entity types that Owner could be; in current example, Users and Teams).
2. Use additional functions to make your intent clear.
There are two new functions you can make use of:
IsType – Checks if a record reference is of a particular entity type.
AsType – Casts a record reference to a particular entity type.
With these functions, you can write a formula that displays the name of the Owner taken from two differently
named fields, based on the entity type of the Owner:

If( IsType( ThisItem.Owner, [@Teams]),


AsType( ThisItem.Owner, [@Teams]).'Team Name',
AsType( ThisItem.Owner, [@Users]).'Full Name' )

Global disambiguation operator for [@Teams] and [@Users] is used to ensure that you reference the global entity
type. Though in this case it's not necessary, it's a recommended to always be clear. One-to-many relationships
often conflict in the gallery's record scope, and this practice avoids that confusion.
Access and set the Company Name field (a Customer data type) of the Contacts entity
Customer lookup field is another polymorphic lookup that's similar to Owner. You can only have one Owner field
per entity. But an entity can include zero, one, or more Customer lookup fields. The Contacts system entity includes
the Company Name field, which is a Customer lookup field. Read show the fields of a customer for more details.
Access and set the Regarding field of activity entities such as Faxes, Phone Calls, Email Messages
Polymorphic lookups aren't limited to Accounts and Contacts. The list of entities is extensible with custom entities.
For example, the Faxes entity has a polymorphic Regarding lookup field, which can refer to Accounts, Contacts, and
other entities. If you have a gallery with data source set to Faxes, you can use the following formula to display the
name associated with the Regarding lookup field.

If( IsBlank( ThisItem.Regarding ), "",


IsType( ThisItem.Regarding, [@Accounts] ),
"Account: " & AsType( ThisItem.Regarding, [@Accounts] ).'Account Name',
IsType( ThisItem.Regarding, [@Contacts] ),
"Contacts: " & AsType( ThisItem.Regarding, [@Contacts] ).'Full Name',
"" )

Read Regarding lookup fields and Regarding relationships for more details.
Access the list of all Activities for a record
In Common Data Service, entities such as Faxes, Tasks, Emails, Notes, Phone Calls, Letters, and Chats are
designated as activities. You can also create your own custom activity entities.
You can show activities of a specific type (such as Faxes or Taxes), or all activities associated with an entity such as
account. Add the Activities entity and other individual entities whose data you plan to display in the canvas app.
Each time you add a record to (for example the Tasks entity), a record in the Activity entity with the fields common
across all activity entities is created. Read activity entity for more details.
The following example shows that as you select an Account, all the Activities associated with that account will be
displayed:
The records are being displayed from the Activity entity. But you can still use the IsType function to identify which
kind of activity they are. Again, before you use IsType with an entity type, you must add the necessary data source.
By using this formula, you can show the record type in a label control within the gallery:

If( IsType( ThisItem, [@Faxes] ), "Fax",


IsType( ThisItem, [@'Phone Calls'] ), "Phone Call",
IsType( ThisItem, [@'Email Messages'] ), "Email Message",
IsType( ThisItem, [@Chats] ), "Chat",
"Unknown")

Access the list of Notes for a record


When you create an entity, you can enable attachments. If you select the check box for enabling attachments, you'll
create a Regarding relationship with the Notes entity, as this graphic shows for the Accounts entity:

Fi l t er i n g

You can't read or filter based on the Regarding field. However, the reverse Notes one-to-many relationship is
available. To list all the Notes associated to an Account entity, you can use the following formula:

First( Accounts ).Notes

Pat c h

You can't set the Notes field on an entity by using Patch. To add a record to an entity's Notes table, you can use the
Relate function. Create the note first, as in this example:

Relate( ThisItem.Notes, Patch( Notes, Defaults( Notes ), { Title: "A new note", isdocument:'Is Document
(Notes)'.No } ) )

Next steps
Formula reference
Controls reference
See also
What is Common Data Service?
Connect to cloud-storage from Power Apps
12/3/2019 • 3 minutes to read • Edit Online

Power Apps offers several cloud-storage connections. Using any of these connections, you can store an Excel file
and use the information in it throughout your app. These connections include:

ONEDRIVE
AZURE BLOB BOX DROPBOX GOOGLE DRIVE ONEDRIVE FOR BUSINESS

Prerequisites
Access to Power Apps
Add the connection
Create an app from a template, from data, or from scratch
An Excel file with the data formatted as a table:
1. Open the Excel file, and then select any cell in the data that you want to use.
2. On the Insert tab, select Table.
3. In the Save as Table dialog box, select the My table has headers checkbox, and then select OK.
4. Save your changes.

Connect to the cloud storage connection


1. At powerapps.com, expand Manage, and select Connections:

2. Select New connection, and select your cloud storage connection. For example, select OneDrive.
3. You are prompted for the user name and password of your cloud storage account. Enter them, and then
select Sign in:
Once you are signed in, this connection is ready to be used within your apps.
4. In your app, click or tap Data sources on the View tab of the ribbon. In the right-hand pane, click or tap
Add a data source, click or tap your cloud-storage connection, and then choose the Excel table.
5. Select Connect.
The table is listed as a data source:
NOTE
Remember, the Excel data must be formatted as a table.

Using the Excel data in your app


1. On the Insert tab, select Gallery, and then select a With text gallery control.
2. Set the Items property of the gallery to your Excel table. For example, if your Excel table is named Table1,
then set it to Table1:

The gallery is automatically updated with information from your Excel table.
3. In the gallery, select the second or third Label control. By default, you see the Text property of the second
and third labels is automatically set to ThisItem.something . You can set these labels to any column in your
table.
In the following example, the second label is set to ThisItem.Name and the third label is set to
ThisItem.Notes :
Sample output:

NOTE
The first box is actually an image control. If you don't have an image in your Excel table, then you can delete the image
control, and add a label in its place. Add and configure controls is a good resource.

Understand tables and records provides more details and some examples.

Sharing your app


You can share your app, your resources such as connectors, and your data with others in your organization.
If you're sharing a folder in Dropbox, the shared folder must be attached to the user's Dropbox account.
There are certain limitations with connectors involving Excel files.

Known limitations
If Data type unsupported or Not formatted as a table appears when you try to use an Excel connection in
your app, format the data as a table.
If your Excel data includes a calculated column, you can't use it to build an app, and you can’t add that data to an
existing app.
Sharing Excel tables
To share data in an Excel file:
In OneDrive for Business, share the file itself.
In OneDrive, share the folder that contains the file, and specify file paths, not URLs, for any media.
In Dropbox or Google Drive, share either the file or the folder.

Helpful links
See all the available connections.
Learn how to add connections and add a data source to your apps.
Understand tables and records with tabular data sources.
Some additional gallery resources include Show a list of items and Show images and text in a gallery.
Connect to Dynamics 365 from Power Apps
1/14/2020 • 3 minutes to read • Edit Online

Power Apps lets you quickly generate, customize, share, and run mobile apps with little or no code. By using the
Dynamics 365 connector, you can create useful mobile apps to share with your organization in just a few minutes.
By following the steps in this topic, you'll create an app in which users can browse, add, delete, and make updates
to contacts in model-driven apps in Dynamics 365 (Dynamics 365 Sales, Dynamics 365 Customer Service,
Dynamics 365 Field Service, Dynamics 365 Marketing, and Dynamics 365 Project Service Automation). Users can
run the app in a browser or on a mobile device such as a phone.

NOTE
We recommend using a more robust Common Data Service connector when connecting to model-driven apps in Dynamics
365.

Prerequisite
To follow this tutorial, you need a Microsoft Office 365 account that includes a Dynamics 365 subscription.

Create a connection
1. Sign in to Power Apps.
2. In the left navigation pane, click Connections.

3. Near the upper-right corner, click New connection.

4. In the list of connections, click Dynamics 365.

5. In the dialog box, click Create.


6. In the Sign in to your account dialog box, provide your credentials for the Dynamics 365 (online) tenant.
A connection is created.

Generate an app automatically


1. Sign in to Power Apps, and then click New app near the lower-left corner.

2. Under Start with your data, click Phone layout on the Dynamics 365 tile.

3. Under Connections, select the connection that you want, and then choose a dataset, which corresponds to
the instance of Dynamics 365 that you'll manage in the app.
4. Under Choose a table, click Contacts, and then click Connect.
5. In the left navigation bar, click or tap an icon in the upper-right corner to switch to the thumbnail view.

Power Apps generates a three-screen app based on contact records.


BrowseScreen1. This screen appears by default when users open the app. In the left navigation bar, a
thumbnail for this screen appears above the other two screens.
DetailScreen1. This screen appears when users click an item in BrowseScreen1. In the left navigation bar, a
thumbnail for DetailScreen1 appears between the other two screens.
EditScreen1. This screen appears when users click the edit icon for an item in DetailScreen1. In the left
navigation bar, a thumbnail for EditScreen1 appears under the other two screens.
The app can run in its initial state, but we can make it more useful by refining the information on each screen.

Customize BrowseScreen1
In this procedure, you'll configure BrowseScreen1 to show the first and last names of each contact. The data will
be sorted alphabetically by last name and include images in a two-column grid.
1. In BrowseScreen1, select the gallery by clicking any record in it except the first one.

2. In the right-hand pane, click or tap the Data tab.


3. In the list of layouts, click or tap the one that shows pictures and text in a two-column grid.
You might need to scroll down to show this option.

4. Copy this formula and then, with the gallery still selected, paste the formula in the formula bar (to the right
of the fx button):
SortByColumns(Search(Filter(Contacts,statuscode=1), TextSearchBox1.Text, "lastname"), "lastname",
If(SortDescending1, Descending, Ascending))

5. In the right-hand pane, set the top drop-down list to firstname and the middle drop-down list to lastname.

6. (optional) On the File menu, click Save as, type a name for the app, and then click Save.
By default, the app will be saved to the cloud. Click This computer to save your app locally.

Customize DetailsScreen1 and EditScreen1


1. In the left navigation bar, click the middle thumbnail to select DetailsScreen1.
2. On DetailScreen1, click anywhere below the title bar to show customization options in the right-hand
pane.

3. In the right-hand pane, click the eye icon for each field to hide it.

4. Click anywhere under the title bar to select Form1.

5. In the right-hand pane, click the eye icon for each of these fields, so that the screen will show an image (if
the table contains one) and four other fields for each contact:
entityimage
firstname
lastname
mobilephone
emailaddress1
The right-hand pane should resemble this graphic:

6. Select EditScreen1 by clicking the bottom thumbnail in the left navigation bar.
7. Repeat the steps in this procedure to customize EditScreen1 the same way as DetailsScreen1.
8. (optional) Save the app.

Next steps
Test your app in Preview mode by clicking BrowseScreen1 in the left navigation bar and then pressing F5 or
clicking near the upper-right corner.
Share your app.
Add a second data source.
Connect from Microsoft Power Apps to Dynamics AX
12/3/2019 • 2 minutes to read • Edit Online

Use this connection to easily build apps that read, update, and delete data from these versions of Dynamics AX:
• Dynamics AX Update1 + hotfix-KB article
• Dynamics AX Update 2 and later
For information about how to create an app, see Generate an app automatically or Create an app from scratch.
These topics are written for Excel, but the same principles apply to Dynamics AX.
For information about how to add data from Dynamics AX to an existing app, see Add a data connection.
See the list of available connections, and learn how to manage connections in Power Apps.
Next steps
Learn how to show data from a data source.
Learn how to view details and create or update records.
Connect to Excel from Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Excel is kind of a connection. To display Excel data in your app:


1. Format the Excel data as a table.
2. Store the Excel file in a cloud-storage account, such as Box, Dropbox, Google Drive, OneDrive, and OneDrive
for Business.
3. Connect to the cloud-storage account, and then add the Excel table as a data source.
4. Display this information in your app by generating an app automatically or by adding and configuring, for
example, a Gallery control.

NOTE
When you connect to your Excel table from Power Apps, it will create a column called _PowerAppsId_, with a unique ID for
each row of your Excel table.

Overview of the cloud-storage connection shows you how to add the connection, add an Excel table as a data
source, and use the Excel data in your app.
For information about how to connect to other types of data, see the list of connections for Power Apps.
Known limitations
For information about how to share Excel data within your organization, review these limitations.
Connect to Microsoft Translator from Power Apps
12/3/2019 • 3 minutes to read • Edit Online

Add the Microsoft Translator connector to display translated text in a Label control in your app. For example, you
can create an input text box that asks the user to enter some text to translate. In another label, you can display the
translated text.
This topic shows you how to create the Microsoft Translator connection, use the Microsoft Translator connection in
an app, and lists the available functions.

NOTE
This connector is limited to 150 calls per user per day.

Prerequisites
Access to Power Apps
Add the connection
Create an app from a template, from data, or from scratch

Connect to Microsoft Translator


1. Open Power Apps, select New, and then create a Blank app. Choose phone or tablet layout. Tablet layout
gives you more workspace:

2. In the right-hand pane, click or tap Data tab, and then click or tap Add data source.
3. Select New connection, and then select Microsoft Translator:
4. Select Connect. Your connection appears under Data sources:
Use the Microsoft Translator connection in your app
Translate text
1. On the Insert menu, select Text, and then select Text input. Rename the text input control to Source:

2. Add a Drop down list (Insert menu > Controls), rename it to TargetLang, and move it below Source.
3. Set the Items property of TargetLang to the following formula:
MicrosoftTranslator.Languages()

4. Add a label, move it below TargetLang, and set its Text property to the following formula:
MicrosoftTranslator.Translate(Source.Text, TargetLang.Selected.Value)

5. Type some text into Source, and select a language in TargetLang. The label shows the text that you
entered in the language you chose:
Speak translated text
If you haven't already, follow the steps in the previous section to translate some text. These next steps use the
same controls.
1. Set the Items property of the TargetLang drop-down list to the following formula:
MicrosoftTranslator.SpeechLanguages()

2. Rename the second label (not the Source box) to Target.


3. Add an Audio control (Insert menu > Media), and set its Media property to the following formula:
MicrosoftTranslator.TextToSpeech(Target.Text, TargetLang.Selected.Value)

4. Press F5, or select the Preview button ( ). Type some text into Source, select a language in TargetLang,
and then select the play button in the audio control.
The app plays an audio version of the text that you entered in the language you chose.
5. Press Esc to return to the default workspace.
Detect the source language
These next steps use the same Source text input and Target text controls. You can create new controls if you
prefer, just update the names in the formula.
1. Select the Target text control, and set the Text property to the following formula:
MicrosoftTranslator.Detect(Source.Text).Name

2. Type some text into Source.


The label shows you the language of the text that you typed. For example, the label shows French if you
type bonjour, or Italian if you type ciao.

View the available functions


This connection includes the following functions:

FUNCTION NAME DESCRIPTION

Languages Retrieves all languages that Microsoft Translator supports

Translate Translates text to a specified language using Microsoft


Translator

Detect Detects source language of given text

SpeechLanguages Retrieves the languages available for speech synthesis

TextToSpeech Converts a given text into speech as an audio stream in wave


format

Languages
Get languages: Retrieves all languages that Microsoft Translator supports
Input properties
None.
Output properties
PROPERTY NAME DATA TYPE REQUIRED DESCRIPTION

Code string No

Name string No

Translate
Translate text: Translates text to a specified language using Microsoft Translator
Input properties

NAME DATA TYPE REQUIRED DESCRIPTION

query string yes Text to translate

languageTo string yes Target language code


(example: 'fr')

languageFrom string no Source language (if not


provided, Microsoft
Translator will try to auto-
detect) (example: en)

category string no Translation category (default:


'general')

Output properties
None.
Detect
Detect language: Detects source language of given text
Input properties

NAME DATA TYPE REQUIRED DESCRIPTION

query string yes Text whose language will be


identified

Output properties

PROPERTY NAME DATA TYPE REQUIRED DESCRIPTION

Code string No

Name string No

SpeechLanguages
Get speech languages: Retrieves the languages available for speech synthesis
Input properties
None.
Output properties
PROPERTY NAME DATA TYPE REQUIRED DESCRIPTION

Code string No

Name string No

TextToSpeech
Text to speech: Converts a given text into speech as an audio stream in wave format
Input properties

NAME DATA TYPE REQUIRED DESCRIPTION

query string yes Text to convert

language string yes Language code to generate


speech (example: 'en-us')

Output properties
None.

Helpful links
See all the available connections.
Learn how to add connections to your apps.
Connect to Office 365 Outlook from Power Apps
12/3/2019 • 3 minutes to read • Edit Online

If you connect to Office 365 Outlook, you can show, send, delete, and reply to email messages, in addition to
other tasks.
You can add controls to perform these functions in your app. For example, you can add Text input controls to ask
for the recipient, the subject, and the body of the email, and add a Button control to send the email.
This topic shows you how to add Office 365 Outlook as a connection, add Office 365 Outlook as a data source to
your app, and use this data in different controls.

IMPORTANT
As of this writing, the calendar operation doesn't support recurring events.

Prerequisites
Access to Power Apps
Add the connection
Create an app from a template, from data, or from scratch

Connect to Office 365 Outlook


1. Add a data connection and select Office 365 Outlook:

2. Select Connect, and if prompted to sign in, enter your work account.
The Office 365 Outlook connection has been created and added to your app. Now, it's ready to be used.
Show messages
1. On the Insert menu, select Gallery, and then select a Text gallery control.
2. Set its Items property to the following formula:
Office365.GetEmails({fetchOnlyUnread:false})

After changing the settings, change Layout to Title, Subtitle, Body.


The gallery control is automatically populated with some of your emails.
3. In the gallery, set the Text property of the first label to ThisItem.From . Set the second label to
ThisItem.Subject . Set the third label to ThisItem.BodyPreview . You can also resize the labels.

The gallery control is automatically populated with the new properties.


4. This function has several optional parameters available. Set the gallery's Items property to one of the
following formulas:
Office365.GetEmails({fetchOnlyUnread:false})
Office365.GetEmails({fetchOnlyUnread:false, top:2})
Office365.GetEmails({folderPath:"Sent Items", fetchOnlyUnread:false, top:2})
Office365.GetEmails({folderPath:"Sent Items", fetchOnlyUnread:false, top:2, searchQuery:"powerapps"})
Office365.GetEmails({folderPath:"Deleted Items", fetchOnlyUnread:false, top:2, skip:3})

Send a message
1. On the Insert menu, select Text, and then select Text input.
2. Repeat the previous step two more times so that you have three boxes, and then arrange them in a column:

3. Rename the controls to:


inputTo
inputSubject
inputBody
4. On the Insert menu, select Controls, and then select Button. Set its OnSelect property to the following
formula:
Office365.SendEmail(inputTo.Text, inputSubject.Text, inputBody.Text)

5. Move the button so that it appears under all the other controls, and set its Text property to "Send email".

6. Press F5, or select the Preview button ( ). Type in a valid email address in inputTo, and type whatever
you want in the other two Text input controls.
7. Select Send email to send the message. Press Esc to return to the default workspace.
Send a message with an attachment
You can, for example, create an app in which the user takes pictures by using the device's camera and then sends
them as attachments. Users can also attach many other kinds of files to an email app.
To add an attachment to a message, follow the steps in the previous section, but add a parameter to specify an
attachment (when you set the OnSelect property of the button). This parameter is structured as a table in which
you specify up to three properties for each attachment:
Name
ContentBytes
@odata.type

NOTE
You can specify the @odata.type property for only one attachment, and you can set it to an empty string.

In this example, a photo will be sent as file1.jpg:


Office365.SendEmail(inputTo.Text, inputSubject.Text, inputBody.Text, {Attachments:Table({Name:"file1.jpg",
ContentBytes:Camera1.Photo, '@odata.type':""})})

In this example, an audio file will be sent in addition to the photo:


Office365.SendEmail(inputTo.Text, inputSubject.Text, inputBody.Text, {Attachments:Table({Name:"file1.jpg",
ContentBytes:Camera1.Photo, '@odata.type':""}, {Name:"AudioFile", ContentBytes:microphone1.audio })})

Delete a message
1. On the Insert menu, select Gallery, and then select a Text gallery control.
2. Set its Items property to the following formula:
Office365.GetEmails({fetchOnlyUnread:false})

The gallery control is automatically populated with some of your emails.


3. In the gallery, set the Text property of the first label to ThisItem.Id . Set the second label to
ThisItem.Subject . Set the third label to ThisItem.Body .

4. Select the first label in the gallery, and rename it to EmailID:

5. Select the third label in the gallery, and add a Button (Insert menu). Set the button's OnSelect property
to the following formula:
Office365.DeleteEmail(EmailID.Text)

6. Press F5, or select the Preview button ( ). Select one of the emails in your gallery, and click the button.
NOTE
This deletes the selected email from your inbox. So, choose wisely.

7. Press Esc to return to the default workspace.

Mark a message as read


This section uses the same controls as Delete a message.
1. Set the button's OnSelect property to the following formula:
Office365.MarkAsRead(EmailID.Text)

2. Press F5, or select the Preview button ( ). Select one of the unread emails, and then click the button.
3. Press Esc to return to the default workspace.

Helpful links
For a list of all functions and their parameters, see the Office 365 Outlook reference.
See all the available connections.
Learn how to manage your connections.
Connect to Office 365 Users connection from Power
Apps
12/3/2019 • 6 minutes to read • Edit Online

Office 365 Users lets you access user profiles in your organization using your Office 365 account. You can
perform various actions such as get your profile, a user's profile, a user's manager or direct reports.
You can display this information in a label on your app. You can display one function, multiple functions, or even
combine different functions. For example, you can create an expression that combines the User Name and Phone
Number, and then display this information in your app.
This topic shows you how to add Office 365 Users as a connection, add Office 365 Users as a data source to your
app, and use table data in a gallery control.

Prerequisites
Access to Power Apps
Add the connection
Create an app from a template, from data, or from scratch

Add a connection
1. Add a data connection and select Office 365 Users:

2. Select Connect, and if prompted to sign in, enter your work account.
The Office 365 Users connection has been created and added to your app. Now, it's ready to be used.

Use the connection in your app


Show information about the current user
1. On the Insert menu, select Label
2. In the function bar, set its Text property to any of the following formulas:
Office365Users.MyProfile().City
Office365Users.MyProfile().CompanyName
Office365Users.MyProfile().Country
Office365Users.MyProfile().Department
Office365Users.MyProfile().DisplayName
Office365Users.MyProfile().GivenName
Office365Users.MyProfile().Id
Office365Users.MyProfile().JobTitle
Office365Users.MyProfile().Mail
Office365Users.MyProfile().MailNickname
Office365Users.MyProfile().mobilePhone
Office365Users.MyProfile().OfficeLocation
Office365Users.MyProfile().PostalCode
Office365Users.MyProfile().Surname
Office365Users.MyProfile().TelephoneNumber
Office365Users.MyProfile().UserPrincipalName
Office365Users.MyProfile().AccountEnabled
Office365Users.MyProfile().BusinessPhones

The label shows the information that you entered about the current user.
Show information about another user
1. On the Insert menu, select Text, and then select Text input. Rename it InfoAbout:

2. In InfoAbout, type or paste an email address of a user in your organization. For example, type in
yourName@yourCompany.com.
3. Add a Label (Insert menu), and set its Text property to any of the following formulas:
To show information about another user:
Office365Users.UserProfile(InfoAbout.Text).City
Office365Users.UserProfile(InfoAbout.Text).CompanyName
Office365Users.UserProfile(InfoAbout.Text).Country
Office365Users.UserProfile(InfoAbout.Text).Department
Office365Users.UserProfile(InfoAbout.Text).DisplayName
Office365Users.UserProfile(InfoAbout.Text).GivenName
Office365Users.UserProfile(InfoAbout.Text).Id
Office365Users.UserProfile(InfoAbout.Text).JobTitle
Office365Users.UserProfile(InfoAbout.Text).Mail
Office365Users.UserProfile(InfoAbout.Text).MailNickname
Office365Users.UserProfile(InfoAbout.Text).mobilePhone
Office365Users.UserProfile(InfoAbout.Text).OfficeLocation
Office365Users.UserProfile(InfoAbout.Text).PostalCode
Office365Users.UserProfile(InfoAbout.Text).Surname
Office365Users.UserProfile(InfoAbout.Text).TelephoneNumber
Office365Users.UserProfile(InfoAbout.Text).UserPrincipalName
Office365Users.UserProfile(InfoAbout.Text).AccountEnabled
Office365Users.UserProfile(InfoAbout.Text).BusinessPhones

To show information about another user's manager:


Office365Users.Manager(InfoAbout.Text).City
Office365Users.Manager(InfoAbout.Text).CompanyName
Office365Users.Manager(InfoAbout.Text).Country
Office365Users.Manager(InfoAbout.Text).Department
Office365Users.Manager(InfoAbout.Text).DisplayName
Office365Users.Manager(InfoAbout.Text).GivenName
Office365Users.Manager(InfoAbout.Text).Id
Office365Users.Manager(InfoAbout.Text).JobTitle
Office365Users.Manager(InfoAbout.Text).Mail
Office365Users.Manager(InfoAbout.Text).MailNickname
Office365Users.Manager(InfoAbout.Text).mobilePhone
Office365Users.Manager(InfoAbout.Text).OfficeLocation
Office365Users.Manager(InfoAbout.Text).PostalCode
Office365Users.Manager(InfoAbout.Text).Surname
Office365Users.Manager(InfoAbout.Text).TelephoneNumber
Office365Users.Manager(InfoAbout.Text).UserPrincipalName
Office365Users.Manager(InfoAbout.Text).AccountEnabled
Office365Users.Manager(InfoAbout.Text).BusinessPhones

The label shows the information that you entered about the user you specified or that user's manager.

NOTE
If you're developing an app based on an entity in the Common Data Service, you can specify a user based on ID instead of
email address.

For example, you can create an app automatically, add a screen that contains a Label control, and set the control's
Text property to this formula:
Office365Users.UserProfile(BrowseGallery1.Selected.CreatedByUser).DisplayName
If you create a contact and select that contact in the browse screen of the app, the Label control will show your
display name.
Show the direct reports of another user
1. Add a Text input control (Insert menu > Text), and rename it InfoAbout.
2. In InfoAbout, enter the email address of a user in your organization. For example, enter
yourManagersName@yourCompany.com
3. Add a With text gallery ( Insert menu > Gallery), and set its Items property to the following formula:
Office365Users.DirectReports(InfoAbout.Text)

The gallery shows information about the direct reports of the user you entered.
With the gallery selected, the right-hand pane shows options for that gallery.
4. In the second list, select JobTitle. In the third list, select DisplayName. The gallery is updated to show
these values.

NOTE
The first box is actually an image control. If you don't have an image, you can delete the image control, and add a label in its
place. Add and configure controls is a good resource.

Search for users


1. Add a Text input control (Insert menu > Text), and rename it SearchTerm. Enter a name to search. For
example, enter your first name.
2. Add a With text gallery ( Insert menu > Gallery), and set its Items property to the following formula:
Office365Users.SearchUser({searchTerm: SearchTerm.Text})

The gallery shows users whose name contains the search text you entered.
With the gallery selected, the right-hand pane shows options for that gallery.
3. In the second list, select Mail. In the third list, select DisplayName.
The second and third labels in the gallery are updated.

View the available functions


This connection includes the following functions:

FUNCTION NAME DESCRIPTION

DirectReports Returns the direct reports for the specified user.

Manager Retrieves user profile for the manager of the specified user.

MyProfile Retrieves the profile for the current user.

SearchUser Retrieves search results of user profiles.

UserProfile Retrieves a specific user profile.

MyProfile
Get my profile: Retrieves the profile for the current user.
Input properties
None.
Output properties

PROPERTY NAME TYPE DESCRIPTION

City string City of user.

CompanyName string Company of user.


PROPERTY NAME TYPE DESCRIPTION

Country string Country of user.

Department string Department of user.

DisplayName string Display name of user.

GivenName string Given name of user.

Id string User id.

JobTitle string Job title of user.

Mail string Email id of user.

MailNickname string Nickname of user.

mobilePhone string Mobile phone of user.

OfficeLocation string Office location of user.

PostalCode string Postal code of user.

Surname string Surname of user.

TelephoneNumber string Telephone number of user.

UserPrincipalName string User Principal Name.

AccountEnabled boolean Account enabled flag.

BusinessPhones string Phone numbers of user's company.

UserProfile
Get user profile: Retrieves a specific user profile.
Input properties

NAME DATA TYPE REQUIRED DESCRIPTION

Id string yes User principal name or email


id.

Output properties

PROPERTY NAME TYPE DESCRIPTION

City string City of user.

CompanyName string Company of user.

Country string Country of user.


PROPERTY NAME TYPE DESCRIPTION

Department string Department of user.

DisplayName string Display name of user.

GivenName string Given name of user.

Id string User id.

JobTitle string Job title of user.

Mail string Email id of user.

MailNickname string Nickname of user.

Surname string Surname of user.

TelephoneNumber string Telephone number of user.

UserPrincipalName string User Principal Name.

AccountEnabled boolean Account enabled flag.

BusinessPhones string Phone numbers of user's company.

Manager
Get manager: Retrieves user profile for the manager of the specified user.
Input properties

NAME DATA TYPE REQUIRED DESCRIPTION

Id string yes User principal name or email


id.

Output properties

PROPERTY NAME TYPE DESCRIPTION

City string City of user.

CompanyName string Company of user.

Country string Country of user.

Department string Department of user.

DisplayName string Display name of user.

GivenName string Given name of user.

Id string User id.


PROPERTY NAME TYPE DESCRIPTION

JobTitle string Job title of user.

Mail string Email id of user.

MailNickname string Nickname of user.

mobilePhone string Mobile phone of user.

OfficeLocation string Office location of user.

PostalCode string Postal code of user.

Surname string Surname of user.

TelephoneNumber string Telephone number of user.

UserPrincipalName string User Principal Name.

AccountEnabled boolean Account enabled flag.

BusinessPhones string Phone numbers of user's company.

DirectReports
Get direct reports: Get direct reports.
Input properties

NAME DATA TYPE REQUIRED DESCRIPTION

Id string yes User principal name or email


id.

Output properties

PROPERTY NAME TYPE DESCRIPTION

City string City of user.

CompanyName string Company of user.

Country string Country of user.

Department string Department of user.

DisplayName string Display name of user.

GivenName string Given name of user.

Id string User id.

JobTitle string Job title of user.


PROPERTY NAME TYPE DESCRIPTION

Mail string Email id of user.

MailNickname string Nickname of user.

mobilePhone string Mobile phone of user.

OfficeLocation string Office location of user.

PostalCode string Postal code of user.

Surname string Surname of user.

TelephoneNumber string Telephone number of user.

UserPrincipalName string User Principal Name.

AccountEnabled boolean Account enabled flag.

BusinessPhones string Phone numbers of user's company.

SearchUser
Search for users: Retrieves search results of user profiles.
Input properties

NAME DATA TYPE REQUIRED DESCRIPTION

searchTerm string no Search string. Applies to:


display name, given name,
surname, mail, mail
nickname, and user principal
name.

Output properties

PROPERTY NAME TYPE DESCRIPTION

City string City of user.

CompanyName string Company of user.

Country string Country of user.

Department string Department of user.

DisplayName string Display name of user.

GivenName string Given name of user.

Id string User id.

JobTitle string Job title of user.


PROPERTY NAME TYPE DESCRIPTION

Mail string Email id of user.

MailNickname string Nickname of user.

mobilePhone string Mobile phone of user.

OfficeLocation string Office location of user.

PostalCode string Postal code of user.

Surname string Surname of user.

TelephoneNumber string Telephone number of user.

UserPrincipalName string User Principal Name.

AccountEnabled boolean Account enabled flag.

BusinessPhones string Phone numbers of user's company.

Helpful links
See all the available connections.
Learn how to add connections to your apps.
Connect to an Oracle database from Power Apps
1/29/2020 • 2 minutes to read • Edit Online

List tables, and create, read, update and delete table rows in an Oracle database after you create a connection and
build an app in Power Apps. The Oracle Database connection supports full delegation of filtering, sorting, and
other functions but not triggers or stored procedures.

Prerequisites
Oracle 9 and later
Oracle client software 8.1.7 and later
Installation of an on-premises data gateway
Installation of the Oracle client SDK
Install an on-premises data gateway
To install a gateway, follow the steps in this tutorial.
An on-premises data gateway acts as a bridge, providing quick and secure data transfer between on-premises data
(data that isn't in the cloud) and the Power BI, Power Automate, Logic Apps, and Power Apps services. You can use
the same gateway with multiple services and multiple data sources. For more information, see Understand
gateways.
Install Oracle client
On the same computer as the on-premises data gateway, install the 64-bit ODAC 12c Release 4 (12.1.0.2.4) for
Windows x64. Otherwise, an error will appear if you try to create or use the connection, as the list of known issues
describes.

Create an app from a table in an Oracle database


1. In Power Apps Studio, click or tap New on the File menu (near the left edge).

2. Under Start with your data, click or tap the arrow.


A list of connections that you already have appears.
3. Click or tap New connection.
4. In the list of connections, click or tap Oracle Database.

5. Specify the name of an Oracle server, a username, and a password.


Specify a server in this format if an SID is required:
ServerName/SID

6. Click or tap the gateway that you want to use, or install one.
If your gateway doesn't appear after you install it, click Refresh gateway list.

7. Click or tap Create to create the connection.


8. Click or tap the default dataset.

9. In the list of tables, click or tap the table that you want to use.

10. Click Connect to create the app.

Power Apps creates an app that has three screens and shows data from the table that you selected:
BrowseScreen1, which lists all entries in the table.
DetailScreen1, which provides more info about a single entry.
EditScreen1, in which users can update an entry or create an entry.
Next steps
To save the app that you've just generated, press Ctrl-S.
To customize BrowseScreen1 (which appears by default), see Customize a layout.
To customize DetailsScreen1 or EditScreen1, see Customize a form.

Known issues, tips, and troubleshooting


1. Cannot reach the Gateway.
This error appears if the on-premises data gateway can't connect to the cloud. To check the status of your
gateway, sign in to powerapps.microsoft.com, click or tap Gateways, and then click or tap the gateway that
you want to use.
Make sure that your gateway is running and can connect to the Internet. Avoid installing the gateway on a
computer that may be turned off or asleep. Also try restarting the on-premises data gateway service
(PBIEgwService).
2. System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.
This error appears if the Oracle client SDK isn't installed on the same computer as the on-premises data
gateway. To resolve this issue, install the official provider.
3. Table '[Tablename]' does not define any key columns.
This error appears if you're connecting to a table that doesn't have a primary key, which the Oracle Database
connection requires.
4. As of this writing, stored procedures, tables with composite keys, and nested object types in tables aren't
directly supported in Power Apps. However, stored procedures using Power Automate are supported.
Connect to Power BI from Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Power BI is a suite of business analytics tools to analyze data and share insights. Monitor your business and get
answers quickly with rich dashboards available on every device. In your app, you can check the status of the data
alerts that you have set up in the Power BI service. For more information on data alerts in Power BI, head to the
documentation page.
This topic shows you how to use the Power BI connection in an app, and lists the available functions.

Prerequisites
Sign up
Add the Power BI connection
Create an app from a template, from data, or from scratch

Use the Power BI connection in your app


List the alerts that you've set up in the Power BI service
1. On the Insert menu, select Gallery, and add any of the Text galleries.
2. To show the current user's alerts, set the Items property of the gallery to the following formula:
PowerBI.GetAlerts()

The gallery will update with the list of alerts. For each alert, you will receive the alert name, the ID number of the
alert, and the ID of the group workspace in which the alert was configured. You will need the alert ID to get further
information about the alert.
View the status of an alert
To view the status of the alert, call the CheckAlertStatus function with the alert ID obtained from the step above.
The alert ID can be passed in either as a literal string (e.g. "1234") or as a reference to a gallery section populated
using the GetAlerts() call (e.g. Gallery1.Selected.alertId)
To proceed, add a label, and then set its Text property to one of these formulas:
PowerBI.CheckAlertStatus( /* alert ID that you received from GetAlert */ ).alertTitle
PowerBI.CheckAlertStatus( /* alert ID that you received from GetAlert */ ).currentTileValue
PowerBI.CheckAlertStatus( /* alert ID that you received from GetAlert */ ).alertThreshold
PowerBI.CheckAlertStatus( /* alert ID that you received from GetAlert */ ).isAlertTriggered

The label will update with the current status of the alert.

View the available functions


This connection includes the following functions:
FUNCTION NAME DESCRIPTION

GetAlerts List the alerts that you have set up in the Power BI service

CheckAlertStatus Check the status of a particular alert

GetAlerts
List the alerts that you have set up in the Power BI service.
Input properties
None.
Output properties

PROPERTY NAME DATA TYPE REQUIRED DESCRIPTION

value array No An array of the data alerts


that you have set up in the
Power BI service. Each
element in the array will
include:
alertTitle: the title of
the alert
alertId: the ID of the
alert
groupId: the ID of
the group that the
alert was created in

CheckAlertStatus
Check the status of an alert.

NOTE
Requests to this endpoint will be throttled on a per-alert basis if called too frequently.

Input properties

PROPERTY NAME DATA TYPE REQUIRED DESCRIPTION

alertId integer Yes The ID of the alert, as


returned by GetAlerts

Output properties

PROPERTY NAME DATA TYPE REQUIRED DESCRIPTION

tileValue number No The value of the tile when


the alert was triggered

tileUrl string No URL for the tile that has the


alert
PROPERTY NAME DATA TYPE REQUIRED DESCRIPTION

alertTitle string No Name of the alert

isAlertTriggered boolean No Whether the alert is


currently triggered

alertThreshold number No The threshold at which the


alarm is triggered

Helpful links
See all the available connections.
Learn how to add connections to your apps.
Connect to SharePoint from a canvas app
12/3/2019 • 6 minutes to read • Edit Online

Connect to a SharePoint site to generate an app automatically from a custom list, or create a connection before
you add data to an existing app or build an app from scratch.
Depending on where your data resides, you can take either or both of these approaches:
Show data from a custom list in a SharePoint Online site or an on-premises site.
Show images and play video or audio files in a library (SharePoint Online only).

Generate an app
If you want to manage data in a custom list, Power Apps can generate a three-screen app for you automatically.
Users can browse the list on the first screen, show details of an item in the second screen, and create or update
items in the third screen.

NOTE
If your SharePoint list contains a Choice, Lookup, or Person or group column, see Show data in a gallery later in this topic.

Create a connection
1. Sign in to Power Apps, select Data > Connections in the left navigation bar, and then select New
connection near the upper-left corner.
2. In the search box near the upper-right corner, type or paste SharePoint, and then select SharePoint.

3. Perform either of these sets of steps:


To connect to SharePoint Online, select Connect directly (cloud services), select Create, and then
provide credentials (if prompted).

The connection is created, and you can add a data to an existing app or build an app from scratch.
To connect to an on-premises site, select Connect using on-premises data gateway.
Specify Windows as the authentication type, and then specify your credentials. (If your credentials
include a domain name, specify it as domain\alias.)

Under Choose a gateway, select the gateway that you want to use, and then select Create.

NOTE
If you don't have an on-premises data gateway installed, install one, and then select the icon to refresh the
list of gateways.

The connection is created, and you can add a data to an existing app or build an app from scratch.

Add data to an existing app


1. In Power Apps Studio, open the app that you want to update, select the View tab, and then select Data
sources.

2. In the Data pane, select Add data source > SharePoint.


3. Under Connect to a SharePoint site, select an entry in the Recent sites list (or type or paste the URL for
the site that you want to use), and then select Connect.
4. Under Choose a list, select the check box for Documents or one or more lists that you want to use, and
then select Connect:

Not all types of lists appear by default. Power Apps supports custom lists, not template-based lists. If the
name of the list that you want to use doesn't appear, scroll to the bottom, and then type the name of the list
in the box that contains Enter custom table name.

The data source or sources are added to your app.

Build your own app from scratch


Apply the concepts in Create an app from scratch to SharePoint instead of Excel.

Show list columns in a gallery


If your custom list contains any of these types of columns, show that data in a Gallery control by using the
formula bar to set the Text property of one or more Label controls in that gallery:
For a Choice or Lookup column, specify ThisItem.ColumnName.Value to show data in that column.
For example, specify ThisItem.Location.Value if you have a Choice column named Location, and specify
ThisItem.PostalCode.Value if you have a Lookup column named PostalCode.
For a Person or Group column, specify ThisItem.ColumnName.DisplayName to show the display name
of the user or the group.
For example, specify ThisItem.Manager.DisplayName to show display names from a Person or Group
column named Manager.
You can also show different information about users, such as email addresses or job titles. To display a
complete list of options, specify ThisItem.ColumnName. (including the trailing period).
NOTE
For a CreatedBy column, specify ThisItem.Author.DisplayName to show the display names of users who created
items in the list. For a ModifiedBy column, specify ThisItem.Editor.DisplayName to show the display names of
users who changed items in the list.

For a Managed Metadata column, specify ThisItem.ColumnName.Label to show data in that column.
For example, specify ThisItem.Languages.Label if you have a Managed Metadata column named
Languages.

Show data from a library


If you have several images in a SharePoint library, you can add a Drop down control to your app so that users
can specify which image to show. You can also apply the same principles to other controls, such as Gallery
controls, and other types of data, such as videos.
1. If you haven't already, create a connection, and then add data to an existing app.
2. Add a Drop down control, and name it ImageList.
3. Set the Items property of ImageList to Documents.
4. On the Properties tab of the right-hand pane, open the Value list, and then select Name.
The file names of the images in your library appear in ImageList.

5. Add an Image control, and set its Image property to this expression:
ImageList.Selected.'Link to item'

6. Press F5, and then select a different value in ImageList.


The image that you specified appears.
You can download a sample app that demonstrates a more complex approach to showing data from a SharePoint
library.
1. After you download the app, open Power Apps Studio, select Open in the left navigation bar, and then select
Browse.
2. In the Open dialog box, find and open the file that you downloaded, and then add a SharePoint library as a
data source by following the first two procedures in this topic.

NOTE
By default, this app shows delegation warnings, but you can ignore them if your library contains fewer than 500 items.

In this one-screen app, the list in the lower-left corner shows all files in your library.
You can search for a file by typing or pasting one or more characters in the search box near the top.
If your library contains folders, you can filter the list of files by selecting a filter icon in the list of folders just
under the title bar.
When you find the file that you want, select it to show it in the Video, Image, or Audio control along the right-
hand side.

Known issues
Lists
Power Apps can read column names that contain spaces, but the spaces are replaced with the hexadecimal escape
code "_x0020_". For example, "Column Name" in SharePoint will appear as "Column_x0020_Name" in Power
Apps when displayed in the data layout or used in a formula.
Not all types of columns are supported, and not all types of columns support all types of cards.

COLUMN TYPE SUPPORT DEFAULT CARDS

Single line of text Yes View text

Multiple lines of text Yes View text

Choice Yes View lookup


Edit lookup
View multiselect
Edit multiselect

Number Yes View percentage


View rating
View text

Currency Yes View percentage


View rating
View text

Date and Time Yes View text

Lookup Yes View lookup


Edit lookup
View multiselect
Edit multiselect

Boolean (Yes/No) Yes View text


View toggle

Person or Group Yes View lookup


Edit lookup
View multiselect
Edit multiselect

Hyperlink Yes View URL


View text

Picture Yes (read-only) View image


View text

Attachment Yes (read-only) View Attachments

Calculated Yes (read-only)

Task Outcome No

External data No

Managed Metadata Yes (read-only)

Rating No
Libraries
You can't upload files from Power Apps to a library.
You can't show PDF files from a library in a PDF Viewer control.
Power Apps Mobile doesn't support the Download function.
If your users will run the app in Power Apps Mobile or the Windows 10 app, use the Launch function to
display library content in a gallery.

Next steps
Learn how to show data from a data source.
Learn how to view details and create or update records.
See other types of data sources to which you can connect.
Connect to SQL Server from Power Apps
12/3/2019 • 6 minutes to read • Edit Online

Connect to SQL Server, in either Azure or an on-premises database, so that you can display information from it in
Power Apps.

Prerequisites
Sign up for Power Apps, and then sign in by providing the same credentials that you used to sign up.
Gather the following information for a database that contains at least one table with a primary key:
the name of the database
the name of the server on which the database is hosted
a valid user name and password to connect to the database
the type of authentication needed to connect to the database
If you don't have this information, ask the administrator of the database that you want to use.
For an on-premises database, identify a data gateway that was shared with you (or create one).

NOTE
Gateways and on-premises connections can only be created and used in the user's default environment.

Generate an app automatically


1. In Power Apps Studio, click or tap New on the File menu (along the left edge).

2. Under Start with your data, click or tap the right arrow at the end of the row of connectors.
3. If you already have a connection to the database that you want to use, click or tap it, and then skip to step 7
in this procedure.
4. Click or tap New connection, and then click or tap SQL Server.
5. Perform either of these steps:
Specify Connect directly (cloud services), and then type or paste the server name, the database
name, the user name, and the password for the database that you want to use.

Specify Connect using on-premises data gateway, type or paste the server name, the database
name, the user name, and the password for the database that you want to use, and specify the
authentication type and the gateway.
NOTE
If you don't have a gateway, install one, and then click or tap Refresh gateway list.

6. Click or tap Connect.


7. Click or tap an option under Choose a dataset, click or tap an option under Choose a table, and then click
or tap Connect.
Power Apps creates an app that shows data on three screens. Heuristics suggest what kind of data to show,
but you might need to customize the UI to suit your needs.
8. Customize the app by using techniques that are similar to those that Create an app from Excel describes,
starting with changing the app layout.

Build an app from scratch


1. Sign in to powerapps.com with the same account that you used to sign up for Power Apps.
2. In the left navigation bar, click or tap Connections:
3. In the upper-right corner, click or tap New connection, and then click or tap SQL Server.
4. Perform either of these steps:
Specify Connect directly (cloud services), and then type or paste the server name, the database
name, the user name, and the password for the database that you want to use.

Specify Connect using on-premises data gateway, type or paste the server name, the database
name, the user name, and the password for the database that you want to use, and specify the
authentication type and the gateway.

NOTE
If you don't have a gateway, install one, and then click or tap the clockwise icon to refresh the list.

5. Click or tap Create to create the connection.


6. Create an app by using techniques that are similar to those that Create an app from scratch describes.

Update an existing app


1. In Power Apps Studio, open the app that you want to update.
2. Click or tap Data sources on the View tab of the ribbon.
3. In the right-hand pane, click or tap Add a data source.

4. Click or tap New connection, click or tap SQL Server, and then click or tap Connect.
5. Perform either of these steps:
Specify Connect directly (cloud services), and then type or paste the server name, the database
name, the user name, and the password for the database that you want to use.

Specify Connect using on-premises data gateway, type or paste the server name, the database
name, the user name, and the password for the database that you want to use, and specify the
authentication type and the gateway.
NOTE
If you don't have a gateway, install one, and then click or tap the circular icon to refresh the list.

6. Click or tap Connect.


7. Under Choose a dataset, click or tap an option.
8. Under Choose a table, select one or more checkboxes, and then click or tap Connect.

Next steps
Learn how to show data from a data source.
Learn how to view details and create or update records.
See other types of data sources to which you can connect.
Understand tables and records with tabular data sources.
Connect to Twitter from Power Apps
12/3/2019 • 9 minutes to read • Edit Online

Twitter lets you post tweets and get tweets, timeline, friends, and followers from your Twitter account.
You can display this information in a label on your app. For example, you can add an input text box, ask the user to
enter in some Tweet text, and then add a button that "posts" the tweet. You can use similar methods to get a tweet
or search for a tweet, and then display the text in a label or gallery control in your app.
This topic shows you how to create the Twitter connection, use the Twitter connection in an app, and lists the
available functions.

Prerequisites
Access to Power Apps
Add the connection
Create an app from a template, from data, or from scratch

Connect to Twitter
1. Open Power Apps, select New, and then create a Blank app. Choose phone or tablet layout. Tablet layout
gives you more workspace:

2. In the right-hand pane, click or tap the Data tab, and then click or tap Add data source.
3. Select New connection, and then select Twitter:
4. Select Connect, enter your Twitter sign in credentials, and then select Authorize app.
5. Select Add Data Source. Your connection appears under Data sources:

The Twitter connection has been created, and added to your app. Now, it's ready to be used.

Use the Twitter connection in your app


Show a timeline
1. On the Insert menu, select Gallery, and add any of the With text galleries.
2. Let's show some timelines:
To show the current user's timeline, set the Items property of the gallery to the following formulas:
Twitter.HomeTimeline().TweetText
Twitter.HomeTimeline({maxResults:3}).TweetText
To show another user's timeline, set the Items property of the gallery to the following formula:
Twitter.UserTimeline( *TwitterHandle* ).TweetText

Enter a Twitter handle in double quotation marks or an equivalent value. For example, enter
"satyanadella" or "powerapps" directly in the formula expression.

Add a text input control named Tweep, and set its Default property to Tweep.Text . In the Tweep text
box, type in a Twitter handle such as satyanadella (without quotation marks and without the @
symbol).
In the gallery control, set the Items property to the following formula:
Twitter.UserTimeline(Tweep.Text, {maxResults:5}).TweetText

The gallery control automatically shows the tweets of the Twitter handler you type in.

TIP
Some of these formulas use the maxResults argument to show the x number of most recent tweets in a
timeline.

3. Set the gallery's Items property to Twitter.HomeTimeline() .


With the gallery selected, the right-hand pane shows options for that gallery.
4. Select TweetText in the first list, select TweetedBy in the second list, and select CreatedAt in the third list.
The gallery now shows the values of the properties you chose.
Show followers
1. Using a With text gallery, let's show some followers:
To show the current user's followers, set the Items property of the gallery to the following formula:
Twitter.MyFollowers()
Twitter.MyFollowers({maxResults:3})

To show the another user's followers, set the Items property of the gallery to the following formula:
Twitter.Followers( *TwitterHandle* )

Enter a Twitter handle in double quotation marks or an equivalent value. For example, enter
"satyanadella" or "powerapps" directly in the formula expression.

Add a text input control named Tweep, and set its Default property to Tweep.Text . In the Tweep text
box, type in a Twitter handle such as satyanadella (without quotation marks and without the @
symbol).
In the gallery control, set the Items property to the following formula:
Twitter.Followers(Tweep.Text, {maxResults:5})

The gallery control automatically shows who is following the Twitter handle you type in.

TIP
Some of these formulas use the maxResults argument to show the x number of most recent tweets in a
timeline.
2. Set the gallery's Items property to Twitter.MyFollowers() .
With the gallery selected, the right-hand pane shows options for that gallery.
3. Select UserName in the second list, and select FullName in the third list.
The gallery now shows the values of the properties you chose.
Show followed users
1. Using a With text gallery, let's show some followed users:
To show which users the current user is following, set the Items property of the gallery to the
following formula:
Twitter.MyFollowing()
Twitter.MyFollowing({maxResults:3})

To show which users another user is following, set the Items property of the gallery to the following
formula:
Twitter.Following( *TwitterHandle* )

Enter a Twitter handle in double quotation marks or an equivalent value. For example, enter
"satyanadella" or "powerapps" directly in the formula expression.

Add a text input control named Tweep, and set its Default property to Tweep.Text . In the Tweep text
box, type in a Twitter handle such as satyanadella (without quotation marks and without the @
symbol).
In the gallery control, set the Items property to the following formula:
Twitter.Following(Tweep.Text, {maxResults:5})

The gallery control automatically shows the other handles you are following.
With the gallery selected, the right-hand pane shows options for that gallery.
2. Select Description in the Body1 list, UserName in the Heading1 list, and FullName in the Subtitle1 list.
The gallery now shows the values of the properties you chose.
Show information about a user
Add a label, and then set its Text property to one of these formulas:
twitter.User( *TwitterHandle* ).Description
twitter.User( *TwitterHandle* ).FullName
twitter.User( *TwitterHandle* ).Location
twitter.User( *TwitterHandle* ).UserName
twitter.User( *TwitterHandle* ).FollowersCount
twitter.User( *TwitterHandle* ).FriendsCount
twitter.User( *TwitterHandle* ).Id
twitter.User( *TwitterHandle* ).StatusesCount

Enter a Twitter handle in double quotation marks or an equivalent value. For example, enter "satyanadella" or
"powerapps" directly in the formula expression.

Or, you can use an input text control to type in a Twitter handle, just as we have throughout this topic.
Search tweets
1. Using a With text gallery, set its Items property to the following formula:
Twitter.SearchTweet( *SearchTerm* ).TweetText

Enter a SearchTerm in double quotation marks or by referring to an equivalent value. For example, enter
"PowerApps" or "microsoft" directly in the formula.

Or, you can use an Input text control to specify a search term, just as we have throughout this topic.

TIP
Show the first five results by using maxResults:

Twitter.SearchTweet(SearchTerm.Text, {maxResults:5}).TweetText

2. Set the gallery's Items property to Twitter.SearchTweet(SearchTerm.Text, {maxResults:5}) .


With the gallery selected, the right-hand pane shows options for that gallery.
3. Select TweetText in the first list, TweetedBy in the second list, and CreatedAt in the third list.
The gallery now shows the values of the properties you chose.
Send a tweet
1. Add a text input control, and then rename it MyTweet.
2. Add a button, and then set its OnSelect property to the following formula:
Twitter.Tweet({tweetText: MyTweet.Text})

3. Press F5, or select the Preview button ( ). Type some text into MyTweet, and then select the button to tweet
the text that you entered.
4. Press Esc to return to the default workspace.

View the available functions


This connection includes the following functions:

FUNCTION NAME DESCRIPTION

UserTimeline Retrieves a collection of the most recent tweets posted by the


specified user

HomeTimeline Retrieves the most recent tweets and re-tweets posted me


and my followers

SearchTweet Retrieves a collection of relevant tweets matching a specified


query

Followers Retrieves users following the specified user

MyFollowers Retrieves users who are following me

Following Retrieves users who the specified user is following

MyFollowing Retrieves users that I am following


FUNCTION NAME DESCRIPTION

User Retrieves details about the specified user (example: user name,
description, followers count, etc.)

Tweet Tweet

OnNewTweet Triggers a workflow when a new tweet is posted which


matches your search query

UserTimeline
Get user timeline: Retrieves a collection of the most recent tweets posted by the specified user
Input properties

NAME DATA TYPE REQUIRED DESCRIPTION

userName string yes Twitter handle

maxResults integer no Maximum number of tweets


to retrieve, e.g.
{maxResults:5}

Output properties

PROPERTY NAME DATA TYPE REQUIRED DESCRIPTION

TweetText string Yes

TweetId string No

CreatedAt string No

RetweetCount integer Yes

TweetedBy string Yes

MediaUrls array No

HomeTimeline
Get home timeline: Retrieves the most recent tweets and re-tweets posted me and my followers
Input properties

NAME DATA TYPE REQUIRED DESCRIPTION

maxResults integer no Maximum number of tweets


to retrieve, e.g.
{maxResults:5}

Output properties

PROPERTY NAME DATA TYPE REQUIRED DESCRIPTION

TweetText string Yes


PROPERTY NAME DATA TYPE REQUIRED DESCRIPTION

TweetId string No

CreatedAt string No

RetweetCount integer Yes

TweetedBy string Yes

MediaUrls array No

SearchTweet
Search tweet: Retrieves a collection of relevant tweets matching a specified query
Input properties

NAME DATA TYPE REQUIRED DESCRIPTION

searchQuery string yes Query text (you may use any


Twitter supported query
operators:
https://www.twitter.com/sear
ch)

maxResults integer no Maximum number of tweets


to retrieve, e.g.
{maxResults:5}

Output properties

PROPERTY NAME DATA TYPE REQUIRED DESCRIPTION

TweetText string Yes

TweetId string No

CreatedAt string No

RetweetCount integer Yes

TweetedBy string Yes

MediaUrls array No

Followers
Get followers: Retrieves users following the specified user
Input properties

NAME DATA TYPE REQUIRED DESCRIPTION

userName string yes Twitter handle of the user


NAME DATA TYPE REQUIRED DESCRIPTION

maxResults integer no Maximum number of users


to retrieve, e.g.
{maxResults:5}

Output properties

PROPERTY NAME DATA TYPE REQUIRED DESCRIPTION

FullName string Yes

Location string Yes

Id integer No

UserName string Yes

FollowersCount integer No

Description string Yes

StatusesCount integer No

FriendsCount integer No

MyFollowers
Get my followers: Retrieves users who are following me
Input properties

NAME DATA TYPE REQUIRED DESCRIPTION

maxResults integer no Maximum number of users


to retrieve, e.g.
{maxResults:5}

Output properties

PROPERTY NAME DATA TYPE REQUIRED DESCRIPTION

FullName string Yes

Location string Yes

Id integer No

UserName string Yes

FollowersCount integer No

Description string Yes

StatusesCount integer No
PROPERTY NAME DATA TYPE REQUIRED DESCRIPTION

FriendsCount integer No

Following
Get following: Retrieves users who the specified user is following
Input properties

NAME DATA TYPE REQUIRED DESCRIPTION

userName string yes Twitter handle of the user

maxResults integer no Maximum number of users


to retrieve, e.g.
{maxResults:5}

Output properties

PROPERTY NAME DATA TYPE REQUIRED DESCRIPTION

FullName string Yes

Location string Yes

Id integer No

UserName string Yes

FollowersCount integer No

Description string Yes

StatusesCount integer No

FriendsCount integer No

MyFollowing
Get my following: Retrieves users that I am following
Input properties

NAME DATA TYPE REQUIRED DESCRIPTION

maxResults integer no Maximum number of users


to retrieve, e.g.
{maxResults:5}

Output properties

PROPERTY NAME DATA TYPE REQUIRED DESCRIPTION

FullName string Yes

Location string Yes


PROPERTY NAME DATA TYPE REQUIRED DESCRIPTION

Id integer No

UserName string Yes

FollowersCount integer No

Description string Yes

StatusesCount integer No

FriendsCount integer No

User
Get user: Retrieves details about the specified user (example: user name, description, followers count, etc.)
Input properties

NAME DATA TYPE REQUIRED DESCRIPTION

userName string yes Twitter handle of the user

Output properties

PROPERTY NAME DATA TYPE REQUIRED DESCRIPTION

FullName string Yes

Location string Yes

Id integer No

UserName string Yes

FollowersCount integer No

Description string Yes

StatusesCount integer No

FriendsCount integer No

Tweet
Post a new tweet: Tweet
Input properties

NAME DATA TYPE REQUIRED DESCRIPTION

tweetText string no Text to be posted e.g.


{tweetText:"hello"}

body string no Media to be posted


Output properties

PROPERTY NAME DATA TYPE REQUIRED DESCRIPTION

TweetId string Yes

OnNewTweet
When a new tweet appears: Triggers a workflow when a new tweet is posted which matches your search query
Input properties

NAME DATA TYPE REQUIRED DESCRIPTION

searchQuery string yes Query text (you may use any


Twitter supported query
operators:
https://www.twitter.com/sear
ch)

Output properties

PROPERTY NAME DATA TYPE REQUIRED DESCRIPTION

value array No

Helpful links
See all the available connections.
Learn how to add connections to your apps.
Add a data connection to a canvas app in Power
Apps
12/3/2019 • 2 minutes to read • Edit Online

In Power Apps, add a data connection to an existing canvas app or to an app that you're building from scratch.
Your app can connect to SharePoint, Common Data Service, Salesforce, OneDrive, or many other data sources.
Your next step after this article is to display and manage data from that data source in your app, as in these
examples:
Connect to OneDrive, and manage data in an Excel workbook in your app.
Connect to Twilio, and send an SMS message from your app.
Connect to Common Data Service, and update an entity from your app.
Connect to SQL Server, and update a table from your app.

Prerequisites
Sign up for Power Apps, and then sign in by providing the same credentials that you used to sign up.

Open a blank app


1. On the Home tab, select Canvas app from blank.
2. Specify a name for your app, and then select Create.
3. If the Welcome to Power Apps Studio dialog box appears, select Skip.

Add data source


1. In the center pane, select connect to data to open the Data pane.
If this were an existing app and the screen already contained a control, select View > Data sources to
open the same pane.
2. Select Add data source.
3. If the list of connections includes the one that you want, select it to add it to the app. Otherwise, skip to
the next step.
4. Select New connection to display a list of connections.

5. In the search bar, type or paste the first few letters of the connection you want, and then select the
connection when it appears.

6. Select Create to both create the connection and add it to your app.
Some connectors, such as Office 365 Outlook, require no additional steps, and you can show data from
them immediately. Other connectors prompt you to provide credentials, specify a particular set of data,
or perform other steps. For example, SharePoint and SQL Server require additional information before
you can use them. With Common Data Service, you can change the environment before you select an
entity.

Identify or change a data source


If you're updating an app, you might need to identify or change the source of data that appears in a gallery, a
form, or another control. For example, you might need to identify a data source as you update an app that
someone else created or that you created long ago.
1. Select the control, such as a gallery, for which you want to identify or change the data source.
The name of the data source appears on the Properties tab of the right-hand pane.

2. To show more information about the data source or to change it, select the down arrow next to its name.
More information about the current data source appears, and you can select or create another source.

Next steps
To show and update data in a source such as Excel, SharePoint, Common Data Service, or SQL Server, add a
gallery, and add a form.
For data in other sources, use connector-specific functions such as those for Office 365 Outlook, Twitter, and
Microsoft Translator.
Manage canvas-app connections in Power Apps
2/6/2020 • 2 minutes to read • Edit Online

In powerapps.com, create a connection to one or more data sources, delete a connection, or update its
credentials.
Your canvas app's data connection can connect to SharePoint, SQL Server, Office 365, OneDrive for Business,
Salesforce, Excel, and many other data sources.
Your next step after this article is to display and manage data from the data source in your app, as in these
examples:
Connect to OneDrive for Business, and manage data in an Excel workbook in your app.
Update a list on a SharePoint site.
Connect to SQL Server, and update a table from your app.
Send email in Office 365.
Send a tweet.
Connect to Twilio, and send an SMS message from your app.

Prerequisites
1. Sign up for Power Apps.
2. Sign in to make.powerapps.com using the same credentials that you used to sign up.

Background on data connections


Most Power Apps apps use external information called Data Sources that is stored in cloud services. A
common example is a table in an Excel file stored in OneDrive for Business. Apps are able to access these data
sources by using Connections.
The commonest type of data source is the table, which you can use to retrieve and store information. You can
use connections to data sources to read and write data in Microsoft Excel workbooks, SharePoint lists, SQL
tables, and many other formats, which can be stored in cloud services like OneDrive for Business, DropBox,
SQL Server, etc.
There are other kinds of data sources that are not tables, such as email, calendars, twitter, and notifications.
Using the Gallery, Display form, and Edit form controls, it is easy to create an app that reads and writes data
from a data source. To get started, read the article Understand data forms.
In addition to creating and managing connections in powerapps.com, you also create connections when you do
these tasks:
Automatically generate an app from data, such as a custom SharePoint list.
Update an existing app, or create one from scratch as add a connection describes.
Open an app that another user created and shared with you.

NOTE
If you want to use Power Apps Studio instead, open the File menu, and then click or tap Connections, powerapps.com
opens so that you can create and manage connections there.
Create a new connection
1. If you have not already done so, log in to make.powerapps.com.
2. In the left navigation, expand Data and select Connections.

3. Select New connection.

4. Select a connector in the list that appears, and then follow the prompts.
5. Select the Create button.

6. Follow the prompts. Some connectors prompt you to provide credentials, specify a particular set of data,
or perform other steps. Others such as Microsoft Translator, do not.
For example, these connectors require additional information before you can use them.
SharePoint
SQL Server
The new connector appears under Connections, and you can add it to an app.

Update or delete a connection


In the list of connections, find the connection that you want to update or delete, and then select the ellipsis (...)
on the right of the connection.
To update the credentials for a connection, select the key icon, and then provide credentials for that
connection.
To delete the connection, select delete.
Select the information icon to see the connection details.
Format a table in Excel and naming tips
12/3/2019 • 2 minutes to read • Edit Online

In Power Apps, you can create a canvas app based on Excel data only if it's formatted as a table. By following this
content, you'll learn how to format a table in Excel and some tips of naming Excel columns.

How to format a table in Excel


You can convert your data to a table by selecting Format as Table in the Home tab of Excel.

You can also create a table by selecting Table on the Insert tab.

To find your table easily, go to Design under Table Tools, and rename your table. It's useful to give your table a
meaningful name, especially when the same Excel file contains more than one table.

Naming tips in Excel


If a column in your table contains images, include "image" in the name of that column. This keyword will bind that
column to an image control in a gallery.
Next steps
Generate an app from Excel in Power Apps based on a table that you specify. The app will have three screens
by default: one each for browsing records, displaying details about a single record, and creating or updating a
record.
Create an app from scratch using the table you format in Excel. You can manually create and customize your
app to display, browse, or edit the data in your table.
Understand delegation in a canvas app
12/2/2019 • 9 minutes to read • Edit Online

Power Apps includes a powerful set of functions for filtering, sorting, and shaping tables of data in a canvas
app: Filter, Sort, and AddColumns functions to name just a few. With these functions, you can provide your
users with focused access to the information they need. For those with a database background, using these
functions is the equivalent of writing a database query.
The key to building efficient apps is to minimize the amount of data that must be brought to your device.
Perhaps you need only a handful of records from a sea of million, or a single aggregate value can represent
thousands of records. Or perhaps only the first set of records can be retrieved, and the rest brought in as the
user gestures that they want more. Being focused can dramatically reduce the processing power, memory, and
network bandwidth that your app needs, resulting in snappier response times for your users, even on phones
connected via a cellular network.
Delegation is where the expressiveness of Power Apps formulas meets the need to minimize data moving over
the network. In short, Power Apps will delegate the processing of data to the data source, rather than moving
the data to the app for processing locally.
Where this becomes complicated, and the reason this article exists, is because not everything that can be
expressed in a Power Apps formula can be delegated to every data source. The Power Apps language mimics
Excel's formula language, designed with complete and instant access to a full workbook in memory, with a
wide variety of numerical and text manipulation functions. As a result, the Power Apps language is far richer
than most data sources can support, including powerful database engines such as SQL Server.
Working with large data sets requires using data sources and formulas that can be delegated. It's the
only way to keep your app performing well and ensure users can access all the information they need. Take
heed of delegation warnings that identify places where delegation isn't possible. If you're working with small
data sets (fewer than 500 records), you can use any data source and formula because the app can process data
locally if the formula can't be delegated.

NOTE
Delegation warnings were previously flagged in Power Apps as "blue dot" suggestions, but delegation suggestions have
since been re-classified as warnings. If the data in your data source exceeds 500 records and a function can't be
delegated, Power Apps might not be able to retrieve all of the data, and your app may have wrong results. Delegation
warnings help you manage your app so that it has correct results.

Delegable data sources


Delegation is supported for certain tabular data sources only. If a data source supports delegation, its
connector documentation outlines that support. For example, these tabular data sources are the most popular,
and they support delegation:
Common Data Service
SharePoint
SQL Server
Imported Excel workbooks (using the Add static data to your app data source), collections, and tables stored
in context variables don't require delegation. All of this data is already in memory, and the full Power Apps
language can be applied.
Delegable functions
The next step is to use only those formulas that can be delegated. Included here are the formula elements that
could be delegated. However, every data source is different, and not all of them support all of these elements.
Check for delegation warnings in your particular formula.
These lists will change over time. We're working to support more functions and operators with delegation.
Filter functions
Filter, Search, and LookUp can be delegated.
Within the Filter and LookUp functions, you can use these with columns of the table to select the appropriate
records:
And (including && ), Or (including ||), Not (including !)
In
=, <>, >=, <=, >, <
+, -
TrimEnds
IsBlank
StartsWith, EndsWith
Constant values that are the same across all records, such as control properties and global and context
variables.
You can also use portions of your formula that evaluate to a constant value for all records. For example, Left(
Language(), 2 ), Date( 2019, 3, 31 ), and Today() don't depend on any columns of the record and, therefore,
return the same value for all records. These values can be sent to the data source as a constant and won't block
delegation.
The previous list doesn't include these notable items:
If
*, /, Mod
Concatenate (including & )
ExactIn
String manipulation functions: Lower, Upper, Left, Mid, Len, ...
Signals: Location, Acceleration, Compass, ...
Volatiles: Rand, ...
Collections
Sorting functions
Sort and SortByColumns can be delegated.
In Sort, the formula can only be the name of a single column and can't include other operators or functions.
Aggregate functions
Sum, Average, Min, and Max can be delegated. Only a limited number of data sources support this
delegation at this time; check the delegation list for details.
Counting functions such as CountRows, CountA, and Count can't be delegated.
Other aggregate functions such as StdevP and VarP can't be delegated.
Table shaping functions
AddColumns, DropColumns, RenameColumns, and ShowColumns partially support delegation.
Formulas in their arguments can be delegated. However, the output of these functions are subject to the non-
delegation record limit.
As in this example, makers often use AddColumns and LookUp to merge information from one table into
another, commonly referred to as a Join in database parlance:

AddColumns( Products,
"Supplier Name",
LookUp( Suppliers, Suppliers.ID = Product.SupplierID ).Name
)

Even though Products and Suppliers may be delegable data sources and LookUp is a delegable function, the
output of the AddColumns function isn't delegable. The result of the entire formula is limited to the first
portion of the Products data source. Because the LookUp function and its data source are delegable, a match
for Suppliers can be found anywhere in the data source, even if it's large.
If you use AddColumns in this manner, LookUp must make separate calls to the data source for each of
those first records in Products, which causes a lot of network chatter. If Suppliers is small enough and doesn't
change often, you could call the Collect function in OnStart to cache the data source in your app when it
starts. As an alternative, you could restructure your app so that you pull in the related records only when the
user asks for them.

Non-delegable functions
All other functions don't support delegation, including these notable functions:
First, FirstN, Last, LastN
Choices
Concat
Collect, ClearCollect
CountIf, RemoveIf, UpdateIf
GroupBy, Ungroup

Non-delegable limits
Formulas that can't be delegated will be processed locally. This allows for the full breadth of the Power Apps
formula language to be used. But at a price: all the data must be brought to the device first, which could involve
retrieving a large amount of data over the network. That can take time, giving the impression that your app is
slow or possibly crashed.
To avoid this, Power Apps imposes a limit on the amount of data that can be processed locally: 500 records by
default. We chose this number so that you would still have complete access to small data sets and you would
be able to refine your use of large data sets by seeing partial results.
Obviously care must be taken when using this facility because it can confuse users. For example, consider a
Filter function with a selection formula that can't be delegated, over a data source that contains a million
records. Because the filtering is done locally, only the first 500 records are scanned. If the desired record is
record 501 or 500,001, it isn't considered or returned by Filter.
Aggregate functions can also cause confusion. Take Average over a column of that same million-record data
source. Average can't yet be delegated, so only the first 500 records are averaged. If you're not careful, a
partial answer could be misconstrued as a complete answer by a user of your app.

Changing the limit


500 is the default number of records, but you can change this number for an entire app:
1. On the File tab, select App settings.
2. Under Advanced settings, change the Data row limit for non-delegable queries setting from 1 to
2000.
In some cases, you'll know that 2,000 (or 1,000 or 1,500) will satisfy the needs of your scenario. With care, you
can increase this number to fit your scenario. As you increase this number, your app's performance may
degrade, especially for wide tables with lots of columns. Still, the best answer is to delegate as much as you
can.
To ensure that your app can scale to large data sets, reduce this setting down to 1. Anything that can't be
delegated returns a single record, which should be easy to detect when testing your app. This can help avoid
surprises when trying to take a proof-of-concept app to production.

Delegation warnings
To make it easier to know what is and isn't being delegated, Power Apps provides warning (yellow triangle)
when you create a formula that contains something that can't be delegated.
Delegation warnings appear only on formulas that operate on delegable data sources. If you don't see a
warning and you believe your formula isn't being properly delegated, check the type of data source against the
list of delegable data sources earlier in this topic.

Examples
For this example, you'll automatically generate a three-screen app based on a SQL Server table named [dbo].
[Fruit]. For information about how to generate the app, you can apply similar principles in the topic about
Common Data Service to SQL Server.
The gallery's Items property is set to a formula that contains SortByColumns and Search functions, both of
which can be delegated.
In the search box, type "Apple".
Marching dots appear momentarily near the top of the screen as the app communicates with SQL Server to
process the search request. All records that meet the search criteria appear, even if the data source contains
millions of records.
The search results include "Apples", "Crab apples", and "Pineapple" because the Search function looks
everywhere in a text column. If you wanted to find only records that contain the search team at the start of the
fruit's name, you can use another delegable function, Filter, with a more complicated search term. (For
simplicity, remove the SortByColumns call.)

The new results include "Apples" but not "Crab apples" or "Pineapple". However, a yellow triangle appears
next to the gallery (and in the screen thumbnail if the left navigation bar shows thumbnails), and a blue, wavy
line appears under a portion of the formula. Each of these elements indicate a warning. If you hover over the
yellow triangle next to the gallery, this message appears:

SQL Server is a delegable data source, and Filter is a delegable function, However, Mid and Len can't be
delegated to any data source.
But it worked, didn't it? Well, kind of. And that is why this is a warning and not a red, wavy squiggle.
If the table contains fewer than 500 records, the formula worked perfectly. All records were brought to the
device, and Filter was applied locally.
If the table contains more than 500 records, the formula won't return record 501 or higher, even if it
matches the criteria.
Manage an on-premises data gateway in Power
Apps
12/3/2019 • 2 minutes to read • Edit Online

Install an on-premises data gateway to transfer data quickly and securely between a canvas app that's built in
Power Apps and a data source that isn't in the cloud, such as an on-premises SQL Server database or an on-
premises SharePoint site. View all gateways for which you have administrative permissions, and manage
permissions and connections for those gateways.
With a gateway, you can connect to on-premises data over these connections:
SharePoint
SQL Server
Oracle
Informix
Filesystem
DB2

Prerequisites
The user name and password that you used to sign up for Power Apps.
Administrative permissions on a gateway. (You have these permissions by default for each gateway that you
install, and an administrator of another gateway can grant you these permissions for that gateway.)
A license that supports accessing on-premises data using an on-premises gateway. For more information, see
the “Connectivity” section of the pricing page.
Gateways and on-premises connections can only be created and used in the user's default environment.

Install a gateway
To install a gateway, follow the steps in Install an on-premises data gateway. Install the gateway in standard mode
because the on-premises data gateway (personal mode) is available only for Power BI.

View and manage gateway permissions


1. In the left navigation bar of powerapps.com, click or tap Gateways, and then click or tap a gateway.
2. Add a user to a gateway by clicking or tapping Users, specifying a user or group, and then specifying a
permission level:
Can use: Users who can create connections on the gateway to use for apps and flows, but cannot share
the gateway. Use this permission for users who will run apps but not share them.
Can use + share: Users who can create a connection on the gateway to use for apps and flows, and
automatically share the gateway when sharing an app. Use this permission for users who need to share
apps with other users or with the organization.
Admin: Administrators who have full control of the gateway, including adding users, setting
permissions, creating connections to all available data sources, and deleting the gateway.
For Can use and Can use + share permission levels, select the data sources that the user can connect to over the
gateway.
View and manage gateway connections
1. In the left navigation bar of powerapps.com, click or tap Gateways, and then click or tap a gateway.
2. Click or tap Connections, and then click or tap a connection to view its details, edit the settings, or delete it.
3. To share a connection, click or tap Share, and then add or remove users.

NOTE
You can share only some types of connections, such as SQL Server. For more information, see Share app resources.

For more information about how to manage a connection, see Manage your connections.

Troubleshooting and Advanced Configuration


For more information about troubleshooting issues with gateways, see Troubleshoot the on-premises data
gateway. For more information about configuration, see Use the on-premises data gateway app.

Next steps
Install the on-premises data gateway.
Create an app that connects to an on-premises data source, such as SQL Server or SharePoint.
Share an app that connects to an on-premises data source.
What is an on-premises data gateway?
12/3/2019 • 2 minutes to read • Edit Online

The on-premises data gateway acts as a bridge to provide quick and secure data transfer between on-premises
data (data that isn't in the cloud) and several Microsoft cloud services. These cloud services include Power BI,
Power Apps, Power Automate, Azure Analysis Services, and Azure Logic Apps. By using a gateway, organizations
can keep databases and other data sources on their on-premises networks, yet securely use that on-premises data
in cloud services.

How the gateway works

For more information on how the gateway works, see On-premises data gateway architecture.

Types of gateways
There are two different types of gateways, each for a different scenario:
On-premises data gateway allows multiple users to connect to multiple on-premises data sources. You
can use an on-premises data gateway with all supported services, with a single gateway installation. This
gateway is well-suited to complex scenarios with multiple people accessing multiple data sources.
On-premises data gateway (personal mode) allows one user to connect to sources, and can’t be shared
with others. An on-premises data gateway (personal mode) can be used only with Power BI. This gateway
is well-suited to scenarios where you’re the only person who creates reports, and you don't need to share
any data sources with others.

Use a gateway
There are four main steps for using a gateway.
1. Download and install the gateway on a local computer.
2. Configure the gateway based on your firewall and other network requirements.
3. Add gateway admins who can also manage and administer other network requirements.
4. Troubleshoot the gateway in case of errors.

Next steps
Install the on-premises data gateway
Understand data sources for canvas apps in
Power Apps
12/3/2019 • 10 minutes to read • Edit Online

In Power Apps, most canvas apps use external information stored in cloud services called Data Sources.
A common example is a table in an Excel file stored in OneDrive for Business. Apps access these data
sources by using Connections.
This article discusses the different kinds of data sources and how to work with table data sources.
It's easy to create an app that does basic reading and writing to a data source. But sometimes you want
more control over how data flows in and out of your app. This article describes how the Patch,
DataSourceInfo, Validate, and Errors functions provide more control.

Kinds of data sources


Data sources can be connected to a cloud service, or they can be local to an app.
Connected data sources
The most common data sources are tables, which you can use to retrieve and store information. You can
use connections to data sources to read and write data in Microsoft Excel workbooks, SharePoint lists,
SQL tables, and many other formats, which can be stored in cloud services such as OneDrive for
Business, DropBox, and SQL Server.
Data sources other than tables include email, calendars, Twitter, and notifications, but this article doesn't
discuss these other kinds of data sources.
Local data sources
Using the Gallery, Display form, and Edit form controls, it is easy to create an app that reads and
writes data from a data source. To get started, read the article Understand data forms.
When you ask Power Apps to create an app from data, these controls are used. Behind the scenes, the
app uses an internal table to store and manipulate the data that comes from the data source.
A special kind of data source is the Collection, which is local to the app and not backed by a connection to
a service in the cloud, so the information can not be shared across devices for the same user or between
users. Collections can be loaded and saved locally.
Kinds of tables
Tables that are internal to a Power Apps app are fixed values, just as a number or a string is a value.
Internal tables aren't stored anywhere, they just exist in your app's memory. You can't directly modify the
structure and data of a table. What you can do instead is to create a new table through a formula: you use
that formula to make a modified copy of the original table.
External tables are stored in a data source for later retrieval and sharing. Power Apps provides
"connections" to read and write stored data. Within a connection, you can access multiple tables of
information. You'll select which tables to use in your app, and each will become a separate data source.
To learn more, Working with tables goes into more detail about internal tables, but it is also applicable to
external tables residing in a cloud service.
Working with tables
You can use table data sources the same way that you use an internal Power Apps table. Just like an
internal table, each data source has records, columns, and properties that you can use in formulas. In
addition:
The data source has the same column names and data types as the underlying table in the
connection.

NOTE
For SharePoint and Excel data sources that contain column names with spaces, Power Apps will replace the
spaces with "_x0020_". For example, "Column Name" in SharePoint or Excel will appear as
"Column_x0020_Name" in Power Apps when displayed in the data layout or used in a formula.

The data source is loaded from the service automatically when the app is loaded. You can force the
data to refresh by using the Refresh function.
As users run an app, they can create, modify, and delete records and push those changes back to
the underlying table in the service.
Records can be created with the Patch and Collect functions.
Records can be modified with the Patch, Update, and UpdateIf functions.
Records can be removed with the Remove and RemoveIf functions.
Errors when working with a data source are available through the Errors function.
The DataSourceInfo, Defaults, and Validate functions provide information about the data
source that you can use to optimize the user experience.
Creating data sources
Power Apps can't be used to create a connected data source, or modify its structure; the data source must
already exist in a service somewhere. For example, to create a table in an Excel workbook stored on
OneDrive, you first use Excel Online on OneDrive to create a workbook. Next you create a connection to
it from your app.
However, collection data sources can be created and modified inside an app, but are only temporary.
Display one or more records

The diagram above shows the flow of information when an app reads the information in a data source:
The information is stored and shared through a storage service (in this case, a SharePoint list of an
Office 365 site).
A connection makes this information available to the app. The connection takes care of authentication
of the user to access the information.
When the app is started or the Refresh function is pressed, information is drawn from the connection
into a data source in the app for local use.
Formulas are used to read the information and expose it in controls that the user can see. You can
display the records of a data source by using a gallery on a screen and wiring the Items property to
the data source: Gallery.Items = DataSource. You wire controls within the gallery, to the gallery,
using the controls' Default property.
The data source is also a table. So you can use Filter, Sort, AddColumns, and other functions to
refine and augment the data source before using it as a whole. You can also use the Lookup, First,
Last, and other functions to work with individual records.
Modify a record
In the preceding section, you saw how to read a data source. Note that the arrows in the diagram above
are one way. Changes to a data source aren't pushed back through the same formulas in which the data
was retrieved. Instead, new formulas are used. Often a different screen is used for editing a record than
for browsing records, especially on a mobile device.
Note that, to modify an existing record of a data source, the record must have originally come from the
data source. The record may have traveled through a gallery, a context variable, and any number of
formulas, but its origin should be traceable back to the data source. This is important because additional
information travels with the record that uniquely identifies it, ensuring that you modify the correct record.

The diagram above shows the flow of information to update a data source:
An Edit form control provides a container for input cards, which are made up of user input controls
such as a text-input control or a slider. The DataSource and Item properties are used to identify the
record to edit.
Each input card has a Default property, which is usually set to the field of the form's ThisItem
record. The controls within the input card will then take their input values from Default. Normally
you do not need to modify this.
Each input card exposes an Update property. This property maps the user's input to a specific field of
the record for writing back to the data source. Normally you do not need to modify this.
A button or an image control on the screen enables the user to save changes to the record. The
OnSelect formula of the control calls the SubmitForm function to do this work. SubmitForm reads
all the Update properties of the cards and uses this to write back to the data source.
Sometimes there will be issues. A network connection may be down, or a validation check is made by
the service that the app didn't know about. The Error and ErrorKind properties of the form control
makes this information available, so you can display it to the user.
For more fine grained control over the process, you can also use the Patch and Errors function. The Edit
form control exposes an Updates property so that you can read the values of the fields within the form.
You can also use this property to call a custom connector on a connection, completely bypassing the
Patch and SubmitForm functions.
Validation
Before making a change to a record, the app should do what it can to make sure the change will be
acceptable. There are two reasons for this:
Immediate feedback to the user. The best time to fix a problem is right when it happens, when it is
fresh in the user's mind. Literally with each touch or keystroke, red text can appear that identifies an
issue with their entry.
Less network traffic and less user latency. More issues detected in the app means fewer conversations
over the network to detect and resolve issues. Each conversation takes time during which the user
must wait before they can move on.
Power Apps offers two tools for validation:
The data source can provide information about what is and isn't valid. For example, numbers can have
minimum and maximum values, and one or more entries can be required. You can access this
information with the DataSourceInfo function.
The Validate function uses this same information to check the value of a single column or of an entire
record.
Error handling
Great, you've validated your record. Time to update that record with Patch!
But, alas, there may still be a problem. The network is down, validation at the service failed, or the user
doesn't have the right permissions, just to name a few of the possible errors your app may encounter. It
needs to respond appropriately to error situations, providing feedback to the user and a means for them
to make it right.
When errors occur with a data source, your app automatically records the error information and makes it
available through the Errors function. Errors are associated with the records that had the problems. If the
problem is something the user can fix, such as a validation problem, they can resubmit the record, and
the errors will be cleared.
If an error occurs when a record is created with Patch or Collect, there is no record to associate any
errors with. In this case, blank will be returned by Patch and can be used as the record argument to
Errors. Creation errors are cleared with the next operation.
The Errors function returns a table of error information. This information can include the column
information, if the error can be attributed to a particular column. Use column-level error messages in
label controls that are close to where the column is located on the edit screen. Use record-level error
messages where the Column in the error table is blank, in a location close to the Save button for the
entire record.
Working with large data sources
When you are creating reports from large data sources (perhaps millions of records), you want to
minimize network traffic. Let's say you want to report on all Customers having a StatusCode of
"Platinum" in New York City. And that your Customers table contains millions of records.
You do not want to bring those millions of Customers into your app, and then choose the ones you want.
What you want is to have that choosing happen inside the cloud service where your table is stored, and
only send the chosen records over the network.
Many, but not all, functions that you can use to choose records can be delegated, which means that they
are run inside the cloud service. You can learn how to do this by reading about Delegation.

Collections
Collections are a special kind of data source. They're local to the app and not backed by a connection to a
service in the cloud, so the information can not be shared across devices for the same user or between
users. They operate like any other data source, with a few exceptions:
Collections can be created dynamically with the Collect function. They don't need to be established
ahead of time, as connection-based data sources do.
The columns of a collection can be modified at any time using the Collect function.
Collections allow duplicate records. More than one copy of the same record can exist in a collection.
Functions such as Remove will operate on the first match they find, unless the All argument is
supplied.
You can use the SaveData and LoadData functions to save and reload a copy of the collection. The
information is stored in a private location that other users, apps, or devices can't access.
You can use the Export and Import controls to save and reload a copy of the collection to a file that
the user can interact with.
For more information on working with a collection as a data source, see create and update a collection.
Collections are commonly used to hold global state for the app. See working with variables for the
options available for managing state.
Understand canvas-app tables and records
in Power Apps
12/3/2019 • 17 minutes to read • Edit Online

In Power Apps, you can create a canvas app that accesses information in Microsoft Excel,
SharePoint, SQL Server, and several other sources that store data in records and tables. To work
most effectively with this kind of data, review the concepts that underlie these structures.
A record contains one or more categories of information about a person, a place, or a thing.
For example, a record might contain the name, the email address, and the phone number of a
single customer. Other tools refer to a record as a "row" or an "item."
A table holds one or more records that contain the same categories of information. For
example, a table might contain the names, the email addresses, and the phone numbers of 50
customers.
In your app, you'll use formulas to create, update, and manipulate records and tables. You'll
probably read and write data to an external data source, which is an extended table. In addition,
you might create one or more internal tables, which are called collections.
You can build a variety of formulas that take the name of a table as an argument, just as a
formula in Excel takes one or more cell references as arguments. Some formulas in Power Apps
return a table that reflects the other arguments that you specify. For example, you might create a
formula:
to update a record in a table by specifying that table as one of multiple arguments for the
Patch function
to add, remove, and rename columns in a table by specifying that table as an argument for
the AddColumns, DropColumns, or RenameColumns function. None of those functions
modifies the original table. Instead, the function returns another table based on the other
arguments that you specify.

Elements of a table

Records
Each record contains at least one category of information for a person, a place, or a thing. The
example above shows a record for each product (Chocolate, Bread, and Water) and a column
for each category of information (Price, Quantity on Hand, and Quantity on Order).
In a formula, you can refer to a record by itself, outside of a table's context, by using curly braces.
For example, this record { Name: "Strawberries", Price: 7.99 } isn't associated with a table.
Note that field names, such as Name and Price in that example, aren't enclosed in double
quotation marks.
Fields
A field is an individual piece of information in a record. You can visualize this sort of field as a
value in a column for a particular record.
Just as with a control, you refer to a field of a record by using the . operator on the record. For
example, First(Products).Name returns the Name field for the first record in the Products
table.
A field can contain another record or table, as the example for the GroupBy function shows. You
can nest as many levels of records and tables as you want.
Columns
A column refers to the same field for one or more records in a table. In the above example, each
product has a price field, and that price is in the same column for all products. The above table
has four columns, shown horizontally across the top:
Name
Price
Quantity on Hand
Quantity on Order
The column's name reflects the fields in that column.
All values within a column are of the same data type. In the above example, the "Quantity on
Hand" column always contains a number and can't contain a string, such as "12 units," for one
record. The value of any field may also be blank.
You may have referred to columns as "fields" in other tools.

NOTE
For SharePoint and Excel data sources that contain column names with spaces, Power Apps will replace
the spaces with "_x0020_". For example, "Column Name" in SharePoint or Excel will appear as
"Column_x0020_Name" in Power Apps when displayed in the data layout or used in a formula.

Table
A table comprises one or more records, each with multiple fields that have consistent names
across the records.
Any table that's stored in a data source or a collection has a name, which you use to refer to the
table and pass it to functions that take tables as arguments. Tables can also be the result of a
function or a formula.
As in the following example, you can express a table in a formula by using the Table function
with a set of records, which you express in curly braces:
Table( { Value: "Strawberry" }, { Value: "Vanilla" } )

You can also define a single-column table with square brackets. An equivalent way to write the
above:
[ "Strawberry", "Vanilla" ]
Table formulas
In Excel and Power Apps, you use formulas to manipulate numbers and strings of text in similar
ways:
In Excel, type a value, such as 42, in cell A1, and then type a formula, such as A1+2, in
another cell to show the value of 44.
In Power Apps, set the Default property of Slider1 to 42, and set the Text property of a
label to Slider1.Value + 2 to show the value of 44.
In both cases, the calculated value changes automatically if you change the values of the
arguments (for example, the number in cell A1 or the value of Slider1).
Similarly, you can use formulas to access and manipulate data in tables and records. You can use
names of tables as arguments in some formulas, such as Min(Catalog, Price) to show the
lowest value in the Price column of the Catalog table. Other formulas provide whole tables as
return values, such as RenameColumns(Catalog, "Price", "Cost"), which returns all the
records from the Catalog table but changes the name of the Price column to Cost.
Just as with numbers, formulas that involve tables and records are automatically recalculated as
the underlying table or record changes. If the cost of a product in the Catalog table is lowered
below the previous minimum, the return value of the Min formula will automatically change to
match it.
Let's walk through some simple examples.
1. Create a blank app for a phone, and add a vertical Gallery control that contains other
controls.
By default, the screen shows placeholder text from a table named
CustomGallerySample. The Items property of the screen's Gallery control is
automatically set to that table.
NOTE
Some controls have been rearranged and enlarged for illustration purposes.

2. Instead of setting the Items property to the name of a table, set it to a formula that
includes the name of the table as an argument, as in this example:
Sort(CustomGallerySample, SampleHeading, Descending)

This formula incorporates the Sort function, which takes the name of a table as its first
argument and the name of a column in that table as its second argument. The function
also supports an optional third argument, which stipulates that you want to sort the data
in descending order.

3. Set the Items property to a formula that takes the formula from the previous step as an
argument and returns a table, as in this example:
FirstN(Sort(CustomGallerySample, SampleHeading, Descending), 2)

In this formula, you use the FirstN function to show a particular number of records in a
table. You use the Sort function as the first argument to FirstN and a number (in this
case, 2) as the second argument, which specifies how many records to show.
The entire formula returns a table that contains the first two records of the
CustomGallerySample table, sorted by the SampleHeading column in descending
order.
Table functions and control properties
Consider the Lower function. If the variable welcome contains the text string "Hello, World",
the formula Lower( welcome ) returns "hello, world". This function doesn't, in any way,
change the value in that variable. Lower is a pure function in that it only processes input and
produces output. That's all; it has no side effects. All functions in Excel and most functions in
Power Apps are pure functions, which allow the workbook or the app to be recalculated
automatically.
Power Apps offers a set of functions that operate on tables in the same manner. These functions
take tables as input and filter, sort, transform, reduce, and summarize entire tables of data. In
fact, Lower and many other functions that typically take a single value can also take a single-
column table as input.
Sort, Filter - Sorts and filters records.
FirstN, LastN - Returns the first N or last N records of the table.
Abs, Sqrt, Round, RoundUp, RoundDown - Arithmetic operations on each record of a
single-column table, resulting in a single-column table of results.
Left, Mid, Right, Replace, Substitute, Trim, Lower, Upper, Proper - String manipulations
on each record of a single-column table, resulting in a single-column table of strings.
Len - For a column of strings, returns a single-column table that contains the length of each
string.
Concatenate - Concatenates multiple columns of strings, resulting in a single-column table
of strings.
AddColumns, DropColumns, RenameColumns, ShowColumns - Column manipulation
of the table, resulting in a new table with different columns.
Distinct - Removes duplicates records.
Shuffle - Shuffles records into a random order.
HashTags - Searches for hashtags in a string.
Errors - Provides error information when you work with a data source.
Many of these functions take a single-column table as their input. If an entire table has only one
column, you can specify it by name. If a table has multiple columns, you can specify one of those
columns by using Table.Column syntax. For example, Products.Name returns the single-
column table of only Name values from the Products table.
You can completely reshape a table however you want by using the AddColumns,
RenameColumns, ShowColumns, or DropColumns function. Again, these functions change
only their output, not their source.
Properties of controls can also be tables:
Items - Applies to galleries, list boxes, and combo boxes. This property defines the table that
the gallery or the list shows.
SelectedItems - Applies to list boxes and combo boxes. This property defines the table of
items that the user has selected if SelectMultiple is enabled.

Behavioral formulas
Other functions are specifically designed to modify data and have side effects. Because these
functions aren't pure, you must build them carefully, and they can't participate in automatically
recalculating values in the app. You can use these functions only within behavioral formulas.
Collect, Clear, ClearCollect - Creates collections, clears them, and adds data to them.
Patch - Modifies one or more fields in a record.
Update, UpdateIf - Updates records that match one or more criteria that you specify.
Remove, RemoveIf - Deletes records that match one or more criteria that you specify.

Record formulas
You can also build a formula that calculates data for an individual record, takes an individual
record as an argument, and provides an individual record as a return value. Returning to our
gallery example above, let's use the Gallery1.Selected property to display information from
whatever record the user selects in that gallery.
1. Add a Button, and set its OnSelect property to this formula:
Collect( SelectedRecord, Gallery1.Selected )
2. While holding down the Alt key, select the button.
3. In the File menu, select Collections.

This formula returns a record that includes not only the data from the record that's currently
selected in the gallery but also each control in that gallery. For example, the record contains
both a SampleText column, which matches the SampleText column in the original table, and a
Subtitle1 column, which represents the label that shows the data from that column. Select the
table icon in the Subtitle1 column to drill into that data.
NOTE
The Subtitle1 column might be named Subtitle2 or similar if you've added elements other than those
that this topic specifies.

Now that you have the selected record, you can extract individual fields from it with the .
operator.
1. Add a Label control, and then move it under the gallery and the button.
2. Set the label's Text property to this expression:
"Selected: " & Gallery1.Selected.SampleHeading

You've taken the Selected property, which is a record, and extracted the SampleHeading
property from it.
You can also use a record as a general-purpose container for related named values.
If you build a formula around the UpdateContext and Navigate functions, use a record to
gather the context variables that you want to update.
Use the Updates property on an Edit form control to gather the changes that have been
made by the user in a form.
Use the Patch function to update a data source but also to merge records.
In these cases, the record was never a part of a table.

Record functions and control properties


Functions that return records:
FirstN, LastN - Returns the first or last record or records of the table.
Lookup - Returns the first record from a table that matches one or more criteria.
Patch - Updates a data source or merges records.
Defaults - Returns the default values for a data source.
Properties that return records:
Selected - Applies to galleries and list boxes. Returns the currently selected record.
Updates - Applies to galleries. Pulls together all the changes that a user makes in a data-
entry form.
Update - Applies to input controls such as text-input controls and sliders. Sets up individual
properties for the gallery to pull together.

Record scope
Some functions operate by evaluating a formula across all the records of a table individually.
The formula's result is used in various ways:
AddColumns - Formula provides the value of the added field.
Average, Max, Min, Sum, StdevP, VarP - Formula provides the value to aggregate.
Filter, Lookup - Formula determines if the record should be included in the output.
Concat - Formula determines the strings to concatenate together.
Distinct - Formula returns a value, used to identify duplicate records.
ForAll - Formula can return any value, potentially with side effects.
Sort - Formula provides the value to sort the records on.
With - Formula can return any value, potentially with side effects.
Inside these formulas, you can reference the fields of the record being processed. Each of these
functions creates a "record scope" in which the formula is evaluated, where the fields of the
record are available as top-level identifiers. You can also reference control properties and other
values from throughout your app.
For example, take a table of Products:

To create this example table in your app, insert a button, set its OnSelect property to this
formula, and then select the button (click it while you hold down the Alt key in Power Apps
Studio):

Set( Products,
Table(
{ Product: "Widget", 'Quantity Requested': 6, 'Quantity Available': 3 },
{ Product: "Gadget", 'Quantity Requested': 10, 'Quantity Available': 20 },
{ Product: "Gizmo", 'Quantity Requested': 4, 'Quantity Available': 11 },
{ Product: "Apparatus", 'Quantity Requested': 7, 'Quantity Available': 6 }
)
)

To determine whether any of any of these products had more requested than is available:
Filter( Products, 'Quantity Requested' > 'Quantity Available' )

The first argument to Filter is the table of records to operate on, and the second argument is a
formula. Filter creates a record scope for evaluating this formula in which the fields of each
record are available, in this case Product, Quantity Requested, and Quantity Available. The
result of the comparison determines if each record should be included in the result of the
function:

Adding to this example, we can calculate how much of each product to order:

AddColumns(
Filter( Products, 'Quantity Requested' > 'Quantity Available' ),
"Quantity To Order", 'Quantity Requested' - 'Quantity Available'
)

Here we are adding a calculated column to the result. AddColumns has its own record scope
that it uses to calculate the difference between what has been requested and what is available.

Finally, we can reduce the result table to just the columns that we want:

ShowColumns(
AddColumns(
Filter( Products, 'Quantity Requested' > 'Quantity Available' ),
"Quantity To Order", 'Quantity Requested' - 'Quantity Available'
),
"Product",
"Quantity To Order"
)

Note that in the above, we used double quotes (") in some places and single quotes (') in other
places. Single quotes are required when referencing the value of an object, such as a field or
table, in which the name of the object contains a space. Double quotes are used when we are not
referencing the value of an object but instead talking about it, especially in situations in which
the object does not yet exist, as in the case of AddColumns.

Disambiguation
Field names added with the record scope override the same names from elsewhere in the app.
When this happens, you can still access values from outside the record scope with the @
disambiguation operator:
To access values from nested record scopes, use the @ operator with the name of the table
being operated upon using this pattern:
Table[@FieldName]
To access global values, such as data sources, collections, and context variables, use the
pattern [@ObjectName] (without a table designation).
If the table being operated upon is an expression, such as Filter( Table, ... ), then the
disambiguation operator cannot be used. Only the innermost record scope can access fields
from this table expression, by not using the disambiguation operator.
For example, imagine having a collection X:

You can create this collection with ClearCollect( X, [1, 2] ).


And another collection Y:

You can create this collection with ClearCollect( Y, ["A", "B"] ).


In addition, define a context variable named Value with this formula: UpdateContext( {Value:
"!"} )
Let's put it all together. In this context, the following formula:

Ungroup(
ForAll( X,
ForAll( Y,
Y[@Value] & Text( X[@Value] ) & [@Value]
)
),
"Value"
)

produces this table:

What is going on here? The outermost ForAll function defines a record scope for X, allowing
access to the Value field of each record as it is processed. It can be accessed by simply using the
word Value or by using X[@Value].
The innermost ForAll function defines another record scope for Y. Since this table also has a
Value field defined, using Value here refers to the field in Y's record and no longer the one
from X. Here, to access X's Value field, we must use the longer version with the disambiguation
operator.
Since Y is the innermost record scope, accessing fields of this table do not require
disambiguation, allowing us to use this formula with the same result:
Ungroup(
ForAll( X,
ForAll( Y,
Value & Text( X[@Value] ) & [@Value]
)
),
"Value"
)

All the ForAll record scopes override the global scope. The Value context variable we defined
isn't available by name without the disambiguation operator. To access this value, use [@Value].
Ungroup flattens the result because nested ForAll functions result in a nested result table.

Single-column tables
To operate on a single column from a table, use the ShowColumns function as in this example:

ShowColumns( Products, "Product" )

This formula produces this single-column table:

For a shorter alternative, specify Table.Column, which extracts the single-column table of just
Column from Table. For example, this formula produces exactly the same result as using
ShowColumns.

Products.Product

Inline records
You express records by using curly braces that contain named field values. For example, you can
express the first record in the table at the start of this topic by using this formula:
{ Name: "Chocolate", Price: 3.95, 'Quantity on Hand': 12, 'Quantity on Order': 10 }

You can also embed formulas within other formulas, as this example shows:
{ Name: First(Products).Name, Price: First(Products).Price * 1.095 }

You can nest records by nesting curly braces, as this example shows:
{ 'Quantity': { 'OnHand': ThisItem.QuantOnHand, 'OnOrder': ThisItem.QuantOnOrder } }

Enclose each column name that contains a special character, such as a space or a colon, in single
quotes. To use a single quote within a column name, double it.
Note that the value in the Price column doesn't include a currency symbol, such as a dollar sign.
That formatting will be applied when the value is displayed.
Inline tables
You can create a table by using the Table function and a set of records. You can express the table
at the start of this topic by using this formula:

Table(
{ Name: "Chocolate", Price: 3.95, 'Quantity on Hand': 12, 'Quantity on Order': 10 },
{ Name: "Bread", Price: 4.95, 'Quantity on Hand': 34, 'Quantity on Order': 0 },
{ Name: "Water", Price: 4.95, 'Quantity on Hand': 10, 'Quantity on Order': 0 }
)

You can also nest tables:

Table(
{ Name: "Chocolate",
'Quantity History': Table( { Quarter: "Q1", OnHand: 10, OnOrder: 10 },
{ Quarter: "Q2", OnHand: 18, OnOrder: 0 } )
}
)

Inline value tables


You can create single-column tables by specifying values in square brackets. The resulting table
has a single column, named Value.
For example, [ 1, 2, 3, 4 ] is equivalent to
Table( { Value: 1 }, { Value: 2 }, { Value: 3 }, { Value: 4 } ) and returns this table:
Understand record references and polymorphic
lookups in canvas apps
12/2/2019 • 18 minutes to read • Edit Online

When you wrote a research paper in school, you probably provided a list of your references at the end. You didn't
include a copy of the actual background material you used but rather a web link, book title and author, or other
information so that someone could track down the original source. You mixed different kinds of sources in a single
list, newspaper articles next to audio recordings, each with their own specific details for a proper citation. For
example, Wikipedia articles often include a long list of references.
In canvas apps, you often work with copies of records downloaded from data sources. You use the LookUp and
Filter functions and the Gallery control's Selected property to identify the specific record that you want. All the
records from Filter or Selected will be of the same entity type, so you can use fields with a simple .Field notation.
These copies often include reference information so you can use the Patch function to update the original source.
Canvas apps also support record references. Much like a research-paper reference, a record reference refers to a
record without including a complete copy of it. Such a reference can refer to a record in any entity. Also like
research-paper references, you can mix records from different entities in a single column.
Many operations on record references are identical to working with records. You can compare record references to
each other and to full records. You can set a record reference's value with the Patch function just as you would a
lookup with a full record.
There is one important usage difference: you can't directly access the fields of a record reference without first
establishing to which entity it refers. This is because canvas apps require that all types be known when you write
formulas. Because you don't know the type of a record reference until the app is running, you can't use the simple
.Field notation directly. You must first dynamically determine the entity type with the IsType function and then use
.Field notation on the result of the AsType function.
Entity type refers to the schema of each record in an entity. Each entity has a unique set of fields with different
names and data types. Each record of the entity inherits that structure; two records have the same entity type if
they come from the same entity.

Polymorphic lookups
Common Data Service supports relationships between records. Each record in the Accounts entity has a
Primary Contact lookup field to a record in the Contacts entity. The lookup can only refer to a record in
Contacts and can't refer to a record in, say, the Teams entity. That last detail is important because you always
know what fields will be available for the lookup.
Common Data Service also supports polymorphic lookups, which can refer to a record from any entity in a set.
For example, the Owner field can refer to a record in the Users entity or the Teams entity. The same lookup field
in different records could refer to records in different entities. In this case, you don't always know what fields will
be available.
Canvas record references were designed for working with polymorphic lookups in Common Data Service. You can
also use record references outside of this context, which is how the two concepts differ.
In the next section, you'll start to explore these concepts by working with the Owner lookup.

Show the fields of a record owner


Every entity in Common Data Service includes an Owner field. This field can't be removed, you can't add another,
and it always requires a value.
To show that field in the Account entity:
1. Open this Power Apps site.
2. In the left navigation bar, select Data > Entities.
3. In the list of entities, select Account.
4. In the upper-right corner, open the filter list (which is set to Default by default), and then select All.
5. Scroll down until the Owner field appears.

This lookup field can refer to a record from either the Teams entity or the Users entity. Not every record in these
entities has permission to be an Owner; check the supported roles if you run into a problem.
This graphic shows a simple gallery of Accounts, where the Accounts entity has been added to the app as a data
source:

IMPORTANT
Throughout this topic, the graphics show some names and other values that aren't part of the sample data that ships with
Common Data Service. The steps accurately demonstrate how to configure controls for a particular result, but your
experience will vary based on the data for your organization.

To show the owner of each account in the gallery, you might be tempted to use the formula
ThisItem.Owner.Name. However, the name field in the Team entity is Team Name, and the name field in the
User entity is Full Name. The app can't know which type of lookup you're working with until you run the app, and
it can vary between records in the Accounts entity.
You need a formula that can adapt to this variance. You also need to add the data sources for the entity types that
Owner could be (in this case, Users and Teams). Add these three data sources to your app:

With these data sources in place, use this formula to display the name of either a user or a team:

If( IsType( ThisItem.Owner, [@Teams] ),


"Team: " & AsType( ThisItem.Owner, [@Teams] ).'Team Name',
"User: " & AsType( ThisItem.Owner, [@Users] ).'Full Name' )

In this formula, the IsType function tests the Owner field against the Teams entity. If it's of that entity type, the
AsType function casts it to a Team record. At this point, you can access all the fields of the Teams entity, including
Team Name, by using the .Field notation. If IsType determines that the Owner isn't a record in the Teams entity,
that field must be a record in the Users entity because the Owner field is required (can't be blank).
You're using the global disambiguation operator for [@Teams] and [@Users] to ensure that you're using the
global entity type. You don't need it in this case, but it's a good habit to form. One-to-many relationships often
conflict in the gallery's record scope, and this practice avoids that confusion.
To use any fields of a record reference, you must first use the AsType function to cast it to a specific entity type.
You can't access fields directly from the Owner field because the system doesn't know what entity type you want
to use.
The AsType function returns an error if the Owner field doesn't match the entity type being requested, so you can
use the IfError function to simplify this formula. First, turn on the experimental feature Formula-level error
management:

Then replace the previous formula with this one:

IfError(
"Team: " & AsType( ThisItem.Owner, [@Teams] ).'Team Name',
"User: " & AsType( ThisItem.Owner, [@Users] ).'Full Name' )

Filter based on an owner


Congratulations—you've finished the hardest aspect of working with a record reference. Other use cases are more
straightforward because they don't access fields of the record. As a case in point, take filtering, which you'll explore
in this section.
Add a Combo box control above the gallery, and set these properties of the new control:
Items: Users
SelectMultiple: false
To filter the gallery by a specific user selected from this combo box, set the gallery's Items property to this
formula:

Filter( Accounts, Owner = ComboBox1.Selected )

IMPORTANT
The instructions in this topic are accurate if you follow the steps exactly. However, any formula that refers to a control by its
name fails if the control has a different name. If you delete and add a control of the same type, the number at the end of the
control's name changes. For any formula that shows an error, confirm that it contains the correct names of all controls.

You don't need to use IsType or AsType because you're comparing record references to other record references
or to full records. The app knows the entity type of ComboBox1.Selected because it's derived from the Users
entity. Accounts for which the owner is a team won't match the filter criterion.
You can get a little fancier by supporting filtering by either a user or a team.
1. Make some space near the top of the screen by resizing the gallery and moving the combo box, insert a
Radio control above the gallery, and then set these properties for the new control:
Items: [ "All", "Users", "Teams" ]
Layout: Layout.Horizontal
2. For the Combo box control, set this property (if the combo box disappears, select Users in the radio
control):
Visible: Radio1.Selected.Value = "Users"
3. Copy and paste the Combo box control, move the copy directly over the original, and then set these
properties for the copy:
Items: Teams
Visible: Radio1.Selected.Value = "Teams"
The app will display only one combo box at a time, depending on the state of the radio control. Because
they're directly above one another, they'll appear to be the same control that changes its contents.
4. Finally, set the Items property of the Gallery control to this formula:

Filter( Accounts,
Radio1.Selected.Value = "All"
Or (Radio1.Selected.Value = "Users" And Owner = ComboBox1.Selected)
Or (Radio1.Selected.Value = "Teams" And Owner = ComboBox1_1.Selected)
)

With these changes, you can show all records or filter them based on either a user or a team:

The formula is fully delegable. The portion that's comparing the radio-button values is a constant across all
records and is evaluated before the rest of the filter is sent to Common Data Service.
If you want to filter on the type of the owner, you can use the IsType function, but it's not yet delegable.
Update the owner by using Patch
You can update the Owner field in the same manner as any other lookup. To set the currently selected account's
owner to the first team:

Patch( Accounts, Gallery1.Selected, { Owner: First( Teams ) } )

This approach doesn't differ from a normal lookup because the app knows the type of First( Teams ). If you want
the first user instead, replace that portion with First( Users ). The Patch function knows that the Owner field can
be set to either of these two entity types.
To add this capability to the app:
1. In the Tree view pane, select the Radio control and the two Combo box controls at the same time.
2. On the ellipsis menu, select Copy these items.
3. On the same menu, select Paste.

4. Move the copied controls to the right of the gallery.


5. Select the copied Radio control, and then change these properties:
Items: [ "Users", "Teams" ]
Default: If( IsType( Gallery1.Selected.Owner, Users ), "Users", "Teams" )

6. In the Radio control, select Users so that the Combo box control that lists users is visible.
7. Select the visible Combo box control, and then set the DefaultSelectedItems property to this formula:

If( IsType( Gallery1.Selected.Owner, Users ),


AsType( Gallery1.Selected.Owner, Users ),
Blank()
)
8. In the Radio control, select Teams so that the Combo box control that lists teams is visible.
9. Select the Radio control to take selection away from the now -invisible Combo box control for users.
10. Select the visible Combo box control for teams, and then set its DefaultSelectedItems property to this
formula:

If( IsType( Gallery1.Selected.Owner, Teams ),


AsType( Gallery1.Selected.Owner, Teams ),
Blank()
)

11. Insert a Button control, move it under the Combo box control, and then set the button's Text property to
"Patch Owner" .
12. Set the OnSelect property of the button to this formula:

Patch( Accounts, Gallery1.Selected,


{ Owner: If( Radio1_1.Selected.Value = "Users",
ComboBox1_2.Selected,
ComboBox1_3.Selected ) } )

The copied Radio and Combo box controls show the owner for the currently selected account in the gallery.
With the same controls, you can set the owner of the account to any team or user by selecting the button:

Show the owner by using a form


You can show an Owner field inside a form by adding a custom card. As of this writing, you can't change the value
of the field with a form control.
1. Insert an Edit form control, and then resize and move it to the lower-right corner.
2. On the Properties tab near the right side of the screen, open the Data source list, and then select
Accounts.

3. Set the form's Item property to Gallery1.Selected .

4. On the Properties tab near the right side of the screen, select Edit fields.
5. In the Fields pane, select the ellipsis, and then select Add a custom card.

The new card appears at the bottom of the form control.


6. Resize the card as needed to show all the text.

7. Insert a Label control into the custom card, and then set the label's Text property to the formula that you
used in the gallery:

If( IsType( ThisItem.Owner, Teams ),


"Team: " & AsType( ThisItem.Owner, Teams ).'Team Name',
"User: " & AsType( ThisItem.Owner, Users ).'Full Name' )

For each selection in the gallery, more fields of the account, including the record's owner, appear in the form. If you
change the owner by using the Patch button, the form control also shows that change.
Show the fields of a customer
In Common Data Service, the Customer lookup field is another polymorphic lookup that's very similar to Owner.
Owner is limited to one per entity, but entities can include zero, one, or more Customer lookup fields. The
Contacts system entity includes the Company Name field, which is a Customer lookup field.

You can add more Customer lookup fields to an entity by selecting the Customer data type for a new field.

A Customer lookup field can refer to a record from either the Accounts entity or the Contacts entity. You'll use
the IsType and AsType functions with these entities, so now is a good time to add them as data sources (you can
leave Teams and Users in place).
The treatment of the Customer and Owner fields is so similar that you can literally copy the app (File > Save as,
and then specify a different name) and make these simple replacements:

LOCATION OWNER SAMPLE CUSTOMER SAMPLE

Throughout Owner 'Customer Name'

Throughout Users Accounts

Throughout Teams Contacts

Gallery's Items property Accounts Contacts

Form's Items property Accounts Contacts

The first argument of Patch Accounts Contacts


in the button's OnSelect property

Filter radio's Items property [ "All", "Users", "Teams" ] [ "All", "Accounts", "Contacts" ]

Patch radio's Items property [ "Users", "Teams" ] [ "Accounts", "Contacts" ]

Combo box's Visible property "Users" and "Teams" "Accounts" and "Contacts"

For example, the new gallery should have this Items property:

Filter( Contacts,
Radio1.Selected.Value = "All"
Or (Radio1.Selected.Value = "Accounts" And 'Company Name' = ComboBox1.Selected)
Or (Radio1.Selected.Value = "Contacts" And 'Company Name' = ComboBox1_1.Selected)
)
Two important differences between Customer and Owner require an update to the formulas inside the gallery
and the form:
1. One-to-many relationships between Accounts and Contacts take precedence when you refer to these
entity types by name. Instead of Accounts, use [@Accounts]; instead of Contacts, use [@Contacts]. By
using the global disambiguation operator, you ensure that you're referring to the entity type in IsType and
AsType. This problem exists only in the record context of the gallery and form controls.
2. The Owner field must have a value, but Customer fields can be blank. To show the correct result without a
type name, test for this case with the IsBlank function, and show an empty text string instead.
Both of these changes are in the same formula, which appears in the custom card in the form, as well as in the
Text property of the gallery's label control:

If( IsBlank( ThisItem.'Company Name' ), "",


IsType( ThisItem.'Company Name', [@Accounts] ),
"Account: " & AsType( ThisItem.'Company Name', [@Accounts] ).'Account Name',
"Contact: " & AsType( ThisItem.'Company Name', [@Contacts] ).'Full Name'
)

With these changes, you can view and change the Company Name field in the Contacts entity.
Understand Regarding lookup fields
The Regarding lookup field differs a little from those that you've already worked with in this topic. You'll start by
applying the patterns that this topic described earlier, and then you'll learn other tricks.
You can start simply with the Faxes entity. This entity has a polymorphic Regarding lookup field, which can refer
to Accounts, Contacts, and other entities. You can take the app for Customers and modify it for Faxes.

LOCATION CUSTOMER SAMPLE FAXES SAMPLE

Throughout 'Customer Name' Regarding

Gallery's Items property Contacts Faxes

Form's Items property Contacts Faxes

The first argument of Patch Contacts Faxes


in the button's OnSelect property

Again, you'll need to add a data source: this time for Faxes. On the View tab, select Data sources:
An important difference for Regarding is that it isn't limited to Accounts and Contacts. In fact, the list of entities
is extensible with custom entities. Most of the app can accommodate this point without modification, but you must
update the formula for the label in the gallery and the form:

If( IsBlank( ThisItem.Regarding ), "",


IsType( ThisItem.Regarding, [@Accounts] ),
"Account: " & AsType( ThisItem.Regarding, [@Accounts] ).'Account Name',
IsType( ThisItem.Regarding, [@Contacts] ),
"Contacts: " & AsType( ThisItem.Regarding, [@Contacts] ).'Full Name',
""
)

After you make these changes, you work with the Regarding lookup just as you did the Owner and Customer
lookups.
Understand Regarding relationships
Regarding differs from Owner and Customer because the former involves a many-to-one relationship. By
definition, a reverse, one-to-many relationship allows you to write First( Accounts ).Faxes.
Let's back up and look at the entity definitions. In Common Data Service, entities such as Faxes, Tasks, Emails,
Notes, Phone Calls, Letters, and Chats are designated as activities. You can also create your own custom activity
entities. When you view or create an activity entity, its settings appear under More settings.

Other entities can be related to an activity entity if they're enabled as an activity task in the entity's settings.
Accounts, Contacts, and many other standard entities are so designated (again, under More settings).
All activity entities and activity-task entities have an implied relationship. If you change the filter to All at the top
of the screen, select the Faxes entity, and then select the Relationships tab, all entities that can be a target of a
Regarding lookup appear.

If you show the relationships for the Accounts entity, all the entities that can be a source of a Regarding lookup
field appear.

What does it all mean?


When you write formulas, you must consider that the list of activity entities isn't fixed, and you can create your
own. The formula must appropriately handle an activity entity that you didn't expect.
Activity tasks and activities have a one-to-many relationship. You can easily ask for all faxes that relate to an
account.
To explore this concept in the app:
1. Add another screen.

2. Insert a gallery control, resize it, and then move it to the left side of the screen.
3. On the Properties tab near the right side of the screen, set the gallery's Items to Accounts.

4. Set the gallery's layout to Title, and then set the title field to Account Name.
5. Add a second gallery, resize it, and then move it to the right side of the screen.
6. Set the new gallery's Items property to Gallery2.Selected.Faxes .
This step returns the filtered list of faxes for a given account.

7. Set the gallery's layout to Title and subtitle, and then set the title field to show the Subject field (which
might be lowercase subject).

As you select an item in the list of accounts, the list of faxes shows faxes for only that account.
Activity entity
As the previous section describes, you can show all the faxes for an account. However, you can also show all the
activities for an account, including faxes, email messages, phone calls, and other interactions.
For the latter scenario, you use the Activity entity. You can show this entity by turning on All in the upper-right
corner to remove the filter from the list of entities.

The Activity entity is special. Whenever you add a record to the Faxes entity, the system also creates a record in
the Activity entity with the fields that are common across all activity entities. Of those fields, Subject is one of the
most interesting.
You can show all activities by changing only one line in the previous example. Replace Gallery2.Selected.Faxes
with Gallery2.Selected.Activities .
Records are coming from the Activity entity, but you can nevertheless use the IsType function to identify which
kind of activity they are. Again, before you use IsType with an entity type, you must add the data source.
By using this formula, you can show the record type in a label control within the gallery:

If( IsType( ThisItem, [@Faxes] ), "Fax",


IsType( ThisItem, [@'Phone Calls'] ), "Phone Call",
IsType( ThisItem, [@'Email Messages'] ), "Email Message",
IsType( ThisItem, [@Chats] ), "Chat",
"Unknown"
)

You can also use AsType to access the fields of the specific type. For example, this formula determines the type of
each activity and, for phone calls, shows the phone number and call direction from the Phone Numbers entity:

If( IsType( ThisItem, [@Faxes] ), "Fax",


IsType( ThisItem, [@'Phone Calls'] ),
"Phone Call: " &
AsType( ThisItem, [@'Phone Calls'] ).'Phone Number' &
" (" & AsType( ThisItem, [@'Phone Calls'] ).Direction & ")",
IsType( ThisItem, [@'Email Messages'] ), "Email Message",
IsType( ThisItem, [@Chats] ), "Chat",
"Unknown"
)
As a result, the app shows a complete list of activities. The Subject field appears for all types of activities, whether
the formula takes them into account or not. For types of activities that you know about, you can show their type
names and type-specific information about each activity.

Notes entity
So far, all of the Regarding examples have been based on activities, but the Notes entity represents another case.
When you create an entity, you can enable attachments.
If you select the check box for enabling attachments, you'll create a Regarding relationship with the Notes entity,
as this graphic shows for the Accounts entity:

Other than this difference, you use the Regarding lookup in the same manner in which you use activities. Entities
that are enabled for attachments have a one-to-many relationship to Notes, as in this example:
First( Accounts ).Notes

NOTE
As of this writing, the Regarding lookup isn't available for the Notes entity. You can't read or filter based on the Regarding
field, and you can't set the field by using Patch.
However, the reverse Notes one-to-many relationship is available, so you can filter a list of notes for a record that's enabled
for attachments. You can also use the Relate function to add a note to a record's Notes table, but the note must be created
first, as in this example:
Relate( ThisItem.Notes, Patch( Notes, Defaults( Notes ), { Title: "A new note" } ) )

Activity parties
As of this writing, canvas apps don't support activity parties.
Add and configure a canvas-app control in Power
Apps
12/3/2019 • 5 minutes to read • Edit Online

Add a variety of UI elements to your canvas app, and configure aspects of their appearance and behavior
directly, from the toolbar, in the Properties tab, or in the formula bar. These UI elements are called controls,
and the aspects that you configure are called properties.

Prerequisites
1. If you don't already have a Power Apps license, sign up, and then sign in.
2. Under Make your own app, hover over Canvas app from blank, and then select Make this app.
3. If you're prompted to take the intro tour, selectNext to get familiar with key areas of the Power
Apps interface (or select Skip).
You can always take the tour later by selecting the question-mark icon near the upper-right corner of
your screen and then selecting Take the intro tour.

Add and select a control


On the Insert tab, perform either of these steps:
Select Label or Button to add one of those types of controls.
Select a category of controls, and then select the type of control that you want to add.
For example, select New screen, and then select Blank to add a blank screen to your app. (Screens are a
type of control that can contain other types of controls.)

The new screen is named Screen2 and appears in the left navigation pane. This pane shows a hierarchical
list of controls in your app so that you can easily find and select each control.

To demonstrate how this list works, select Label on the Insert tab. The new control appears under
Screen2 in the hierarchical list.
In the screen, a box with six handles surrounds the label by default. That type of box surrounds whichever
control is selected. If you select the screen by clicking or tapping in it (but outside the label), the box
disappears from the label. To select the label again, you can click or tap in it, or you can click or tap its name
in the hierarchical list of controls.

IMPORTANT
You must always select a control before you can configure it.

Rename a control
In the hierarchical list of controls, hover over the control that you want to rename, select the ellipsis button
that appears, and then select Rename. You can then type a unique, memorable name to make building
your app easier.

Delete a control
In the hierarchical list of controls, hover over the control that you want to delete, select the ellipsis button
that appears, and then select Delete. To delete a control that isn't a screen, you can also select the control
on the canvas, and then press the Delete key.
Reorder screens
In the hierarchical list of controls, hover over a screen that you want to move up or down, select the ellipsis
button that appears, and then select Move up or Move down.

NOTE
When the app is opened, the screen at the top of the hierarchical list of controls usually appears first. But you can
specify a different screen by setting the OnStart property to a formula that includes the Navigate function.

Move and resize a control


To move a control, select it, hover over its center so that the four-headed arrow appears, and then drag the
control to a different location.

To resize a control, select it, hover over any handle in the selection box so that the two-headed arrow
appears, and then drag the handle.
NOTE
As this topic describes later, you can also move and resize a control by modifying any combination of its X, Y,
Height, and Width properties in the formula bar.

Change the text of a label or a button


Select a label or button, double-click the text that appears in the control, and then type the text that you
want.

NOTE
As this topic describes later, you can also change this text by modifying its Text property in the formula bar.

Configure a control from the toolbar


By configuring a control from the toolbar, you can specify a wider variety of options than you can by
configuring a control directly.
For example, you can select a label, select the Home tab, and then change the font of the text in the label.

Configure a control from the Properties tab


By using the Properties tab, you can specify a wider variety of options than you can by configuring a
control from the toolbar.
For example, you can select a control and then show or hide it by changing its Visible property.
Configure a control in the formula bar
Instead of configuring a control directly, from the toolbar, or in the Properties tab, you can configure a
control by selecting a property in the property list and then specifying a value in the formula bar. By taking
this approach, you can search for a property alphabetically, and you can specify more types of values.
For example, you can select a label and then configure it in these ways:
Move it by selecting X or Y in the properties list and then specifying a different number in the
formula bar.

Resize it by selecting Height or Width in the properties list and then specifying a different number
in the formula bar.

Change its text by selecting Text in the properties list and then specifying any combination of a
literal string, an expression, or a formula in the formula bar.
A literal string is surrounded by quotation marks and appears exactly as you type it. "Hello,
world" is a literal string.
An expression doesn't include a function and is often based on a property of another control.
Screen1.Height is an expression that shows the height of Screen1.

A formula includes one or more functions. The Now function returns the current date and
time in your local time zone, and the Text function formats values such as dates, times, and
currency.

Formulas are usually much more complex than this example so that they can update data,
sort it, filter it, and perform other operations. For more information, see the formula
reference.

Next steps
Find step-by-step procedures for configuring common controls such as screens, lists, galleries, forms,
and charts.
Find reference information about each type of control in the control reference.
Add a screen to a canvas app and navigate between
screens
12/3/2019 • 2 minutes to read • Edit Online

Create a canvas app with multiple screens, and add ways for users to navigate between them.

Add and rename a screen


1. On the Home tab, select New screen, and then select the type of screen that you want to add.

2. In the right-hand pane, select the name of the screen (just above the Properties tab), and then type
Source.

3. Add another screen, and name it Target.

Reorder screens
In the left navigation bar, hover over a screen that you want to move up or down, select the ellipsis button that
appears, and then select Move up or Move down.
NOTE
When the app is opened, the screen at the top of the hierarchical list of controls usually appears first. But you can specify a
different screen by setting the OnStart property to a formula that includes the Navigate function.

Add navigation
1. With the Source screen selected, open the Insert tab, select Icons, and then select Next arrow.

2. (optional) Move the arrow so that it appears in the lower-right corner of the screen.
3. With the arrow still selected, select the Action tab, and then select Navigate.
The OnSelect property for the arrow is automatically set to a Navigate function.

When a user selects the arrow, the Target screen fades in.
4. On the Target screen, add a Back arrow, and set its OnSelect property to this formula:
Navigate(Source, ScreenTransition.Fade)

5. While holding down the Alt key, toggle between screens by selecting the arrow on each screen.

More information
Screen-control reference
Add a scrolling screen to a canvas app in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

In a canvas app, create a screen that users can scroll to show different items. For example, create a phone app that
shows data in several charts, which users can display if they scroll.
When you add multiple controls in a section, the controls maintain their relative positions within that section,
regardless if it's a phone app or a tablet app. Note that the screen size and orientation may determine how the
sections are arranged.

Prerequisites
1. Sign up for PowerApps.
2. Sign in using the same credentials that you used to sign up.
3. Under Make your own app, hover over the Canvas app from blank tile, select the phone icon, and then
select Make this app.
4. Learn how to add and configure controls.

Create a scrolling screen


1. On the Home tab, click or tap New screen:

2. On the Home tab, click or tap Layouts, and then click or tap the option to add an infinite scrolling canvas:

The canvas is added:


Add elements
Now, let's add some controls to the canvas to see how the scrolling screen works.
1. In the canvas you added, click or tap Add an item from the Insert tab.

2. On the Insert tab, click or tap Charts, and then click or tap Column Chart.
A column chart appears in the first card on the screen:

3. On the Insert tab, click or tap Text, and then click or tap Pen input:

4. Move the pen control below the chart, and resize the pen control to cover the bottom of the card:

Add a section
Now, let's add another card with another control.
1. Near the bottom of the screen, click or tap Add section:

A new card is added to the screen:

2. With the card still selected, go to the Insert tab, click or tap Charts, and then click or tap Line chart.
The new chart is too big to appear on the screen with the other controls:

3. Open Preview mode by pressing F5 (or by clicking or tapping the play icon near the upper-right corner).

4. Scroll down to display the new line chart.


Overview of the calendar-screen template for canvas
apps
12/3/2019 • 10 minutes to read • Edit Online

In a canvas app, add a calendar screen that shows users upcoming events from their Office 365 Outlook accounts.
Users can select a date from a calendar and scroll through a list of that day's events. You can change which details
appear in the list, add a second screen that shows more details about each event, show a list of attendees for each
event, and make other customizations.
You can also add other template-based screens that show different data from Office 365, such as email, people in
an organization, and availability of people users might want to invite to a meeting.
This overview teaches you:
How to use the default calendar screen.
How to modify it.
How to integrate it into an app.
For a deeper dive into this screen's default functionality, see the calendar-screen reference.

Prerequisite
Familiarity with how to add and configure screens and other controls as you create an app in Power Apps.

Default functionality
To add a calendar screen from the template:
1. Sign in to Power Apps, and then create an app or open an existing app in Power Apps Studio.
This topic shows a phone app, but the same concepts apply to a tablet app.
2. On the Home tab of the ribbon, select New screen > Calendar.
By default, the screen looks similar to this:

3. To show data, select an option in the drop-down list near the top of the screen.
A few helpful notes:
Today's date is selected by default, and you can easily return to it by selecting the calendar icon in the upper-
right corner.
If you select a different date, a circle surrounds it, and a light-colored rectangle (blue if the default theme is
applied) surrounds today's date.
If at least one event is scheduled for a particular date, a small colored circle appears under that date in the
calendar.
If you select a date for which one or more events are scheduled, the event(s) appear in a list under the calendar.

Modify the screen


You can modify the default functionality of this screen in a few common ways:
Specify the calendar.
Show different details about an event.
Hide nonblocking events.
If you want to modify the screen further, use the calendar-screen reference as a guide.
Specify the calendar
If you already know which calendar your users should view, you can simplify the screen by specifying that calendar
before you publish the app. This change removes the need for the drop-down list of calendars, so you can remove
it.
1. Set the OnStart property of the default screen in the app to this formula:
Set( _userDomain, Right( User().Email, Len( User().Email ) - Find( "@", User().Email ) ) );
Set( _dateSelected, Today() );
Set( _firstDayOfMonth, DateAdd( Today(), 1 - Day( Today() ), Days ) );
Set( _firstDayInView,
DateAdd( _firstDayOfMonth, -( Weekday( _firstDayOfMonth) - 2 + 1 ), Days )
);
Set( _lastDayOfMonth, DateAdd( DateAdd( _firstDayOfMonth, 1, Months ), -1, Days ) );
Set( _calendarVisible, false );
Set( _myCalendar,
LookUp( Office365.CalendarGetTables().value, DisplayName = "{YourCalendarNameHere}" )
);
Set( _minDate,
DateAdd( _firstDayOfMonth, -( Weekday(_firstDayOfMonth) - 2 + 1 ), Days )
);
Set( _maxDate,
DateAdd(
DateAdd( _firstDayOfMonth, -( Weekday(_firstDayOfMonth) - 2 + 1 ), Days ),
40,
Days
)
);
ClearCollect( MyCalendarEvents,
Office365.GetEventsCalendarViewV2( _myCalendar.Name,
Text( _minDate, UTC ),
Text( _maxDate, UTC )
).value
);
Set( _calendarVisible, true )

NOTE
This formula is slightly edited from the default value of the OnSelect property of the drop-down list for selecting a
calendar. For more information about that control, see its section in the calendar-screen reference.

2. Replace {YourCalendarNameHere} , including the curly braces, with the name of the calendar that you want to
show (for example, Calendar).

IMPORTANT
The following steps assume that you've added only one calendar screen to the app. If you've added more than one,
control names (such as iconCalendar1) will end with a different number, and you'll need to adjust the formulas
accordingly.

3. Set the Y property of the iconCalendar1 control to this expression:


RectQuickActionBar1.Height + 20

4. Set the Y property of the LblMonthSelected1 control to this expression:


iconCalendar1.Y + iconCalendar1.Height + 20

5. Set the Text property of the LblNoEvents1 control to this value:


"No events scheduled"

6. Set the Visible property of LblNoEvents1 to this formula:


CountRows(CalendarEventsGallery1.AllItems) = 0 && _calendarVisible

7. Delete these controls:


dropdownCalendarSelection1
LblEmptyState1
iconEmptyState1
8. If the calendar screen isn't the default screen, add a button that navigates from the default screen to the
calendar screen so that you can test the app.
For example, add a button on Screen1 that navigates to Screen2 if you added a calendar screen to an app
that you created from blank.
9. Save the app, and then test it in a browser or on a mobile device.
Show different details about an event
By default, the gallery under the calendar, named CalendarEventsGallery, shows the start time, the duration, the
subject, and the location of each event. You can configure the gallery to show any field (such as the organizer) that
the Office 365 connector supports.
1. In CalendarEventsGallery, set the Text property of a new or an existing label to ThisItem followed by a
period.
IntelliSense lists the fields that you can select.
2. Select the field that you want.
The label shows the type of information that you specified.
Hide nonblocking events
In many offices, team members send meeting requests to notify each other when they'll be away from the office.
To avoid blocking everyone's schedules, the person sending the request sets its availability to Free. You can hide
these events from the calendar and the gallery by updating a couple of properties.
1. Set the Items property of CalendarEventsGallery to this formula:

SortByColumns(
Filter(
MyCalendarEvents,
Text( Start, DateTimeFormat.ShortDate ) =
Text( _dateSelected, DateTimeFormat.ShortDate ),
ShowAs <> "Free"
),
"Start"
)

In this formula, the Filter function hides not only those events that are scheduled for a date other than the
one selected but also events for which the availability is set to Free.
2. In the calendar, set the Visible property of the Circle control to this formula:

CountRows(
Filter(
MyCalendarEvents,
DateValue( Text(Start) ) = DateAdd( _firstDayInView, ThisItem.Value, Days ),
ShowAs <> "Free"
)
) > 0 && !Subcircle1.Visible && Title2.Visible

This formula contains the same filters as the previous formula. Therefore, the event-indicator circle appears
under a date only if it has one or more events that are on the selected date and for which the availability
isn't set to Free.
Integrate the screen into an app
The calendar screen is a powerful bundle of controls in its own right, but it usually performs best as part of a
larger, more versatile app. You can integrate this screen into a larger app in a number of ways, including adding
these options:
View event details.
Show event attendees.
View event details
If users select an event in CalendarEventsGallery, you can open another screen that shows more information
about that event.

NOTE
This procedure shows event details in a gallery with dynamic content, but you can achieve similar results by taking other
approaches. For example, you can get more design control by using a series of labels instead.

1. Add a blank screen, named EventDetailsScreen, that contains a blank flexible-height gallery and a button
that navigates back to the calendar screen.
2. In the flexible-height gallery, add a Label control and an HTML text control, and set the AutoHeight
property of both to true.

NOTE
Power Apps retrieves the message body of each event as HTML text, so you need to show that content in an HTML
text control.

3. Set the Y property of the HTML text control to this expression:


Label1.Y + Label1.Height + 20

4. Adjust additional properties as necessary to suit your style needs.


For example, you might want to add a separator line below the HTML text control.
5. Set the Items property of the flexible-height gallery to this formula:

Table(
{ Title: "Subject", Value: _selectedCalendarEvent.Subject },
{
Title: "Time",
Value: _selectedCalendarEvent.Start & " - " & _selectedCalendarEvent.End
},
{ Title: "Body", Value: _selectedCalendarEvent.Body }
)

This formula creates a gallery of dynamic data that's set to the field values of _selectedCalendarEvent,
which is set every time the user selects an event in the CalendarEventsGallery control. You can extend
this gallery to include more fields by adding more labels to it, but this set provides a good starting point.
6. With the gallery items in place, set the Text property of the Label control to ThisItem.Title , and the
HtmlText property of the HTML text control to ThisItem.Value .
7. In CalendarEventsGallery, set the OnSelect property of the Title control to this formula:
Set( _selectedCalendarEvent, ThisItem );
Navigate( EventDetailsScreen, None )

NOTE
Instead of using the _selectedCalendarEvent variable, you could instead use CalendarEventsGallery.Selected.

Show event attendees


The Office365.GetEventsCalendarViewV2 operation retrieves a variety of fields for each event, including a
semicolon-separated set of required and optional attendees. In this procedure, you'll parse each set of attendees,
determine which attendees are in your organization, and retrieve the Office 365 profiles of any who are.
1. If your app doesn't contain the Office 365 Users connector,add it.
2. To retrieve the Office 365 profiles of the meeting attendees, set the OnSelect property of the Title control
in the CalendarEventsGallery to this formula:

Set( _selectedCalendarEvent, ThisItem );


ClearCollect( AttendeeEmailsTemp,
Filter(
Split( ThisItem.RequiredAttendees & ThisItem.OptionalAttendees, ";" ),
!IsBlank( Result )
)
);
ClearCollect( AttendeeEmails,
AddColumns( AttendeeEmailsTemp,
"InOrg",
Upper( _userDomain ) = Upper( Right( Result, Len( Result ) - Find( "@", Result ) ) )
)
);
ClearCollect( MyPeople,
ForAll( AttendeeEmails, If( InOrg, Office365Users.UserProfile( Result ) ) )
);
Collect( MyPeople,
ForAll( AttendeeEmails,
If( !InOrg,
{ DisplayName: Result, Id: "", JobTitle: "", UserPrincipalName: Result }
)
)
)

This list discusses what each ClearCollect operation does:


ClearCollect(AttendeeEmailsTemp)

ClearCollect( AttendeeEmailsTemp,
Filter(
Split( ThisItem.RequiredAttendees & ThisItem.OptionalAttendees, ";" ),
!IsBlank( Result)
)
);

This formula concatenates the required and optional attendees into a single string and then splits that string
into individual addresses at each semicolon. The formula then filters out blank values from that set and
adds the other values into a collection named AttendeeEmailsTemp.
ClearCollect(AttendeeEmails)
ClearCollect( AttendeeEmails,
AddColumns( AttendeeEmailsTemp,
"InOrg",
Upper( _userDomain ) = Upper( Right( Result, Len(Result) - Find("@", Result) ) )
)
);

This formula roughly determines whether an attendee is in your organization. The definition of
_userDomain is simply the domain URL in the email address of the person who's running the app. This
line creates an additional true/false column, named InOrg, in the AttendeeEmailsTemp collection. This
column contains true if userDomain is equivalent to the domain URL of the email address in that
particular row of AttendeeEmailsTemp.
This approach isn't always accurate, but it gets pretty close. For example, certain attendees in your org
might have an email address like Jane@OnContoso.com, whereas _userDomain is Contoso.com. The app
user and Jane might work at the same company but have slight variations in their email addresses. For
cases such as these, you might want to use this formula:
Upper(_userDomain) in Upper(Right(Result, Len(Result) - Find("@", Result)))

However, this formula matches email addresses like Jane@NotTheContosoCompany.com with a


_userDomain like Contoso.com, and those people don't work at the same company.
ClearCollect(MyPeople)

ClearCollect( MyPeople,
ForAll( AttendeeEmails,
If( InOrg,
Office365Users.UserProfile( Result )
)
)
);
Collect( MyPeople,
ForAll( AttendeeEmails,
If( !InOrg,
{
DisplayName: Result,
Id: "",
JobTitle: "",
UserPrincipalName: Result
}
)
)
);

To retrieve Office 365 profiles, you must use the Office365Users.UserProfile or


Office365Users.UserProfileV2 operation. These operations first gather all the Office 365 profiles for
attendees who are in the user's org. Then the operations add a few fields for attendees from outside the
organization. You separated these two items into distinct operations because the ForAll loop doesn't
guarantee order. Therefore, ForAll might collect an attendee from outside the organization first. In this case,
the schema for MyPeople contains only DisplayName, Id, JobTitle, and UserPrincipalName. However,
the UserProfile operations retrieve much richer data than that. So you force the MyPeople collection to
add Office 365 profiles before the other profiles.

NOTE
You can achieve the same result with only one ClearCollect function:
ClearCollect( MyPeople,
ForAll(
AddColumns(
Filter(
Split(
ThisItem.RequiredAttendees & ThisItem.OptionalAttendees,
";"
),
!IsBlank( Result )
),
"InOrg", _userDomain = Right( Result, Len( Result ) - Find( "@", Result ) )
),
If( InOrg,
Office365Users.UserProfile( Result ),
{
DisplayName: Result,
Id: "",
JobTitle: "",
UserPrincipalName: Result,
Department: "",
OfficeLocation: "",
TelephoneNumber: ""
}
)
)
)

To finish this exercise:


1. Add a screen that contains a gallery for which the Items property is set to MyPeople.
2. In the OnSelect property of the Title control in the CalendarEventsGallery, add a Navigate function to
the screen that you created in the previous step.

Next steps
View the reference documentation for this screen.
Learn more about the Office 365 Outlook connector.
Learn more about the Office 365 Users connector.
Reference information about the calendar-screen
template for canvas apps
12/3/2019 • 12 minutes to read • Edit Online

For canvas apps in Power Apps, understand how each significant control in the calendar-screen template
contributes to the screen's overall default functionality. This deep dive presents the behavior formulas and the
values of other properties that determine how the controls respond to user input. For a high-level discussion of
this screen's default functionality, see the calendar-screen overview.
This topic highlights some significant controls and explains the expressions or formulas to which various
properties (such as Items and OnSelect) of these controls are set:
Calendar drop-down (dropdownCalendarSelection)
Calendar icon (iconCalendar)
Previous-month chevron (iconPrevMonth)
Next-month chevron (iconNextMonth)
Calendar gallery (MonthDayGallery) (+ child controls)
Events gallery (CalendarEventsGallery)

Prerequisite
Familiarity with how to add and configure screens and other controls as you create an app in Power Apps.

Calendar drop-down

Property: Items
Value: Office365.CalendarGetTables().value
This value is a connector operation that retrieves the app user's Outlook calendars. You can see the value
that this operation retrieves.
Property: OnChange
Value: Select(dropdownCalendarSelection)
When the user selects an option in the list, the function in the control's OnSelect property runs.
Property: OnSelect
Value: An If function, which appears in the following code block, and several additional functions, which
appear in the code block after that.
This part of the formula runs only the first time that the user selects an option in the drop-down list after
opening the app:
If( IsBlank( _userDomain ),
UpdateContext( {_showLoading: true} );
Set( _userDomain, Right( User().Email, Len( User().Email ) - Find( "@", User().Email ) ) );
Set( _dateSelected, Today() );
Set( _firstDayOfMonth, DateAdd( Today(), 1 - Day( Today() ), Days ) );
Set( _firstDayInView, DateAdd( _firstDayOfMonth, -(Weekday(_firstDayOfMonth) - 1), Days ) );
Set( _lastDayOfMonth, DateAdd( DateAdd( _firstDayOfMonth, 1, Months ), -1, Days ) )
);

The preceding code defines the following variables:


_userDomain: The app user's company domain, as reflected in the user's email address.
_dateSelected: Today's date (by default). The calendar gallery highlights this date, and the event gallery
shows the events that are scheduled for that date.
_firstDayOfMonth: The first day of the current month. Because
(Today + (1 - Today)) = Today - Today + 1 = 1 , this DateAdd function always returns the first day of
the month.
_firstDayInView: The first day that the calendar gallery can show. This value isn't the same as the first
day of the month unless the month starts on a Sunday. To prevent showing an entire week of the
previous month, the value of _firstDayInView is _firstDayOfMonth - Weekday(_firstDayOfMonth) + 1 .
_lastDayOfMonth: The last day of the current month, which is the same as the first day of next month,
minus one day.
The functions after the If function run whenever the user selects an option in the calendar drop-down list
(not just the first time the user opens the app):

Set( _calendarVisible, false );


UpdateContext( {_showLoading: true} );
Set( _myCalendar, dropdownCalendarSelection2.Selected );
Set( _minDate,
DateAdd( _firstDayOfMonth, -(Weekday( _firstDayOfMonth ) - 2 + 1), Days )
);
Set(_maxDate,
DateAdd(
DateAdd( _firstDayOfMonth, -(Weekday( _firstDayOfMonth ) - 2 + 1), Days ),
40,
Days
)
);
ClearCollect( MyCalendarEvents,
'Office365'.GetEventsCalendarViewV2( _myCalendar.Name,
Text( _minDate, UTC ),
Text( _maxDate, UTC )
).value
);
UpdateContext( {_showLoading: false} );
Set( _calendarVisible, true )

The preceding code defines these variables and one collection:


_calendarVisible: Set to false so that the calendar doesn't appear while the new selection is loaded.
_showLoading: Set to true so that loading indicators appear while the new selection is being loaded.
_myCalendar: Set to the current value of the calendar drop-down control so that events from the
correct calendar are retrieved.
_minDate: Set to the same value as _firstDayInView. This variable determines what events have
already been retrieved from Outlook and cached in the app.
_maxDate: Set to the last viewable day in the calendar. The formula is _firstDayInView + 40 . The
calendar displays a maximum of 41 days, so the _maxDate variable always reflects the last viewable
day, and determines what events have already been retrieved from Outlook and cached in the app.
MyCalendarEvents: Set to a collection of the user's events from the selected calendar, ranging from
_minDate to _maxDate.
_showLoading: Set to false; _calendarVisible is set to true after everything else has been loaded.

Calendar icon

Property: OnSelect
Value: Four Set functions that reset the calendar gallery to today's date:

Set( _dateSelected, Today() );


Set( _firstDayOfMonth, DateAdd( Today(), 1 - Day( Today() ), Days) );
Set( _firstDayInView, DateAdd(_firstDayOfMonth, -(Weekday( _firstDayOfMonth ) - 2 + 1), Days));
Set( _lastDayOfMonth, DateAdd( DateAdd( _firstDayOfMonth, 1, Months ), -1, Days ) )

The preceding code resets all date variables that are necessary for displaying the proper calendar view:
_dateSelected is reset to today.
_firstDayOfMonth is reset to the first day of today's month.
_firstDayInView is reset to the first day viewable when today's month is selected.
_lastDayOfMonth is reset to the last day of today's month.
The Calendar drop-down section of this topic explains these variables in more detail.

Previous-month chevron

Property: OnSelect
Value: Four Set functions and an If function that show the previous month in the calendar gallery:

Set( _firstDayOfMonth, DateAdd( _firstDayOfMonth, -1, Months ) );


Set( _firstDayInView,
DateAdd( _firstDayOfMonth, -(Weekday( _firstDayOfMonth ) - 2 + 1), Days )
);
Set( _lastDayOfMonth, DateAdd(DateAdd( _firstDayOfMonth, 1, Months ), -1, Days ) );
If( _minDate > _firstDayOfMonth,
Collect( MyCalendarEvents,
'Office365'.GetEventsCalendarViewV2( _myCalendar.Name,
Text( _firstDayInView, UTC ),
Text( DateAdd( _minDate, -1, Days ), UTC )
).value
);
Set( _minDate, _firstDayInView )
)
NOTE
Definitions for _firstDayOfMonth, _firstDayInView, and _lastDayOfMonth are nearly identical to those in the
Calendar drop-down section of this topic.

The first three lines of the preceding code run whenever the user selects the previous-month chevron. The
code sets the variables that are necessary to display the proper calendar view. The remaining code runs
only if the user hasn't previously selected this month for the selected calendar.
If this is the case, _minDate is the first day that appears when the previous month displays. Before the user
selects the icon, _minDate has a minimum possible value of the 23rd of the current month. (When March
1 falls on a Saturday, _firstDayInView for March is February 23.) That means that if a user hasn't selected
this month yet, _minDate is greater than the new _firstDayOfMonth, and the If function returns true.
The code runs, and a collection and a variable are updated:
MyCalendarEvents retrieves events from the selected calendar with the
Office365.GetEventsCalendarViewV2 operation. The date range is between the _firstDayInView
date and _minDate - 1. Because MyCalendarEvents already contains events on the _minDate
date, 1 is subtracted from that date for the maximum value in this new date range.
_minDate is set to the current _firstDayInView because this is the first date for which events have
been retrieved. If a user returns to this date by selecting the previous-month chevron, the If function
returns false; the code doesn't run because events for this view are already cached in
MyCalendarEvents.

Next-month chevron

Property: OnSelect
Value: Four Set functions and an If function that show the next month in the calendar gallery:

Set( _firstDayOfMonth, DateAdd( _firstDayOfMonth, 1, Months ) );


Set( _firstDayInView,
DateAdd( _firstDayOfMonth, -(Weekday( _firstDayOfMonth ) - 2 + 1), Days ) );
Set( _lastDayOfMonth, DateAdd( DateAdd( _firstDayOfMonth, 1, Months ), -1, Days ) );
If( _maxDate < _lastDayOfMonth,
Collect( MyCalendarEvents,
'Office365'.GetEventsCalendarViewV2( _myCalendar.Name,
Text( DateAdd( _maxDate, 1, Days ), UTC ),
DateAdd( _firstDayInView, 40, Days )
).value
);
Set( _maxDate, DateAdd( _firstDayInView, 40, Days) )
)

NOTE
Definitions for _firstDayOfMonth, _firstDayInView, and _lastDayOfMonth are nearly identical to those in the
Calendar drop-down section of this topic.
The first three lines of the preceding code, which run when the user selects the next-month chevron, set the
variables that are necessary to display the proper calendar view. The remaining code runs only if the user
hasn't previously selected this month for the selected calendar.
In that case, _maxDate is the last day that appears when the previous month displays. Before the user
selects the next-month chevron, _maxDate has a maximum possible value of the 13th of the next month.
(When February 1 falls on a non-leap year Sunday, _maxDate is March 13, which is _firstDayInView +
40 days.) That means that if a user hasn't selected this month yet, _maxDate is greater than the new
_lastDayOfMonth, and the If function returns true. The code runs, and a collection and a variable are
updated:
MyCalendarEvents retrieves events from the selected calendar with the
Office365.GetEventsCalendarViewV2 operation. The date range is between _maxDate + 1 day and
_firstDayInView + 40 days. Because MyCalendarEvents already contains events on the
_minDate date, 1 is added to that date for the minimum value in this new date range.
_firstDayInView + 40 is the formula for _maxDate, so the second date in the range is just the new
_maxDate.
_maxDate is set to _firstDayInView + 40 days because this is the last day for which events have
been retrieved. If a user returns to this date by selecting the next-month chevron, the If function
returns false; the code doesn't run because events for this view are already cached in
MyCalendarEvents.

Calendar gallery

Property: Items
Value:
[0,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]

The set of 0 through 41 is used for the items in the calendar gallery because, in the worst-case scenario, the
calendar view will have to display 42 full days. This occurs when the first of the month occurs on a Saturday
and the last of the month occurs on a Sunday. In this case, the calendar shows six days from the previous
month in the row containing the first of the month, and six days from the following month in the row
containing the last of the month. This is 42 unique values, of which 30 are for the selected month.
Property: WrapCount
Value: 7
This value reflects a seven-day week.
Title control in the calendar gallery
Property: Text
Value: Day( DateAdd( _firstDayInView, ThisItem.Value, Days ) )

Recall that _firstDayInView is defined as (_firstDayOfMonth - its weekday value) + 1. This tells you that
_firstDayInView is always a Sunday, and _firstDayOfMonth is always in the first row of
MonthDayGallery. Because of these two facts, _firstDayInView is always in the very first cell of
MonthDayGallery. ThisItem.Value is the number for that cell in the MonthDayGallery item property.
So, taking _firstDayInView as a starting point, each cell displays the increment of _firstDayInView + its
respective cell value.
Property: Fill
Value: One If function:

If( DateAdd( _firstDayInView, ThisItem.Value ) = Today() &&


DateAdd( _firstDayInView, ThisItem.Value ) = _dateSelected,
RGBA( 0, 0, 0, 0 ),
DateAdd( _firstDayInView, ThisItem.Value) = Today(),
ColorFade( Subcircle.Fill, 0.67 ),
Abs( Title.Text - ThisItem.Value) > 10,
RGBA( 200, 200, 200, 0.3 ),
RGBA( 0, 0, 0, 0 )
)

As discussed in the description of the Text property, DateAdd(_firstDayInView, ThisItem.Value) represents


the day in the visible cell. Taking this into account, the preceding code performs these comparisons:
1. If the cell’s value is today’s date AND this cell is equivalent to _dateSelected, don't provide a fill
value.
2. If the cell’s value is today’s date but not equivalent to _dateSelected, provide the ColorFade fill.
3. The last comparison isn't as clear. It's a comparison between the actual text value in the cell and the
value of the cell item (the number on display and the item number).
To better understand this, consider September 2018, a month that starts on a Saturday and ends on
a Sunday. In this case, the calendar displays the 26th through 31st of August and the 1st of
September in the first row, and Abs(Title.Text - ThisItem.Value) = 26 until September 1st. Then
Abs(Title.Text - ThisItem.Value) = 5 . It will stay at 5 until the last row in the calendar, which
displays September 30th and October 1st through 6th. In that Abs(Title.Text - ThisItem.Value) will
still be 5 for September 30th, but will be 35 for the October dates.
This is the pattern: For days displayed from the previous month, Abs(Title.Text - ThisItem.Value)
will always equal the Title.Text value of the first day on display. For days being displayed in the
next month, Abs(Title.Text - ThisItem.Value) will always equal the MonthDayGallery item value
of the first cell of that month (in this case, October 1st) minus 1. And, most importantly, for days
displayed in the currently selected month, Abs(Title.Text - ThisItem.Value) will also always equal
the value of the first item of that month minus 1 and will never exceed 5, as the previous example
shows. So it is perfectly valid to write the formula as Abs(Title.Text - ThisItem.Value) > 5 .
This statement checks whether the date value is outside of the currently selected month. If it is, Fill is
a partially opaque gray.

NOTE
You can check the validity of this last comparison for yourself by inserting a Label control into the gallery and
setting its Text property to this value:
Abs(Title.Text - ThisItem.Value) .

Property: Visible
Value:

!(
DateAdd( _firstDayInView, ThisItem.Value, Days ) -
Weekday( DateAdd( _firstDayInView, ThisItem.Value,Days ) ) + 1
> _lastDayOfMonth
)

The preceding statement checks whether the cell is in a row where no days of the currently selected month
occur. Recall that subtracting the weekday value of any day from its date value and adding 1 always returns
the first item in the row that day lives in. So this statement checks whether the first day in the row is after
the last day of the viewable month. If it is, it won't appear because the entire row contains days of the
following month.
Property: OnSelect
Value: A Set function that sets the _dateSelected variable to the date of the selected cell:

Set( _dateSelected, DateAdd( _firstDayInView, ThisItem.Value, Days ) )

Circle control in the calendar gallery

Property: Visible
Value: A formula that determines whether any events are scheduled for the selected date and whether the
Subcircle and Title controls are visible:
CountRows(
Filter( MyCalendarEvents,
DateValue( Text( Start ) ) = DateAdd( _firstDayInView, ThisItem.Value, Days )
)
) > 0 && !Subcircle.Visible && Title.Visible

The Circle control is visible if the Start field for any event is equivalent to the date of that cell, if the Title
control is visible, and if the Subcircle control isn't visible. In other words, this control is visible when at least
one event occurs on this day, and this day isn't selected. If it is selected, the events for that day are displayed
in the CalendarEventsGallery control.
Subcircle control in the calendar gallery

Property: Visible
Value:

DateAdd( _firstDayInView, ThisItem.Value ) = _dateSelected && Title.Visible

The Subcircle control is visible when _dateSelected is equivalent to the date of the cell, and the Title
control is visible. In other words, this control appears when the cell is the currently selected date.

Events gallery

Property: Items
Value: A formula that sorts and filters the events gallery:
SortByColumns(
Filter( MyCalendarEvents,
Text( Start, DateTimeFormat.ShortDate ) = Text( _dateSelected, DateTimeFormat.ShortDate )
),
"Start"
)

The MyCalendarEvents collection contains all the events between _minDate and _maxDate. In order to
display the events for only the date selected, a filter is applied on MyCalendarEvents to display the events
that have a start date equivalent to \ _dateSelected. The items are then sorted by their start dates to put
them in sequential order.

Next steps
Learn more about this screen
Learn more about the Office 365 Outlook connector in Power Apps
Learn more about the Office 365 Users connector in Power Apps
Overview of the email-screen template for canvas
apps
12/3/2019 • 4 minutes to read • Edit Online

In a canvas app, add an email screen that lets users send an email from their Office 365 Outlook account. Users
can search for recipients in their orgs and add external email addresses, too. You can add image-attachment
support, change the user data that appears in the search gallery, and make other customizations.
You can also add other template-based screens that show different data from Office 365, such as a user's calendar,
people in an organization, and availability of the people users might want to invite to a meeting.
This overview teaches you:
How to use the default email screen.
How to modify it.
How to integrate it into an app.
For a deeper dive into this screen's default functionality, see the email-screen reference.

Prerequisite
Familiarity with how to add and configure screens and other controls as you create an app in Power Apps.

Default functionality
To add an email screen from the template:
1. Sign in to Power Apps, and then create an app or open an existing app in Power Apps Studio.
This topic shows a phone app, but the same concepts apply to a tablet app.
2. On the Home tab of the ribbon, select New screen > Email.
By default, the screen looks similar to this:
A few helpful notes:
To search for users in your org, start typing their name in the text input box below "To".
When searching for people, only the top 15 results will be returned.
To add email addresses for email recipients outside your org, type out the full, valid email address, and select
the '+' icon that appears to the right of it.
You must add at least one person as a recipient and provide a subject to send an email.
After you send the email, the contents of the subject line and message body, as well as the recipient list will all
be erased.

Modify the screen


You can modify the default functionality of this screen in a few common ways:
Add image-attachment support
Show different data for people
If you want to modify the screen further, use the email-screen reference as a guide.

IMPORTANT
The following steps assume that you've added only one email screen to the app. If you've added more than one, control
names (such as iconMail1) will end with a different number, and you'll need to adjust the formulas accordingly.

Add image -attachment support


This allows users to send a single image with their email as an attachment.
1. On the Insert tab, select Media, and then select Add picture.
2. Set the new control's Y property to this expression:
TextEmailMessage1.Y + TextEmailMessage1.Height + 20

3. With the AddMediaWithImage control inserted, set its height to be less than 210.
4. In the control tree view, select AddMediaWithImage > ... > Reorder > Send to back. This prevents the
control from sitting in front of the PeopleBrowseGallery control.
5. Change the Height property of EmailPeopleGallery to this formula:

Min(
( EmailPeopleGallery1.TemplateHeight + EmailPeopleGallery1.TemplatePadding * 2 ) *
RoundUp( CountRows( EmailPeopleGallery1.AllItems ) / 2, 0 ),
304
)

6. Set the ShowScrollbar property of EmailPeopleGallery to this expression:


EmailPeopleGallery1.Height >= 304

This prevents the max height from pushing the AddMediaWithImage control off the page.
7. Change the OnSelect property of the iconMail control to this formula:

Set( _emailRecipientString, Concat(MyPeople, Mail & ";") );


If( IsBlank( UploadedImage1 ),
'Office365'.SendEmail( _emailRecipientString,
TextEmailSubject1.Text,
TextEmailMessage1.Text,
{ Importance: "Normal" }
),
'Office365'.SendEmail( _emailRecipientString,
TextEmailSubject1.Text,
TextEmailMessage1.Text,
{
Importance: "Normal",
Attachments: Table(
{
Name: "Image.jpg",
ContentBytes: UploadedImage1.Image
}
)
}
)
);
Reset( TextEmailSubject1 );
Reset( TextEmailMessage1 );
Reset( AddMediaButton1 );
Clear( MyPeople )

This formula checks for an uploaded image. If there is none, then it uses the same Office365.SendEmail
operation as before. If there is an image, it is added as an attachment in the Attachments table. After
sending the email, an additional Reset operation is performed on AddMediaButton to remove the
uploaded image.

NOTE
To add more than one attachment to an email, add records to the Attachments table.

Show different data for people


This screen uses the Office365Users.SearchUser operation to search for users in your org. It provides additional
fields for each event beyond what appears in the PeopleBrowseGallery control. Adding or changing fields in the
gallery is simple:
1. In the PeopleBrowseGallery control, select a label to modify (or add one and keep it selected).
2. With its Text property selected, in the formula bar, replace the contents with ThisItem.

IntelliSense shows a list of fields that you can select.


3. Select the field that you want.
The Text property updates to ThisItem.{FieldSelection} .

Integrate the screen into an app


The email screen is a powerful bundle of controls in its own right, but it usually performs best as part of a larger,
more versatile app. You can integrate this screen into a larger app in a number of ways, including linking to the
calendar screen.
Linking to the calendar screen
Follow the steps outlined in the "Show event attendees" section of Calendar screen overview but, in the final step,
set the Navigate function to open the email screen. After you complete these steps, the MyPeople collection is
populated, which allows users to send email to the people who are attending the selected event.

NOTE
Sending this email will send a separate email from the actual event in your Outlook.

Next steps
View the reference documentation for this screen.
Learn more about the Office 365 Users connector in Power Apps.
See all available connections in Power Apps.
Reference information about the email-screen
template for canvas apps
12/3/2019 • 4 minutes to read • Edit Online

For canvas apps in Power Apps, understand how each significant control in the email-screen template contributes
to the screen's overall default functionality. This deep dive presents the behavior formulas and the values of other
properties that determine how the controls respond to user input. For a high-level discussion of this screen's
default functionality, see the email-screen overview.
This topic highlights some significant controls and explains the expressions or formulas to which various
properties (such as Items and OnSelect) of these controls are set:
Text search box
Add Icon
People browse gallery
Email people gallery (+ child controls)
Mail icon

Prerequisite
Familiarity with how to add and configure screens and other controls as you create an app in Power Apps.

Text search box

Several other controls in the screen have a dependency on the Text search box control:
If a user starts typing any text, PeopleBrowseGallery appears.
If a user types out a valid email address, AddIcon appears.
When a user selects a person within PeopleBrowseGallery, the search contents are reset.

Add icon
The Add icon control allows app users to add people who don't exist inside their org to the recipient list of the
email being composed.
Property: Visible
Value: Logic to show the control only when a user types a valid email address into the search box:

!IsBlank( TextSearchBox.Text ) &&


IsMatch( TextSearchBox.Text, Match.Email ) &&
Not( Trim( TextSearchBox.Text ) in MyPeople.UserPrincipalName )

Line by line, the preceding code block says that the Add icon control will be visible only if:
TextSearchBox contains text.
The text in TextSearchBox is a valid email address.
The text in TextSearchBox doesn't already exist in the MyPeople collection.
Property: OnSelect
Value: Selecting this adds the valid email address to the MyPeople collection. This collection is used by the
screen as the recipient list:

Collect( MyPeople,
{
DisplayName: TextSearchBox.Text,
UserPrincipalName: TextSearchBox.Text,
Mail: TextSearchBox.Text
}
);
Reset( TextSearchBox )

This code block adds a row to the MyPeople collection and populates three fields with the text in
TextSearchBox. These three fields are DisplayName, UserPrincipalName, and Mail. It then resets the
contents of TextSearchBox.

People browse gallery

Property: Items
Value: The top 15 search results of the search text typed into the TextSearchBox control:

If( !IsBlank( Trim(TextSearchBox.Text ) ),


'Office365Users'.SearchUser( {searchTerm: Trim( TextSearchBox.Text ), top: 15} )
)

The items of this gallery are populated by search results from the Office365.SearchUser operation. The
operation takes the text in Trim(TextSearchBox) as its search term and returns the top 15 results based on
that search.
TextSearchBox is wrapped in a Trim() function because a user search on spaces is invalid. The
Office365Users.SearchUser operation is wrapped in an If(!IsBlank(Trim(TextSearchBox.Text)) ... )
function, which means that the operation is performed only if the search box contains user-entered text.
This improves performance.
People browse gallery Title control

Property: Text
Value: ThisItem.DisplayName
Displays the person's display name from their Office 365 profile.
Property: OnSelect
Value: Code to add the user to an app-level collection, and then select the user:

Concurrent(
Set( _selectedUser, ThisItem ),
Reset( TextSearchBox ),
If( Not( ThisItem.UserPrincipalName in MyPeople.UserPrincipalName ),
Collect( MyPeople, ThisItem )
)
)

Selecting this control does three things concurrently:


Sets the _selectedUser variable to the item selected.
Resets the search term in TextSearchBox.
Adds the selected item to the MyPeople collection, a collection of all the selected users that the email screen
uses as a set of recipients.

Email people gallery


Property: Items
Value: MyPeople
This is the collection of people initialized or added to by selecting the PeopleBrowseGallery Title control.
Property: Height
Value: Logic to set the height, based on the number of items currently in the gallery:

Min(
( EmailPeopleGallery.TemplateHeight + EmailPeopleGallery.TemplatePadding * 2) *
RoundUp(CountRows(EmailPeopleGallery.AllItems) / 2, 0 ),
304
)

The height of this gallery adjusts to the number of items in the gallery, with a maximum height of 304.
It takes TemplateHeight + TemplatePadding * 2 as the total height of a single row of EmailPeopleGallery,
then multiplies it by the number of rows. Since WrapCount = 2 , the number of true rows is
RoundUp(CountRows(EmailPeopleGallery.AllItems) / 2, 0) .

Property: ShowScrollbar
Value: EmailPeopleGallery.Height >= 304

When the height of the gallery reaches 304, the scroll bar is visible.
Email people gallery Title control

Property: OnSelect
Value: Set(_selectedUser, ThisItem)

Sets the _selectedUser variable to the item selected in EmailPeopleGallery.


Email people gallery iconRemove control

Property: OnSelect
Value: Remove( MyPeople, LookUp( MyPeople, UserPrincipalName = ThisItem.UserPrincipalName ) )

Looks up the record in the MyPeople collection, where UserPrincipalName matches the
UserPrincipalName of the selected item, and removes that record from the collection.

Mail icon
Property: OnSelect
Value: Logic to send the user's email message:

Set( _emailRecipientString, Concat( MyPeople, Mail & ";" ) );


'Office365'.SendEmail( _emailRecipientString,
TextEmailSubject.Text,
TextEmailMessage.Text,
{ Importance:"Normal" }
);
Reset( TextEmailSubject );
Reset( TextEmailMessage );
Clear( MyPeople )

Sending an email message requires a semicolon-separated string of email addresses. In the preceding
code:
1. The first line of code takes the Mail field from all the rows in the MyPeople collection, concatenates
them into a single string of email addresses separated by semicolons, and sets the
_emailRecipientString variable to that string value.
2. It then uses the Office365.SendEmail operation to send the email to the recipients. The operation
has three required parameters, To, Subject, and Body, and one optional parameter--Importance.
In the preceding code, these are _emailRecipientString, TextEmailSubject.Text,
TextEmailMessage.Text, and Normal, respectively.
3. Finally, it resets the TextEmailSubject and TextEmailMessage controls and clears the MyPeople
collection.
Property: DisplayMode
Value:
If( Len( Trim( TextEmailSubject.Text ) ) > 0 && !IsEmpty( MyPeople ), DisplayMode.Edit,
DisplayMode.Disabled )
For an email to be sent, the email subject line must have text, and the recipient (MyPeople) collection must
not be empty.

Next steps
Learn more about this screen
Learn more about the Office 365 Outlook connector in Power Apps
Learn more about the Office 365 Users connector in Power Apps
Overview of the meeting-screen template for canvas
apps
12/3/2019 • 2 minutes to read • Edit Online

In a canvas app, add a meeting screen that lets users create and send meeting requests from their Office 365
Outlook accounts. Users can search for attendees in their org and add external email addresses. If your tenant has
meeting rooms built into Outlook, users can select a location as well.
You can also add other template-based screens that show different data from Office 365, such as email, people in
an organization, and a user's calendar.
This overview teaches you about the high-level functionality of the screen.
For a deeper dive into this screen's default functionality, see the meeting-screen reference.

Prerequisite
Familiarity with how to add and configure screens and other controls as you create an app in Power Apps.

Default functionality
To add a meeting screen from the template:
1. Sign in to Power Apps, and then create an app or open an existing app in Power Apps Studio.
This topic shows a phone app, but the same concepts apply to a tablet app.
2. On the Home tab of the ribbon, select New screen > Meeting.
When filled out, both tabs of the meeting screen look similar to this:
A few helpful notes:
The meeting screen allows an app user to create a meeting in Outlook. Users can search for and add attendees
and, optionally, add a meeting room to the meeting.
To search for a user in your org, start typing their name in the text-input box under "Attendees".
When you search for people, only the top 15 results are returned.
To add email addresses for attendees outside your org, type out the full, valid email address, and select the '+'
icon that appears to the right of the email address.
To create a meeting, you must add at least one person as an attendee, provide a subject, and select a meeting
time in the Schedule tab.
After you send the meeting request, all information for that meeting is cleared.
The OnSelect statement of the Send icon (upper-right corner) contains this formula:

Set( _myCalendarName,
LookUp( 'Office365'.CalendarGetTables().value, DisplayName = "Calendar" ).Name
);

"Calendar" is the default display name for most Office user's calendars, but your org might differ. If so, you can
change "Calendar" to the appropriate term for your org.
You get an error if you try to schedule a meeting that occurs in the past or add more than 20 people to a
meeting.

Next steps
View the reference documentation for this screen.
Learn more about the Office 365 Outlook connector.
Learn more about the Office 365 Users connector.
Reference information about the meeting-screen
template for canvas apps
12/3/2019 • 18 minutes to read • Edit Online

For canvas apps in Power Apps, understand how each significant control in the meeting-screen template
contributes to the screen's overall default functionality. This deep dive presents the behavior formulas and the
values of other properties that determine how the controls respond to user input. For a high-level discussion of
this screen's default functionality, see the meeting-screen overview.
This topic highlights some significant controls and explains the expressions or formulas to which various
properties (such as Items and OnSelect) of these controls are set:
Invite tab (LblInviteTab)
Schedule tab (LblScheduleTab)
Text search box
Add icon (AddIcon)
People browse gallery (+ child controls)
Meeting people gallery (+ child controls)
Meeting date picker (MeetingDateSelect)
Meeting duration drop-down (MeetingDurationSelect)
Find meeting times gallery (+ child controls)
Room browse gallery (+ child controls)
Back chevron (RoomsBackNav) (may not be visible if tenant doesn't have rooms lists)
Send icon

Prerequisite
Familiarity with how to add and configure screens and other controls as you create an app in Power Apps.

Invite tab

Property: Color
Value: If( _showDetails, LblRecipientCount.Color, RectQuickActionBar.Fill )

_showDetails is a variable used to determine whether the LblInviteTab control or the LblScheduleTab
control is selected. If the value of _showDetails is true, LblScheduleTab is selected; if the value is false,
LblInviteTab is selected. That means that if the value of _showDetails is true (this tab isn't selected), the
tab color matches that of LblRecipientCount. Otherwise, it matches the fill value of RectQuickActionBar.
Property: OnSelect
Value: Set( _showDetails, false )

Sets the _showDetails variable to false, which means the contents of the Invite tab are visible, and the
contents of the Schedule tab are hidden.

Schedule tab

Property: Color
Value: If( !_showDetails, LblRecipientCount.Color, RectQuickActionBar.Fill )

_showDetails is a variable used to determine whether the LblInviteTab control or the LblScheduleTab
control is selected. If it's true, LblScheduleTab is selected; if false, LblInviteTab is. This means that if
_showDetails is true (this tab is selected), the tab color matches the fill value of RectQuickActionBar.
Otherwise, it matches the color value of LblRecipientCount.
Property: OnSelect
Value: Set( _showDetails, true )

Sets the _showDetails variable to true, which means the contents of the Schedule tab are visible, and the
contents of the Invite tab are hidden.

Text search box


Several other controls in the screen have a dependency on this one:
If a user starts typing any text, PeopleBrowseGallery becomes visible.
If a user types a valid email address, AddIcon becomes visible.
When a user selects a person within PeopleBrowseGallery the search contents are reset.

Add icon

This control allows users to add people who don't exist inside their org to the attendee list for the meeting being
composed.
Property: Visible
Value: Three logical checks that all must evaluate to true for the control to be visible:

!IsBlank( TextSearchBox.Text ) &&


IsMatch( TextSearchBox.Text, Match.Email ) &&
Not( Trim( TextSearchBox.Text ) in MyPeople.UserPrincipalName )

Line by line, this code block says that the AddIcon control is visible only if:
The TextSearchBox contains text.
The text in TextSearchBox is a valid email address.
The text in TextSearchBox doesn't already exist in the MyPeople collection.
Property: OnSelect
Value: A Collect statement to add the user to the attendee list, another to refresh available meeting times,
and several variable toggles:
Collect( MyPeople,
{
DisplayName: TextSearchBox.Text,
UserPrincipalName: TextSearchBox.Text,
Mail: TextSearchBox.Text
}
);
Concurrent(
Reset( TextSearchBox ),
Set( _showMeetingTimes, false ),
UpdateContext( { _loadMeetingTimes: true } ),
Set( _selectedMeetingTime, Blank() ),
Set( _selectedRoom, Blank() ),
Set( _roomListSelected, false ),
ClearCollect( MeetingTimes,
AddColumns(
'Office365'.FindMeetingTimes(
{
RequiredAttendees: Concat(MyPeople, UserPrincipalName & ";")
MeetingDuration: MeetingDurationSelect.Selected.Minutes,
Start: Text( DateAdd( MeetingDateSelect.SelectedDate, 8, Hours ), UTC ),
End: Text( DateAdd( MeetingDateSelect.SelectedDate, 17, Hours ), UTC ),
MaxCandidates: 15,
MinimumAttendeePercentage:1,
IsOrganizerOptional: false,
ActivityDomain: "Work"
}
).MeetingTimeSuggestions,
"StartTime", MeetingTimeSlot.Start.DateTime,
"EndTime", MeetingTimeSlot.End.DateTime
)
)
);
UpdateContext( { _loadingMeetingTimes: false } );
Set( _showMeetingTimes, true )

Selecting this control adds the valid email address (visible only if a valid email address is typed into
TextSearchBox) to the MyPeople collection (this collection is the attendee list) and then refreshes the
available meeting times with the new user entry.
At a low level, this code block:
1. Collects the email address into the MyPeople collection, collecting the email address into the
DisplayName, UserPrincipalName, and Mail fields.
2. Resets the contents of the TextSearchBox control.
3. Sets the _showMeetingTimes variable to false. This variable controls the visibility of
FindMeetingTimesGallery, which displays open times for the selected attendees to meet.
4. Sets the _loadMeetingTimes context variable to true. This variable sets a loading state, which toggles
the visibility of loading state controls like _LblTimesEmptyState to indicate to the user that their data is
being loaded.
5. Sets _selectedMeetingTime to Blank(). _selectedMeetingTime is the selected record from the
FindMeetingTimesGallery control. It is blanked here because the addition of another attendee might
mean that the previous definition of _selectedMeetingTime is not be available for that attendee.
6. Sets _selectedRoom to Blank(). _selectedRoom is the selected room record from
RoomBrowseGallery. The room availabilities are determined from the value of
_selectedMeetingTime. With that value blanked, the _selectedRoom value is no longer valid, so it
must be blanked.
7. Sets _roomListSelected to false. This line may not be applicable to everyone. In Office, you can group
your rooms by different "room lists." If you have room lists, this screen accounts for that, allowing you to
first select a room list before selecting a room from within that list. The value of _roomListSelected is
what determines whether a user (in a tenant with room lists only) will be viewing rooms within a room
list or the set of room lists. It's set to false to force users to reselect a new room list.
8. Uses the Office365.FindMeetingTimes operation to determine and collect the available meeting times
for the attendees. This operation passes:
The UserPrincipalName of each selected user into the RequiredAttendees parameter.
MeetingDurationSelect.Selected.Minutes into the MeetingDuration parameter.
MeetingDateSelect.SelectedDate + 8 hours into the Start parameter. Eight hours is added
because, by default, the full date/time for the calendar control is 12:00 AM of the selected date.
You probably want to retrieve availabilities within normal working hours. A normal work start
time would be 8:00 AM.
MeetingDateSelect.SelectedDate + 17 hours into the End parameter. 17 hours is added
because 12:00 AM + 17 = 5:00 PM. A normal work end time would be 5:00 PM.
15 into the MaxCandidates parameter. This means the operation returns only the top 15 available
times for the selected date. This makes sense because there are only sixteen 30-minute chunks in
an 8-hour work day, and a 30-minute meeting is the minimum one can set in this screen.
1 into the MinimumAttendeePercentage parameter. Essentially, unless no attendees are available,
the meeting time is retrieved.
false into the IsOrganizerOptional parameter. The app user is not an optional attendee for this
meeting.
"Work" into the ActivityDomain parameter. This means the times retrieved are only those within a
normal working time period.
9. The ClearCollect function also adds two columns: "StartTime" and "EndTime". This simplifies the data
returned. The field containing the available start and end times is the MeetingTimeSlot field. This field
is a record containing the Start and End records, which themselves contain the DateTime and
TimeZone values of their respective suggestion. Instead of attempting to retrieve this nesting of
records, adding the "StartTime" and "EndTime" columns to the MeetingTimes collection brings those
Start > DateTime and End > DateTime values to the surface of the collection.
10. Once these functions have all completed, the _loadingMeetingTimes variable is set to false, removing
the loading state, and _showMeetingTimes is set to true, displaying FindMeetingTimesGallery.

People browse gallery

Property: Items
Value:

If( !IsBlank( Trim( TextSearchBox.Text ) ),


'Office365Users'.SearchUser( { searchTerm: Trim(TextSearchBox.Text), top: 15 } )
)

The items of this gallery are populated by search results from the Office365.SearchUser operation. The operation
takes the text in Trim(**TextSearchBox**) as its search term and returns the top 15 results based on that search.
TextSearchBox is wrapped in a Trim function because a user search on spaces isn't valid. The
Office365Users.SearchUser operation is wrapped in an If(!IsBlank(Trim(TextSearchBox.Text)) ... ) function
because retrieving search results before a user has searched is a performance waste.
People browse gallery Title

Property: Text
Value: ThisItem.DisplayName
Displays the person's display name from their Office 365 profile.
Property: OnSelect
Value: A Collect statement to add the user to the attendee list, another to refresh available meeting times,
and several variable toggles:
Concurrent(
Reset( TextSearchBox ),
Set( _selectedUser, ThisItem ),
If( Not( ThisItem.UserPrincipalName in MyPeople.UserPrincipalName ),
Collect( MyPeople, ThisItem );
Concurrent(
Set( _showMeetingTimes, false ),
UpdateContext( { _loadMeetingTimes: true } ),
Set( _selectedMeetingTime, Blank() ),
Set( _selectedRoom, Blank() ),
Set( _roomListSelected, false ),
ClearCollect( MeetingTimes,
AddColumns(
'Office365'.FindMeetingTimes(
{
RequiredAttendees: Concat( MyPeople, UserPrincipalName & ";" ),
MeetingDuration: MeetingDurationSelect.Selected.Minutes,
Start: Text( DateAdd( MeetingDateSelect.SelectedDate, 8, Hours ), UTC ),
End: Text( DateAdd( MeetingDateSelect.SelectedDate, 17, Hours ), UTC ),
MaxCandidates: 15,
MinimumAttendeePercentage: 1,
IsOrganizerOptional: false,
ActivityDomain: "Work"
}
).MeetingTimeSuggestions,
"StartTime", MeetingTimeSlot.Start.DateTime,
"EndTime", MeetingTimeSlot.End.DateTime
)
)
);
UpdateContext( { _loadingMeetingTimes: false } );
Set( _showMeetingTimes, true )
)
)

At a high level, selecting this control adds the person to the MyPeople collection (the app's storage of the
attendee list), and refreshes the available meeting times based on the new user addition.
Selecting this control is very similar to selecting the AddIcon control; the only difference is that the
Set(_selectedUser, ThisItem) statement and the execution order of the operations. As such, this discussion
won't be as deep. For a fuller explanation, read through the AddIcon control section.
Selecting this control resets TextSearchBox. Then, if the selection is not in the MyPeople collection, the
control:
1. Sets the _loadMeetingTimes state to true and the _showMeetingTimes state to false, blanks the
_selectedMeetingTime and _selectedRoom variables, and refreshes the MeetingTimes collection
with the new addition to the MyPeople collection.
2. Sets the _loadMeetingTimes state to false, and sets _showMeetingTimes to true. If the selection is
already in the MyPeople collection, it resets only the contents of TextSearchBox.

Meeting people gallery


Property: Items
Value: MyPeople
The MyPeople collection is the collection of people initialized or added to by selecting the
PeopleBrowseGallery Title control.
Property: Height
Value: Logic to allow the gallery to grow to a maximum height of 350:

Min(
76 * RoundUp( CountRows( MeetingPeopleGallery.AllItems ) / 2, 0 ),
350
)

The height of this gallery adjusts to the number of items in the gallery, to a maximum height of 350. The
formula takes 76 as the height of a single row of MeetingPeopleGallery, then multiplies it by the number
of rows. The WrapCount property is set to 2, so the number of true rows is
RoundUp(CountRows(MeetingPeopleGallery.AllItems) / 2, 0) .

Property: ShowScrollbar
Value: MeetingPeopleGallery.Height >= 350

When the maximum height of the gallery is reached (350), the scroll bar is visible.
Meeting people gallery Title

Property: OnSelect
Value: Set(_selectedUser, ThisItem)

Sets the _selectedUser variable to the item selected in MeetingPeopleGallery.


Meeting people gallery iconRemove

Property: OnSelect
Value: A Remove statement to remove the user from the attendee list, a Collect statement to refresh
available meeting times, and several variable toggles:

Remove( MyPeople, LookUp( MyPeople, UserPrincipalName = ThisItem.UserPrincipalName ) );


Concurrent(
Reset( TextSearchBox ),
Set( _showMeetingTimes, false ),
UpdateContext( { _loadMeetingTimes: true } ),
Set( _selectedMeetingTime, Blank() ),
Set( _selectedRoom, Blank() ),
Set( _roomListSelected, false ),
ClearCollect( MeetingTimes,
AddColumns(
'Office365'.FindMeetingTimes(
{
RequiredAttendees: Concat( MyPeople, UserPrincipalName & ";" ),
MeetingDuration: MeetingDurationSelect.Selected.Minutes,
Start: Text( DateAdd( MeetingDateSelect.SelectedDate, 8, Hours ), UTC ),
End: Text( DateAdd( MeetingDateSelect.SelectedDate, 17, Hours ), UTC ),
MaxCandidates: 15,
MinimumAttendeePercentage: 1,
IsOrganizerOptional: false,
ActivityDomain: "Work"
}
).MeetingTimeSuggestions,
"StartTime", MeetingTimeSlot.Start.DateTime,
"EndTime", MeetingTimeSlot.End.DateTime
)
)
);
UpdateContext( { _loadingMeetingTimes: false } );
Set( _showMeetingTimes, true )

At a high level, selecting this control removes the person from the attendee list and refreshes the available
meeting times based on the removal of this person.
After the first line of the preceding code, selecting this control is almost identical to selecting the AddIcon
control. As such, this discussion will not be as deep. For a fuller explanation, read through the AddIcon
control section.
In the first line of code, the selected item is removed from the MyPeople collection. The code then:
1. Resets TextSearchBox, and then removes the selection from the MyPeople collection.
2. Sets the _loadMeetingTimes state to true and the _showMeetingTimes state to false, blanks the
_selectedMeetingTime and _selectedRoom variables, and refreshes the MeetingTimes collection
with the new addition to the MyPeople collection.
3. Sets the _loadMeetingTimes state to false, and sets _showMeetingTimes to true.

Meeting date picker

Property: DisplayMode
Value: If( IsEmpty(MyPeople), DisplayMode.Disabled, DisplayMode.Edit )

A date for a meeting cannot be chosen until at least one attendee has been added to the MyPeople
collection.
Property: OnChange
Value: Select( MeetingDateSelect )

Changing the selected date triggers the code in the OnSelect property of this control to run.
Property: OnSelect
Value: A Collect statement to refresh available meeting times, and several variable toggles:

Concurrent(
Reset( TextSearchBox ),
Set( _showMeetingTimes, false ),
UpdateContext( { _loadingMeetingTimes: true } ),
Set( _selectedMeetingTime, Blank() ),
Set( _selectedRoom, Blank() ),
Set( _roomListSelected, false ),
ClearCollect( MeetingTimes,
AddColumns(
'Office365'.FindMeetingTimes(
{
RequiredAttendees: Concat( MyPeople, UserPrincipalName & ";" ),
MeetingDuration: MeetingDurationSelect.Selected.Minutes,
Start: Text( DateAdd( MeetingDateSelect.SelectedDate, 8, Hours ), UTC ),
End: Text( DateAdd( MeetingDateSelect.SelectedDate, 17, Hours ), UTC ),
MaxCandidates: 15,
MinimumAttendeePercentage: 1,
IsOrganizerOptional: false,
ActivityDomain: "Work"
}
).MeetingTimeSuggestions,
"StartTime", MeetingTimeSlot.Start.DateTime,
"EndTime", MeetingTimeSlot.End.DateTime
)
)
);
UpdateContext( { _loadingMeetingTimes: false } );
Set( _showMeetingTimes, true )

At a high level, selecting this control refreshes the available meeting times. It is valuable because if a user
changes the date, the available meeting times need to update to reflect the attendees' availabilities for that
day.
With the exception of the initial Collect statement, this is identical to the OnSelect functionality of the
AddIcon control. As such, this discussion will not be as deep. For a fuller explanation, read through the
AddIcon control section.
Selecting this control resets TextSearchBox. It then:
1. Sets the _loadMeetingTimes state to true and the _showMeetingTimes state to false, blanks the
_selectedMeetingTime and _selectedRoom variables, and refreshes the MeetingTimes collection
with the new date selection.
2. Sets the _loadMeetingTimes state to false, and sets _showMeetingTimes to true.

Meeting duration drop-down

Property: DisplayMode
Value: If( IsEmpty(MyPeople), DisplayMode.Disabled, DisplayMode.Edit )

A duration for a meeting cannot be chosen until at least one attendee has been added to the MyPeople
collection.
Property: OnChange
Value: Select(MeetingDateSelect1)
Changing the selected duration triggers the code in the OnSelect property of the MeetingDateSelect
control to run.

Find meeting times gallery

Property: Items
Value: MeetingTimes
The collection of potential meeting times retrieved from the Office365.FindMeetingTimes operation.
Property: Visible
Value: _showMeetingTimes && _showDetails && !IsEmpty( MyPeople )

The gallery is visible only if _showMeetingTimes is set to true, the user has selected the LblScheduleTab
control, and there is at least one attendee added to the meeting.
Find meeting times gallery Title

Property: Text
Value: A conversion of the start time to be displayed in the user's local time:

Text(
DateAdd(
DateTimeValue( ThisItem.StartTime ),
- TimeZoneOffset(),
Minutes
),
DateTimeFormat.ShortTime
)

The retrieved value of StartTime is in UTC format. To convert from UTC to local time, the DateAdd
function is applied. The Text function takes a date/time as its first argument, and formats it based on its
second argument. You pass it the local time conversion of ThisItem.StartTime, and display it as
DateTimeFormat.ShortTime.
Property: OnSelect
Value: Several Collect statements to gather meeting rooms and their suggested availabilities, as well as
several variable toggles:
Set( _selectedMeetingTime, ThisItem );
UpdateContext( { _loadingRooms: true } );
If( IsEmpty( RoomsLists ),
ClearCollect( RoomsLists, 'Office365'.GetRoomLists().value) );
If( CountRows( RoomsLists ) <= 1,
Set( _noRoomLists, true );
ClearCollect( AllRooms, 'Office365'.GetRooms().value );
Set( _allRoomsConcat, Concat( FirstN( AllRooms, 20 ), Address & ";" ) );
ClearCollect( RoomTimeSuggestions,
'Office365'.FindMeetingTimes(
{
RequiredAttendees: _allRoomsConcat,
MeetingDuration: MeetingDurationSelect.Selected.Minutes,
Start: _selectedMeetingTime.StartTime & "Z",
End: _selectedMeetingTime.EndTime & "Z",
MinimumAttendeePercentage: "1",
IsOrganizerOptional: "false",
ActivityDomain: "Unrestricted"
}
).MeetingTimeSuggestions
);
ClearCollect( AvailableRooms,
AddColumns(
AddColumns(
Filter(
First( RoomTimeSuggestions ).AttendeeAvailability,
Availability="Free"
),
"Address", Attendee.EmailAddress.Address
),
"Name", LookUp( AllRooms, Address = Attendee.EmailAddress.Address ).Name
)
);
ClearCollect( AvailableRoomsOptimal,
DropColumns(
DropColumns( AvailableRooms, "Availability" ),
"Attendee"
)
),
Set( _roomListSelected, false)
);
UpdateContext( {_loadingRooms: false} )

At a high level, this code block gathers available rooms for users who don't have rooms lists, based on the
selected date/time for the meeting. Otherwise, it simply retrieves the rooms lists.
At a low level, this code block:
1. Sets _selectedMeetingTime to the selected item. This is used to find what rooms are available during
that time.
2. Sets the loading state variable _loadingRooms to true, turning the loading state on.
3. If the RoomsLists collection is empty, it retrieves the user's tenant's rooms lists and stores them in the
RoomsLists collection.
4. If the user has no room list or one room list:
a. The noRoomLists variable is set to true, and this variable is used to determine the items
displayed in the RoomBrowseGallery control.
b. The Office365.GetRooms() operation is used to retrieve the first 100 rooms in their tenant. These
are stored in the AllRooms collection.
c. The _allRoomsConcat variable is set to a semicolon-separated string of the first 20 email
addresses of the rooms in the AllRooms collection. This is because the
Office365.FindMeetingTimes is limited to searching for the available times of 20 person objects
in a single operation.
d. The RoomTimeSuggestions collection uses the Office365.FindMeetingTimes to retrieve the
availabilities of the first 20 rooms in the AllRooms collection, based on the time values from the
_selectedMeetingTime variable. Note that the & "Z" is used to properly format the DateTime
value.
e. The AvailableRooms collection is created. This is simply the RoomTimeSuggestions collection
of attendee availabilities with two additional columns added to it: "Address" and "Name".
"Address" is the email address of the room, and "Name" is the name of the room.
f. Then, the AvailableRoomsOptimal collection is created. This is just the AvailableRooms
collection with the "Availability" and "Attendee" columns removed. Doing this matches the
schemas of AvailableRoomsOptimal and AllRooms. This allows you to use both collections in
the Items property of the RoomBrowseGallery.
g. _roomListSelected is set to false.
5. The loading state, _loadingRooms, is set to false once everything else has finished executing.

Room browse gallery

Property: Items
Value: Logically set to two internal collections of identical schema, depending on whether the user has
selected a room list or has rooms lists in their tenant:

Search(
If( _roomListSelected || _noRoomLists, AvailableRoomsOptimal, RoomsLists ),
Trim(TextMeetingLocation1.Text),
"Name",
"Address"
)

This gallery displays the AvailableRoomsOptimal collection if _roomListSelected or _noRoomLists is


true. Otherwise, it displays the RoomsLists collection. This can be done because the schema of these
collections are identical.
Property: Visible
Value: _showDetails && !IsBlank( _selectedMeetingTime ) && !_loadingRooms

The gallery is visible only if the three preceding statements evaluate to true.
RoomBrowseGallery Title
Property: OnSelect
Value: A set of logically bound Collect and Set statements, which might or might not be triggered,
depending on whether the user is viewing room lists or rooms:

UpdateContext( { _loadingRooms: true } );


If( !_roomListSelected && !noRoomLists,
Set( _roomListSelected, true );
Set( _selectedRoomList, ThisItem.Name );
ClearCollect( AllRooms, 'Office365'.GetRoomsInRoomList( ThisItem.Address ).value );
Set( _allRoomsConcat, Concat( FirstN( AllRooms, 20 ), Address & ";" ) );
ClearCollect( RoomTimeSuggestions,
'Office365'.FindMeetingTimes(
{
RequiredAttendees: _allRoomsConcat,
MeetingDuration: MeetingDurationSelect.Selected.Minutes,
Start: _selectedMeetingTime.StartTime & "Z",
End: _selectedMeetingTime.EndTime & "Z",
MinimumAttendeePercentage: "1",
IsOrganizerOptional: "false",
ActivityDomain: "Unrestricted"
}
).MeetingTimeSuggestions
);
ClearCollect( AvailableRooms,
AddColumns(
AddColumns(
Filter(
First( RoomTimeSuggestions ).AttendeeAvailability,
Availability = "Free"
),
"Address", Attendee.EmailAddress.Address
),
"Name", LookUp( AllRooms, Address = Attendee.EmailAddress.Address ).Name
)
);
ClearCollect( AvailableRoomsOptimal,
DropColumns(
DropColumns( AvailableRooms, "Availability" )
),
"Attendee" )
),
Set( _selectedRoom, ThisItem )
);
UpdateContext( {_loadingRooms: false} )

The actions that occur when this control is selected depend on whether a user is currently viewing a set of
room lists or a set of rooms. If it's the former, then selecting this control retrieves the rooms that are
available at the selected time from the selected room list. If it's the latter, selecting this control sets the
_selectedRoom variable to the selected item. The preceding statement is very similar to the Select
statement for FindMeetingTimesGallery Title.
At a low level, the preceding code block:
1. Turns the loading state for the rooms on by setting _loadingRooms to true.
2. Checks to see if a room list has been selected, and if the tenant has room lists. If so:
a. Sets _roomListSelected to true and sets _selectedRoomList to the selected item.
b. The _allRoomsConcat variable is set to a semicolon-separated string of the first 20 email
addresses of the rooms in the AllRooms collection. This is because the
Office365.FindMeetingTimes operation is limited to searching for the available times of 20
person objects in a single operation.
c. The RoomTimeSuggestions collection uses the Office365.FindMeetingTimes operation to
retrieve the availabilities of the first 20 rooms in the AllRooms collection, based on the time
values from the _selectedMeetingTime variable. Note that & "Z" is used to properly format
the DateTime value.
d. The AvailableRooms collection is created. This is simply the RoomTimeSuggestions collection
of attendee availabilities with two additional columns added to it: "Address" and "Name".
"Address" is the email address of the room, and "Name" is the name of the room.
e. Then, the AvailableRoomsOptimal collection is created. This is just the AvailableRooms
collection with the "Availability" and "Attendee" columns removed. Doing this matches the
schemas of AvailableRoomsOptimal and AllRooms. This allows you to use both collections in
the Items property of RoomBrowseGallery.
f. _roomListSelected is set to false.
3. The loading state, _loadingRooms, is set to false once everything else has finished executing.

Back chevron

Property: Visible
Value: _roomListSelected && _showDetails

This control is visible only if both a room list has been selected and the Schedule tab is selected.
Property: OnSelect
Value: Set( _roomListSelected, false )

When _roomListSelected is set to false, it changes the RoomBrowseGallery control to display items
from the RoomsLists collection.
Send icon

Property: DisplayMode
Value: Logic to force user to input certain meeting details before the icon becomes editable.

If( Len( Trim( TextMeetingSubject1.Text ) ) > 0


&& !IsEmpty( MyPeople ) && !IsBlank( _selectedMeetingTime ),
DisplayMode.Edit, DisplayMode.Disabled
)

The icon is selectable only if the meeting subject is filled out, there is at least one attendee for the meeting,
and a meeting time has been selected. Otherwise, it's disabled.
Property: OnSelect
Value: Code to send the meeting invite to your selected attendees and clear all the input fields:

Set( _myCalendarName, LookUp( 'Office365'.CalendarGetTables().value, DisplayName = "Calendar" ).Name );


Set( _myScheduledMeeting,
'Office365'.V2CalendarPostItem( _myCalendarName,
TextMeetingSubject1.Text,
Text(DateAdd(DateTimeValue( _selectedMeetingTime.StartTime), -TimeZoneOffset(), Minutes) ),
Text(DateAdd(DateTimeValue( _selectedMeetingTime.EndTime), -TimeZoneOffset(), Minutes) ),
{
RequiredAttendees: Concat( MyPeople, UserPrincipalName & ";" ) & _selectedRoom.Address,
Body: TextMeetingMessage1.Text,
Location: _selectedRoom.Name,
Importance: "Normal",
ShowAs: "Busy",
ResponseRequested: true
}
)
);
Concurrent(
Reset( TextMeetingLocation1 ),
Reset( TextMeetingSubject1 ),
Reset( TextMeetingMessage1 ),
Clear( MyPeople ),
Set( _selectedMeetingTime, Blank() ),
Set( _selectedRoomList, Blank() ),
Set( _selectedRoom, Blank() ),
Set( _roomListSelected, false )
)

At a low level, this code block:


1. Sets _myCalendarName to the calendar in the Office365.CalendarGetTables() operation with a
DisplayName of "Calendar."
2. Schedules the meeting with all of the input values from the various selections the user made throughout
the screen using the Office365.V2CalendarPostItem operation.
3. Resets all of the input fields and variables used in creating the meeting.

NOTE
Depending on your region, the calendar you want might not have a display name of "Calendar." Go to Outlook to see what
the title of your calendar is, and make the appropriate change in the app.

Next steps
Learn more about this screen
Learn more about the Office 365 Outlook connector in Power Apps
Learn more about the Office 365 Users connector in Power Apps
Overview of the people-screen template for canvas
apps
12/3/2019 • 4 minutes to read • Edit Online

In a canvas app, add a people screen that lets users search for people within their organizations. Users can search
for, select, and add people to a collection. You can change which types of data appear in the search result gallery,
use your people selections to send an email, and make other customizations.
You can also add other template-based screens that show different data from Office 365, such as email, a user's
calendar, and availability of people users might want to invite to a meeting.
This overview teaches you:
How to use the default people screen.
How to modify the screen.
How to integrate the screen into apps.
For a deeper dive into this screen's default functionality, see the people-screen reference.

Prerequisite
Familiarity with how to add and configure screens and other controls as you create an app in Power Apps.

Default functionality
To add a people screen from the template:
1. Sign in to Power Apps, and then create an app or open an existing app in Power Apps Studio.
This topic shows a phone app, but the same concepts apply to a tablet app.
2. On the Home tab of the ribbon, select New screen > People.
By default, the screen looks similar to this:
3. To start searching for users, select the text input box at the top and start typing a coworker's name. The
search results appear below the text input box:
4. When you select individuals from the search results, they are added to the MyPeople collection. The
search bar input value is reset, revealing the collection of people you've selected:
Modify the screen
You can modify the default functionality of this screen by showing different data for people.
If you want to modify the screen further, use the people-screen reference as a guide.
Show different data for people
This screen uses the Office365Users.SearchUser operation to search for users in your org. It provides additional
fields for each event beyond what appears in the UserBrowseGallery control. Adding or changing fields in the
gallery is a simple process:
1. In the UserBrowseGallery, select a label to modify (or add one and keep it selected).
2. With its Text property selected, in the formula bar, replace the contents with ThisItem.

IntelliSense shows a list of fields that you can select.


3. Select the field that you want.
The Text property should update to ThisItem.{FieldSelection} .

Integrate the screen into an app


The people screen is a powerful bundle of controls in its own right, but it usually performs best as part of a larger,
more versatile app. You can integrate this screen into a larger app in a number of ways, including using your
cached list of people.
Use your cached list of people
The people screen caches your people selections in the MyPeople collection. Should your business scenario call
for a person lookup, you will need to know how to use this collection. Here, you'll walk through how to connect
this screen to a rudimentary email screen and send emails to users in the MyPeople collection. You'll also gain
insight into how the email-screen works.
1. Add the Office 365 Outlook data source to your app by selecting the View tab, selecting Data sources >
Add data source, and looking for the Office 365 Outlook connector. You might have to select New
connection to find it.
2. After inserting the people screen, insert a new blank screen. Within that screen, add a back-arrow icon, two
text-input boxes, and a send icon.
3. Rename the screen to EmailScreen, the back-arrow icon to BackIcon, one text-input box to SubjectLine,
the other to MessageBody, and the send icon to SendIcon.
4. Set the OnSelect property of BackIcon to Back() .
5. Set the OnSelect property of SendIcon to this formula:

Office365.SendEmail(
Concat( MyPeople, UserPrincipalName & ";" ),
SubjectLine.Text,
MessageBody.Text
)

Here, you're using the Outlook connector to send an email. You pass it
Concat(MyPeople, UserPrincipalName & ";") as the list of recipients. This formula concatenates all of the
email addresses in the MyPeople collection into a single string with semicolons separating them. This is
no different from writing out a string of email addresses separated by semicolons in the "To" line of your
favorite email client.
You're passing SubjectLine.Text as the subject of the message, and MessageBody.Text as the body of
the message.
6. On the people screen, in the upper-right corner, insert the Mail icon. Change the icon color to whatever
suits you.
7. Set the OnSelect property of the SendIcon to Navigate( EmailScreen, None ) .
You now have a two-screen app in which you can select users, compose an email message to them, and
then send it. Feel free to test it out, but be careful, because the app sends emails to everyone you add to the
MyPeople collection.

Next steps
View the reference documentation for this screen.
Learn more about the Office 365 Outlook connector.
Learn more about the Office 365 Users connector.
Reference information about the people-screen
template for canvas apps
12/3/2019 • 2 minutes to read • Edit Online

For canvas apps in Power Apps, understand how each significant control in the people-screen template
contributes to the screen's overall default functionality. This deep dive presents behavior formulas and the values
of other properties that determine how the controls respond to user input. For a high-level discussion of this
screen's default functionality, see the people-screen overview.
This topic highlights some significant controls and explains the expressions or formulas to which various
properties (such as Items and OnSelect) of these controls are set:
Text search box
User-browse gallery (+ child controls)
People added gallery (+ child controls)

Prerequisite
Familiarity with how to add and configure screens and other controls as you create an app in Power Apps.

Text search box

A couple other controls interact or have a dependency on the text search box:
If a user starts typing any text, UserBrowseGallery becomes visible.
When a user selects a person within UserBrowseGallery, the search contents are reset.

User-browse gallery

Property: Items
Value: Logic to look up users when the user starts typing:

If( !IsBlank( Trim( TextSearchBox.Text ) ),


'Office365Users'.SearchUser(
{
searchTerm: Trim( TextSearchBox.Text ),
top: 15
}
)
)

The items of this gallery are populated by search results from the Office365.SearchUser operation. The operation
takes the text in Trim(TextSearchBox) as its search term and returns the top 15 results based on that search.
TextSearchBox is wrapped in a Trim() function because a user search on spaces is invalid.
The Office365Users.SearchUser operation is wrapped in an If(!IsBlank(Trim(TextSearchBox.Text)) ... ) function
because you only need to call the operation when the search box contains user-entered text. This improves
performance.
UserBrowseGallery Title control

Property: Text
Value: ThisItem.DisplayName
Displays the person's display name from their Office 365 profile.
Property: OnSelect
Value: Code to add the user to an app-level collection, and then select the user:

Concurrent(
Set( _selectedUser, ThisItem ),
Reset( TextSearchBox ),
If( Not( ThisItem.UserPrincipalName in MyPeople.UserPrincipalName ),
Collect( MyPeople, ThisItem )
)
)

Selecting this control does three things concurrently:


Sets the _selectedUser variable to the item selected.
Resets the search term in TextSearchBox.
Adds the selected item to the MyPeople collection, a collection of all the people the app user has selected.
UserBrowseGallery ProfileImage control
Property: Image
Value: Logic to retrieve a user's profile photo.

If( !IsBlank( ThisItem.Id ) &&


'Office365Users'.UserPhotoMetadata( ThisItem.Id ).HasPhoto,
'Office365Users'.UserPhoto( ThisItem.Id )
)

The Image control retrieves the user's image with the Office365Users.UserPhoto operation. However, before
doing that, it checks for two things:
Whether the ID field is empty or not empty. This prevents the Image control from trying to retrieve a user
photo before the gallery has been populated with search results.
Whether the user has a photo (with the Office365Users.UserPhotoMetadata operation). This prevents the
Office365Users.UserPhoto lookup from returning an exception if the user doesn't have a profile picture.

Note that if an image isn't retrieved, the Image control is blank, and the iconUser control is visible instead.

People-added gallery

Property: Items
Value: MyPeople
This is the collection of people initialized or added to by selecting the UserBrowseGallery Title control.
PeopleAddedGallery Title control

Property: OnSelect
Value: Set( _selectedUser, ThisItem )

Sets the _selectedUser variable to the item selected in EmailPeopleGallery.


PeopleAddedGallery iconRemove control

Property: OnSelect
Value: Remove( MyPeople, LookUp( MyPeople, UserPrincipalName = ThisItem.UserPrincipalName ) )

Looks up the record in the MyPeople collection, where UserPrincipalName matches the UserPrincipalName
of the selected item, and then removes that record from the collection.

Next steps
Learn more about this screen.
Learn more about the Office 365 Outlook connector.
Learn more about the Office 365 Users connector.
Show a list of items in Power Apps
12/3/2019 • 3 minutes to read • Edit Online

Show a list of items from any data source by adding a Gallery control to your canvas app. This topic uses Excel
as the data source. Filter the list by configuring the Gallery control to show only those items that match the filter
criterion in a Text input control.

Prerequisites
Learn how to add and configure a control in Power Apps.
Set up the sample data:
1. Download this Excel file, which contains sample data for this tutorial.
2. Upload the Excel file to a cloud-storage account, such as OneDrive for Business.
Open a blank app:
1. Sign in to Power Apps.
2. Under Make your own app, select Canvas app from blank.
3. Specify a name for your app, select Phone, and then select Create.
4. If the Welcome to Power Apps Studio dialog box appears, select Skip.
5. Add a connection to the FlooringEstimates table in the Excel file.

Add a gallery to a blank screen


1. On the Insert tab, select Gallery, and then select Vertical.

2. On the Properties tab of the right-hand pane, open the Items list, and then select Flooring Estimates.
3. (optional) In the Layout list, select a different option.

Add a gallery in a screen


1. On the Home tab, select New screen > List screen.
A screen that contains a Gallery control and other controls, such as a search bar, appears.
2. Set the gallery's Items property to FlooringEstimates .
The Gallery control shows the sample data.
Add a control to the Gallery control
Before you do any other customization, ensure that the layout for your Gallery control most closely matches
what you want. From there, you can further modify the Gallery template, which determines how all data in the
Gallery control appears.
1. Select the template by clicking or tapping near the bottom of the Gallery control and then selecting the
pencil icon in its upper-left corner.

2. With the template still selected, add a Label control, and then move and resize it so that it doesn't overlap
with other controls in the template.
3. Select the gallery, and then select Edit next to Fields on the Properties tab of the right-hand pane.
4. Select the label that you added earlier in this procedure, and then open the highlighted list in the Data
pane.

5. In that list, click or tap Price.


The Gallery control shows the new values.
Filter and sort a gallery
The Items property of a Gallery control determines which items it shows. In this procedure, you configure that
property so that it also determines which records appear based on filter criteria and in what order.

1. Set the Items property of the Gallery control to this formula:

Sort
(If
(IsBlank(TextSearchBox1.Text),
FlooringEstimates,
Filter(
FlooringEstimates,
TextSearchBox1.Text in Text(Name)
)
),
Name,
If(
SortDescending1,
SortOrder.Descending,
SortOrder.Ascending
)
)

For more information about the functions in this formula, see the formula reference.
2. Double-click the search box, and then type part or all of a product name in it.
Only those items that meet the filter criterion appear.
3. While pressing the Alt key, select the sort icon one or more times to switch the sort order.
The records toggle between ascending and descending alphabetical order based on the product name.

Highlight the selected item


Set the Gallery control's TemplateFill property to a formula that's similar to this example, but you can specify
different colors if you want:
If(ThisItem.IsSelected, LightCyan, White)

Change the default selection


Set the Gallery control's Default property to the record that you want to select by default. For example, you can
specify the fifth item in the FlooringEstimates data source:
Last(FirstN (FlooringEstimates, 5))
In this example, you specify the first item in the Hardwood category of the FlooringEstimates data source:
First(Filter(FlooringEstimates, Category = "Hardwood"))

Next steps
Learn how to work with forms and formulas.
Show items of different heights in a Power Apps
gallery
12/2/2019 • 2 minutes to read • Edit Online

If different items in your data set contain different amounts of data in the same field, you can completely show
items that contain more data without adding empty space after items that contain less data. Add and configure a
Flexible height gallery control so that you can:
Configure Label controls to expand or shrink based on their contents.
Position each control so that it automatically appears just under the control above it.
In this tutorial, you show data about flooring products in a Flexible height gallery control. The image of each
product appears 5 pixels below the overview, whether the overview contains five lines of text or two lines.

Suggested reading
If you've never added controls to a gallery, follow the steps in Show a list of items before you proceed in this topic.

Add data to a blank app


1. Download this Excel file, which contains names, overviews, and links to images of flooring products.

2. Upload the Excel file to a cloud-storage account such as OneDrive, Dropbox, or Google Drive.
3. In Power Apps Studio, click or tap New on the File menu.
4. On the Blank app tile, click or tap Phone layout.

5. Add a connection to the FlooringEstimates table in the Excel file.


For more information, see Add a connection.

Add data to a gallery


1. On the Insert tab, click or tap Gallery, and then click or tap Flexible height.

2. Resize the gallery to take up the entire screen.


3. Set the gallery's Items property to FlooringEstimates.

Show the product names


1. In the upper-left corner of the gallery, click or tap the pencil icon to select the gallery template.

2. With the gallery template selected, add a Label control to it.


3. Set the Text property of the Label control to this expression:
ThisItem.Name
Show the product overviews
1. With the gallery template selected, add another Label control, and move it below the first Label control.
2. Set the Text property of the second Label control to this expression:
ThisItem.Overview
3. With the second Label control selected, click or tap the name-tag icon on the Content tab, and rename the
control to OverviewText.

4. Set the AutoHeight property of the OverviewText box to true.


This step ensures that the box will grow or shrink to fit its contents.
Show the product images
1. Resize the template so that it's twice as tall as it was.
You can add controls to the template more easily as you build the app, and this change won't affect how the
app looks when it runs.
2. With the gallery template selected, add an Image control, and move it below the OverviewText box.
3. Ensure that the Image property of the Image control is set to this expression:
ThisItem.Image
4. Set the Y property of the Image control based on the position and the size of the OverviewText box, as in
this expression:
OverviewText.Y + OverviewText.Height + 5

Apply the same concept if you want to add more controls: set each control's Y property based on the Y and Height
properties of the control above it.

Next steps
Learn more about how to work with a gallery control and formulas.
Show, edit, or add a record in a canvas app
12/3/2019 • 2 minutes to read • Edit Online

In a canvas app, add and configure a Display form control to show all fields in a record, You can also add and
configure an Edit form control to edit any field in a record, add a record, and save your changes back to a data
source.

Prerequisites
Learn how to add and configure a control in Power Apps.
Download this Excel file, which contains sample data for this tutorial.
Upload the Excel file to a cloud-storage account, such as OneDrive for Business.
Create or open an app for phones, add a connection to the FlooringEstimates table in the Excel file.
You can add a form to a tablet app, but it won't match this topic because the form will have three columns
by default.
If you open an existing app, add a screen to it.

Add a form, and show data


1. On a blank screen, add a Drop down control, and name it ChooseProduct.

NOTE
If you're not sure how to add a control, rename it, or set a property, see Add and configure controls.

2. On the Properties tab of the right-hand pane, set Items to FlooringEstimates and Value to Name .

The list shows names of flooring products from the data source.
3. Add an Edit form control, move it below ChooseProduct, and then resize the form to cover most of the
screen.
NOTE
This topic describes the Edit form control, but similar principles apply to the Display form control.

4. Set the form's DataSource property to FlooringEstimates and its Item property to this formula:
First(Filter(FlooringEstimates, Name=ChooseProduct.Selected.Value))

This formula specifies that, after you finish configuring the form, it will show the record that the user
selects in ChooseProduct.
5. On the Properties tab of the right-hand pane, select Edit fields.

6. In the Fields pane, select Add field, select the check box for each field, and then select Add.
7. Select the ellipsis (...) next to Add field, select Collapse all, and then drag Name to the top of the list.

The Edit form control reflects your change.


Set the card type for a field
1. In the Fields pane, expand the Price field by selecting its down arrow.
2. Open the Control type list, and then select Edit slider.

In the form, the Price field shows a Slider control instead of a Text input control.
3. (optional) Follow the same process to change the control for the Overview field to an Edit multi-line
text control.

(Edit form only) Save changes


1. Rename the form EditForm.
2. Add a Button control, and set its OnSelect property to this formula:
SubmitForm(EditForm)

3. Press F5 to open Preview, change the name of a product, and then select the button that you created.
The SubmitForm function saves your changes to the data source.
4. (optional) Close Preview by pressing Esc (or by selecting the close icon in the upper-right corner).

Next steps
Learn more about working with forms and formulas.
Understand canvas-app forms in Microsoft Power
Apps
12/3/2019 • 20 minutes to read • Edit Online

Add three types of controls to a canvas app so that the user can browse for a record, display details about that
record, and edit or create a record:

ACTIVITY CONTROL DESCRIPTION

Browse for a record Gallery control Filter, sort, search, and scroll through
records in a data source, and select a
specific record. Display only a few fields
from each record to show several
records at a time, even on a small
screen.

Show details of a record Display form control For a single record, display many or all
fields in that record.

Edit or create a record Edit form control Update one or more fields in a single
record (or create a record starting with
default values), and save those
changes back to the underlying data
source.

Put each control on a different screen to make them easier to distinguish:

As this topic describes, combine these controls with formulas to create the overall user experience.

Prerequisites
Sign up for Power Apps, and then sign in by providing the same credentials that you used to sign up.
Learn how to configure a control in Power Apps.

Explore a generated app


Power Apps can automatically generate an app based on a data source that you specify. Each app contains three
screens with the controls described earlier and formulas that connect them. Run these apps "out of the box,"
customize them for your specific goals, or examine how they work so that you can learn useful concepts that
apply to your own apps. In the following sections, inspect the screens, controls, and formulas that drive a
generated app.
Browse screen

This screen features these key formulas:

CONTROL SUPPORTED BEHAVIOR FORMULA

BrowseGallery1 Display records from the Assets data The Items property of the gallery is
source. set to a formula that's based on the
Assets data source.

ImageNewItem1 Display the Edit and Create screen The OnSelect property of the image is
with each field set to a default value, set to this formula:
so that the user can easily create a NewForm( EditForm1 );
record. Navigate( EditScreen1, None )

NextArrow1 (in the gallery) Display the Details screen to view The OnSelect property of the arrow is
many or all fields of the currently set to this formula:
selected record. Navigate( DetailScreen1, None )
The primary control on this screen, BrowseGallery1, covers most of the area of the screen. The user can scroll
through the gallery to find a specific record to display more fields or to update.
Set the Items property of a gallery to show records from a data source in it. For example, set that property to
Assets to show records from a data source of that name.

NOTE
In a generated app, Items is set to a significantly more complicated formula by default so that the user can sort and
search for records. You'll learn how to build that formula later in this topic; the simpler version is enough for now.

Instead of finding a record to display or edit, the user can create a record by selecting the "+" symbol above the
gallery. Create this effect by adding an Image control, showing a "+" symbol in it, and setting its OnSelect
property to this formula:
NewForm ( EditForm1 ); Navigate( EditScreen1, None )
This formula opens the Edit and Create screen, which features an Edit form control named EditForm1. The
formula also switches that form into New mode, in which the form shows default values from the data source
so that the user can easily create a record from scratch.
To examine any control that appears in BrowseGallery1, select that control in the first section of that gallery,
which serves as a template for all other sections. For example, select the middle Label control on the left edge:

In this example, the control's Text property is set to ThisItem.AssignedTo, which is a field in the Assets data
source. The Text property of the other three Label controls in the gallery are set to similar formulas, and each
control shows a different field in the data source.
Select the Shape control (the arrow ), and confirm that its OnSelect property is set to this formula:
Navigate( DetailScreen1, None )
If the user finds a record in BrowseGallery1, the user can select the arrow for that record to show more
information about it in DetailScreen1. By selecting an arrow, the user changes the value of the Selected
property of BrowseGallery1. In this app, that property determines which record appears in not only
DetailScreen1 but also, if the user decides to update the record, the Edit and Create screen.
Detail screen

This screen features these key formulas:

CONTROL SUPPORTED BEHAVIOR FORMULA

DetailForm1 Displays a record in the Assets data Set the DataSource property to
source Assets.

DetailForm1 Determines which record to display. In Set the Item property of this control
a generated app, displays the record to this value:
that the user selected in the gallery. BrowseGallery1.Selected

Card controls In a Display form control, displays a Set the DataField property to the
single field in a record. name of a field, enclosed in double
quotation marks (for example,
"Name").

ImageBackArrow1 When the user selects this control, Set the OnSelect property to this
opens BrowseScreen1. formula:
Back()

ImageDelete1 When the user selects this control, Set the OnSelect property to this
deletes a record. formula:
Remove( Assets,
BrowseGallery1.Selected )

ImageEdit1 When the user selects this control, Set the OnSelect property to this
opens the Edit and Create screen to formula:
the current record. Navigate( EditScreen1, None )

At the top of the screen, three images sit outside of DetailForm1 and act as buttons, orchestrating between the
three screens of the app.
DetailForm1 dominates this screen and displays the record that the user selected in the gallery (because the
form's Item property is set to BrowseGallery1.Selected). The DataSource property of the form also
provides metadata about the data source, such as a user-friendly display name for each field.
DetailForm1 contains several Card controls. You can select either the Card control itself or the control that it
contains to discover additional information.

The DataField property of a Card control determines which field the card displays. In this case, that property is
set to AssetID. The card contains a Label control for which the Text property is set to Parent.Default. This
control shows the Default value for the card, which is set through the DataField property.
In a generated app, Card controls are locked by default. When a card is locked, you can't modify some
properties, such as DataField, and the formula bar is unavailable for those properties. This restriction helps
ensure that your customizations don't break the basic functionality of the generated app. However, you can
change some properties of a card and its controls in the right-hand pane:
In the right-hand pane, you can select which fields to display and in which kind of control each field displays.
Edit/Create screen

This screen features these key formulas:


CONTROL SUPPORTED BEHAVIOR FORMULA

EditForm1 Displays a record in the Assets data Set the DataSource property to
source. Assets.

EditForm1 Determines which record to display. In Set the Item property to this value:
a generated app, displays the record BrowseGallery1.Selected
that the user selected in
BrowseScreen1.

Card controls In a Edit form control, provides Set the DataField property to the
controls so that the user can edit one name of a field, enclosed in double
or more fields in a record. quotation marks (for example,
"Name").

ImageCancel1 When the user selects this control, Set the OnSelect property to this
discards any changes in progress, and formula:
opens the Details screen. ResetForm( EditForm1 ); Back()

ImageAccept1 When the user selects this control, Set the OnSelect property to this
submits changes to the data source. formula:
SubmitForm( EditForm1 )

EditForm1 If changes are accepted, returns to the Set the OnSuccess property to this
previous screen. formula:
Back()

EditForm1 If changes aren't accepted, remain on Leave the OnFailure property blank.
the current screen so that the user can
fix any issues and try to submit again.

LblFormError1 If changes aren't accepted, shows an Set the Text property to this value:
error message. EditForm1.Error

As in the Details screen, a form control, named EditForm1, dominates the Edit and Create screen. In
addition, the Item property of EditForm1 is set to BrowseGallery1.Selected, so the form displays the record
that the user selected in BrowseScreen1. While the Details screen shows each field as read-only, the user can
update the value of one or more fields by using the controls in EditForm1. It also uses the DataSource
property to access metadata about this data source, such as the user-friendly display name for each field and
the location where changes should be saved.
If the user selects the "X" icon to cancel an update, the ResetForm function discards any unsaved changes, and
the Back function opens the Details screen. Both the Details screen and the Edit and Create screen show the
same record until the user selects a different one on BrowseScreen1. The fields in that record remain set to the
values that were most recently saved, not any changes that the user made and then abandoned.
If the user changes one or more values in the form and then selects the "checkmark" icon, the SubmitForm
function sends the user's changes to the data source.
If the changes are successfully saved, the form's OnSuccess formula runs, and the Back() function opens
the detail screen to show the updated record.
If the changes aren't successfully saved, the form's OnFailure formula runs, but it doesn't change anything
because it's blank. The Edit and Create screen remains open so that the user can either cancel the changes
or fix the error. LblFormError1 shows a user-friendly error message, to which the form's Error property is
set.
As with a Display form control, an Edit form control contains Card controls, which contain other controls that
show different fields in a record:

In the previous image, the selected card shows the AssetID field and contains a Text input control so that the
user can edit the value of that field. (In contrast, the detail screen shows the same field in a Label control, which
is read-only.) The Text input control has a Default property, which is set to Parent.Default. If the user were
creating a record instead of editing one, that control would show an initial value that the user can change for
the new record.
In the right-hand pane, you can show or hide each card, rearrange them, or configure them to show fields in
different types of controls.
Build an app from scratch
By understanding how Power Apps generates an app, you can build one yourself that uses the same building
blocks and formulas discussed earlier in this topic.

Identify test data


To get the most from this topic, start with a data source with which you can experiment. It should contain test
data that you can read and update without concern.

NOTE
If you use a SharePoint list or an Excel table that contains column names with spaces as your data source, Power Apps
will replace the spaces with "_x0020_". For example, "Column Name" in SharePoint or Excel will appear as
"Column_x0020_Name" in Power Apps when displayed in the data layout or used in a formula.

To follow the rest of this topic exactly, create a SharePoint list named "Ice Cream" that contains this data:
Create an app from blank, for phones, and connect it to your data source.

NOTE
Tablet apps are very similar, but you may want a different screen layout to make the most of the extra screen
space.

The examples in the rest of the topic are based on a data source named Ice Cream.

Browse records
Get a quick piece of information from a record by finding it in a gallery on a browse screen.
1. Add a Vertical gallery, and change the layout to Title only.
2. Set the gallery's Items property to Ice Cream.
3. Set the Text property of the first label in the gallery to ThisItem.Title if it's set to something else.
The label now shows the value in the Title field for each record.
4. Resize the gallery to fill the screen, and set its TemplateSize property to 60.
The screen resembles this example, which shows all records in the data source:
View details
If the gallery doesn't show the information that you want, select the arrow for a record to open the details
screen. A Display form control on that screen shows more, possibly all, fields for the record that you selected.
The Display form control uses two properties to display the record:
DataSource property. The name of the data source that holds the record. This property populates the right-
hand panel with fields and determines the display name and data type (string, number, date, etc.) of each
field.
Item property. The record to display. This property is often connected to the Selected property of the
Gallery control so that the user can select a record in the Gallery control and then drill into that record.
When the DataSource property is set, you can add and remove fields through the right-hand pane and change
how they're displayed.
On this screen, users can't intentionally or accidentally change any values of the record. The Display form
control is a read-only control, so it won't modify a record.
To add a Display form control:
1. Add a screen, and then add a Display form control to it
2. Set the DataSource property of the form control to 'Ice Cream'.
In the right-hand pane, you can select the fields to display on your screen and which type of card to display for
each field. As you make changes in the right-hand pane, the DataField property on each Card control is set to
the field that the user will interact with. Your screen should resemble this example:

Finally, we need to connect the Display form control to the Gallery control so that we can look at details for a
specific record. As soon as we complete setting the Item property, the first record from the gallery will appear
in our form.
Set the Item property of the Display form control to Gallery1.Selected.
The details for the selected item appear in the form.
Great! We now turn to navigation: how a user opens the details screen from the gallery screen and opens the
gallery screen from the details screen.
Add a Button control to the screen, set its Text property to show Back, and set its OnSelect property
to Back().
This formula returns the user back to the gallery when they finish viewing details.

Now, let's return to the Gallery control and add some navigation to our detail screen.
1. Switch to the first screen, which is hosting our Gallery control, and select the arrow in the first item in
the gallery.
2. Set the OnSelect property of the shape to this formula:
Navigate( Screen2, None )

3. Press F5, and then select an arrow in the gallery to show the details for an item.
4. Select the Back button to return to the gallery of products, and then press Esc.

Editing details
Finally, our last core activity is changing the contents of a record, which users accomplish in an Edit form
control.
The Edit form control uses two properties to display and edit the record:
DataSource property. The name of the data source that holds the record. Just as with the Display form
control, this property populates the right-hand panel with fields and determines the display name and data
type (string, number, date, etc.) for each field. This property also determines whether each field's value is
valid before submitting it to the underlying data source.
Item property. The record to edit, which is often connected to the Selected property of the Gallery control.
That way, you can select a record in the Gallery control, show it in the details screen, and edit it in the Edit
and Create screen.
To add an Edit form control:
1. Add a screen, add an Edit form control, and then set the form's DataSource property to 'Ice Cream'.
2. Set the Item property to Gallery1.Selected.
You can now select the fields to display on your screen. You can also select which type of card to display for
each field. As you make changes in the right-hand pane, the DataField property on each Card control is set to
the field your user will interact with. Your screen should resemble this example:

These two properties are the same as the properties on the Display form control. And with these alone, we
can display the details of a record.
The Edit form control goes further by offering the SubmitForm function to write back changes to the data
source. You use this with a button or image control to save a user's changes.
Add a Button control, set its Text property to show Save, and set its OnSelect property to this formula:
SubmitForm ( Form1 )
To add navigation to and from this screen:
1. Add another Button control, set its Text property to show Cancel, and set its OnSelect property to this
formula:
ResetForm ( Form1 ); Back()
This formula discards any unsaved edits and opens the previous screen.

2. Set the OnSuccess property of the form to Back().


When updates are successfully saved, the previous screen (in this case, the details screen) opens
automatically.

3. On the Display screen, add a button, set its Text property to show Edit, and set its OnSelect property
to this formula:
Navigate( Screen3, None )

You've built a basic app with three screens for viewing and entering data. To try it out, show the gallery screen,
and then press F5 (or select the forward arrow "Preview" button near the upper-left corner of the screen). The
pink dot indicates where the user clicks or taps the screen at each step.
Create a record
The user interacts with the same Edit form to both update and create records. When the user wants to create a
record, the NewForm function switches the form to New mode.
When the form is in New mode, the value of each field is set to the defaults of the data source. The record
that's provided to the form's Item property is ignored.
When the user is ready to save the new record, SubmitForm runs. After the form is successfully submitted, the
form is switched back to EditMode.
On the first screen, you'll add a New button:
1. On the screen with the gallery, add a Button control.
2. Set the button's Text property to New and its OnSelect property to this formula:
NewForm ( Form1 ); Navigate( Screen3, None )
This formula switches the Edit form control on Screen3 to New mode and opens that screen so that
the user can fill it in.
When the Edit and Create screen opens, the form is empty, ready for the user to add an item. When the user
selects the Save button, the SubmitForm function ensures that a record is created instead of being updated. If
the user selects the Cancel button, the ResetForm function switches the form back to Edit mode, and the
Back function opens the screen for browsing the gallery.

Delete a record
1. On the Display screen, add a button, and set its Text property to show Delete..
2. Set the button's OnSelect property to this formula:
Remove( 'Ice Cream', Gallery1.Selected ); Back()
Handling errors
In this app, an error occurs when the value of a field is not valid, a required field is blank, you're disconnected
from the network, or any number of other problems pop up.
If SubmitForm fails for any reason, the Error property of the Edit form control contains an error message to
show the user. With this information, the user should be able to correct the issue and resubmit the change, or
they can cancel the update.
1. On the Edit and Create screen, add a Label control, and move it just below the Save button. Any error
will be easy to see after the user selects this control to save changes.
2. Set the Text property of the Label control to show Form1.Error.
In an app that Power Apps generates from data, the AutoHeight property on this control is set to true so that
no space is consumed if no error occurs. The Height and Y properties of the Edit form control are also
adjusted dynamically to account for this control growing when an error occurs. For more details, generate an
app from existing data, and inspect these properties. The text-box control for errors is very short when no error
has occurred, you may need to open the Advanced view (available on the View tab) to select this control.
Refresh data
The data source is refreshed whenever the user opens the app, but the user might want to refresh the records in
the gallery without closing the app. Add a Refresh button so that the user can select it to manually refresh the
data:
1. On the screen with the Gallery control, add a Button control and set its Text property to show Refresh.
2. Set the OnSelect property of this control to this formula:
Refresh( 'Ice Cream' )
Search and sort the gallery
In the app that Power Apps generated from data, we neglected to discuss two controls at the top of the Browse
screen. By using these controls, the user can search for one or more records, sort the list of records in
ascending or descending order, or both.

When the user selects the sort button, the sort order of the gallery reverses. To create this behavior, we use a
context variable to track the direction in which the gallery is sorted. When the user selects the button, the
variable is updated, and the direction reverses. The OnSelect property of the sort button is set to this formula:
UpdateContext( {SortDescending1: !SortDescending1} )
The UpdateContext function creates the SortDescending1 context variable if it doesn't already exist. The
function will read the value of the variable and set it to the logical opposite by using the ! operator. If the value
is true, it becomes false. If the value is false, it becomes true.
The formula for the Items property of the Gallery control uses this context variable, along with the text in the
TextSearchBox1 control:

Sort(
If( IsBlank(TextSearchBox1.Text),
Assets,
Filter( Assets, TextSearchBox1.Text in Text(ApproverEmail) )
),
ApproverEmail,
If(SortDescending1, Descending, Ascending)
)

Let's break this down:


On the outside, we have the Sort function, which takes three arguments: a table, a field on which to sort,
and the direction in which to sort.
The sort direction is taken from the context variable that toggles when the user selects the
ImageSortUpDown1 control. The true/false value is translated to the constants Descending and
Ascending.
The field to sort on is fixed to ApproverEmail. If you change the fields that appear in the gallery,
you'll need to change this argument too.
On the inside, we have the Filter function, which takes a table as an argument and an expression to
evaluate for each record.
The table is the raw Assets data source, which is the starting point before filtering or sorting.
The expression searches for an instance of the string in TextSearchBox1 within the ApproverEmail
field. Again, if you change the fields that appear in the gallery, you'll also need to update this
argument.
If TextSearchBox1 is empty, the user wants to show all records, and the Filter function is bypassed.
This is but one example; you can craft your own formula for the Items property, depending on the needs of
your app, by composing Filter, Sort, and other functions and operators together.

Screen design
So far, we haven't discussed other ways to distribute controls across screens. That's because you have many
options, and the best selection depends on your specific app's needs.
Because real estate on phone screens is so limited, you probably want to browse, display, and edit/create on
different screens. In this topic, the Navigate and Back functions open each screen.
On a tablet, you can browse, display, and edit/create on two or even one screen. For the latter, no Navigate or
Back function would be required.
If the user is working on the same screen, you need to be careful that the user can't change the selection in the
Gallery and potentially lose edits in the Edit form control. To keep the user from selecting a different record
when changes to another record haven't been saved yet, set the Disabled property of the gallery to this
formula:
EditForm.Unsaved
Understand data-form layout for canvas apps in
Power Apps
2/11/2020 • 14 minutes to read • Edit Online

Easily create an attractive and efficient form when you build a canvas app in Power Apps. For example, consider
this basic form for recording sales orders:

In this tutorial, we'll walk through the steps to create this form. We'll also look at some advanced topics, such as
dynamic sizing of fields to fill available space.

Before you start


If you're new to Power Apps (or have only generated apps automatically), you'll want to build an app from scratch
before you dive into this topic. By building an app from scratch, you'll become familiar with required concepts,
such as adding data sources and controls, that are mentioned but not explained in this topic.
This topic is written as though you have a data source that's named Sales order and that contains the fields in the
previous graphic. If you have a Power Apps Plan 2 license or a trial license and system administrator or system
customizer permissions, you can create an entity in Common Data Service and add similar fields.

Add a gallery
1. Create a tablet app from scratch, and add your data source.
Everything discussed in this topic also applies to phone layouts, but phone apps often have only one
vertical column.
2. Add a vertical Gallery control, and set its Items property to 'Sales order'.
(optional) To match the examples in this tutorial, change the gallery's Layout to show only Title and
subtitle.
3. In the gallery, click or tap SO004.

This record will appear in the form that you build by following steps later in this topic.

Add a title bar


1. Add a blank screen where you'll put the form.
Outside of this tutorial, you can put the Gallery and Edit form controls on the same screen, but you'll have
more room to work with if you put them on separate screens.
2. At the top of the new screen, add a Label control, and set its Text property to this expression:
"Sales Order " & Gallery1.Selected.SalesOrderId
The label shows the sales-order number of the record that you selected in the gallery.
3. (optional) Format the label as follows:
a. Set its Align property to Center.
b. Set its Size property to 20.
c. Set its Fill property to Navy.
d. Set its Color property to White.
e. Set its Width property to Parent.Width.
f. Set its X and Y properties to 0.

Add a form
1. Add an Edit form control, and then move and resize it to fill the screen under the label.
In the next step, you'll connect the form control to the Sales order data source by using the right-hand
pane, not the formula bar. If you use the formula bar, the form won't show any fields by default. You can
always show any fields that you want by selecting one or more check boxes in the right-hand pane.
2. In the right-hand pane, click or tap the down arrow next to No data source selected, and then click or tap
Sales order.
A default set of fields from the Sales order data source will appear in a simple, three-column layout.
However, many are blank, and they may take a few moments to settle into their final positions.
3. Set the form's Item property to Gallery1.Selected.
The form shows the record that you selected in the gallery, but the default set of fields might not match
what you want in your final product.
4. In the right-hand pane, hide each of these fields by clearing its checkbox:
Sales order ID
Account
Sales person
Account contact
5. Move the Order status field by dragging it to the left and then dropping it on the other side of the
Customer purchase order reference field.
Your screen should resemble this example:

Select a data card


Each field displayed has a corresponding data card on the form. This card comprises a set of controls for the field
title, an input box, a star (which appears if the field is required), and a validation error message.
You can also select cards directly on the form. When a card is selected, a black caption appears above it.
NOTE
To delete a card (not just hide it), select it, and then press Delete.

Arrange cards in columns


By default, forms in tablet apps have three columns, and those in phone apps have one. You can specify not only
how many columns a form has but also whether all cards should fit within column borders.
In this graphic, the number of columns in the form was changed from three to four with the Snap to columns
check box selected. The cards in the form were arranged automatically to fit the new layout.

Resize cards across multiple columns


Depending on the data in each card, you might want some cards to fit in a single column and other cards to span
multiple columns. If a card contains more data than you want to show in a single column, you can widen the card
by selecting it and then dragging the grab handle on the left or right border of its selection box. As you drag the
handle, the card will "snap" to column boundaries.
To make your design more flexible but retain some structure, you can increase the number of columns to 12. With
that change, you can easily configure each card to span the entire form, half of the form, one-third, one-quarter,
one-sixth, and so forth. Let's see this in action.
1. In the right-hand pane, set the number of columns in the form to 12.

The form doesn't visibly change, but you have more snap points as you drag the left or right grab handle.
2. Increase the width of the Order date card by dragging the grab handle on the right one snap point to the
right.
The card spans four of the form's 12 columns (or 1/3 of the form), instead of only three of the form's 12
columns (or 1/4 of the form). Whenever you increase a card's width by one snap point, the card spans an
additional 1/12 of the form.

3. Repeat the previous step with the Order status and Customer purchase order reference cards.

4. Resize the Name and Description cards to take up six columns (or 1/2) of the form.
5. Make the first two lines of the delivery address stretch entirely across the form:
All done. We have our desired form, mixing rows with different numbers of columns:

Manipulate controls in a card


The delivery address comprises several pieces of information that we want to visually group together for the user.
Each field will remain in its own data card, but we can manipulate the controls within the card to make them fit
better together.
1. Select the First line of Delivery address card, select the label within that card, and then delete the first
three words from the text.
2. Select the Second line of Delivery address card, select the label within that card, and then delete all of
the text in it.
It may be tempting to simply remove the label control and, in many cases, that will work fine. But formulas
might depend on that control being present. The safer approach is to remove the text or to set the Visible
property of the control to false.

3. In the same card, move the text input box over the label to reduce the space between the first and second
lines of the address.
The height of the card shrinks when its contents take up less space.

Now let's turn our attention to the third line of the address. Similar to what we just did, let's shorten the text of
each label for these cards and arrange the Text input box to be to the right of each label. Here are the steps for the
State card:

STEP DESCRIPTION RESULT

1 Select the State card so that grab


handles appear around it.
STEP DESCRIPTION RESULT

2 Select the label within this card so that


grab handles appear around it.

3 Place the cursor to the right of the text,


and then delete the portion that we
don't need.

4 Using the grab handles on the sides,


size the label control to fit the new text
size.

5 Select the text input control within this


card.

6 Using the grab handles on the sides,


size the text input control to the size
that you want.

7 Drag the text input box up and to the


right of the label control, and then drop
the text input box.

Our modifications to the State card are


now complete.

The result for the complete third address line:


Note that many of the cards start out with dynamic formulas for their properties. For example, the Text input
control that we resized and moved above had a Width property based on the width of its parent. When you move
or resize a control, these dynamic formulas are replaced with static values. If you want, you can restore the
dynamic formulas by using the formula bar.

Turning off Snap to columns


Sometimes you'll want finer control than the standard 12 columns can provide. For these cases, you can turn off
Snap to columns and then position cards manually. The form will continue snapping to 12 columns, but you can
also hold down the Alt or Ctrl+Shift keys after starting a resize or reposition to override the snap points. For more
details, see alternate behavior keyboard shortcuts.
In our example, the four components that make up the third line of the address all have exactly the same width.
But this may not be the best layout, as city names are longer than state abbreviations, and the Text input box for
countries/regions is short due to the length of its label. To optimize this space, turn off Snap to columns in the
right-hand pane and then hold down the Alt or Ctrl+Shift keys after starting to size and position these cards. For
After careful positioning, the result has appropriate sizes for each field and even spacing horizontally between
fields:

In summary, what are the differences when Snap to columns is on versus off?

BEHAVIOR SNAP TO COLUMNS ON SNAP TO COLUMNS OFF

Resize snaps to Number of columns you select: 12 columns


1, 2, 3, 4, 6, or 12

Resize snap can be overriden No Yes, with Alt or Ctrl+Shift keys after
starting the resize

Cards automatically re-layout between Yes No


rows (more on this later)

Set width and height


As with everything in Power Apps, the form's layout is governed by properties on the card controls. As already
described, you can change the values of these properties by dragging controls to different locations or dragging
grab handles to resize controls. But you'll discover situations in which you'll want to understand and manipulate
these properties more precisely, especially when making your forms dynamic with formulas.
Basic Layout: X, Y, and Width
The X and Y properties control the position of cards. When we work with controls on the raw canvas, these
properties provide an absolute position. In a form, these properties have a different meaning:
X: Order within a row.
Y: Row number.
Similar to controls on the canvas, the Width property specifies the minimum width of the card (more on the
minimum aspect in a moment).
Let's take a look at the X, Y, and Width properties of the cards in our form:

Overflowing rows
What happens if the cards on a row are too wide to fit on that row? Normally you don't need to worry about this
possibility. With Snap to columns on, these three properties will automatically be adjusted so that everything fits
nicely within rows without overflowing.
But with Snap to columns turned off or a formula-based Width on one or more of your cards, overflowing a
row can happen. In this case, the cards will automatically wrap so that, effectively, another row is created. For
example, let's manually change the Width property of our Customer purchase order reference card (first row,
third item) to 500:
The three cards on the top row no longer fit horizontally, and another row has been created to wrap the overflow.
The Y coordinate for all these cards is still the same at 0, and the Name and Description cards still have a Y of 1.
Cards that have different Y values aren't merged across rows.
You can use this behavior to create a fully dynamic layout, where cards are placed based on a Z -order, filling across
as much as possible before moving to the next row. To achieve this effect, give all the cards the same Y value, and
use X for the order of the cards.
Filling spaces: WidthFit
The overflow in the last example created a space after the Order status card, which was the second card in the
first row. We could manually adjust the Width properties of the two remaining cards to fill this space, but this
approach is tedious.
As an alternative, use the WidthFit property. If this property is set to true for one or more cards in a row, any
remaining space on the row will be evenly divided between them. This behavior is why we said earlier that the
Width property of a card is a minimum, and what is actually seen can be wider. This property will never cause a
card to shrink, only expand.
If we set WidthFit to true on the Order status card, it fills the available space, while the first card remains
unchanged:

If we also set WidthFit to true on the Order date card, both cards will evenly split the available space:

Note that grab handles on these cards take into account the extra width provided by WidthFit, not the minimum
width provided by the Width property. It can be confusing to manipulate the Width property while WidthFit is
turned on; you may want to turn it off, make changes to Width, and then turn it back on.
When might WidthFit be useful? If you have a field that is used only in certain situations, you can set its Visible
property to false, and the other cards on the row will automatically fill the space around it. You might want to use
a formula that shows a field only when another field has a particular value.
Here, we'll set the Visible property of the Order status field to a static false:

With the second card effectively removed, the third card can now return to the same row as the first card. The first
card still has WidthFit set to true, so it alone expands to fill the available space.
Because Order status is invisible, you can't select it as easily on the canvas. However, you can select any control,
visible or not, in the hierarchical list of controls on the left side of the screen.
Height
The Height property governs the height of each card. Cards have the equivalent of WidthFit for Height, and it's
always set to true. Imagine that a HeightFit property exists, but don't look for it in the product because such a
property isn't yet exposed.
You can't turn off this behavior, so changing the heights of cards can be challenging. All cards within a row appear
to be the same height as the tallest card. You might look at a row like this:

Which card is making the row tall? In the previous graphic, the Total amount card is selected and appears tall, but
its Height property is set to 80 (same as the height of the first row ). To reduce the height of a row, you must
reduce the Height of the tallest card in that row, and you can't identify the tallest card without reviewing the
Height property of each card.
AutoHeight
A card might also be taller than you expect if it contains a control for which the AutoHeight property is set to
true. For example, many cards contain a label that displays an error message if the field's value causes a validation
problem.
Without any text to display (no error), the label collapses to zero height. If you didn't know any better, you wouldn't
know it was there, and that's as it should be:
On the left side of the screen, the list of controls shows ErrorMessage1, which is our label control. As you update
an app, you can select this control to give it some height and show grab handles with which you can position and
size the control. The "A" in a blue box indicates that the control has AutoHeight set to true:

The Text property of this control is set to Parent.Error, which is used to obtain dynamic error information based
on validation rules. For illustration purposes, let's statically set the Text property of this control, which will increase
its height (and, by extension, the height of the card) to accommodate the length of the text:

Let's make the error message a little longer, and again the control and the card grow to accommodate. Note that
the row overall grows in height, retaining vertical alignment between the cards:
Understand data cards in Power Apps
12/3/2019 • 8 minutes to read • Edit Online

Card controls are the building blocks of the Edit form and Display form controls in canvas apps. The form
represents the entire record, and each card represents a single field of that record.
You can interact with cards most easily in the right-hand pane after you select a form control in the design
workspace. In that pane, you can choose which fields to show, how to show each field, and in what order to show
them. This example shows an Edit form control in an app built from a SharePoint list that's named Assets.

To get started with cards, see add a form and understand data forms. The remainder of this topic goes into more
detail about how cards work and how you can customize or even create your own.

Predefined cards
Power Apps offers a predefined set of cards for strings, numbers, and other data types. In the right-hand pane, you
can see the variations available and change the card used for a field:
In this example, a single-line text card is selected, but the URL's text is longer than can be shown on a single line.
Let's change this to a multi-line text card to give our users more room to edit:

Several fields of this data source aren't being shown, but you can show or hide a field by selecting its checkbox.
This example illustrates how to show the SecurityCode field.

Customize a card
Cards comprise other controls. In an Edit form control, the user enters data in a standard Text input control that
you add from the Insert tab.
Let's walk through an example of how to change a card's appearance by manipulating controls in it.
1. First, let's return to the card that we inserted most recently, for the SecurityCode field. Select this card by
clicking or tapping it once:

2. Select the Text input control inside the card by clicking or tapping the input control itself.

3. Move this control within the card by dragging the selection box, and resize the control by dragging the
handles along the edge of the selection box:

You can resize, move, and make other modifications to controls within a card, but you can't delete it without
unlocking it first.

Unlock a card
In addition to containing controls, cards themselves are controls that have properties and formulas just like any
other control. When you choose to display a field on a form, the right-hand pane automatically creates the card for
you and generates the needed formulas. We can see these formulas in the Advanced tab of the right-hand pane:
We immediately see one of the most important properties of the card: the DataField property. This property
indicates which field of the data source the user sees and can edit in this card.
On the Advanced tab, the banner at the top indicates that the properties of this card are locked. A lock icon also
appears next to the DataField, DisplayName, and Required properties. The right-hand pane created these
formulas, and the lock prevents accidental changes to these properties.

Click or tap the banner at the top to unlock the card so that you can modify these properties:
Let's modify the DisplayName to put a space between Asset and ID. By making this change, we're altering what
was generated for us. In the right-hand pane, this card has a different label:

We've now taken control over this card and can modify it further to fit our need. But we've lost the ability to
change the card from one representation to another (for example, single-line text to multi-line text) as we did
before. We've transformed the predefined card into a "custom card" that we now control.

IMPORTANT
You can't relock a card if you unlock it. To get a card back to a locked state, remove it, and reinsert it in the right-hand pane.

You can change the appearance and behavior of an unlocked card in a variety of ways, such as adding and deleting
controls within it. For example, you can add a star shape from the Icons menu on the Insert tab.
The star is now a part of the card and will travel with it if, for example, you reorder the cards within the form.
As another example, unlock the ImageURL card, and then add an Image control to it from the Insert tab:

In the formula bar, set the Image property of this control to TextBox.Text, where TextBox is the name of the Text
input control that holds the URL:
And now we can see the images and edit their URLs. Note that we could have used Parent.Default as the Image
property, but it wouldn't have updated if the user changed the URL.
We can do the same thing on the second screen of this app, where we use a Display form control to display the
details of a record. In this case, we may want to hide the label (set the Visible property of the label, not the card, to
false) because the user won't edit the URL on that screen:
Interact with a form
After you unlock a card, you can change how it interacts with the form that contains it.
Below are some guidelines for how controls should work with their card and how the cards should work with the
form. These are only guidelines. As with any control in Power Apps, you can create formulas that reference any
other control in Power Apps, and that's no less true for cards and controls within cards. Be creative: you can create
an app in many ways.
DataField property
The most important property on the card is the DataField property. This property drives validation, what field is
updated, and other aspects of the card.
Information flowing in
As a container, the form makes ThisItem available to all cards within it. This record contains all of the fields for the
current record of interest.
The Default property of every card should be set to ThisItem.FieldName. Under certain circumstances, you
might want to transform this value on the way in. For example, you might want to format a string or translate the
value from one language to another.
Each control within the card should reference Parent.Default to get at the field's value. This strategy provides a
level of encapsulation for the card so that the card's Default property can change without changing the internal
formulas of the card.
By default, DefaultValue and Required properties are taken from the data source's metadata based on the
DataField property. You can override these formulas with your own logic, integrating the data source's metadata
by using the DataSourceInfo function.
Information flowing out
After the user modifies a record by using controls in the cards, the SubmitForm function saves those changes to
the data source. When that function runs, the form control reads the values of each card's DataField property to
know what field to change.
The form control also reads the value of each card's Update property. This value will be stored in the data source
for this field. This is the place to apply another transform, perhaps to reverse the transform that was applied in the
card's Default formula.
The Valid property is driven from the metadata of the data source, based on the DataField property. It's also
based on the Required property and whether the Update property contains a value. If the value on the Update
property isn't valid, the Error property provides a user-friendly error message.
If the DataField property of a card is blank, the card is just a container of controls. Its Valid and Update
properties don't participate when the form is submitted.

Dissecting an example
Let's look at the controls that make up a basic data-entry card. The space between controls has been increased to
show each more clearly:
In this graphic, the controls within the data card have been labeled:

Four controls make this card work:

NAME TYPE DESCRIPTION

TextRequiredStar Label control Displays a star, which is commonly used


on data-entry forms to indicate that a
field is required.

TextFieldDisplayName Label control Displays the user-friendly name of this


field. This name can differ from what is
in the data source's schema.

InputText Input text control Displays the initial value of the field and
allows the user to change that value.

TextErrorMessage Label control Displays a user-friendly error message


to the user if a problem occurs with
validation. Also ensures that the field
has a value if one is required.

To populate these controls with data, their properties can be driven from the properties of the card, through these
key formulas. Note that none of these formulas refers to a specific field. Instead, all information comes from the
card.

CONTROL PROPERTY FORMULA DESCRIPTION

TextRequiredStar.Visible Parent.Required The star appears only if the field is


required. Required is a formula that's
driven by you or the metadata of the
data source.

TextFieldDisplayName.Text Parent.DisplayName The text-box control shows the user-


friendly name, which you or the data
source's metadata provides, and which
is set on the card's DisplayName
property.
CONTROL PROPERTY FORMULA DESCRIPTION

InputText.Default Parent.Default The text-input control initially shows


the value of the field from the data
source, as provided by the card's default
value.

TextErrorMessage.Text Parent.Error If a validation problem occurs, the card's


Error property provides an appropriate
error message.

NOTE
The Parent.Error property is an output-only property that you can't set by using a formula. Therefore, this property won't
appear in list of properties near the upper-left corner or in the Properties or Advanced tabs near the right edge. The
formula bar suggests this property if you're writing a formula that could reference the property.

To pull information out of these controls and push it back into the data source, we have the following key formulas:

CONTROL NAME FORMULA DESCRIPTION

DataCard.DataField "ApproverEmail" The name of the field that the user can
display and edit in this card.

DataCard.Update InputText.Text The value to validate and push back


into the data source when
SubmitForm runs.
Add a list box, a drop-down list, or radio buttons to a
canvas app
12/2/2019 • 2 minutes to read • Edit Online

Show a single column of data (for example, from a multi-column table) in a canvas app so that users can select one
or more items in a list.
Add a list box to allow users to select more than one option.
Add a drop-down list to take up less space on a screen.
Add a set of radio buttons for a particular design effect.
This topic focuses on lists boxes and radio buttons, but the same principles apply to drop-down lists.

Prerequisites
1. Sign up for PowerApps.
2. Sign in using the same credentials that you used to sign up.
3. Under Make your own app, hover over the Canvas app from blank tile, select the phone icon, and then
select Make this app.
4. Learn how to add and configure controls.

Create a simple list


1. Add a List box control named MyListBox, and set its Items property to this expression:
["circle","triangle","rectangle"]

Your designer looks similar to the following:

2. On the Insert tab, select Icons, select the circle, and move it under MyListBox:

3. Add a triangle and a rectangle, and then arrange the shapes in a row under MyListBox:
4. Set the Visible property of the following shapes to the following functions:

SHAPE SET VISIBLE FUNCTION TO

circle If("circle" in MyListBox.SelectedItems.Value,


true)

triangle If("triangle" in MyListBox.SelectedItems.Value,


true)

rectangle If("rectangle" in MyListBox.SelectedItems.Value,


true)

5. While holding down the Alt key, select one or more shapes in MyListBox.
Only the shape or shapes that you select appear.
In these steps, you used an expression to create a list of items. You can apply this to other elements within your
business. For example, you can use a Drop down control to display product images, product descriptions, and so
on.

Add radio buttons


1. On the Home tab, select New Screen, and then select Blank.
2. On the Insert tab, select Controls, and then select Radio.

3. Rename the Radio control to Choices, and set its Items property to this formula:
["red","green","blue"]

If needed, resize the control to show all the options.


4. On the Insert tab, select Icons, and then select the circle.
5. Set the Fill property of the circle to the following function:
If(Choices.Selected.Value = "red", Red, Choices.Selected.Value = "green", Green, Choices.Selected.Value =
"blue", Blue)

In this formula, the circle changes its color depending on which radio button you choose.
6. Move the circle under the Radio control, as in this example:

7. While holding down the Alt key, select a different radio button to change the color of the circle.
Create dependent drop-down lists in a canvas app
12/3/2019 • 6 minutes to read • Edit Online

When you create dependent (or cascading) drop-down lists, users select an option in a list to filter options in
another list. Many organizations create dependent lists to help users fill out forms more efficiently. For example,
users might select a country or region to filter a list of cities, or users might select a category to show only the
codes in that category.
As a best practice, create a data source for the values in the "parent" and "child" lists (for example,
countries/regions and cities) that's separate from the data source that users update by using the app. If you take
this approach, you can use the same parent and child data in more than one app, and you can update that data
without republishing the app or apps that use them. You can accomplish the same outcome by using a collection or
static data, but it isn't recommended for enterprise scenarios.
For the scenario in this topic, store employees submit issues to an Incidents list through a form. Employees
specify not only the location of the store at which the incident occurred but also the department within that
location. Not all locations have the same departments, so a Locations list ensures that employees can't specify a
department for a location that doesn't have that department.
This topic uses Microsoft SharePoint lists as data sources, but all tabular data sources work the same way.

Create data sources


A Locations list shows the departments at each location.

LOCATION DEPARTMENT

Eganville Bakery

Eganville Deli

Eganville Produce

Renfrew Bakery

Renfrew Deli

Renfrew Produce

Renfrew Pharmacy

Renfrew Floral

Pembroke Bakery

Pembroke Deli

Pembroke Produce

Pembroke Floral
An Incidents list shows contact information and information about each incident. Create the Date column as a
Date column, but create the other columns as Single line of text columns to simplify configuration and avoid
delegation warnings in Microsoft Power Apps.

PHONE
FIRST NAME LAST NAME NUMBER LOCATION DEPARTMENT DESCRIPTION DATE

Tonya Cortez (206) 555 - Eganville Produce I had a 2/12/2019


1022 problem
with…

Moses Laflamme (425) 555 - Renfrew Floral I experienced 2/13/2019


1044 an issue…

By default, custom SharePoint lists include a Title column that you can't rename or remove, and it must contain
data before you can save an item in the list. To configure the column so that it doesn't require data:
1. Near the upper-right corner, select the gear icon, and then select List settings.
2. On the Settings page, select Title in the list of columns.
3. Under Require that this column contains information, select No.
After that change, you can ignore the Title column, or you can remove it from the default view if at least one other
column appears.

Open the form


1. Open the Incidents list, and then select PowerApps > Customize forms.

A browser tab opens with the default form in Power Apps Studio.
2. (optional) In the Fields pane, hover over the Title field, select the ellipsis (...) that appears, and then select
Remove.
If you've closed the Fields pane, you can open it again by selecting SharePointForm1 in the left navigation
bar and then selecting Edit fields on the Properties tab of the right-hand pane.
3. (optional) Repeat the previous step to remove the Attachments field from the form.
The form appears with just the fields that you added.
Replace the controls
1. In the Fields pane, select the arrow next to Location.
If you've closed the Fields pane, you can open it again by selecting SharePointForm1 in the left navigation
bar and then selecting Edit fields on the Properties tab of the right-hand pane.
2. Open the Control type list, and then select Allowed Values.

The input mechanism changes to a Drop down control.


3. Repeat these steps for the Department card.

Add the Locations list


1. Select View > Data Sources > Add data source.
2. Select or create a SharePoint connection, and then specify the site that contains the Locations list.
3. Select the check box for that list, and then select Connect.
The list of connections shows the Incidents list, on which the form is based, and the Locations list, which
will identify locations and departments in the form.

Unlock the cards


1. Select the Location card, select the Advanced tab in the right-hand pane, and then select Unlock to
change properties.
2. Repeat the previous step for the Department card.

Rename the controls


If you rename your controls, you can identify them more easily, and the examples are easier to follow. To discover
other best practices, review the Coding Standards and Guidelines whitepaper.
1. In the Location card, select the Drop down control.
2. Near the top of the right-hand pane, rename the selected control by typing or pasting ddLocation.

3. Repeat the previous two steps in the Department card to rename the Drop down control to
ddDepartment.

Configure the locations


1. Set the Items property of ddlocation to this formula:
Distinct(Locations, Location)

2. (optional) While holding down the Alt key, open ddLocation, and confirm that the list shows the three
locations.

Configure the departments


1. Select ddDepartment, and then, on the Properties tab of the right-hand pane, select Depends on.
2. Under Parent control, ensure that ddLocation appears in the upper list and Result appears in the lower
list.

NOTE
If you don’t want to match on a string but on the actual ID of the row of data, select ID Instead of Result.

3. Under Matching field, select Locations in the upper list, select Location in the lower list, and then select
Apply.

The Items property of ddDepartment is set to this formula:


Filter(Locations, Location = ddLocation.Selected.Result)

This formula filters the items in ddDepartment based on what the user selects in ddLocation. Such a
configuration ensures that the "child" list of departments reflects the data for its "parent" location, as the
Locations list in SharePoint specifies.
4. On the Properties tab of the right-hand pane, open the list next to Value, and then select Department.
This step sets the display text to the options from the Department column of the Locations list in
SharePoint.
Test the form
While holding down the Alt key, open the list of locations, select one, open the list of departments, and then select
one.
The lists of locations and departments reflects the information in the Locations list in SharePoint.

Save and open the form (optional)


1. Open the File menu, and then select Save > Publish to SharePoint > Publish to SharePoint.
2. In the upper-left corner, select the back arrow, and then select Back to SharePoint.
3. In the command bar, select New to open your customized form.

FAQ
I can’t see any data: the sources are all blank or have the wrong data. Confirm whether you're displaying the
correct field for your control in either of these ways:
Select a drop-down list, and then select the Value property in the Properties tab of the right-hand pane.
Select a combo box, and then ensure that the primary text is the field that you want to display.

My child drop-down list contains duplicate items. This symptom is likely due to using a LookUp column in
SharePoint or a Choices function in Power Apps. To remove the duplication, wrap a Distinct function around the
properly returning data. More information: Distinct function.

Known limitations
This configuration is available on Drop down controls, as well as Combo box and List box controls that allow
one selection at a time. You can't use the Depends On configuration for any of those controls if they allow multiple
selections. This approach isn't recommended for working with option sets in Common Data Service.
The Depends On configuration doesn't support static data or collections. To configure dependent drop-down lists
with these sources, edit the expression directly in the formula bar. In addition, Power Apps doesn't support using
two choice fields in SharePoint without any matching table of data, and you can't define Matching field within this
UI.
Show data in a line, pie, or bar chart in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Use line charts, pie charts, and bar charts to display your data in a canvas app. When you work with charts, the
data that you import should be structured based on these criteria:
Each series should be in the first row.
Labels should be in the leftmost column.
For example, your data should look similar to the following:

You can create and use these charts within Power Apps. Let's get started.

Prerequisites
Sign up for Power Apps, and then sign in using the same credentials that you used to sign up.
Create an app from a template, from data, or from scratch.
Learn how to configure a control in Power Apps.
Download ChartData.zip, which contains sample data as an XML file. Follow the steps in this topic to import it
directly into your app. As an alternative, decompress the .zip file, open the XML file in Excel, and save it to a
cloud-storage account.

Import the sample data


In these steps, we import the sample data into a collection, named ProductRevenue.
1. On the Insert tab, select Controls, and then select Import:
2. Set the control's OnSelect property to the following function:
Collect(ProductRevenue, Import1.Data)

3. Press F5 to open Preview mode, and then select the Import Data button.
4. In the Open dialog box, select ChartData.zip, select Open, and then press Esc.
5. On the File menu, select Collections.
The ProductRevenue collection is listed with the chart data you imported:

NOTE
The import control is used to import Excel-like data and create the collection. The import control imports data when
you are creating your app, and previewing your app. Currently, the import control does not import data when you
publish your app.

6. Press Esc to return to the default workspace.

Add a pie chart


1. On the Insert tab, select Charts, and then select Pie Chart.
2. Move the pie chart under the Import data button.
3. In the pie-chart control, select the middle of the pie chart:
4. Set the Items property of the pie chart to this expression: ProductRevenue.Revenue2014

The pie chart shows the revenue data from 2014.

Add a bar chart to display your data


Now, let's use this ProductRevenue collection in a bar chart:
1. On the Home tab, add a screen.]
2. On the Insert tab, select Charts, and then select Column Chart.
3. Select the middle of the column chart. Set the Items property of the column chart to ProductRevenue :

The column chart shows the revenue data from 2012:

4. In the column chart, select the center square:

5. On the Chart tab, select Number of Series, and then enter 3 in the formula bar:
The column chart shows revenue data for each product over three years:
Using multimedia files in Power Apps
12/3/2019 • 5 minutes to read • Edit Online

This topic shows you how to embed multimedia files in your canvas app, upload pen drawings to a data source,
and show images from a data source in your canvas app. The data source used in this topic is an Excel file in
OneDrive for Business.

Prerequisites
Sign up for Power Apps, and then sign in using the same credentials that you used to sign up.

Add media from a file or the cloud


You can choose the kind of media file to add (for example, images, video, or audio).
1. On the Content tab, select Media.
2. Under Media, select Images, Videos, or Audio, and then select Browse:

3. Select the file that you want to add, and then select Open.
The Pictures folder on your computer opens, and you can select an image from there or navigate to another
folder.
4. When you finish adding files, press Esc to return to the default workspace.
5. On the Insert tab, select Media, and then select Image, Video, or Audio:

6. If you added an image control, set its Image property to the file that you added:
NOTE
Specify the file name only, without the extension, inside single quotes.

7. If you added a video or audio control, set its Media property to the file that you added:

NOTE
Play a YouTube video by setting the Media property of a video control to the appropriate URL, enclosed in double
quotation marks.

Add media from Azure Media Services


1. From your Azure Media Services account, upload and publish your video asset from AMS > Settings >
Assets.
2. After the video is published, copy its URL.
3. From Power Apps, add the Video control from Insert > Media.
4. Set the Media property to the URL that you copied.
As this graphic shows, you can choose any streaming URL that Azure Media Services supports:

Add images from the cloud to your app


In this scenario, you save images in a cloud storage account, OneDrive for Business. You use an Excel table to
contain the path to the images, and you display the images in a gallery control in your app.
This scenario uses the CreateFirstApp.zip that contains some .jpeg files.
NOTE
The path to these images in the Excel file must use forward slashes. When Power Apps saves image paths in an Excel table,
the path uses backslashes. If you use image paths from such a table, change the paths in the Excel table to use forward
slashes instead of backslashes. Otherwise, the images won't display.

1. Download CreateFirstApp.zip, and extract the Assets folder to your cloud storage account.
2. Rename the Assets folder to Assets_images.
3. In an Excel spreadsheet, create a one-column table, and fill it with the following data:

4. Name the table Jackets, and name the Excel file Assets.xlsx.
5. In your app, add the Jackets table as a data source.
6. Add an Image only control (Insert tab > Gallery), and set its Items property to Jackets :

The gallery is automatically updated with the images:

When you set the Items property, a column named PowerAppsId is automatically added to the Excel table.
In the Excel table, the image path can also be the URL to an image. An example is the Flooring Estimates
sample file. You can download it to your cloud storage account, add the FlooringEstimates table as a data
source in your app, and then set the gallery control to FlooringEstimates . The gallery is automatically
updated with the images.

Upload pen drawings to the cloud


In this scenario, you learn how to upload pen drawings to your data source, OneDrive for Business, and examine
how the drawings are stored there.
1. In Excel, add Image [image] to cell A1.
2. Create a table using the following steps:
a. Select cell A1.
b. On the Insert ribbon, select Table.
c. In the dialog box, select My table has headers, and then select OK.

Your Excel file is now in a table format. See Format the data as a table for more information about
table formatting in Excel.
d. Name the table Drawings:

3. Save the Excel file to OneDrive for Business as SavePen.xlsx.


4. In Power Apps, create a blank app.
5. In your app, add the OneDrive for Business account as a data source:
a. Click or tap the View tab, and then click or tap Data sources.

b. Click or tap Add data source, and then click or tap OneDrive for Business.

c. Click or tap SavePen.xlsx.


d. Select the Drawings table, and then click or tap Connect.
Now, the Drawings table is listed as a data source.
6. On the Insert tab, select Text, and then select Pen input.
7. Rename the new control MyPen:

8. On the Insert tab, add a Button control, and set its OnSelect property to this formula:
Patch(Drawings, Defaults(Drawings), {Image:MyPen.Image})
9. Add an Image gallery control (Insert tab > Gallery), and set its Items property to Drawings . The Image
property of the gallery control is automatically set to ThisItem.Image .
Arrange the controls so that your screen resembles the following:
10. Press F5, or select Preview ( ).
11. Draw something in MyPen, and then select the button.
The first image in the gallery control displays what you drew.
12. Add something else to your drawing, and select the button.
The second image in the gallery control displays what you drew.
13. Close the preview window by pressing Esc.
In your cloud storage account, a SavePen_images folder has been automatically created. This folder
contains your saved images with IDs for their file names. To show the folder, you may need to refresh the
browser window by, for example, pressing F5.
In SavePen.xlsx, the Image column specifies the path to the new images.
Known limitations
For information about how to share Excel data within your organization, review these limitations.

For more information


Be sure to test your app on different platforms, including in a browser window and on a phone.
For information about more advanced scenarios that involve uploading multimedia directly to a different data
source, see image capture pro tips and custom connectors for image upload.
Another way to upload files to a data source is to use the Patch function.
Power Apps visual for Power BI
3/12/2020 • 4 minutes to read • Edit Online

Power BI enables data insights and better decision-making, while Power Apps enables everyone to build and use
apps that connect to business data. Using the Power Apps visual, you can pass context-aware data to a canvas app,
which updates in real time as you make changes to your report. Now, your app users can derive business insights
and take actions from right within their Power BI reports and dashboards.

Using the Power Apps visual


Let's look at the steps required to use the Power Apps visual in your Power BI report.
1. Power Apps visual is available by default in the Power BI service. If you are using Power BI Desktop and
don't see it, you must upgrade to the latest version of Power BI Desktop.
2. Add the Power Apps visual to your report, and set the data fields associated with it.

You can choose an existing app or create one, but the report must be published to the Power BI service and
opened in Microsoft Edge or Google Chrome.
3. If you choose to create an app, you can choose in which environment to create it.

If you choose to use an existing app, the visual prompts you to open the app in Power Apps. The visual then
sets up the required components in your app so that Power BI can send data to Power Apps.
If you create a new app, Power Apps creates a simple app with the required components already set up.
NOTE
You must create a new app from Power Apps visual in Power BI report for the PowerBIIntegration.Refresh()
function to be available in the app.

4. Now in Power Apps Studio, you can use the data fields you set in step 2. The PowerBIIntegration object acts
like any other Power Apps read-only data source or collection. You can use the object to populate any
control, or join and filter with other data sources.

This formula joins Power BI data with the Customer data source:
LookUp(Customer,Customer_x0020_Name=First(PowerBIIntegration.Data).Customer_Name)

The Power BI report and the instance of Power Apps Studio that was launched share a live data connection.
While they are both open, you can filter or change the data in your report to see the updated data reflect
immediately in your app in Power Apps Studio.
5. After you have completed building or making changes to your app, save and publish the app in Power Apps
to see your app in the Power BI report.
6. Once you are satisfied with your changes, make sure to share the Power Apps app with users of your report
and then save your report.
7. And with that, you have created a report in which your users can take actions as they gain insights from
your data.

If you need to makes changes to an app, open the report in edit mode, click or tap More options (. . .) on
the Power Apps visual and select Edit.

Limitations of the Power Apps visual


The following limitations apply to the Power Apps visual:
If you change the data fields associated with the visual, you must edit the app from within the Power BI service
by selecting the ellipsis (...) and then selecting Edit. Otherwise, the changes won't be propagated to Power Apps,
and the app will behave in unexpected ways.
The Power Apps visual can't trigger a refresh of Power BI reports and Power BI data sources from within Power
BI Desktop. If you write back data from the app to the same data source as the report, your changes won't be
reflected immediately in Power BI Desktop. Changes are reflected on the next scheduled refresh.
The Power Apps visual can't filter the data or send any data back to the report.
You'll need to share the Power Apps app separately from your report. Learn about sharing apps in Power Apps.
Power BI Report Server does not support the Power Apps visual.
Following limitations apply when using the PowerBIIntegration.Refresh() function:
You must create a new app from Power Apps visual in Power BI report for this function to be available in
the app.
You must use a source that supports DirectQuery and the data connection must be created using
DirectQuery method.
Power Apps in Power BI Desktop provides data to Power Apps Studio when creating apps but not while editing.
Use Power BI Web to preview the data while editing apps.
The Power BI mobile app does not support microphone control in Power Apps visuals.
NOTE
We recommend that you first publish your report to the Power BI service and then create or modify apps.

Browser support
The following table lists the browser supportability for view, create and modify actions of the Power Apps visual.
Supported browsers and actions are identified by a check mark ( ✓ ).

BROWSER VIEW CREATE MODIFY

Microsoft Edge ✓ ✓ ✓

Internet Explorer 11 ✓

Google Chrome ✓ ✓ ✓

Safari * ✓

Mozilla Firefox

All other browsers

* In Safari, you must enable cross site tracking (Preferences > Privacy, and clear Prevent cross site tracking) to
view Power Apps visual.

Accessibility support
To navigate the Power Apps visual using the keyboard follow these steps:
1. Focus selection on the Power BI Report for the desired Power Apps visual.
2. Use the Tab key on the keyboard until the visual is highlighted.
3. Use the Ctrl+Right key on the keyboard to enter the visual.
4. Use the Tab key on the keyboard until the desired component of the visual is selected.
For more information see: Power BI Accessibility Documentation

Next steps
Go through a simple step-by-step tutorial.
Check out our video.
Show, sort, and filter data in a Power Apps gallery
12/3/2019 • 6 minutes to read • Edit Online

Create a gallery to show images and text about several products, and sort and filter that information.
In Power Apps, you can use a gallery to show several related items, just as you see in a catalog. Galleries are
great for showing information about products, such as names and prices. In this topic, we create a gallery and
sort and filter the information using Excel-like functions. Also, when an item is selected, a border is placed
around the item.

NOTE
This topic uses a tablet app. You can use a phone app but you will need to resize some of the controls.

Prerequisites
Sign up for Power Apps, and then sign in using the same credentials that you used to sign up.
Create a tablet app from a template, from data, or from scratch.
Learn how to configure a control.
These steps use the CreateFirstApp as sample input data, which includes .jpg images. The zip file includes an
XML file that can be converted to Excel. Otherwise, Power Apps automatically reads the files in the .zip files
and imports it successfully. You can download and use this sample data, or import your own.

Show data in a gallery


1. Create a collection named Inventory using the sample data. Steps include:
a. On the Insert tab, select Controls, and then select Import:

b. Set the OnSelect property of the import control to the following formula:
Collect(Inventory, Import1.Data)

c. Select the Import Data button to open Windows Explorer. Select CreateFirstApp.zip, and select
Open.
d. In the File menu, select Collections. The Inventory collection is listed with the data you imported:

You've just created the Inventory collection, which contains information about five products,
including a design image, the name of the product, and the number of units in stock.

NOTE
The import control is used to import Excel-like data and create the collection. The import control imports
data when you are creating your app, and previewing your app. Currently, the import control does not
import data when you publish your app.

2. Select the back arrow to return to the designer.


3. On the Insert tab, click or tap Gallery, and then click or tap the Horizontal gallery.

4. In the right-hand pane, click or tap the option in which the title and the subtitle overlay the graphic:
5. Set the Items property of the gallery to Inventory:

6. Rename the gallery to ProductGallery, and move the gallery so it doesn't block the other controls. Resize
the gallery so it shows three products:

7. In the first item of the gallery, select the bottom label:

NOTE
When you change the first item in any gallery, you automatically change all other items in the gallery.
8. Set the Text property of the label to the following expression:
ThisItem.UnitsInStock
When you do this, the label shows the units in stock for each product:

NOTE
By default, the Text property of the top label is set to ThisItem.ProductName . You can change it to any other item in
your collection. For example, if your collection has ProductDescription or Price fields, you can set the label to
ThisItem.ProductDescription or ThisItem.Price .

Using these steps, you imported data that includes .jpg images into a collection. You then added a gallery that
displays the data and configured a label to show the units in stock for each product.

Highlight the gallery item you select


1. Select any item in the gallery except the first one. The edit icon displays (upper left corner). Select the edit
icon:

2. On the Insert tab, select Shapes, and then select the rectangle. A blue solid rectangle appears in each
gallery item.
3. On the Home tab, select Fill, and then select No Fill.
4. Select Border, select Border Style, and then select the solid line.
5. Select Border again, and set the thickness to 3. Resize the rectangle so that it surrounds the gallery item.
The items in your gallery now have a blue border and should look similar to the following:

6. On the Shape tab, select Visible, and then enter the following formula in the Formula Bar:
If(ThisItem.IsSelected, true)
A blue rectangle surrounds the current selection in a gallery. Select a few gallery items to confirm that the
rectangle appears around each item that you select. Remember, you can also open Preview to see
and test what you're creating.

TIP
Select the rectangle, select Reorder on the Home tab, and then select Send to Back. Using this feature, you can select a
gallery item without the border blocking anything.

Using these steps, you added a border around the current selection in the gallery.

Sort and filter items in the gallery


In these steps, we are going to sort the gallery items in ascending and descending order. Also, we'll add a slider
control to 'filter' gallery items by the units in stock that you choose.
Sort in ascending or descending order
1. Select any item in the gallery except the first one.
2. The Items property is currently set to Inventory (the name of your collection). Change it to the following:
Sort(Inventory, ProductName)
When you do this, the items in the gallery are sorted by the product name in ascending order:

Try descending order. Set the Items property of the gallery to the following formula:
Sort(Inventory, ProductName, Descending)
Add a slider control and filter items in the gallery
1. Add a Slider control (Insert tab > Controls), rename it to StockFilter, and move it under the gallery.
2. Configure the slider so that users can't set it to a value outside the range of units in stock:
a. On the Content tab, select Min, and then enter the following expression:
Min(Inventory, UnitsInStock)
b. On the Content tab, select Max, and then enter the following expression:
Max(Inventory, UnitsInStock)
3. Select any item in the gallery except the first one. Set the Items property of the gallery to the following
expression:
Filter(Inventory, UnitsInStock<=StockFilter.Value)

4. In Preview, adjust the slider to a value that's between the highest and the lowest quantity in the gallery.
As you adjust the slider, the gallery shows only those products that are less than the value you choose:
Now, let's add to our filter:
1. Go back to the designer.
2. On the Insert tab, select Text, select Input Text, and rename the new control to NameFilter. Move the text
control below the slider.
3. Set the Items property of the gallery to the following expression:
Filter(Inventory, UnitsInStock<=StockFilter.Value && NameFilter.Text in ProductName)
4. In Preview, set the slider to 30, and type the letter g in the text-input control. The gallery shows the only
product with less than 30 units in stock and has a name with the letter "g":

Tips and Tricks


At anytime, you can select the preview button ( ) to see what you created and test it.
When designing your app, you can re-size the controls and move them around using click-and-drag.
Press ESC or select the X to close the preview window.
When using a gallery, select the first item in the gallery to change all items in the gallery. For example, select
the first item to add a border to all items in the gallery.
To update the properties of the gallery, select any item in the gallery except the first one. For example, select
the second item to update the Items, ShowScrollbar, and other properties that apply to the gallery (not the
items in the gallery).
What you learned
In this topic, you:
Created a collection, imported data that includes .jpg images into that collection, and showed the data in a
gallery.
Under each image in the gallery, configured a label that lists the units in stock for that item.
Added a border around the item that you select.
Sorted the items by product name in ascending and descending order.
Added a slider and an input text control to filter the products by units in stock and product name.
Controls and properties in Power Apps
1/25/2020 • 24 minutes to read • Edit Online

Configure the appearance and behavior of a control by setting one of its properties. Each type of control has a
different set of properties. Some properties, such as Height and Width, are common to almost every type of
control, but other properties, such as CheckboxSize, are specific to one type of control.

Controls
Add picture – Load images from the local device, for upload to a data source.
Attachments – Download and upload files from the local device to a data source.
Audio – Play an audio clip or the audio portion of a video clip.
Barcode scanner – Scans barcodes, QR codes, and data-matrix codes on an Android or iOS device.
Button – Interact with the app by clicking or tapping.
Camera – Take and save photos in the app or to a data source.
Card – Display and edit an individual field of a record in a Edit form or Display form control.
Check box – Select or clear an option to specify true or false.
Column chart – Show values as vertical bars relative to two axes.
Column - Provides the display experience for a single field in a Data table control.
Combo box - Allows users to make selections from provided choices. Supports search and multi-select.
Container (experimental) - Create nested hierarchy for accessibility and responsiveness.
Data table - Show data in a tabular format.
Date picker – Specify a date by clicking or tapping.
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.
Edit form – Edit and create records in a data source using a form.
Entity form - Experimental feature: Add dynamic forms in which users can view, navigate, and edit relational data
from the Common Data Service.
Export – Export data for use elsewhere in Power Apps.
Gallery – Show a list of records that can contain multiple types of data.
HTML text – Convert HTML tags automatically.
Icon – Add graphic appeal and visual interest.
Image – Show an image from, for example, a local file or a data source.
Import – Import data from elsewhere in Power Apps.
Line chart – Show values as data points relative to two axes.
List box – Select one or more items in a list.
Microphone – Record and save sounds in the app or to a data source.
PDF viewer (experimental) – Show the content of a PDF file on the Internet.
Pen input – Draw an image or text, and save it in the app or to a data source.
Pie chart – Show how values relate to each other.
Power BI tile – Display a Power BI tile inside an app.
Radio – Show options that are mutually exclusive.
Rating – Indicate a value between 1 and a specified number.
Rich text editor – Allows rich text formatting by app users.
Screen – Show and update data about a specific task.
Shape – Display arrows and geometric shapes, such as rectangles.
Slider – Specify a value by dragging a handle.
Stream Video – Play videos and browse through channels from the Microsoft Stream service.
Label – Shows data such as text, numbers, dates, or currency,
Text input – Type text, numbers, and other data.
Timer – Configure your app to respond after a certain amount of time passes.
Toggle – Drag a handle to specify true or false.
Video – Play a video clip from a local file, a data source, or YouTube.
Web barcode scanner (experimental) – The legacy barcode scanner, which is obsolete but might be useful for
scanning codes in a web browser.

Common properties by category


Color and border – Configure the color and border of a control that can change as a user interacts with it.
Core – Configure whether the user can see and interact with a control.
Image – Configure what image is shown and how it fills the control.
Size and location – Configure how big a control (or an element of a control) is and where it is in relation to the
screen it's on.
Text – Configure how text appears in controls, such as font characteristics, alignment, line height.

All properties
A
ActualZoom – The actual zoom of the control, which may differ from the zoom requested with the Zoom
property. Applies to the PDF viewer control.
Align – The location of text in relation to the horizontal center of its control. Applies to many controls.
AllItems – All items in a gallery, including additional control values that are a part of the gallery's template.
Applies to the Gallery control.
AutoDisableOnSelect – Automatically disables the control while the OnSelect behavior is executing. Applies to
Button and Image controls.
AutoHeight – Whether a label automatically increases its height if its Text property contains more characters
than the control can show. Applies to the Label control.
AutoPause – Whether an audio or video clip automatically pauses if the user navigates to a different screen.
Applies to Audio, Timer, and Video controls.
AutoStart – Whether an audio or video control automatically starts to play a clip when the user navigates to the
screen that contains that control. Applies to Audio, Timer, and Video controls.
B
BackgroundImage – The name of an image file that appears in the background of a screen. Applies to the
Screen control.
BorderColor – The color of a control's border. Applies to many controls.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None. Applies to many controls.
BorderThickness – The thickness of a control's border. Applies to many controls.
Brightness – How much light the user is likely to perceive in an image. Applies to the Camera control.
C
CalculateOriginalDimensions – Enables the OriginalHeight and OriginalWidth properties. Applies to the
Image control.
Camera – On a device that has more than one camera, the numeric ID of the camera that the app uses. Applies to
the Camera control.
CheckboxBackgroundFill – The background color of the box that surrounds the checkmark in a checkbox
control. Applies to the Check box control.
CheckboxBorderColor – The color of the border that surrounds the checkmark in a checkbox control. Applies to
the Check box control.
CheckboxSize – The width and height of the box that surrounds the checkmark in a checkbox control. Applies to
the Check box control.
CheckmarkFill – The color of the checkmark in a checkbox control. Applies to the Check box control.
ChevronBackground – The color behind the down arrow in a dropdown list. Applies to the Drop down control.
ChevronFill – The color of the down arrow in a dropdown list. Applies to the Drop down control.
Clear – Whether a text-input control shows an "X" that the user can tap or click to clear the contents of that
control. Applies to the Text input control.
Color – The color of text in a control. Applies to many controls.
Contrast – How easily the user can distinguish between similar colors in an image. Applies to the Camera
control.
CurrentFindText – The current search term that is in use. Applies to the PDF viewer control.
CurrentPage – The number of the page in a PDF file that is actually being shown. Applies to the PDF viewer
control.
D
Data – The name of a collection that you want to export to a local file. Applies to the Export control.
DataField – The name of the field within a record that this card displays and edits. Applies to the Card control.
DataSource – The data source that contains the record that the user will show, edit, or create. Applies to Display
form and Edit form controls.
Default – The initial value of a control before it is changed by the user. Applies to many controls.
DefaultDate – The initial value of a date control before it is changed by the user. Applies to the Date Picker
control.
DefaultMode – The initial mode of a form control, either Edit, New, or View. Applies to the Edit form control.
Direction – Whether the first item in a gallery in landscape orientation appears near the left or right edge. Applies
to the Gallery control.
Disabled – Whether the user can interact with the control. Applies to many controls.
DisabledBorderColor – The color of a control's border if the control's Disabled property is set to true. Applies
to many controls.
DisabledColor – The color of text in a control if its Disabled property is set to true. Applies to many controls.
DisabledFill – The background color of a control if its Disabled property is set to true. Applies to many controls.
DisplayName – The user friendly name for a field in a data source. Applies to the Card control.
DisplayMode – Values can be Edit, View, or Disabled. Configures whether the control allows user input (Edit),
only displays data (View ) or is disabled (Disabled).
Document – The URL, enclosed in double-quotation marks, of a PDF file. Applies to the PDF viewer control.
Duration – How long a timer runs. Applies to the Timer control.
E
EndYear – The latest year to which the user can set value of a date-picker control. Applies to the Date Picker
control.
Error – The meaning of this property is dependent on the control:
Add picture control - If there is a problem uploading an image, this property will contain an appropriate error
string.
Card control – The user friendly error message to display for this field when validation fails.
Edit form control – A user friendly error message to display for this form when the SubmitForm function
fails.
ErrorKind – If an error occurs when SubmitForm runs, the kind of error that occurred. Applies to Display form
and Edit form controls.
Explode – The distance between wedges in a pie chart. Applies to the Pie chart control.
F
Fill – The background color of a control. Applies to many controls.
FindNext – Finds the next instance of FindText in the document. Applies to the PDF viewer control.
FindPrevious – Finds the previous instance of FindText in the document. Applies to the PDF viewer control.
FindText – The search term to look for in the document. Applies to the PDF viewer control.
Font – The name of the family of fonts in which text appears. Applies to many controls.
FontWeight – The weight of the text in a control: Bold, Semibold, Normal, or Lighter. Applies to many
controls.
G
GridStyle – Whether a column or line chart shows its x-axis, its y-axis, both, or neither. Applies to Column chart
and Line chart controls.
H
HandleActiveFill – The color of the handle for a slider as the user changes its value. Applies to the Slider
control.
HandleFill – The color of the handle (the element that changes position) in a toggle or slider control. Applies to
the Slider control.
HandleHoverFill – The color of the handle in a slider when the user keeps the mouse pointer on it. Applies to the
Slider control.
Height – The distance between a control's top and bottom edges. Applies to many controls.
HintText – Light-grey text that appears in a text-input control if it's blank. Applies to the Text input control.
HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that control.
Applies to many controls.
HoverColor – The color of the text in a control when the user keeps the mouse pointer on it. Applies to many
controls.
HoverFill – The background color of a control when the user keeps the mouse pointer on it. Applies to many
controls.
HTMLText – Text that appears in an HTML text control and that may contain HTML tags. Applies to the HTML
text control.
I
Image – The name of the image that appears in an image, audio, or microphone control. Applies to Audio,
Image, Microphone, and Video controls.
ImagePosition – The position (Fill, Fit, Stretch, Tile, or Center) of an image in a screen or a control if it isn't the
same size as the image. Applies to many controls.
Input – Input. Applies to the Pen input control.
Italic – Whether the text in a control is italic. Applies to many controls.
Item – The record in the DataSource that the user will show or edit. Applies to Display form and Edit form
controls.
ItemBorderColor – The color of the border around each wedge in a pie chart. Applies to the Pie chart control.
ItemBorderThickness – The thickness of the border around each wedge in a pie chart. Applies to the Pie chart
control.
ItemColorSet – The color of each data point in a chart. Applies to Column chart, Line chart, and Pie chart
controls.
ItemPaddingLeft – The distance between text in a listbox and its left edge. Applies to the List Box control.
Items – The source of data that appears in a control such as a gallery, a list, or a chart. Applies to many controls.
ItemsGap – The distance between columns in a column chart. Applies to the Column chart control.
L
LabelPosition – The location of labels in a pie chart relative to its wedges. Applies to the Pie chart control.
LastSubmit – The last successfully submitted record, including any server generated fields. Applies to the Edit
form control.
Layout – Whether the user scrolls through a gallery or adjusts a slider top to bottom ( Vertical) or left to right
(Horizontal). Applies to Gallery and Slider controls.
LineHeight – The distance between, for example, lines of text or items in a list. Applies to List Box, Radio, Label,
and Text input controls.
Loop – Whether an audio or video clip automatically starts over as soon as it finishes playing. Applies to Audio
and Video controls.
M
Markers – Whether a column or line chart shows the value of each data point. Applies to Column chart and Line
chart controls.
MarkerSuffix – Text that appears after each value in a column chart for which the Markers property is set to
true. Applies to the Column chart control.
Max – The maximum value to which the user can set a slider or a rating. Applies to Rating and Slider controls.
MaxLength – The number of characters that the user can type into a text-input control. Applies to the Text input
control.
Media – An identifier for the clip that an audio or video control plays. Applies to Add picture, Audio, and Video
controls.
Mic – On a device that has more than one microphone, the numeric ID of the microphone that the app uses.
Applies to the Microphone control.
Min – The minimum value to which the user can set a slider. Applies to the Slider control.
MinimumBarWidth – The narrowest possible width of columns in a column chart. Applies to the Column chart
control.
Mode – The meaning of this property is dependent on the control:
Edit form control – The control is in Edit or New mode.
Pen input control – The control is in Draw, Erase, or Select mode.
Text input control – The control is in SingleLine, MultiLine, or Password mode.
N
NavigationStep – How far a gallery scrolls if its ShowNavigation property is set to true and the user selects a
navigation arrow at either end of that gallery. Applies to the Gallery control.
NumberOfSeries – How many columns of data are reflected in a column or line chart. Applies to Column chart
and Line chart controls.
O
OnChange – The behavior of an app when the user changes the value of a control (for example, by adjusting a
slider). Applies to many controls.
OnCheck – The behavior of an app when the value of a checkbox or a toggle changes to true. Applies to Check
box and Toggle controls.
OnEnd – The behavior of an app when an audio or video clip finishes playing. Applies to Audio and Video
controls.
OnFailure – The behavior of an app when a data operation has been unsuccessful. Applies to the Edit form
control.
OnHidden – The behavior of an app when the user navigates away from a screen. Applies to the Screen control.
OnPause – The behavior of an app when the user pauses the clip that an audio or video control is playing. Applies
to Audio and Video controls.
OnReset – The behavior of an app when an Edit form control is reset. Applies to the Edit form control.
OnSelect – The behavior of an app when the user taps or clicks a control. Applies to many controls.
OnStart – The behavior of an app when the user opens it or starts to record with a microphone control. Applies to
Audio, Microphone, Screen, and Video controls.
OnStateChange – The behavior of an app when the state of the control changes. Applies to the PDF viewer
control.
OnStop – The behavior of an app when the user stops recording with a microphone control. Applies to the
Microphone control.
OnStream – The behavior of an app when the Stream property is updated. Applies to the Camera control.
OnSuccess – The behavior of an app when a data operation has been successful. Applies to the Edit form
control.
OnTimerEnd – The behavior of an app when a timer finishes running. Applies to the Timer control.
OnTimerStart – The behavior of an app when a timer starts to run. Applies to the Timer control.
OnUncheck – The behavior of an app when the value of a checkbox or a toggle changes to false. Applies to
Check box and Toggle controls.
OnVisible – The behavior of an app the user navigates to a screen. Applies to the Screen control.
OriginalHeight – Original height of an image, enabled with the CalculateOriginalDimensions property.
Applies to the Image control.
OriginalWidth – Original width of an image, enabled with the CalculateOriginalDimensions property. Applies
to the Image control.
Overflow – Whether a scrollbar appears in a label if its Wrap property is set to true and the value of the control's
Text property contains more characters than the control can show at one time. Applies to the Label control.
P
Padding – The distance between the text on an import or export button and the edges of that button. Applies to
Add picture, Export, and Import controls.
PaddingBottom – The distance between text in a control and the bottom edge of that control. Applies to many
controls.
PaddingLeft – The distance between text in a control and the left edge of that control. Applies to many controls.
PaddingRight – The distance between text in a control and the right edge of that control. Applies to many
controls.
PaddingTop – The distance between text in a control and the top edge of that control. Applies to many controls.
Page – The number of the page that you want to show. Applies to the PDF viewer control.
PageCount – The number of pages in a document. Applies to the PDF viewer control.
Paused – True if a media playback control is currently paused, false otherwise. Applies to Audio and Video
controls.
Photo – The image captured when the user takes a picture. Applies to the Camera control.
Pressed – True while a control is being pressed, false otherwise. Applies to the Button control.
PressedBorderColor – The color of a control's border when the user taps or clicks that control. Applies to many
controls.
PressedColor – The color of text in a control when the user taps or clicks that control. Applies to many controls.
PressedFill – The background color of a control when the user taps or clicks that control. Applies to many
controls.
R
RadioBackgroundFill – The background color of the circles in a radio-button control. Applies to the Radio
control.
RadioBorderColor – The color of the circle for each option in a radio-button control. Applies to the Radio
control.
RadioSelectionFill – The color that appears inside the circle of the selected option in a radio-button control.
Applies to the Radio control.
RadioSize – The diameter of the circles in a radio-button control. Applies to the Radio control.
RadiusBottomLeft – The degree to which the bottom-left corner of a control is rounded. Applies to many
controls.
RadiusBottomRight – The degree to which the bottom-right corner of a control is rounded. Applies to many
controls.
RadiusTopLeft – The degree to which the top-left corner of a control is rounded. Applies to many controls.
RadiusTopRight – The degree to which the top-right corner of a control is rounded. Applies to many controls.
RailFill – The background color of the rectangle in a toggle control when its value is false or the color of the line
to the right of the handle in a slider control. Applies to Slider and Toggle controls.
RailHoverFill – When you hover on a toggle control or a slider, the background color of the rectangle in a toggle
control when its value is false or the color of the line to the right of the handle in a slider control. Applies to Slider
and Toggle controls.
RatingFill – The color of the stars in a rating control. Applies to the Rating control.
ReadOnly – Whether a user can change the value of a slider or rating control. Applies to Rating and Slider
controls.
Repeat – Whether a timer automatically restarts when it finishes running. Applies to the Timer control.
Required – Whether a card, editing the field of a data source, must contain a value. Applies to the Card control.
Reset – Whether a control reverts to its default value. Applies to many controls. Also see the Reset function.
S
Selected – The selected item. Applies to Drop down and Gallery controls.
SelectedDate – The date currently selected in a date control. Applies to the Date Picker control.
SelectionColor – The text color of a selected item or items in a list or the color of the selection tool in a pen
control. Applies to Drop down, List Box, and Pen input controls.
SelectionFill – The background color of a selected item or items in a list or a selected area of a pen control.
Applies to Drop down and List Box controls.
SelectionThickness – The thickness of the selection tool for a pen-input control. Applies to the Pen input
control.
SelectMultiple – Whether a user can select more than one item in a listbox. Applies to the List Box control.
SeriesAxisMax – The maximum value of the y-axis for a column or line chart. Applies to the Column chart
control.
SeriesAxisMin – A number that determines the minimum value of the y-axis for a column chart. Applies to the
Column chart control.
ShowControls – Whether an audio or video player shows, for example, a play button and a volume slider, and a
pen control shows, for example, icons for drawing, erasing, and clearing. Applies to Audio, PDF viewer, Pen
input, and Video controls.
ShowLabels – Whether a pie chart shows the value that's associated with each of its wedges. Applies to the Pie
chart control.
ShowNavigation – Whether an arrow appears at each end of a gallery so that a user can scroll through the items
in the gallery by clicking or tapping an arrow. Applies to the Gallery control.
ShowScrollbar – Whether a scrollbar appears when the user hovers over a gallery. Applies to the Gallery
control.
ShowValue – Whether a slider's or rating's value appears as the user changes that value or hovers over the
control. Applies to Rating and Slider controls.
Size – The font size of the text that appears on a control. Applies to many controls.
Snap – Whether, when a user scrolls through a gallery, it automatically snaps so that the next item appears in full.
Applies to the Gallery control.
Start – Whether an audio or video clip plays. Applies to Audio, Timer, and Video controls.
StartTime – The time after the start of an audio or video clip when the clip starts to play. Applies to Audio and
Video controls.
StartYear – The earliest year to which the user can set the value of a date-picker control. Applies to the Date
Picker control.
Stream – Automatically updated image based on the StreamRate property. Applies to the Camera control.
StreamRate – How often to update the image on the Stream property, in milliseconds. This value can range from
100 (1/10th of a second) to 3,600,000 (1 hour). Applies to the Camera control.
Strikethrough – Whether a line appears through the text that appears on a control. Applies to many controls.
T
TemplateFill – The background color of a gallery. Applies to the Gallery control.
TemplatePadding – The distance between items in a gallery. Applies to the Gallery control.
TemplateSize – The height of the template for a gallery in vertical/portrait orientation or the width of the
template for a gallery in horizontal/landscape orientation. Applies to the Gallery control.
Text – Text that appears on a control or that the user types into a control. Applies to many controls.
Time – A media control's current position. Applies to Audio and Video controls.
Tooltip – Explanatory text that appears when the user hovers over a control. Applies to many controls.
Transition – The visual effect (Pop, Push, or None) when the user hovers over an item in a gallery. Applies to the
Gallery control.
Transparency – The degree to which controls behind an image remain visible. Applies to the Image control.
U
Underline – Whether a line appears under the text that appears on a control. Applies to many controls.
Unsaved – True if the Edit form control contains user changes that have not been saved. Applies to the Edit
form control.
Update – The value to write back to the data source for a field. Applies to the Card control.
Updates – The values to write back to the data source for a record loaded in a form control. Applies to the Edit
form control.
V
Valid – Whether a Card or Edit form control contains valid entries, ready to be submitted to the data source.
Applies to Card and Edit form controls.
Value – The value of an input control. Applies to Check box, Radio, Slider, and Toggle controls.
ValueFill – The background color of the rectangle in a toggle control when its value is true or the color of the line
to the left of the handle in a slider control. Applies to Slider and Toggle controls.
ValueHoverFill – When you keep the mouse pointer on a toggle control or a slider, the background color of the
rectangle in a toggle control when its value is true or the color of the line to the left of the handle in a slider
control. Applies to Slider and Toggle controls.
VerticalAlign – The location of text on a control in relation to the vertical center of that control. Applies to many
controls.
Visible – Whether a control appears or is hidden. Applies to many controls.
W
Width – The distance between a control's left and right edges. Applies to many controls.
WidthFit – Whether a control automatically grows horizontally to fill any empty space of a container control such
as an Edit form control. If multiple cards have this property set to true, the space is divided between them. For
more information, see Understand data form layout.
Wrap – Whether text that's too long to fit in a label wraps to the next line. Applies to the Label control.
WrapCount – How many records appear in each item of a gallery. Applies to the Gallery control.
X
X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent
container). Applies to many controls. For a Card control in a container that has multiple columns, this property
determines the column in which the card appears.
XLabelAngle – The angle of the labels below the x-axis of a column or line chart. Applies to Column chart and
Line chart controls.
Y
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent
container). Applies to many controls. For a Card control in a container that has multiple rows, this property
determines the row in which the card appears.
YAxisMax – The maximum value of the y-axis for a line chart. Applies to the Line chart control.
YAxisMin – The minimum value of the y-axis for a line chart. Applies to the Line chart control.
YLabelAngle – The angle of the labels next to the y-axis of a line or column chart. Applies to Column chart and
Line chart controls.
Z
Zoom – The percentage by which an image from a camera is magnified or the view of a file in a PDF viewer.
Applies to Camera and PDF viewer controls.
Add picture control in Power Apps
3/6/2020 • 5 minutes to read • Edit Online

Takes a photo or loads images from the local device.

Description
With this control users can take photos or upload image files from their device and update the data source
with this content. On a mobile device the user is presented with the device's choice dialog to choose between
taking a photo or selecting one already available.
This control is a grouped control containing two controls: an Image and an Add picture button. The Image
control shows the uploaded image or a placeholder if no image has been uploaded. The Add picture button
prompts for an image to be uploaded.
See the Image control reference for Image properties.

Add picture button properties


AccessibleLabel – Label for screen readers. Should describe the purpose of adding a picture.
Align – The location of text in relation to the horizontal center of its control.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
ChangePictureText – Text that appears on the button when an image has been uploaded.
Color – The color of text in a control.
DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to
Disabled.
DisabledColor – The color of text in a control if its DisplayMode property is set to Disabled.
DisabledFill – The background color of a control if its DisplayMode property is set to Disabled.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled
(Disabled).
Error - If there is a problem uploading an image, this property will contain an appropriate error string.
Fill – The background color of a control.
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Font – The name of the family of fonts in which text appears.
FontWeight – The weight of the text in a control: Bold, Semibold, Normal, or Lighter.
Height – The distance between a control's top and bottom edges.
HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that control.
HoverColor – The color of the text in a control when the user keeps the mouse pointer on it.
HoverFill – The background color of a control when the user keeps the mouse pointer on it.
Italic – Whether the text in a control is italic.
Media – An identifier for the clip that an audio or video control plays.
OnChange – How the app responds when the user changes the value of a control (for example, by adjusting
a slider).
OnSelect – How the app responds when the user taps or clicks a control.
Padding – The distance between the text on an import or export button and the edges of that button.
PressedBorderColor – The color of a control's border when the user taps or clicks that control.
PressedColor – The color of text in a control when the user taps or clicks that control.
PressedFill – The background color of a control when the user taps or clicks that control.
Reset – Whether a control reverts to its default value.
Size – The font size of the text that appears on a control.
Strikethrough – Whether a line appears through the text that appears on a control.
TabIndex – Keyboard navigation order in relation to other controls.
Text – Text that appears on the button when an image has not been uploaded.
Tooltip – Explanatory text that appears when the user hovers over a control.
Underline – Whether a line appears under the text that appears on a control.
VerticalAlign – The location of text on a control in relation to the vertical center of that control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no
parent container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no
parent container).

Related functions
Patch( DataSource, BaseRecord, ChangeRecord )

Examples
Add images to an Image gallery control
1. Add an Add picture control, and then triple-click it.
Don't know how to add, name, and configure a control?
2. In the Open dialog box, click or tap an image file, and then click or tap Open.
3. Add a Button control, move it under the Add picture control, and set the OnSelect property for the
Button control to this formula:
Collect(MyPix, AddMediaButton1.Media)
Want more information about the Collect function or other functions?
4. Add an Image gallery control, and set its Items property to MyPix.
5. Press F5, and then click or tap the Button control.
The image from the Add picture control appears in the Image gallery control. If your image doesn't
have the same aspect ratio as the Image control in the Image gallery control, set the
ImagePosition property of the Image control to Fit.
6. Click or tap the Add picture control, click or tap another image file, click or tap Open, and then click
or tap the Button control that you added.
The second image appears in the Image gallery control.
7. (optional) Repeat the previous step one or more times, and then return to the default workspace by
pressing Esc.
Use the SaveData function to save the images locally or the Patch function to update a data source.

Accessibility guidelines
The same guidelines for Button and Image apply. In addition, consider the following:
Color contrast
Add picture button must have adequate contrast between its text and background. Since the uploaded
image may have varying colors, use an opaque Fill on the Add picture button to ensure consistent
contrast.
Screen reader support
Add picture button must have Text and ChangePictureText that prompts the user to add or change a
picture.
Keyboard support
Add picture button must have TabIndex of zero or greater so that keyboard users can navigate to it.
Add picture button must have clearly visible focus indicators. Use FocusedBorderColor and
FocusedBorderThickness to achieve this.
Attachments control in Power Apps
3/10/2020 • 3 minutes to read • Edit Online

A control that allows users to download files to their device, as well as upload and delete files from a SharePoint
list or a Common Data Service entity.

Limitations
The attachment control has these limitations:
1. Attachments are supported with SharePoint lists and Common Data Service entities.
2. Upload and delete functionality work only inside a form. The Attachment control appears disabled when in
Edit mode and not inside a form. To save file additions and deletions, the app user must save the form.
Because of this limitation, the Attachment control isn't available from the Insert tab but appears in the form
when the Attachment form field is enabled in a SharePoint or Common Data Service form.
3. You can upload files only if they're 10 MB or smaller.

Description
An Attachments control lets you open, add, and delete files from a SharePoint list or a Common Data Service
entity.

Key properties
Items – The source describing the files that can be downloaded.
MaxAttachments – The maximum number of files the control will accept.
MaxAttachmentSize – The maximum allowed file size in MB of each new attachment. Currently there is a limit of
10 MB.
OnAttach – How the app responds when the user adds a new file attachment.
OnRemove – How the app responds when the user deletes an existing attachment.
OnSelect – How the app responds when the user clicks on an attachment.

Additional properties
AccessibleLabel – Label for screen readers. Should describe the purpose of the attachments.
AddAttachmentText – The label text for the link used to add a new attachment.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
DisplayMode – Whether the control allows adding and deleting files (Edit), only displays data (View), or is
disabled (Disabled).
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Height – The distance between a control's top and bottom edges.
MaxAttachmentsText – The text that replaces the "Attach file" link when the control contains the maximum
number of files allowed.
NoAttachmentsText – Informational text shown to the user when there are no files attached.
TabIndex – Keyboard navigation order in relation to other controls.
Visible – Whether a control is visible or hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (or screen, if no parent
container).
Y – The distance between the top edge of a control and the top edge of the parent container (or screen, if no parent
container).

Example
1. Add a form to your app, and set a SharePoint list as its data source.
2. Select the Display Form control in the tree view on the left-hand side. You can also use Edit Form instead.
3. Select Data Source in the Properties tab in the options panel on the right and then select the SharePoint
list you connected to.
4. Select Edit fields in Fields section and select Add field.
5. Select the Attachments field and select Add.
The Attachments field associated with the SharePoint list will appear in the form.
Learn how to add and configure a control

Accessibility guidelines
Color contrast
There must be adequate color contrast between:
ItemColor and ItemFill
ItemHoverColor and ItemHoverFill
ItemPressedColor and ItemPressedFill
AddedItemColor and AddedItemFill
RemovedItemColor and RemovedItemFill
ItemErrorColor and ItemErrorFill
AddAttachmentColor and Fill
MaxAttachmentsColor and Fill
NoAttachmentsColor and Fill
This is in addition to the standard color contrast requirements.
Screen reader support
The following properties must be present:
AccessibleLabel
AddAttachmentsText
MaxAttachmentsText
NoAttachmentsText
Keyboard support
TabIndex must be zero or greater so that keyboard users can navigate to it.
Focus indicators must be clearly visible. Use FocusedBorderColor and FocusedBorderThickness to achieve
this.
Audio and Video controls in Power Apps
12/3/2019 • 5 minutes to read • Edit Online

A control that plays an audio file, a video file, or a video on YouTube.

Description
An Audio control plays a sound clip from a file, a recording from a Microphone control, or the audio track from a
video file.
A Video control plays a video clip from a file or from YouTube or Azure Media Services. Closed captions can
optionally be shown when specified.

Key properties
Loop – Whether an audio or video clip automatically starts over as soon as it finishes playing.
Media – An identifier for the clip that an audio or video control plays.
ShowControls – Whether an audio or video player shows, for example, a play button and a volume slider, and a
pen control shows, for example, icons for drawing, erasing, and clearing.

Additional properties
AccessibleLabel – Label for screen readers. Should be the title of the video or audio clip.
AutoPause – Whether an audio or video clip automatically pauses if the user navigates to a different screen.
AutoStart – Whether an audio or video control automatically starts to play a clip when the user navigates to the
screen that contains that control.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
ClosedCaptionsUrl – Video control only. URL of closed captions file in WebVTT format. Both video and captions
URLs must be HTTPS. Server hosting both video and captions file needs to be CORS enabled.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled (Disabled).
Fill – The background color of a control.
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Height – The distance between a control's top and bottom edges.
Image – The name of the image that appears in an image, audio, or microphone control.
ImagePosition – The position (Fill, Fit, Stretch, Tile, or Center) of an image in a screen or a control if it isn't the
same size as the image.
OnEnd – How an app responds when an audio or video clip finishes playing.
OnPause – How an app responds when the user pauses the clip that an audio or video control is playing.
OnStart – How the app responds when the user starts to record with a microphone control.
Paused – True if a media playback control is currently paused, false otherwise.
Reset – Whether a control reverts to its default value.
Start – Whether an audio or video clip plays.
StartTime – The time after the start of an audio or video clip when the clip starts to play.
Time – A media control's current position.
TabIndex – Keyboard navigation order in relation to other controls.
Tooltip – Explanatory text that appears when the user hovers over a control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent
container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent
container).

Related functions
First( TableName )

Examples
Play an audio or video file
1. On the File menu, click or tap Media, click or tap Videos or Audio, and then click or tap Browse.
2. Browse to the file you want to use, click or tap it, and then click or tap Open.
3. Press Esc to return to the default workspace, add an Audio or Video control, and set its Media property to
the file that you added.
Don't know how to add and configure a control?
4. Press F5, and then play the clip by clicking or tapping the play button of the control that you added.

TIP
The play button of the Video control appears when you hover over the control.

5. Press Esc to return to the default workspace.


Play a YouTube video
1. Add a Video control, and set its Media property to the URL of the YouTube video, enclosed in double
quotation marks.
2. Press F5, and then play the clip by clicking or tapping the play button of the Video control.
3. Press Esc to return to the default workspace.
Play a video from Azure Media Services
1. After the videos are published on AMS, copy the manifest URL. Start the streaming endpoint of your service, if
not already.
2. Add a Video control, and set its Media property to the URL of the AMS video, enclosed in double quotation
marks.
3. Press F5, and then play the clip by clicking or tapping the play button of the Video control.
4. Press Esc to return to the default workspace.

Accessibility guidelines
Audio and video alternatives
ShowControls must be true so that users can listen or watch multimedia at their own pace. This also allows
users to toggle closed captions and full-screen mode on video players.
Closed captions must be provided for videos.
For YouTube videos, use authoring tools provided by YouTube to add captions.
For other videos, create captions in WebVTT format, upload them, and set ClosedCaptionsUrl to the url
location. There are several limitations. Server(s) hosting video and captions needs to be CORS -enabled
and serve them using HTTPS protocol. Captioning does not work on Internet Explorer.
Consider providing an audio or video transcript using one of these methods:
1. Put the text in a Label and position it adjacent to the multimedia player. Optionally, create a Button to
toggle the display of the text.
2. Put the text in a different screen. Create a Button that navigates to the screen and position the button
adjacent to the multimedia player.
3. If the description is short, it can be put it in the AccessibleLabel.
Color contrast
There must be adequate color contrast between:
FocusedBorderColor and the outside color
Image and the multimedia player controls (if applicable)
Fill and the multimedia player controls (if the fill is visible)
Provide closed captions and/or transcript if the video content has color contrast issues.
Screen reader support
AccessibleLabel must be present.
Keyboard support
TabIndex must be zero or greater so that keyboard users can navigate to it.
Focus indicators must be clearly visible. Use FocusedBorderColor and FocusedBorderThickness to achieve
this.
AutoStart should be false because it can be difficult for keyboard users to stop playback quickly.
Barcode-scanner control for canvas apps
12/11/2019 • 2 minutes to read • Edit Online

Scans barcodes, QR codes, and data-matrix codes on an Android or iOS device. Not supported in a web browser.

Description
The control opens a native scanner on an Android or iOS device. The scanner automatically detects a barcode, a
QR code, or a data-matrix code when in view. The control doesn't support scanning in a web browser.

Key properties
Value – Output property that contains the text value of the code that was scanned most recently.
Text - Text that appears on the button that activates the scanner.
OnScan – How an app responds when a barcode is successfully scanned.

Additional properties
BarcodeType - The barcode type to scan. You can target multiple barcode types by concatenating them. Ex.
BarcodeType.Code128 & BarcodeType.Code39 Default: Auto
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled (Disabled).
FlashlightEnabled - Whether the flashlight is enabled automatically when the scanner is opened.
Height – The height of the button that activates the scanner.
PreferFrontCamera - Whether the front-facing camera, when available, is used for scanning.
Tooltip – Explanatory text that appears when the user hovers over a control.
Type - The type of code that was detected in the scan that succeeded most recently.
Visible – Whether a control appears or is hidden.
Width – The width of the button that activates the scanner.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent
container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent
container).

Accessibility guidelines
The same guidelines for the Button control apply to the Barcode scanner control because it's a button that
launches the scan.
Visual alternatives
The barcode scanner is a button that doesn't display the scan result. Consider showing the scan result with a
Label control. Set the label's Text property to the barcode scanner's Value property. Set the label's Live
property to Polite so that screen-reader users are notified of changes. This change makes the scanned
value accessible to everyone, regardless of visual ability.
Users who have visual and motor disabilities might prefer not to point the camera at a barcode. Consider
adding another form of input, such as a Text input control, for users to enter barcodes.

Barcode Availability by Device


BARCODE TYPE ANDROID IOS

QR_CODE ✔ ✔

DATA_MATRIX ✔ ✔

UPC_A ✔ ✔

UPC_E ✔ ✔

EAN_8 ✔ ✔

EAN_13 ✔ ✔

CODE_39 ✔ ✔

CODE_93 ✔ ✔

CODE_128 ✔ ✔

CODABAR ✔ ✖

ITF ✔ ✔

RSS14 ✔ ✖

PDF_417 ✔ ✔

RSS_EXPANDED ✔ ✖

MSI ✖ ✖

AZTEC ✔ ✔

NOTE: PDF_417 and AZTEC are not supported in Auto mode


Button control in Power Apps
12/3/2019 • 6 minutes to read • Edit Online

A control that the user can click or tap to interact with the app.

Description
Configure the OnSelect property of a Button control to run one or more formulas when the
user clicks or taps the control.

Key properties
OnSelect – How the app responds when the user taps or clicks a control.
Text – Text that appears on a control or that the user types into a control.

Additional properties
Align – The location of text in relation to the horizontal center of its control.
AutoDisableOnSelect – Automatically disables the control while the OnSelect behavior is
running.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
Color – The color of text in a control.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is
disabled (Disabled).
DisabledBorderColor – The color of a control's border if the control's DisplayMode
property is set to Disabled.
DisabledColor – The color of text in a control if its DisplayMode property is set to
Disabled.
DisabledFill – The background color of a control if its DisplayMode property is set to
Disabled.
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Fill – The background color of a control.
Font – The name of the family of fonts in which text appears.
FontWeight – The weight of the text in a control: Bold, Semibold, Normal, or Lighter.
Height – The distance between a control's top and bottom edges.
HoverBorderColor – The color of a control's border when the user keeps the mouse pointer
on that control.
HoverColor – The color of the text in a control when the user keeps the mouse pointer on it.
HoverFill – The background color of a control when the user keeps the mouse pointer on it.
Italic – Whether the text in a control is italic.
PaddingBottom – The distance between text in a control and the bottom edge of that control.
PaddingLeft – The distance between text in a control and the left edge of that control.
PaddingRight – The distance between text in a control and the right edge of that control.
PaddingTop – The distance between text in a control and the top edge of that control.
Pressed – True while a control is being pressed, false otherwise.
PressedBorderColor – The color of a control's border when the user taps or clicks that
control.
PressedColor – The color of text in a control when the user taps or clicks that control.
PressedFill – The background color of a control when the user taps or clicks that control.
RadiusBottomLeft – The degree to which the bottom-left corner of a control is rounded.
RadiusBottomRight – The degree to which the bottom-right corner of a control is rounded.
RadiusTopLeft – The degree to which the top-left corner of a control is rounded.
RadiusTopRight – The degree to which the top-right corner of a control is rounded.
Size – The font size of the text that appears on a control.
Strikethrough – Whether a line appears through the text that appears on a control.
TabIndex – Keyboard navigation order in relation to other controls.
Tooltip – Explanatory text that appears when the user hovers over a control.
Underline – Whether a line appears under the text that appears on a control.
VerticalAlign – The location of text on a control in relation to the vertical center of that
control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container
(screen if no parent container).
Y – The distance between the top edge of a control and the top edge of the parent container
(screen if no parent container).

Related functions
Navigate( ScreenName, ScreenTransitionValue )

Examples
Add a basic formula to a button
1. Add a Text input control, and name it Source.
Don't know how to add, name, and configure a control?
2. Add a Button control, set its Text property to "Add", and set its OnSelect property to
this formula:
UpdateContext({Total:Total + Value(Source.Text)})
Want more information about the UpdateContext function or other functions?
3. Add a Label control, set its Text property to Total, and then press F5.
4. Clear the default text from Source, type a number in it, and then click or tap Add.
The Label control shows the number that you typed.
5. Clear the number from Source, type another number in it, and then click or tap Add.
The Label control shows the sum of the two numbers that you typed.
6. (optional) Repeat the previous step one or more times.
7. To return to the default workspace, press Esc (or click or tap the close icon in the upper-
right corner).
Configure a button with multiple formulas
Add a formula that clears the Text input control between entries.
1. Set the HintText property of Source to "Enter a number".
2. Set the OnSelect property of Add to this formula:
UpdateContext({Total:Total + Value(Source.Text)});
UpdateContext({ClearInput: ""})

NOTE
Separate multiple formulas with a semi-colon “;”.

3. Set the Default property of Source to ClearInput.


4. Press F5, and then test the app by adding several numbers together.
Add another button to reset the total
Add a second button to clear the total between calculations.
1. Add another Button control, set its Text property to "Clear", and set its OnSelect
property to this formula:
UpdateContext({Total:0})
2. Press F5, add several numbers together, and then click or tap Clear to reset the total.
Change a button's appearance
Change a button's shape
By default, Power Apps creates a rectangular Button control with rounded corners. You can
make basic modifications to the shape of a Button control by setting its Height, Width, and
Radius properties.
NOTE
Icons and Shapes provide a wide variety of designs and can perform some of the same basic functions
that Button controls do. However, Icons and Shapes don’t have a Text property.

1. Add a Button control, and set its Height and Width properties to 300 to make a large
square button.
2. Modify the RadiusTopLeft, RadiusTopRight, RadiusBottomLeft, and
RadiusBottomRight properties to adjust the amount of curvature on each corner.
Here are some examples of different shapes, each one starting from a 300 x 300 square
button:
Set all four Radius values to 150 to create a circle.
Set the values for RadiusTopLeft and RadiusBottomRight to 300 to create a leaf-
shaped Button.
Set the values for RadiusTopLeft and RadiusTopRight to 300, and the values for
RadiusBottomLeft and RadiusBottomRight to 100 to create a tab-shaped button.
Change a button's color when you hover over it
By default, the fill color of a Button control will dim by 20% when you hover over it with a
mouse. You can adjust this behavior by changing the HoverFill property, which uses the
ColorFade function. If you set the ColorFade formula to a positive percentage, the color
becomes lighter when you hover over the button, while a negative percentage makes the color
darker.
Change the ColorFade percentage in the HoverFill property of one of the buttons that
you created, and observe the effects.
You can also specify the color of a Button control by setting its HoverFill property to a
formula that contains the ColorValue function instead of the ColorFade function, as in
ColorValue("Red").

NOTE
The color value can be any CSS color definition, either a name or a hex value.

Replace the ColorFade function with a ColorValue function in one of the buttons that you
created, and observe the effects.

Accessibility guidelines
Color contrast
Standard color contrast requirements apply.
Screen reader support
Text must be present.
Keyboard support
TabIndex must be zero or greater so that keyboard users can navigate to it.
Focus indicators must be clearly visible. Use FocusedBorderColor and
FocusedBorderThickness to achieve this.
Camera control in Power Apps
3/17/2020 • 4 minutes to read • Edit Online

A control that enables users to take pictures using the camera on a device.

Description
Use the Camera control to capture pictures with a device's camera. The device must have a camera and the
user must authorize the app to use the camera. The camera control is supported when running in a web
browser.
The most recently captured picture is available through the Photo property. With this property, the images
can be:
Viewed with the Image control. Use the Image control to view the captured image. For more
information, see the examples.
Temporarily put in a variable or a collection. Use the Set or Collect functions to store images in a
variable or a collection. Use caution when using multiple images in a collection at the same time
consuming device's limited memory. Use the SaveData and LoadData functions to move images to the
local storage on the device and for offline scenarios.
Stored in a database. Use the Patch function to store images in a database.
Transmitted as a base64 encoded text string. Use the JSON function to base64 encode images.
Use the Stream, StreamRate, and OnStream properties to automatically capture images on a timer, for
example snapping a picture every minute to create a time-lapse sequence.
Captured media is referenced by a text string URI. For more information, read the data type documentation.
Images generated by the camera control aren't usually in the full resolution of the camera. If you need full
resolution images, use the Add picture control.

Key properties
Camera – On a device that has more than one camera, the numeric ID of the camera that the app uses.
OnStream – How the app responds when the Stream property is updated.
Photo – The image captured when the user takes a picture.
Stream – Automatically updated image based on the StreamRate property.
StreamRate – How often to update the image on the Stream property, in milliseconds. This value can
range from 100 (1/10th of a second) to 3,600,000 (1 hour).

Additional properties
AccessibleLabel – Label for screen readers. Should describe the purpose of taking a picture.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
Brightness – How much light the user is likely to perceive in an image.
Contrast – How easily the user can distinguish between similar colors in an image.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled
(Disabled).
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Height – The distance between a control's top and bottom edges.
OnSelect – How the app responds when the user taps or clicks a control.
TabIndex – Keyboard navigation order compared to other controls.
Tooltip – Explanatory text that appears when the user hovers over a control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container or screen.
Y – The distance between the top edge of a control and the top edge of the parent container or screen.

Examples
For these examples, you'll need a device with a camera. To test your app, use a web cam accessible from
your browser. Or by saving your app and loading it into an iOS or Android device with a camera.
Simple display of a captured picture
1. Add a Camera control.
2. Authorize the app to use device's camera if prompted.
3. Add an Image control.
4. Set the Image property of the Image control to this formula:

Camera1.Photo

NOTE
Replace camera control name Camera1 as appropriate.

5. Press F5 to preview your app.


6. Take a picture by selecting or tapping the camera control. You should see the result in your image
control.
Add pictures to an Image gallery control
1. Add a Camera control, name it MyCamera, and set its OnSelect property to this formula:

Collect( MyPix, MyCamera.Photo )

For more information:


How to add, name, and configure a control?
Read more about Collect function or other functions.
2. Press F5, and then take a picture by selecting or tapping MyCamera.
3. Add a Vertical gallery control. And then resize its Image control, its template, and the Image gallery
control itself to fit in the screen.
4. Set the Items property of the Image gallery control to this formula:

MyPix

5. Set the Image property of the Image control in the gallery to this formula:

ThisItem.Url

The picture that you took appears in the Image gallery control.
6. Take as many pictures as you want, and then return to the default workspace by pressing Esc.
7. (optional) Set the OnSelect property of the Image control in the Image gallery control to the
formula:

Remove( MyPix, ThisItem )

8. Press F5, and then select a picture to remove it.


Use the SaveData function to save the pictures locally or the Patch function to update a data source.

Accessibility guidelines
The camera control shows camera feed and also functions as a button that takes a picture. So, there are
similar accessibility considerations as with buttons.
Video alternatives
Consider adding an alternative form of input for users with visual disabilities. For example, Add picture to
allow users to upload an image from their device.
Color contrast
There must be adequate color contrast between FocusedBorderColor and the outside color.
Screen reader support
AccessibleLabel must be present.
Keyboard support
TabIndex must be zero or greater so that keyboard users can navigate to it.
Focus indicators must be clearly visible. Use FocusedBorderColor and FocusedBorderThickness to
update the visibility of focus indicators.
Card control in Power Apps
12/3/2019 • 5 minutes to read • Edit Online

Provides the display and editing experience for a single field of a Display form or Edit form
control.

Description
Display form and Edit form controls act as containers for displaying and viewing entire
records. Each container can hold a set of Card controls that display individual fields or provide a
way to update those fields. Each card has a DataField property that specifies which field of the
record it works on.
Predefined cards are defined for different data types and user experiences. For example, there
may be a card to edit a number field with a Text input control, which is great for use with the
keyboard. Another card might support editing a number by using a Slider control instead. With
the form control selected, you can, in the right-hand pane, easily select a card based on a field.
Cards themselves contain controls. The controls of a card make up the experience for displaying
and editing a single field. For example, a number card may consist of a Label control to provide
the display name of the field and a Text input control to provide an editor for the value of the
field. The card may also have a Label control that shows any validation errors that occur and a
Label control for the common asterisk to indicate that a field is required.
You can customize the controls of a predefined card by resizing it, moving it, hiding it, adding
controls to it, and making other changes. You can also start with an entirely blank card, a
"custom card", to which you add controls from scratch.
Predefined cards are locked by default. In a locked card, you can modify only certain properties
of the card or the controls within the card, and you can't delete a locked card. You can show the
card lock and unlock it on the View tab of the Advanced view. If a property is locked and can't
be modified, it appears with a lock icon next to its name. Unlocking a card is an advanced activity
and should be done with care, because automatic formula generation will no longer occur for the
card, and you can't relock a card.
Within the form's container, the ThisItem record is available and contains all the fields of the
record. For example, the card's Default property is often set to ThisItem.FieldName.
You can use the Parent reference to configure a control to reference the properties of a card. For
example, a control should use Parent.Default to read the initial state of the field from the data
source. By using Parent instead of directly accessing the information that you want, the card is
better encapsulated, and you can change it to a different field without breaking internal formulas.
See Understand data cards for examples of how to customize, unlock, and create cards.

Key properties
DataField – The name of the field within a record that this card displays and edits.
Specify the name as a single static string that's enclosed in double quotation marks (for
example, "Name"), not a formula.
Unbind a card by setting its DataField property blank. The Valid and Update properties are
ignored for unbound cards.
Default – The initial value of a control before it is changed by the user.
For each control in a card, set this property to Parent.Default to refer to the default value of
the field according to the data source. For example, set a slider's Default property to
Parent.Default to ensure that the user starts with a generic value for that slider.
DisplayMode – Values can be Edit, View, or Disabled. Configures whether the control inside
the card allows user input (Edit), only displays data (View) or is disabled (Disabled).
Allows a single card to be used in both edit and view forms, by configuring this property,
which is tied to the Form's behavior by default.
In View mode, child controls such as Text input, Drop down, Date Picker will only display
the text value and will not render any interactive elements or decorations.
DisplayName – The user friendly name for a field in a data source.
The DataSourceInfo function provides this metadata from the data source.
Controls within the card should use Parent.DisplayName to refer to the name of the field.
Error – The user friendly error message to display for this field when validation fails.
This property is set when SubmitForm is called.
The message describes validation problems based on the data source's metadata and
checking the card's Required property.
Required – Whether a card, editing the field of a data source, must contain a value.
The DataSourceInfo function provides the required metadata from the data source.
Controls within the card should use Parent.Required to determine whether that card's field
is required.
Update – The value to write back to the data source for a field.
Use this property's formula to pull the values from the edit controls of the card in order to
write back to the data source. For example, set a card's Update property to Slider.Value to
update the data source with a value from the slider in that card.
Width – The distance between a control's left and right edges.
WidthFit – Whether a control automatically grows horizontally to fill any empty space in a
container control such as an Edit form control. If multiple cards have this property set to true,
the space is divided between them. For more information, see Understand data form layout.

Additional properties
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
Fill – The background color of a control.
Height – The distance between a control's top and bottom edges.
Valid – Whether a Card or Edit form control contains valid entries, ready to be submitted to the
data source.
Visible – Whether a control appears or is hidden.
X – The distance between the left edge of a control and the left edge of its parent container
(screen if no parent container). For a Card control in a container that has multiple columns, this
property determines the column in which the card appears.
Y – The distance between the top edge of a control and the top edge of the parent container
(screen if no parent container). For a Card control in a container that has multiple rows, this
property determines the row in which the card appears.

Examples
See Understand data cards and Understand data form layout for examples.

Accessibility guidelines
Color contrast
There must be adequate color contrast between:
Fill and any child controls. For example, if a card contains a Label and the label has
transparent fill, then the card's Fill effectively becomes the background color for the label.
Thus, there should be adequate contrast between the card's Fill and the label's Color.
Screen reader support
DisplayName must be present.
Check box control in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

A control that the user can select or clear to set its value to true or false.

Description
The user can specify a Boolean value by using this familiar control, which has been used in GUIs for
decades.

Key properties
Default – The initial value of a control before it is changed by the user.
Text – Text that appears on a control or that the user types into a control.
Value – The value of an input control.

Additional properties
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
CheckboxBackgroundFill – The background color of the box that surrounds the checkmark in a
checkbox control.
CheckboxBorderColor – The color of the border that surrounds the checkmark in a checkbox control.
CheckboxSize – The width and height of the box that surrounds the checkmark in a checkbox control.
CheckmarkFill – The color of the checkmark in a checkbox control.
Color – The color of text in a control.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled
(Disabled).
DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to
Disabled.
DisabledColor – The color of text in a control if its DisplayMode property is set to Disabled.
DisabledFill – The background color of a control if its DisplayMode property is set to Disabled.
Fill – The background color of a control.
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Font – The name of the family of fonts in which text appears.
FontWeight – The weight of the text in a control: Bold, Semibold, Normal, or Lighter.
Height – The distance between a control's top and bottom edges.
HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that
control.
HoverColor – The color of the text in a control when the user keeps the mouse pointer on it.
HoverFill – The background color of a control when the user keeps the mouse pointer on it.
Italic – Whether the text in a control is italic.
OnCheck – How an app responds when the value of a checkbox or a toggle changes to true.
OnSelect – How the app responds when the user taps or clicks a control.
OnUncheck – How an app responds when the value of a checkbox or a toggle changes to false.
PaddingBottom – The distance between text in a control and the bottom edge of that control.
PaddingLeft – The distance between text in a control and the left edge of that control.
PaddingRight – The distance between text in a control and the right edge of that control.
PaddingTop – The distance between text in a control and the top edge of that control.
PressedBorderColor – The color of a control's border when the user taps or clicks that control.
PressedColor – The color of text in a control when the user taps or clicks that control.
PressedFill – The background color of a control when the user taps or clicks that control.
Reset – Whether a control reverts to its default value.
Size – The font size of the text that appears on a control.
Strikethrough – Whether a line appears through the text that appears on a control.
TabIndex – Keyboard navigation order in relation to other controls.
Tooltip – Explanatory text that appears when the user hovers over a control.
Underline – Whether a line appears under the text that appears on a control.
VerticalAlign – The location of text on a control in relation to the vertical center of that control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no
parent container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no
parent container).

Related functions
If( Condition, Result )

Example
1. Add a Check box control, name it chkReserve, and set its Text property to show Reserve now.
Don't know how to add, name, and configure a control?
2. Add a Date picker control, and set its Visible property to this formula:
If(chkReserve.Value = true, true)
Want more information about the If function or other functions?
3. Press F5, click or tap chkReserve to set its Value property to true, and then click or tap
chkReserve again to set its Value property to false.
The Date Picker control appears when the Value property of chkReserve is true but not when it's
false.
4. To return to the default workspace, press Esc.

Accessibility guidelines
Color contrast
There must be adequate color contrast between:
CheckmarkFill and CheckboxBackgroundFill
CheckboxBackgroundFill and Fill
CheckboxBackgroundFill and PressedFill
CheckboxBackgroundFill and HoverFill
This is in addition to the standard color contrast requirements.
Screen reader support
Text must be present.
Keyboard support
TabIndex must be zero or greater so that keyboard users can navigate to it.
Focus indicators must be clearly visible. Use FocusedBorderColor and FocusedBorderThickness to
achieve this.
Column chart and Line chart controls in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Controls that show data as graphs with x- and y-axes.

Description
Column chart and Line chart are grouped controls. Each group contains three controls: a Label for the title, the
chart graphic, and a Legend.

Chart key properties


Items – The source of data that appears in a control such as a gallery, a list, or a chart.
NumberOfSeries – How many columns of data are reflected in a column or line chart.

Additional chart properties


BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
Color – The color of text in a control.
DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to Disabled.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled (Disabled).
Font – The name of the family of fonts in which text appears.
GridStyle – Whether a column or line chart shows its x-axis, its y-axis, both, or neither.
Height – The distance between a control's top and bottom edges.
HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that control.
ItemColorSet – The color of each data point in a chart.
ItemsGap – The distance between columns in a column chart.
The ItemsGap property is available for the Column chart control but not the Line chart control.
Markers – Whether a column or line chart shows the value of each data point.
MarkerSuffix – Text that appears after each value in a column chart for which the Markers property is set to true.
The MarkerSuffix property is available for the Column chart control but not the Line chart control.
MinimumBarWidth – The narrowest possible width of columns in a column chart.
The MinimumBarWidth property is available for the Column chart control but not the Line chart control.
OnSelect – How the app responds when the user taps or clicks a control.
PaddingBottom – The distance between text in a control and the bottom edge of that control.
PaddingLeft – The distance between text in a control and the left edge of that control.
PaddingRight – The distance between text in a control and the right edge of that control.
PaddingTop – The distance between text in a control and the top edge of that control.
PressedBorderColor – The color of a control's border when the user taps or clicks that control.
SeriesAxisMax – The maximum value of the y-axis for a column or line chart.
The SeriesAxisMax property is available for the Column chart control but not the Line chart control.
SeriesAxisMin – A number that determines the minimum value of the y-axis for a column chart.
The SeriesAxisMin property is available for the Column chart control but not the Line chart control.
Size – The font size of the text that appears on a control.
TabIndex – Keyboard navigation order in relation to other controls.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent
container).
XLabelAngle – The angle of the labels below the x-axis of a column or line chart.
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent
container).
YAxisMax – The maximum value of the y-axis for a line chart.
The YAxisMax property is available for the Line chart control but not the Column chart control.
YAxisMin – The minimum value of the y-axis for a line chart.
The YAxisMin property is available for the Line chart control but not the Column chart control.
YLabelAngle – The angle of the labels next to the y-axis of a line or column chart.

Related functions
Max( DataSource, ColumnName )

Example
1. Add a Button control, and set its OnSelect property to this formula:
Collect(Revenue, {Year:"2013", Europa:24000, Ganymede:22300, Callisto:21200}, {Year:"2014",
Europa:26500, Ganymede:25700, Callisto:24700},{Year:"2014", Europa:27900, Ganymede:28300,
Callisto:25600})
Don't know how to add and configure a control?
Want more information about the Collect function or other functions?
2. Press F5, click or tap the Button control, and then press Esc to return to the default workspace.
3. Add a Column chart control or a Line chart control, set its Items property to Revenue, and set its
NumberOfSeries property to 3.
The control shows revenue data for each product over three years.
Accessibility guidelines
Color contrast
There must be adequate color contrast between:
each item in ItemColorSet
every item in ItemColorSet and the background color
Color and the background color
Screen reader support
There must be a Label immediately before the chart graphic to serve as the title.
Consider adding a summary of the chart graphic. For example, "The line chart shows a steady increase in
sales between March and August this year."

NOTE
Chart graphics and Legend are hidden from screen reader users. As an alternative, a tabular form of the data is
presented to them. They can also cycle through buttons that select data in the chart.

Low vision support


There must be a Legend if more than one series is shown.
Consider setting GridStyle to GridStyle.All, which shows both axes. This helps all users accurately determine the
scale of the data.
For Column chart, consider setting Markers to true. This helps low -vision users determine the value of a
column.
Keyboard support
TabIndex must be zero or greater so that keyboard users can navigate to it.

NOTE
When keyboard users navigate to the chart, they can cycle through buttons that select data in the chart.
Column control in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Provides the display experience for a single field in a Data table control.

Description
The Data table control shows a dataset in a tabular format, and each column in that tabular format is represented
by a Column control. The Column control provides properties that the app maker can use to customize the
appearance and behavior of the column.

Capabilities
Now available
Change the width of a Column control.
Change the text for a Column control.
Navigate by clicking or tapping the value in a Column control.
Not yet available
Customize the styling of a Column control.
Known issues
The Visible property doesn't work yet.

Properties
DisplayName – The text that appears in the header for the column.

NOTE
This property will soon be renamed HeaderText.

IsHyperlink – A value that indicates whether the data in the column should be underlined to indicate that
it's a hyperlink.
Width – The distance between the Column control’s left and right edges.

Examples
Resize a column
1. Create a blank tablet app.
2. On the Insert tab, click or tap Data table, and then resize the Data table control so that it covers the whole
screen.
3. In the right pane, click or tap the down arrow to the right of No data source selected, and then click or tap
Add a data source.
4. In the list of connections, click or tap the connection for your Common Data Service database.
5. In the list of entities, click or tap Account, and then click or tap Connect.
The Data table control is initialized and shows a set of default fields.
6. Click or tap the Full name column.

7. Drag the adorner on the right side to resize the field.

Accessibility guidelines
Screen reader support
DisplayName must be present.
Combo box control in Power Apps
12/3/2019 • 3 minutes to read • Edit Online

A control that allows users to make selections from provided choices. Supports search and multiple selections.

Description
A Combo box control allows you to search for items you will select. The search is performed server-side on the
SearchField property so performance is not affected by very large data sources.
Single or multi-select mode is configured via the SelectMultiple property.
When searching for items to select, for each item you can choose to show a single data value, two values, or a
picture and two values (Person) by modifying the Layout settings in the Data pane.

People picker
To use Combo box as a people picker, choose the Person template from the Layout settings in the Data pane
and configure the related data properties to be shown for the person below.

Key properties
Items – The source of data from which selections can be made.
DefaultSelectedItems – The initial selected item(s) before the user interacts with the control.
SelectedItems – List of selected items resulting from user interaction.
SelectMultiple – Whether the user can select a single item or multiple items.
IsSearchable – Whether the user can search for items before selecting.
SearchFields - The data fields of the data source searched when user is entering text. To search on multiple
fields, set ComboBox1.SearchFields = ["MyFirstColumn", "MySecondColumn"]

Additional properties
AccessibleLabel – Label for screen readers.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
DisplayFields – List of fields shown for each item returned by the search. Easiest to configure via the Data pane
in the Properties option tab.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled
(Disabled).
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Height – The distance between a control's top and bottom edges.
InputTextPlaceholder – Instructional text shown to end-users when no items are selected.
OnChange – How the app responds when the user changes a selection.
OnNavigate – How the app responds when the user clicks on an item.
OnSelect – How the app responds when the user taps or clicks a control.
TabIndex – Keyboard navigation order in relation to other controls.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent
container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent
container).

Example
1. On the Insert tab, open the Controls menu, and then select Combo box.
2. On the Properties tab of the right-hand pane, open the Select a data source list (next to Items), and
then add or select a data source.
3. On the same tab, select Edit (next to Fields).
4. In the Data pane, open the Primary text list, and then select the column that you want to show in the
Combo box control.
5. While holding down the Alt key, select the down arrow to open the Combo box control.
The control shows the data from the column that you specified in the data source that you specified.
6. (optional) To show the first record by default, set the DefaultSelectedItems property to this expression,
replacing DataSource with the name of your data source:
First(DataSource)

Accessibility guidelines
Color contrast
There must be adequate color contrast between:
ChevronFill and ChevronBackground
ChevronHoverFill and ChevronHoverBackground
SelectionColor and SelectionFill
SelectionFill and Fill
SelectionTagColor and SelectionTagFill
This is in addition to the standard color contrast requirements.
Screen reader support
AccessibleLabel must be present.
NOTE
On touch screens, screen reader users can navigate the contents of the combo box sequentially. The combo box
acts as a button that shows or hides its contents when selected.

Keyboard support
TabIndex must be zero or greater so that keyboard users can navigate to it.
Focus indicators must be clearly visible. Use FocusedBorderColor and FocusedBorderThickness to
achieve this.

NOTE
The tab key navigates to or away from the combo box. Arrow keys navigate the contents of the combo box. The
escape key closes the drop down when opened.
Container control in Power Apps (experimental)
12/3/2019 • 2 minutes to read • Edit Online

Provides the ability to create hierarchy.

IMPORTANT
This is an experimental feature. Experimental features can radically change or completely disappear at any time. For more
information, read Understand experimental and preview features in Power Apps.

Description
The container can hold a set of controls and has its own properties.
You can start with inserting a blank container, then customize it by adding controls to it, resizing it, moving it,
hiding it, and making other changes. You can also start with a number of controls, select them and add them into a
container through the context menu in the tree view or right click on the canvas.

Properties
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
Fill – The background color of a control.
Height – The distance between a control's top and bottom edges.
Width – The distance between a control's left and right edges.
Visible – Whether a control appears or is hidden.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent
container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent
container).

Known limitations
Containers do not work with canvas components or within forms.

Frequently asked questions


What is the difference between a container and a group? The authoring group is a lightweight concept used
for moving around controls and bulk editing similar properties of controls within the group. The authoring group
does not affect the layout of the app.
The container control previously shipped in experimental as a replacement for the authoring group renamed as the
enhanced group. It was renamed to the container control as there is value in both a lightweight authoring group
and a strutured container control with additional properties.
Data table control in Power Apps
12/3/2019 • 5 minutes to read • Edit Online

Shows a set of data in a tabular format.

Description
The Data table control shows a dataset in a format that includes column headers for each field that the control
shows. As an app maker, you have full control over which fields appear and in what order. Like the Gallery
control, the Data table control maintains a Selected property that points to the selected row. Therefore, you can
link the Data table control to other controls.

Capabilities
Power Apps introduced the Data table control on May 5, 2017. This section provides information about
capabilities that are supported and capabilities that aren't supported.
Now available
Data in a Data table control is read-only.
A single row is always selected in a Data table control.
Link a Data table control to a connected or local data source.
Adjust column widths in a Data table control while you run the app, though your changes aren't saved.
A set of default fields appear in a Data table control when you link it to a connector that has implemented
this capability, such as the Common Data Service. You can then show or hide these fields and others as
necessary.
Customize column width and heading text.
Show hyperlinks in a Data table control.
Copy and paste a Data table control.
Not yet available
Customize the styling of individual columns.
Add a Data table control in a form control.
Change the height of all rows.
Show images in a Data table control.
Show fields from related entities.
Use built-in functionality to filter and sort data by column heading.
Add a Data table control in a Gallery control.
Edit data in the Data table control.
Select multiple rows.
Known issues
No data appears if you use the FirstN function in the Items property.

Key properties
Items – The source of data that appears in the Data table control.
Selected – The selected row in the Data table control.
Other properties
BorderColor – The color of the Data table control's border.
BorderStyle – The style of the Data table control's border. The options are Solid, Dashed, Dotted, and
None.
BorderThickness – The thickness of the Data table control's border.
Color – The default text color for all data rows.
Fill – The default background color for all data rows.
Font - The default font for all data rows.
FontWeight – The default font weight for all data rows.
HeadingColor – The text color for the column headings.
HeadingFill – The background color of the column headings.
HeadingFont – The font of the column headings.
HeadingFontWeight – The font weight of the column headings.
HeadingSize – The font size of the column headings.
Height – The distance between the Data table control's top and bottom edges.
HoverColor – The text color for the row that the mouse pointer is pointing at.
HoverFill – The background color of the row that the mouse pointer is pointing at.
NoDataText – The message that the user receives when there are no records to show in the Data table
control.
SelectedColor – The color of the text in the selected row.
SelectedFill – The background color of the selected row.
Size – The default font size for all data rows.
Visible – A value that determines whether the Data table control appears or is hidden.
Width – The distance between the Data table control's left and right edges.
X – The distance between the left edge of the Data table control and the left edge of its parent container (or
the left edge of the screen if there is no parent container).
Y – The distance between the top edge of the Data table control and the top edge of its parent container (or
the top edge of the screen if there is no parent container).

Related functions
Filter(DataSource, Formula)(DataSource, Formula)
Search(DataSource, SearchString, Column)(DataSource, SearchString, Column)

Examples
Basic usage
1. Create a blank tablet app.
2. On the Insert tab, click or tap Data table.

A Data table control is added to the screen.


3. Rename the Data table control SalesOrderTable, and resize it so that it covers the whole screen.
4. In the right pane, click or tap the down arrow to the right of the No data source selected text, and then
click or tap Add a data source.

5. In the list of connections, click or tap the connection for your Common Data Service database.

6. In the list of entities, click or tap Sales order, and then click or tap Connect.
The Data table control is now attached to the Sales order data source. Several initial fields appear in the
Data table control, because we're using a connector that supports that capability.

7. In the right pane, select one or more check boxes to show or hide individual fields.
For example, select the check box next to CustomerPurchaseOrderReference to hide this field.
8. In the right pane, reorder the fields by dragging them up or down.
The SalesOrderTable control shows the fields in the order that you specified.

Restyle the header for the Data table control


1. While the Data table control is selected, in the right pane, click or tap the Advanced tab.
2. Click or tap the field for the HeadingFill property, and then change the value to RGBA (62,96,170,1).
3. Click or tap the field for the HeadingColor property, and then change the value to White.
4. Click or tap the field for the HeadingSize property, and then change the value to 14.
Connect a Data table control to another control
1. Add an Edit form control to the screen.
2. Resize the Data table and Edit form controls so that the Data table control appears in the left part of
the screen and the Edit form control appears in the right part of the screen.

3. While Form1 is selected, in the right pane, change the number of columns to 1.
4. Connect Form1 to the Sales order data source.
Several initial fields appear in Form1.
5. In the right pane, click or tap the Advanced tab.
6. Set the Item property for Form1 to SalesOrderTable.Selected.
Form1 shows information from the row that's selected in the Data table control.

Accessibility guidelines
Color contrast
There must be adequate color contrast between:
Color and Fill
HeadingColor and HeadingFill
SelectedColor and SelectedFill
HoverColor and HoverFill
This is in addition to the standard color contrast requirements.
Screen reader support
NoDataText must be present.
Date Picker control in Power Apps
12/21/2019 • 4 minutes to read • Edit Online

A control that the user can click or tap to specify a date.

Description
If you add a Date Picker control instead of a Text input control, you help ensure that the user specifies a
date in the correct format.

Key properties
DefaultDate – The initial value of a date control unless the user changes it.
SelectedDate – The date currently selected in a date control. This date is represented in local time.
Format – The text format in which the control shows the date and the user specifies the date. You can set
this property to ShortDate (default) or LongDate to format dates based on the Language property of this
control. You can also set this property to an expression, such as yyyy/mm/dd if you want the same format
regardless of language. For example:
The control shows 12/31/2017 if the user clicks or taps the last day of 2017, the Format property is set
to ShortDate, and the Language property is set to en-us.
The control shows dimanche 31 decembre 2017 if the user clicks or taps the last day of 2017, the
Format property is set to LongDate, and the Language property is set to fr-fr.
Language – Determines the language that's used to format dates, including names of months. If this
property isn't specified, the user's device setting determines the language. Supported values include "EN -us"
and "FR".

Additional properties
AccessibleLabel – Label for screen readers.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
Color – The color of text in a control.
DateTimeZone – Whether to display the date in UTC or the user's Local time.
DisplayMode – Whether the control allows user input (Edit), only displays data (View ), or is disabled
(Disabled).
DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to
Disabled.
DisabledColor – The color of text in a control if its DisplayMode property is set to Disabled.
DisabledFill – The background color of a control if its DisplayMode property is set to Disabled.
EndYear – The latest year to which the user can set value of a date-picker control.
Fill – The background color of a control.
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Font – The name of the family of fonts in which text appears.
FontWeight – The weight of the text in a control: Bold, Semibold, Normal, or Lighter.
Height – The distance between a control's top and bottom edges.
IconFill – The foreground color of a the date picker icon.
IconBackground – The background color of a the date picker icon.
InputTextPlaceholder – Instructional text that appears if no dates are entered.
IsEditable – Whether the datepicker text can be edited. If false, the date can only be changed by using the
calendar.
Italic – Whether the text in a control is italic.
OnSelect – How the app responds when the user taps or clicks a control.
PaddingBottom – The distance between text in a control and the bottom edge of that control.
PaddingLeft – The distance between text in a control and the left edge of that control.
PaddingRight – The distance between text in a control and the right edge of that control.
PaddingTop – The distance between text in a control and the top edge of that control.
Size – The font size of the text that appears on a control.
StartOfWeek – The day of the week to display in the first day column of the date-picker control.
StartYear – The earliest year to which the user can set the value of a date-picker control.
TabIndex – Keyboard navigation order in relation to other controls.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no
parent container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no
parent container).

Related functions
Year( DateTimeValue )

Example
1. Add a Date Picker control, and name it Deadline.
Don't know how to add, name, and configure a control?
2. Add a Label control, and set its Text property to this formula:
DateDiff(Today(), Deadline.SelectedDate) & " days to go!"
Want more information about the DateDiff function or other functions?
3. Press F5, choose a date in Deadline, and then click or tap OK.
The Label control shows the number of days between today and the date that you chose.
4. To return to the default workspace, press Esc.

Accessibility guidelines
Color contrast
Standard color contrast requirements apply.
Screen reader support
AccessibleLabel must be present.
Keyboard support
TabIndex must be zero or greater so that keyboard users can navigate to it.
Focus indicators must be clearly visible. Use FocusedBorderColor and FocusedBorderThickness to
achieve this.

TIP
When the calendar is open, press Page up and Page down to navigate between months and Shift+Page up and
Shift+Page down to navigate between years.
Edit form and Display form controls in Power Apps
12/3/2019 • 10 minutes to read • Edit Online

Display, edit, and create a record in a data source.

Description
If you add a Display form control, the user can display all fields of a record or only the fields that you specify. If
you add an Edit form control, the user can edit those fields, create a record, and save those changes to a data
source.

If you add a Gallery control, you can configure it to show a table in a data source and then configure a form to
show whichever record the user selects in the gallery. You can also add one or more Button controls that the user
can select to save edits, cancel edits, and create a record. By using controls together, you can create a complete
solution.
Record selection
For either type of form, you set its DataSource property to a table of records, and you set the form's Item
property to show a specific record in that table. For example, you can set the Item property of a form to the
SelectedItem property of a Gallery control. When the user selects a record in the gallery, the same record
appears in the form, except that the form can show more fields. If the user returns to the gallery and selects a
different record, the SelectedItem property of the gallery changes. This change updates the Item property of the
form, which then shows the newly selected record.
You can also set a form's Item property by using a Drop down control, as Show, edit, or add a record describes, or
a function such as Lookup or First. For example, you can set the Item property to either of these formulas to show
the Fabrikam entry in the Accounts entity in Common Data Service:
First(Accounts)

Lookup(Accounts, "Fabrikam" in name)

Each form control contains one or more Card controls. By setting the DataField property of a card, you specify
which field that card shows and other details.
Create a record
When an Edit form control is in Edit mode, the user can update the record that's specified in the form's Item
property. If inspected, the Mode property returns Edit.
When an Edit form control is in New mode, however, the Item property is ignored. The form doesn't show an
existing record; instead, the values in each field match the default values of the data source with which you
configured the form. The NewForm function causes a form to switch to this mode.
For example, you can set the Text property of a button to show New and its OnSelect property to a formula that
includes the NewForm function. If the user selects that button, the form switches to New mode so that the user
can create a record starting with known values.
A form switches back to Edit mode if either the ResetForm function runs or the SubmitForm function runs
successfully.
You can set the Text property of a button to show Cancel and its OnSelect property to a formula that includes
the ResetForm function. If the user selects that button, any changes in progress are discarded, and the values in
the form, once again, match the default values of the data source.
You can set the Text property of a button to show Save changes and its OnSelect property to a formula that
includes the SubmitForm function. If the user selects that button and the data source is updated, the values in
the form are reset to the default values of the data source.
Save changes
If you create a Save changes button as the previous section describes, the user can create or update a record and
then select that button to save those changes to the data source. You could, instead, configure an Image control or
some other control to perform the same task, as long as you configure that control with the SubmitForm function.
In any case, the Error, ErrorKind, OnSuccess, and OnFailure properties provide feedback on the outcome.
When the SubmitForm function runs, it first validates the data that user wants to submit. If a required field doesn't
contain a value or another value doesn't conform to some other constraint, the ErrorKind properties are set, and
the OnFailure formula runs. You can configure the Save changes button or other control so that the user can
select it only if the data is valid (that is, if the Valid property of the form is true). Note that the user must not only
correct the problem but also select the Save changes button again (or discard the changes by selecting a Cancel
button, as described earlier) to reset the Error and ErrorKind properties.
If the data passes validation, SubmitForm sends it to the data source, which can take some time depending on
network latency.
If the submission succeeds, the Error property is cleared, the ErrorKind property is set to ErrorKind.None, and
the OnSuccess formula runs. If the user created a record (that is, if the form was previously in New mode), the
form is switched to Edit mode so that the user can edit the newly created record or a different one.
If the submission fails, the Error property contains a user-friendly error message from the data source,
explaining the problem. The ErrorKind property is set appropriately, depending on the issue, and the OnFailure
formula runs.
Some data sources can detect when two people try to update the same record at the same time In this case,
ErrorKind is set to ErrorKind.Conflict, and the remedy is to refresh the data source with the other user's changes
and reapply the change made by this user.

TIP
If you offer a Cancel button on your form so that the user can abandon changes in progress, add the ResetForm function to
the button's OnSelect property even that property also contains a Navigate function to change screens. Otherwise, the
form will retain the user's changes.

Layout
By default, cards are placed in a single column for phone apps and three columns for tablet apps. You can specify
how many columns a form has and whether cards should snap to them as you configure the form. These settings
aren't exposed as properties because they're used only to set the X, Y, and Width properties of the cards.
For more information, see Understand data form layout.

Key properties
DataSource – The data source that contains the record that the user will show, edit, or create.
If you don't set this property, the user can't show, edit, or create a record, and no additional metadata or
validation is provided.
DefaultMode - The initial mode of the form control. See the description of Mode below for the acceptable values
and their meanings.
DisplayMode - The mode to use for data cards and controls within the form control.
Derived from the Mode property based and cannot be set independently:

MODE DISPLAYMODE DESCRIPTION

FormMode.Edit DisplayMode.Edit Data cards and controls are editable,


ready to accept changes to a record.

FormMode.New DisplayMode.Edit Data cards and controls are editable,


ready to accept a new record.

FormMode.View DisplayMode.View Data cards and controls are not editable


and optimized for viewing.

Error – A user friendly error message to display for this form when the SubmitForm function fails.
This property applies only to the Edit form control.
This property changes only when the SubmitForm, EditForm, or ResetForm function runs.
If no error occurs, this property is blank, and ErrorKind is set to ErrorKind.None.
When possible, the error message returned will be in the user's language. Some error messages come from the
data source directly and may not be in the user's language.
ErrorKind – If an error occurs when SubmitForm runs, the kind of error that occurred.
Applies only to an Edit form control.
This property has the same enumeration as the Errors function. An Edit form control can return these values:

ERRORKIND DESCRIPTION

ErrorKind.Conflict Another user changed the same record, resulting in a change


conflict. Execute the Refresh function to reload the record, and
try the change again.

ErrorKind.None The error is of an unknown kind.

ErrorKind.Sync The data source reported an error. Check the Error property
for more information.

ErrorKind.Validation A general validation issue was detected.

Item – The record in the DataSource that the user will show or edit.
LastSubmit – The last successfully submitted record, including any server generated fields.
This property applies only to the Edit form control.
If the data source automatically generates or calculates any fields, such as an ID field with a unique number, the
LastSubmit property will have this new value after SubmitForm successfully runs.
The value of this property is available in the OnSuccess formula.
Mode – The control is in Edit or New mode.

MODE DESCRIPTION

FormMode.Edit The user can edit a record by using the form. The values in the
form's cards are pre-populated with the existing record, for the
user to change. If the SubmitForm function runs successfully,
an existing record is modified.

FormMode.New The user can create a record by using the form. The values in
the form's controls are pre-populated with the defaults for a
record of the data source. If the SubmitForm function runs
successfully, a record is created.

FormMode.View The user can view a record by using the form. The values in
the form's controls are pre-populated with the defaults for a
record of the data source.

The form switches from New mode to Edit mode when any of these changes occurs:
The form is successfully submitted, and a record is created. If the gallery is set to automatically move selection
to this new record, the form will be in Edit mode for the created record so that the user can make additional
changes.
The EditForm function runs.
The ResetForm function runs. For example, the user might select a Cancel button that's been configured with
this function.
OnFailure – How an app responds when a data operation has been unsuccessful.
This property applies only to the Edit form control.
OnReset – How an app responds when an Edit form control is reset.
This property applies only to the Edit form control.
OnSuccess – How an app responds when a data operation has been successful.
This property applies only to the Edit form control.
Unsaved – True if the Edit form control contains user changes that have not been saved.
This property applies only to the Edit form control.
Use this property to warn the user before they lose any unsaved changes. To prevent the user from selecting a
different record in a Gallery control before saving changes to the current record, set the gallery's Disabled
property to Form.Unsaved and, likewise, disable refresh operations.
Updates – The values to write back to the data source for a record loaded in a form control.
This property applies only to the Edit form control.
Use this property to extract the field values from the cards within the control. You can then use these values to
manually update the data source with a Patch function call or another method exposed by a connection. You do
not need to use this property if you are using the SubmitForm function.
This property returns a record of values. For example, if the form control contains card controls for Name and
Quantity fields, and the values of the Update properties for those cards return "Widget" and 10 respectively,
then the Updates property for the form control would return { Name: "Widget", Quantity: 10 }.
Valid – Whether a Card or Edit form control contains valid entries, ready to be submitted to the data source.
This property applies only to the Edit form control.
A Form control's Valid property aggregates the Valid properties of all the Card controls in the form. A
form's Valid property is true only if the data in all cards in that form is valid; otherwise, the form's Valid
property is false.
To enable a button to save changes only when the data in a form is valid but hasn't yet been submitted, set
the button's DisplayMode property to this formula:
SubmitButton.DisplayMode = If(IsBlank( Form.Error ) || Form.Valid, DisplayMode.Edit,
DisplayMode.Disabled)

Additional properties
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
Fill – The background color of a control.
Height – The distance between a control's top and bottom edges.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent
container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent
container).
More information
For a comprehensive overview of how forms work, see Understand data forms.

Accessibility guidelines
Screen reader support
Consider adding a heading to the form using a Label.
Drop down control in Power Apps
12/3/2019 • 5 minutes to read • Edit Online

A list that shows only the first item unless the user opens it.

Description
A Drop down control conserves screen real estate, especially when the list contains a large number of
choices. The control takes up only one line unless the user selects the chevron to reveal more choices. The
control will show a maximum of 500 items.

Key properties
Default – The initial value of a control before the user specifies a different value.
Items – The source of data that contains the items that appear in the control. If the source has multiple
columns, set the control's Value property to the column of data that you want to show.
Value – The column of data that you want to show in the control (for example, if a data source has
multiple columns).
Selected – The data record that represents the selected item.
AllowEmptySelection – Whether the control shows an empty selection if no item has been selected.
App users can also clear their choices by selecting the blank item.

Additional properties
AccessibleLabel – Label for screen readers.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
ChevronBackground – The color behind the down arrow in a dropdown list.
ChevronFill – The color of the down arrow in a dropdown list.
Color – The color of text in a control.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled
(Disabled).
DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to
Disabled.
DisabledColor – The color of text in a control if its DisplayMode property is set to Disabled.
DisabledFill – The background color of a control if its DisplayMode property is set to Disabled.
Fill – The background color of a control.
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Font – The name of the family of fonts in which text appears.
FontWeight – The weight of the text in a control: Bold, Semibold, Normal, or Lighter.
Height – The distance between a control's top and bottom edges.
HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that
control.
HoverColor – The color of the text in a control when the user keeps the mouse pointer on it.
HoverFill – The background color of a control when the user keeps the mouse pointer on it.
Italic – Whether the text in a control is italic.
OnChange – How the app responds when the user changes the value of a control (for example, by
adjusting a slider).
OnSelect – How the app responds when the user taps or clicks a control.
PaddingBottom – The distance between text in a control and the bottom edge of that control.
PaddingLeft – The distance between text in a control and the left edge of that control.
PaddingRight – The distance between text in a control and the right edge of that control.
PaddingTop – The distance between text in a control and the top edge of that control.
PressedBorderColor – The color of a control's border when the user taps or clicks that control.
PressedColor – The color of text in a control when the user taps or clicks that control.
PressedFill – The background color of a control when the user taps or clicks that control.
Reset – Whether a control reverts to its default value.
SelectedText (Deprecated) – A string value that represents the selected item.
SelectionColor – The text color of a selected item or items in a list or the color of the selection tool in a
pen control.
SelectionFill – The background color of a selected item or items in a list or a selected area of a pen
control.
Size – The font size of the text that appears on a control.
Strikethrough – Whether a line appears through the text that appears on a control.
TabIndex – Keyboard navigation order in relation to other controls.
Tooltip – Explanatory text that appears when the user hovers over a control.
Underline – Whether a line appears under the text that appears on a control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no
parent container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no
parent container).
Example
Simple list
1. Add a Drop down control, and then set its Items property to this expression:
["Seattle", "Tokyo", "London", "Johannesburg", "Rio de Janeiro"]

Don't know how to add, name, and configure a control?


2. Show the items in the list by selecting the control's down arrow while pressing the Alt key.
List from a data source
The principles in this procedure apply to any data source that provides tables but, to follow these steps
exactly, you must open an environment for which a Common Data Service database has been created and
sample data added.
1. Open a blank app, and then specify the Accounts entity.
2. Add a Drop down control, and set its Items property to this formula:
Distinct(Accounts, address1_city)

This formula shows all the cities in the Accounts entity. If more than one record has the same city,
the Distinct function hides the duplication in your drop-down control.
3. (optional) Rename your Drop down control to Cities, add a vertical Gallery control, and set the
gallery's Items property to this formula:
Filter(Accounts, address1_city = Cities.Selected.Value)

This Filter function shows only those records in the Accounts entity for which the city matches
the selected value in the Cities control.

Accessibility guidelines
Color contrast
There must be adequate color contrast between:
ChevronFill and ChevronBackground
ChevronHoverFill and ChevronHoverBackground
SelectionColor and SelectionFill
SelectionFill and Fill
This is in addition to the standard color contrast requirements.
Screen reader support
AccessibleLabel must be present.
Keyboard support
TabIndex must be zero or greater so that keyboard users can navigate to it.
Focus indicators must be clearly visible. Use FocusedBorderColor and FocusedBorderThickness to
achieve this.
Edit form and Display form
controls in Power Apps
12/3/2019 • 10 minutes to read • Edit Online

Display, edit, and create a record in a data source.

Description
If you add a Display form control, the user can display all fields of a
record or only the fields that you specify. If you add an Edit form
control, the user can edit those fields, create a record, and save those
changes to a data source.

If you add a Gallery control, you can configure it to show a table in a


data source and then configure a form to show whichever record the
user selects in the gallery. You can also add one or more Button
controls that the user can select to save edits, cancel edits, and create
a record. By using controls together, you can create a complete
solution.
Record selection
For either type of form, you set its DataSource property to a table
of records, and you set the form's Item property to show a specific
record in that table. For example, you can set the Item property of a
form to the SelectedItem property of a Gallery control. When the
user selects a record in the gallery, the same record appears in the
form, except that the form can show more fields. If the user returns
to the gallery and selects a different record, the SelectedItem
property of the gallery changes. This change updates the Item
property of the form, which then shows the newly selected record.
You can also set a form's Item property by using a Drop down
control, as Show, edit, or add a record describes, or a function such
as Lookup or First. For example, you can set the Item property to
either of these formulas to show the Fabrikam entry in the Accounts
entity in Common Data Service:
First(Accounts)

Lookup(Accounts, "Fabrikam" in name)

Each form control contains one or more Card controls. By setting the
DataField property of a card, you specify which field that card
shows and other details.
Create a record
When an Edit form control is in Edit mode, the user can update the
record that's specified in the form's Item property. If inspected, the
Mode property returns Edit.
When an Edit form control is in New mode, however, the Item
property is ignored. The form doesn't show an existing record;
instead, the values in each field match the default values of the data
source with which you configured the form. The NewForm function
causes a form to switch to this mode.
For example, you can set the Text property of a button to show New
and its OnSelect property to a formula that includes the NewForm
function. If the user selects that button, the form switches to New
mode so that the user can create a record starting with known
values.
A form switches back to Edit mode if either the ResetForm function
runs or the SubmitForm function runs successfully.
You can set the Text property of a button to show Cancel and its
OnSelect property to a formula that includes the ResetForm
function. If the user selects that button, any changes in progress
are discarded, and the values in the form, once again, match the
default values of the data source.
You can set the Text property of a button to show Save changes
and its OnSelect property to a formula that includes the
SubmitForm function. If the user selects that button and the data
source is updated, the values in the form are reset to the default
values of the data source.
Save changes
If you create a Save changes button as the previous section
describes, the user can create or update a record and then select that
button to save those changes to the data source. You could, instead,
configure an Image control or some other control to perform the
same task, as long as you configure that control with the
SubmitForm function. In any case, the Error, ErrorKind,
OnSuccess, and OnFailure properties provide feedback on the
outcome.
When the SubmitForm function runs, it first validates the data that
user wants to submit. If a required field doesn't contain a value or
another value doesn't conform to some other constraint, the
ErrorKind properties are set, and the OnFailure formula runs. You
can configure the Save changes button or other control so that the
user can select it only if the data is valid (that is, if the Valid property
of the form is true). Note that the user must not only correct the
problem but also select the Save changes button again (or discard
the changes by selecting a Cancel button, as described earlier) to
reset the Error and ErrorKind properties.
If the data passes validation, SubmitForm sends it to the data
source, which can take some time depending on network latency.
If the submission succeeds, the Error property is cleared, the
ErrorKind property is set to ErrorKind.None, and the
OnSuccess formula runs. If the user created a record (that is, if
the form was previously in New mode), the form is switched to
Edit mode so that the user can edit the newly created record or a
different one.
If the submission fails, the Error property contains a user-friendly
error message from the data source, explaining the problem. The
ErrorKind property is set appropriately, depending on the issue,
and the OnFailure formula runs.
Some data sources can detect when two people try to update the
same record at the same time In this case, ErrorKind is set to
ErrorKind.Conflict, and the remedy is to refresh the data source
with the other user's changes and reapply the change made by this
user.

TIP
If you offer a Cancel button on your form so that the user can abandon
changes in progress, add the ResetForm function to the button's
OnSelect property even that property also contains a Navigate
function to change screens. Otherwise, the form will retain the user's
changes.

Layout
By default, cards are placed in a single column for phone apps and
three columns for tablet apps. You can specify how many columns a
form has and whether cards should snap to them as you configure
the form. These settings aren't exposed as properties because they're
used only to set the X, Y, and Width properties of the cards.
For more information, see Understand data form layout.

Key properties
DataSource – The data source that contains the record that the user
will show, edit, or create.
If you don't set this property, the user can't show, edit, or create a
record, and no additional metadata or validation is provided.
DefaultMode - The initial mode of the form control. See the
description of Mode below for the acceptable values and their
meanings.
DisplayMode - The mode to use for data cards and controls within
the form control.
Derived from the Mode property based and cannot be set
independently:

MODE DISPLAYMODE DESCRIPTION

FormMode.Edit DisplayMode.Edit Data cards and


controls are editable,
ready to accept
changes to a record.

FormMode.New DisplayMode.Edit Data cards and


controls are editable,
ready to accept a new
record.

FormMode.View DisplayMode.View Data cards and


controls are not
editable and optimized
for viewing.

Error – A user friendly error message to display for this form when
the SubmitForm function fails.
This property applies only to the Edit form control.
This property changes only when the SubmitForm, EditForm,
or ResetForm function runs.
If no error occurs, this property is blank, and ErrorKind is set to
ErrorKind.None.
When possible, the error message returned will be in the user's
language. Some error messages come from the data source
directly and may not be in the user's language.
ErrorKind – If an error occurs when SubmitForm runs, the kind of
error that occurred.
Applies only to an Edit form control.
This property has the same enumeration as the Errors function.
An Edit form control can return these values:

ERRORKIND DESCRIPTION

ErrorKind.Conflict Another user changed the same


record, resulting in a change conflict.
Execute the Refresh function to
reload the record, and try the
change again.

ErrorKind.None The error is of an unknown kind.


ERRORKIND DESCRIPTION

ErrorKind.Sync The data source reported an error.


Check the Error property for more
information.

ErrorKind.Validation A general validation issue was


detected.

Item – The record in the DataSource that the user will show or edit.
LastSubmit – The last successfully submitted record, including any
server generated fields.
This property applies only to the Edit form control.
If the data source automatically generates or calculates any fields,
such as an ID field with a unique number, the LastSubmit
property will have this new value after SubmitForm successfully
runs.
The value of this property is available in the OnSuccess formula.
Mode – The control is in Edit or New mode.

MODE DESCRIPTION

FormMode.Edit The user can edit a record by using


the form. The values in the form's
cards are pre-populated with the
existing record, for the user to
change. If the SubmitForm function
runs successfully, an existing record
is modified.

FormMode.New The user can create a record by


using the form. The values in the
form's controls are pre-populated
with the defaults for a record of the
data source. If the SubmitForm
function runs successfully, a record is
created.

FormMode.View The user can view a record by using


the form. The values in the form's
controls are pre-populated with the
defaults for a record of the data
source.

The form switches from New mode to Edit mode when any of these
changes occurs:
The form is successfully submitted, and a record is created. If the
gallery is set to automatically move selection to this new record,
the form will be in Edit mode for the created record so that the
user can make additional changes.
The EditForm function runs.
The ResetForm function runs. For example, the user might select
a Cancel button that's been configured with this function.
OnFailure – How an app responds when a data operation has been
unsuccessful.
This property applies only to the Edit form control.
OnReset – How an app responds when an Edit form control is
reset.
This property applies only to the Edit form control.
OnSuccess – How an app responds when a data operation has been
successful.
This property applies only to the Edit form control.
Unsaved – True if the Edit form control contains user changes that
have not been saved.
This property applies only to the Edit form control.
Use this property to warn the user before they lose any unsaved
changes. To prevent the user from selecting a different record in a
Gallery control before saving changes to the current record, set
the gallery's Disabled property to Form.Unsaved and, likewise,
disable refresh operations.
Updates – The values to write back to the data source for a record
loaded in a form control.
This property applies only to the Edit form control.
Use this property to extract the field values from the cards within
the control. You can then use these values to manually update the
data source with a Patch function call or another method
exposed by a connection. You do not need to use this property if
you are using the SubmitForm function.
This property returns a record of values. For example, if the form
control contains card controls for Name and Quantity fields, and
the values of the Update properties for those cards return
"Widget" and 10 respectively, then the Updates property for the
form control would return { Name: "Widget", Quantity: 10 }.
Valid – Whether a Card or Edit form control contains valid entries,
ready to be submitted to the data source.
This property applies only to the Edit form control.
A Form control's Valid property aggregates the Valid
properties of all the Card controls in the form. A form's Valid
property is true only if the data in all cards in that form is
valid; otherwise, the form's Valid property is false.
To enable a button to save changes only when the data in a
form is valid but hasn't yet been submitted, set the button's
DisplayMode property to this formula:
SubmitButton.DisplayMode = If(IsBlank( Form.Error ) ||
Form.Valid, DisplayMode.Edit, DisplayMode.Disabled)
Additional properties
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed,
Dotted, or None.
BorderThickness – The thickness of a control's border.
Fill – The background color of a control.
Height – The distance between a control's top and bottom edges.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge
of its parent container (screen if no parent container).
Y – The distance between the top edge of a control and the top edge
of the parent container (screen if no parent container).

More information
For a comprehensive overview of how forms work, see Understand
data forms.

Accessibility guidelines
Screen reader support
Consider adding a heading to the form using a Label.
Export control and Import control in Power Apps
3/10/2020 • 4 minutes to read • Edit Online

Controls for exporting data to a local file and then importing that data into another app in Power Apps.

Description
If you want to create more than one app that uses the same data but not share that data outside those apps, you
can export it and import it by using an Export control and an Import control. When you export data, you create a
compressed file that you can copy to another machine, but you can't read it in any program other than Power Apps.

Warning
Enabling this functionality in your app may expose it to security vulnerabilities and data leakage. It is recommended
to advise users to import only recognized and trusted files and only export data that is not confidential or sensitive.

Limitations
The export functionality isn't supported in web browsers.

Key properties
Data – The name of a collection that you want to export to a local file.
The Data property is available for an Export control but not an Import control.
OnSelect – How the app responds when the user taps or clicks a control.

Additional properties
Align – The location of text in relation to the horizontal center of its control.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
Color – The color of text in a control.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled (Disabled).
DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to Disabled.
DisabledColor – The color of text in a control if its DisplayMode property is set to Disabled.
DisabledFill – The background color of a control if its DisplayMode property is set to Disabled.
Fill – The background color of a control.
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Font – The name of the family of fonts in which text appears.
FontWeight – The weight of the text in a control: Bold, Semibold, Normal, or Lighter.
Height – The distance between a control's top and bottom edges.
HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that control.
HoverColor – The color of the text in a control when the user keeps the mouse pointer on it.
HoverFill – The background color of a control when the user keeps the mouse pointer on it.
Italic – Whether the text in a control is italic.
Padding – The distance between the text on an import or export button and the edges of that button.
PressedBorderColor – The color of a control's border when the user taps or clicks that control.
PressedColor – The color of text in a control when the user taps or clicks that control.
PressedFill – The background color of a control when the user taps or clicks that control.
RadiusBottomLeft – The degree to which the bottom-left corner of a control is rounded.
RadiusBottomRight – The degree to which the bottom-right corner of a control is rounded.
RadiusTopLeft – The degree to which the top-left corner of a control is rounded.
RadiusTopRight – The degree to which the top-right corner of a control is rounded.
Size – The font size of the text that appears on a control.
Strikethrough – Whether a line appears through the text that appears on a control.
TabIndex – Keyboard navigation order in relation to other controls.
Text – Text that appears on a control or that the user types into a control.
Underline – Whether a line appears under the text that appears on a control.
VerticalAlign – The location of text on a control in relation to the vertical center of that control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent
container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent
container).

Example
1. Add a Button control, and set its OnSelect property to this formula:

ClearCollect(Products, {Name:"Europa", Price:"10.99"}, {Name:"Ganymede", Price:"12.49"},


{Name:"Callisto", Price:"11.79"})

For more details, read adding, naming, and configuring a control, ClearCollect and other functions.
2. Press F5 and select Button control, and then press Esc.
3. Add an Export control, and set its Data property to Products.
4. Press F5 and select the Export control to download the file Data.zip.
5. Select Save, then press Esc to return to the default workspace.
6. In a new or existing app, add an Import control, name it MyData, and set its OnSelect property to this
formula:
Collect(ImportedProducts, MyData.Data)
7. Press F5 and select MyData, then select the file that you exported, and then select Open.
8. Press Esc and select Collections on the File menu, and confirm that the current app has the data that you
exported.

Accessibility guidelines
The same guidelines for Button apply because Export and Import are just specialized buttons.
Gallery control in canvas apps
3/17/2020 • 4 minutes to read • Edit Online

A control that contains other controls and shows a set of data.

Description
A Gallery control can show multiple records from a data source, and each record can contain
multiple types of data. For example, use a Gallery control to show multiple contacts with each
item showing contact information that includes a name, an address, and a phone number for
each contact.
Each data field appears in a separate control within the Gallery control. And you can
configure those controls in its template. The template appears as the first item inside the
gallery:
On the left edge of a Gallery control in horizontal/landscape orientation.
And at the top of a Gallery control in vertical/portrait orientation.
Any changes that you make in the template are reflected throughout the Gallery control.
Predefined templates for showing images and text in a gallery are available, and a gallery for
variable-height items.

Limitations
If a user scrolls the Flexible height gallery control before all items are loaded, the item that's
currently in view may be pushed down and out of view when the data loading is finished. To
avoid this issue, use a standard Gallery control instead of the Flexible height variant.

Key properties
Default – The item or record from the data source to be selected in the gallery when the app
starts up.
Items – The source of data that appears in a control such as a gallery, a list, or a chart.
Selected – The selected item.

Additional properties
AccessibleLabel – Label of the gallery (not the items it contains) for screen readers. Should
describe what the list of items are.
AllItems – All items in a gallery, including additional control values that are a part of the
gallery's template.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is
disabled (Disabled).
Fill – The background color of a control.
Height – The distance between a control's top and bottom edges.
ItemAccessibleLabel – Label of each gallery item for screen readers. Should describe what
each item is.
NavigationStep – How far a gallery scrolls if its ShowNavigation property is set to true
and the user selects a navigation arrow at either end of that gallery.
Selectable – Whether gallery items can be selected. When set to true, screen readers identify
the gallery as a selectable list. And you select an item by selecting it. When set to false, screen
readers identify the gallery as a regular list, and selecting an item doesn't select it.
ShowNavigation – Whether an arrow appears at each end of a gallery so that a user can
scroll through the items in the gallery by selecting an arrow.
ShowScrollbar – Whether a scrollbar appears when the user hovers over a gallery.
Snap – Whether, when a user scrolls through a gallery, it automatically snaps so that the next
item appears in full.
TemplateFill – The background color of a gallery.
TemplatePadding – The distance between items in a gallery.
TemplateSize – The height of the template for a gallery in vertical/portrait orientation. Or
the width of the template for a gallery in horizontal/landscape orientation.
Transition – The visual effect (Pop, Push, or None) when the user hovers over an item in a
gallery.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
WrapCount – Number of items shown per row or column based on horizontal or vertical
layout.
X – The distance between the left edge of a control and the left edge of its parent container or
screen.
Y – The distance between the top edge of a control and the top edge of the parent container or
screen.

Related functions
Filter( DataSource, Formula )
Reset( Control ) - Resets your gallery back to its initial state. Initial state includes scrolling to
the first item and selecting the first item or default if present.

NOTE
Reset control does not recursively reset all the children of the gallery.

Examples
Show and filter data
Show text
Show images
Filter data by selecting a list option
Filter data by adjusting a slider
Get data from the user
Get text
Get images
Get photos
Get sounds
Get drawings

Accessibility guidelines
Color contrast
If clicking anywhere in a gallery item is meant to select it, there must be adequate color
contrast between:
BorderColor and the color outside the gallery (if there is a border).
Fill and the color outside the gallery (if there's no border).
Screen reader support
AccessibleLabel must be present.

NOTE
Screen readers will announce when items in the gallery change. The AccessibleLabel is also
mentioned. This gives context to the announcement and is even more important when there
are multiple galleries on the same screen.

When a gallery item contains multiple controls, use ItemAccessibleLabel to show the
contents of gallery items.
Set the value of Selectable to true if you want users to select a gallery item.
Otherwise, set that value to false.
When a gallery item contains multiple controls, use ItemAccessibleLabel to provide a
summary of the gallery item's contents.
Selectable should be set appropriately, depending on whether users are meant to
select a gallery item.
Keyboard support
Consider setting ShowScrollbar to true. On most touch screen devices, the scrollbar
won't show until scrolling begins.
If clicking anywhere in a gallery item is meant to select it, there must also be way for
keyboard users to select the gallery item. For example, adding a Button that has its
OnSelect property set to Select(Parent).
NOTE
Controls outside the gallery are not considered in the keyboard navigation order within the
gallery. TabIndex controls inside a gallery are scoped. See accessibility properties to learn
more.
HTML text control in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

A box that shows text and converts HTML tags to formatting.

Description
An HTML text control not only shows plain text and numbers but also converts HTML tags, such as non-
breaking spaces.

Key properties
Color – The color of text in a control.
Font – The name of the family of fonts in which text appears.
HtmlText – Text that appears in an HTML text control and that may contain HTML tags.

Additional properties
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled
(Disabled).
DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to
Disabled.
DisabledFill – The background color of a control if its DisplayMode property is set to Disabled.
Fill – The background color of a control.
Height – The distance between a control's top and bottom edges.
HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that control.
OnSelect – How the app responds when the user taps or clicks a control.
PaddingBottom – The distance between text in a control and the bottom edge of that control.
PaddingLeft – The distance between text in a control and the left edge of that control.
PaddingRight – The distance between text in a control and the right edge of that control.
PaddingTop – The distance between text in a control and the top edge of that control.
Size – The font size of the text that appears on a control.
Tooltip – Explanatory text that appears when the user hovers over a control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent
container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no
parent container).

Related functions
Find( FindString, WithinString )

Example
1. Add a Label control, name it Source, and set its Text property to this string:
"<p>We've&nbsp;done an unusually &quot;deep&quot; globalization and localization.<p>"
Don't know how to add, name, and configure a control?
1. Add an HTML text control, and set its HtmlText property to this value:
Source.Text
The HTML text control shows the same text as the Label control but converts the tags to the
appropriate characters.

Accessibility guidelines
HTML text is not meant to be interactive. It should only be used for text display.
Color contrast
There must be adequate color contrast between:
Color and Fill
Text with custom colors and its background
Screen reader support
HtmlText must be present.
Keyboard support
HtmlText should not contain interactive elements like <button> , <a> , or <input> . The TabIndex system
in Power Apps does not consider elements inside HtmlText.
Shape controls and Icon controls in Power Apps
12/3/2019 • 3 minutes to read • Edit Online

Graphics for which you can configure appearance and behavior properties.

Description
These controls include arrows, geometric shapes, action icons, and symbols for which you can configure properties
such as fill, size, and location. You can also configure their OnSelect property so that the app responds if the user
selects the control.

Key properties (icons and shapes)


Fill – The background color of a control.
OnSelect – How the app responds when the user selects a control.

Key properties (icons only)


Icon - The type of icon to display (for example, ArrowDown or ShoppingCart).
Rotation - The number of degrees to rotate the icon.
Color - The color of the icon by name or RGBA values.

Additional properties
AccessibleLabel – Label for screen readers.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled (Disabled).
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Height – The distance between a control's top and bottom edges.
HoverFill – The background color of a control when the user keeps the mouse pointer on it.
PressedBorderColor – The color of a control's border when the user selects that control.
PressedFill – The background color of a control when the user selects that control.
TabIndex – Keyboard-navigation order in relation to other controls.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent
container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent
container).
Related functions
Navigate( ScreenName, ScreenTransition )

Example
1. Name the default Screen control Target, add a Label control, and set its Text property to show Target.
Don't know how to add and configure a control?
2. Add a Screen control, and name it Source.
3. In Source, add a Shape control, and set its OnSelect property to this formula:
Navigate(Target, ScreenTransition.Fade)

1. Press F5, and then select the Shape control.


The Target screen appears.
2. (optional) Press Esc to return to the default workspace, add a Shape control to Target, and set the OnSelect
property of the Shape control to this formula:
Navigate(Source, ScreenTransition.Fade)

Accessibility guidelines
Color contrast
The following applies only to graphics that are used as buttons or are otherwise not just for decoration.
For icons:
Color and Fill
Other standard color contrast requirements apply (if used as a button)
For shapes with borders:
BorderColor and the color outside the control
FocusedBorderColor and the color outside the control (if used as a button)
For shapes without borders:
Fill and the color outside the control
PressedFill and the color outside the control (if used as a button)
HoverFill and the color outside the control (if used as a button)
Screen-reader support
AccessibleLabel must be set to a non-empty string if the graphic is used as a button or is otherwise not just
for decoration.
AccessibleLabel must be empty or the empty string "" if the graphic provides redundant information or is
purely for decoration. This value causes screen readers to ignore the graphic.
For example, you might set the AccessibleLabel property of a Settings icon to Settings. This icon isn't used as a
button. It's next to a Label that also says Settings. Screen readers will read both the icon and the label as Settings,
which is unnecessarily verbose. In this case, the icon doesn't need an AccessibleLabel.
IMPORTANT
Screen readers will read an icon or shape as button if its AccessibleLabel is set to an empty string and its TabIndex is set to
zero or greater. Such icons or shapes are rendered as buttons.

Keyboard support
TabIndex must be zero or greater if the graphic is used as a button. If you set this value for an icon or shape,
keyboard users can navigate to it.
Focus indicators must be clearly visible if the graphic is used as a button. Use FocusedBorderColor and
FocusedBorderThickness to achieve this result.

NOTE
When TabIndex is zero or greater, the icon or shape is rendered as a button. Its appearance doesn't change, but
screen readers will correctly identify the image as a button. When TabIndex is less than zero, the icon or shape is
identified as an image.
Image control in Power Apps
12/3/2019 • 5 minutes to read • Edit Online

A control that shows an image from, for example, a local file or a data source.

Description
If you add one or more Image controls to your app, you can show individual images that aren't part of
a data set, or you can incorporate images from records in data sources.

Key properties
Image – The name of the image that appears in an image, audio, or microphone control.

Additional properties
AccessibleLabel – Label for screen readers.
ApplyEXIFOrientation – Whether to automatically apply the orientation specified in the EXIF data
embedded with the image.
AutoDisableOnSelect – Automatically disables the control while the OnSelect behavior is executing.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
CalculateOriginalDimensions – Enables the OriginalHeight and OriginalWidth properties.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled
(Disabled).
DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set
to Disabled.
DisabledFill – The background color of a control if its DisplayMode property is set to Disabled.
Fill – The background color of a control.
FlipHorizontal – Whether to flip the image horizontally before displaying it.
FlipVertical – Whether to flip the image vertically before displaying it.
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Height – The distance between a control's top and bottom edges.
HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that
control.
HoverFill – The background color of a control when the user keeps the mouse pointer on it.
ImagePosition – The position (Fill, Fit, Stretch, Tile, or Center) of an image in a screen or a control
if it isn't the same size as the image.
ImageRotation – How to rotate the image before displaying it. Values can be none, clockwise (CW )
90 degrees, counter-clockwise (CCW ) 90 degrees and clockwise 180 degrees.
OnSelect – How the app responds when the user taps or clicks a control.
OriginalHeight – Original height of an image, enabled with the CalculateOriginalDimensions
property.
OriginalWidth – Original width of an image, enabled with the CalculateOriginalDimensions
property.
PaddingBottom – The distance between text in a control and the bottom edge of that control.
PaddingLeft – The distance between text in a control and the left edge of that control.
PaddingRight – The distance between text in a control and the right edge of that control.
PaddingTop – The distance between text in a control and the top edge of that control.
PressedBorderColor – The color of a control's border when the user taps or clicks that control.
PressedFill – The background color of a control when the user taps or clicks that control.
RadiusBottomLeft – The degree to which the bottom-left corner of a control is rounded.
RadiusBottomRight – The degree to which the bottom-right corner of a control is rounded.
RadiusTopLeft – The degree to which the top-left corner of a control is rounded.
RadiusTopRight – The degree to which the top-right corner of a control is rounded.
TabIndex – Keyboard navigation order in relation to other controls.
Tooltip – Explanatory text that appears when the user hovers over a control.
Transparency – The degree to which controls behind an image remain visible.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if
no parent container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if
no parent container).

Related functions
Remove( DataSource, ThisItem )

Examples
Show an image from a local file
1. On the File menu, click or tap Media, and then click or tap Browse.
2. Click or tap the image file that you want to add, click or tap Open, and then press Esc to return
to the default workspace.
3. Add an Image control, and set its Image property to the name of the file that you added.
Don't know how to add and configure a control?
The Image control shows the image that you specified.
Show a set of images from a data source
1. Download this Excel file, and save it on your local device.
2. In Power Apps Studio, create or open an app, and then click or tap Add data source in the
right-hand pane.
If Add data source doesn't appear in the right-hand pane, click or tap a screen in the left
navigation bar.
3. Click or tap Add static data to your app, click or tap the Excel file that you downloaded, and
then click or tap Open.
4. Select the Flooring Estimates check box, and then click or tap Connect.
5. Add a Gallery control with images, and set its Items property to FlooringEstimates.
Don't know how to add and configure a control?
The Gallery control shows images of carpet, hardwood, and tile products based on links in the
Excel file that you downloaded.

Accessibility guidelines
Color contrast
Standard color contrast requirements apply, if the graphic is used as a button.
Consider checking for contrast issues within the image, if it is not purely decorative.
Screen reader support
AccessibleLabel must be present, if the graphic is used as a button or is otherwise not just for
decoration.
AccessibleLabel must be empty or the empty string "", if the graphic is purely for decoration. This
causes screen readers to ignore the graphic.
AccessibleLabel can be empty or the empty string "", if the graphic provides redundant
information.
For example, an Image of gears with its AccessibleLabel set to Settings. This image is
not used as a button. It is next to a Label that also says Settings. Screen readers will
read the image as Settings, and the label as Settings again. This is unnecessarily
verbose. In this case, the Image does not need an AccessibleLabel.

IMPORTANT
Screen readers will always read Images that have TabIndex of zero or greater, even if
AccessibleLabel is empty. This is because they are rendered as buttons. If no AccessibleLabel
is provided, screen readers will simply read the graphic as button.

Keyboard support
TabIndex must be zero or greater, if the graphic is used as a button. This allows keyboard users
to navigate to it.
Focus indicators must be clearly visible, if the graphic is used as a button. Use
FocusedBorderColor and FocusedBorderThickness to achieve this.
NOTE
When TabIndex is zero or greater, the Image is rendered as a button. There is no change to the visual
appearance, but screen readers will correctly identify the image as a button. When TabIndex is less
than zero, the Image is identified as an image.
Export control and Import control in Power
Apps
3/10/2020 • 4 minutes to read • Edit Online

Controls for exporting data to a local file and then importing that data into another app in Power Apps.

Description
If you want to create more than one app that uses the same data but not share that data outside those
apps, you can export it and import it by using an Export control and an Import control. When you
export data, you create a compressed file that you can copy to another machine, but you can't read it in
any program other than Power Apps.

Warning
Enabling this functionality in your app may expose it to security vulnerabilities and data leakage. It is
recommended to advise users to import only recognized and trusted files and only export data that is
not confidential or sensitive.

Limitations
The export functionality isn't supported in web browsers.

Key properties
Data – The name of a collection that you want to export to a local file.
The Data property is available for an Export control but not an Import control.
OnSelect – How the app responds when the user taps or clicks a control.

Additional properties
Align – The location of text in relation to the horizontal center of its control.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
Color – The color of text in a control.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled
(Disabled).
DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set
to Disabled.
DisabledColor – The color of text in a control if its DisplayMode property is set to Disabled.
DisabledFill – The background color of a control if its DisplayMode property is set to Disabled.
Fill – The background color of a control.
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Font – The name of the family of fonts in which text appears.
FontWeight – The weight of the text in a control: Bold, Semibold, Normal, or Lighter.
Height – The distance between a control's top and bottom edges.
HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that
control.
HoverColor – The color of the text in a control when the user keeps the mouse pointer on it.
HoverFill – The background color of a control when the user keeps the mouse pointer on it.
Italic – Whether the text in a control is italic.
Padding – The distance between the text on an import or export button and the edges of that button.
PressedBorderColor – The color of a control's border when the user taps or clicks that control.
PressedColor – The color of text in a control when the user taps or clicks that control.
PressedFill – The background color of a control when the user taps or clicks that control.
RadiusBottomLeft – The degree to which the bottom-left corner of a control is rounded.
RadiusBottomRight – The degree to which the bottom-right corner of a control is rounded.
RadiusTopLeft – The degree to which the top-left corner of a control is rounded.
RadiusTopRight – The degree to which the top-right corner of a control is rounded.
Size – The font size of the text that appears on a control.
Strikethrough – Whether a line appears through the text that appears on a control.
TabIndex – Keyboard navigation order in relation to other controls.
Text – Text that appears on a control or that the user types into a control.
Underline – Whether a line appears under the text that appears on a control.
VerticalAlign – The location of text on a control in relation to the vertical center of that control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if
no parent container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if
no parent container).

Example
1. Add a Button control, and set its OnSelect property to this formula:
ClearCollect(Products, {Name:"Europa", Price:"10.99"}, {Name:"Ganymede", Price:"12.49"},
{Name:"Callisto", Price:"11.79"})

For more details, read adding, naming, and configuring a control, ClearCollect and other functions.
2. Press F5 and select Button control, and then press Esc.
3. Add an Export control, and set its Data property to Products.
4. Press F5 and select the Export control to download the file Data.zip.
5. Select Save, then press Esc to return to the default workspace.
6. In a new or existing app, add an Import control, name it MyData, and set its OnSelect property to
this formula:
Collect(ImportedProducts, MyData.Data)
7. Press F5 and select MyData, then select the file that you exported, and then select Open.
8. Press Esc and select Collections on the File menu, and confirm that the current app has the data
that you exported.

Accessibility guidelines
The same guidelines for Button apply because Export and Import are just specialized buttons.
Column chart and Line chart controls in
Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Controls that show data as graphs with x- and y-axes.

Description
Column chart and Line chart are grouped controls. Each group contains three controls: a Label
for the title, the chart graphic, and a Legend.

Chart key properties


Items – The source of data that appears in a control such as a gallery, a list, or a chart.
NumberOfSeries – How many columns of data are reflected in a column or line chart.

Additional chart properties


BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
Color – The color of text in a control.
DisabledBorderColor – The color of a control's border if the control's DisplayMode property is
set to Disabled.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is
disabled (Disabled).
Font – The name of the family of fonts in which text appears.
GridStyle – Whether a column or line chart shows its x-axis, its y-axis, both, or neither.
Height – The distance between a control's top and bottom edges.
HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on
that control.
ItemColorSet – The color of each data point in a chart.
ItemsGap – The distance between columns in a column chart.
The ItemsGap property is available for the Column chart control but not the Line chart
control.
Markers – Whether a column or line chart shows the value of each data point.
MarkerSuffix – Text that appears after each value in a column chart for which the Markers
property is set to true.
The MarkerSuffix property is available for the Column chart control but not the Line chart
control.
MinimumBarWidth – The narrowest possible width of columns in a column chart.
The MinimumBarWidth property is available for the Column chart control but not the Line
chart control.
OnSelect – How the app responds when the user taps or clicks a control.
PaddingBottom – The distance between text in a control and the bottom edge of that control.
PaddingLeft – The distance between text in a control and the left edge of that control.
PaddingRight – The distance between text in a control and the right edge of that control.
PaddingTop – The distance between text in a control and the top edge of that control.
PressedBorderColor – The color of a control's border when the user taps or clicks that control.
SeriesAxisMax – The maximum value of the y-axis for a column or line chart.
The SeriesAxisMax property is available for the Column chart control but not the Line chart
control.
SeriesAxisMin – A number that determines the minimum value of the y-axis for a column chart.
The SeriesAxisMin property is available for the Column chart control but not the Line chart
control.
Size – The font size of the text that appears on a control.
TabIndex – Keyboard navigation order in relation to other controls.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if
no parent container).
XLabelAngle – The angle of the labels below the x-axis of a column or line chart.
Y – The distance between the top edge of a control and the top edge of the parent container (screen
if no parent container).
YAxisMax – The maximum value of the y-axis for a line chart.
The YAxisMax property is available for the Line chart control but not the Column chart
control.
YAxisMin – The minimum value of the y-axis for a line chart.
The YAxisMin property is available for the Line chart control but not the Column chart
control.
YLabelAngle – The angle of the labels next to the y-axis of a line or column chart.

Related functions
Max( DataSource, ColumnName )

Example
1. Add a Button control, and set its OnSelect property to this formula:
Collect(Revenue, {Year:"2013", Europa:24000, Ganymede:22300, Callisto:21200},
{Year:"2014", Europa:26500, Ganymede:25700, Callisto:24700},{Year:"2014",
Europa:27900, Ganymede:28300, Callisto:25600})
Don't know how to add and configure a control?
Want more information about the Collect function or other functions?
2. Press F5, click or tap the Button control, and then press Esc to return to the default
workspace.
3. Add a Column chart control or a Line chart control, set its Items property to Revenue, and
set its NumberOfSeries property to 3.
The control shows revenue data for each product over three years.

Accessibility guidelines
Color contrast
There must be adequate color contrast between:
each item in ItemColorSet
every item in ItemColorSet and the background color
Color and the background color
Screen reader support
There must be a Label immediately before the chart graphic to serve as the title.
Consider adding a summary of the chart graphic. For example, "The line chart shows a
steady increase in sales between March and August this year."

NOTE
Chart graphics and Legend are hidden from screen reader users. As an alternative, a tabular form of
the data is presented to them. They can also cycle through buttons that select data in the chart.

Low vision support


There must be a Legend if more than one series is shown.
Consider setting GridStyle to GridStyle.All, which shows both axes. This helps all users
accurately determine the scale of the data.
For Column chart, consider setting Markers to true. This helps low -vision users determine the
value of a column.
Keyboard support
TabIndex must be zero or greater so that keyboard users can navigate to it.

NOTE
When keyboard users navigate to the chart, they can cycle through buttons that select data in the
chart.
List Box control in Power Apps
1/21/2020 • 5 minutes to read • Edit Online

A list in which the user can select one or multiple items.

Description
A List Box control always shows all available choices (unlike a Drop down control) and in which the user
can choose more than one item at a time (unlike a Radio control).

Key properties
Default – The initial value of a control before it is changed by the user.
Items – The source of data that appears in a control such as a gallery, a list, or a chart.
Selected – The data record that represents the selected item. You can only have one default selected item.
If you need multiple selected items please use the Combo Box control.
When you add a gallery, a list, or a chart, the property list shows Items by default so that you can easily
specify the data that the new control should show. For example, you might set the Items property of a
gallery to the Account table in Salesforce, a table named Inventory that you created in Excel and
uploaded to the cloud, or a SharePoint list named ConferenceSpeakers.

Additional properties
AccessibleLabel – Label for screen readers.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
Color – The color of text in a control.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled
(Disabled).
DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to
Disabled.
DisabledColor – The color of text in a control if its DisplayMode property is set to Disabled.
DisabledFill – The background color of a control if its DisplayMode property is set to Disabled.
Fill – The background color of a control.
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Font – The name of the family of fonts in which text appears.
FontWeight – The weight of the text in a control: Bold, Semibold, Normal, or Lighter.
Height – The distance between a control's top and bottom edges.
HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that
control.
HoverColor – The color of the text in a control when the user keeps the mouse pointer on it.
HoverFill – The background color of a control when the user keeps the mouse pointer on it.
Italic – Whether the text in a control is italic.
ItemPaddingLeft – The distance between text in a listbox and its left edge.
LineHeight – The distance between, for example, lines of text or items in a list.
OnChange – How the app responds when the user changes the value of a control (for example, by
adjusting a slider).
OnSelect – How the app responds when the user taps or clicks a control.
PaddingBottom – The distance between text in a control and the bottom edge of that control.
PaddingLeft – The distance between text in a control and the left edge of that control.
PaddingRight – The distance between text in a control and the right edge of that control.
PaddingTop – The distance between text in a control and the top edge of that control.
PressedBorderColor – The color of a control's border when the user taps or clicks that control.
PressedColor – The color of text in a control when the user taps or clicks that control.
PressedFill – The background color of a control when the user taps or clicks that control.
Reset – Whether a control reverts to its default value.
SelectedText (Deprecated) – A string value that represents the selected item.
SelectionColor – The text color of a selected item or items in a list or the color of the selection tool in a
pen control.
SelectionFill – The background color of a selected item or items in a list or a selected area of a pen control.
SelectMultiple – Whether a user can select more than one item in a listbox.
Size – The font size of the text that appears on a control.
Strikethrough – Whether a line appears through the text that appears on a control.
TabIndex – Keyboard navigation order in relation to other controls.
Tooltip – Explanatory text that appears when the user hovers over a control.
Underline – Whether a line appears under the text that appears on a control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no
parent container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no
parent container).
Related functions
Distinct( DataSource, ColumnName )

Example
1. Add a List box control, name it CategoryList, and set its Items property to this formula:
["Carpet","Hardwood","Tile"]
Don't know how to add, name, and configure a control?

2. Add three Drop down controls, move them under CategoryList, and name them CarpetList,
HardwoodList, and TileList.
3. Set the Items property of each Drop down control to one of these values:
CarpetList: ["Caserta Stone Beige","Ageless Beauty Clay", "Lush II Tundra"]
HardwoodList: ["Golden Teak","Natural Hickory", "Victoria Mahogany"]
TileList: ["Honey Onyx Marble","Indian Autumn Slate", "Panaria Vitality Ceramic"]

4. Set the Visible property of each Drop down control to one of these values:
CarpetList: If("Carpet" in CategoryList.SelectedItems.Value, true)
HardwoodList: If("Hardwood" in CategoryList.SelectedItems.Value, true)
TileList: If("Tile" in CategoryList.SelectedItems.Value, true)
Want more information about the If function or other functions?
5. Press F5, and then choose one or more items in CategoryList.
The appropriate Drop down control or controls appear based on your choice or choices.
6. (optional) Press Esc to return to the default workspace.

Accessibility guidelines
Color contrast
There must be adequate color contrast between:
SelectionColor and SelectionFill
SelectionFill and Fill
HoverFill and Fill
PressedFill and Fill
This is in addition to the standard color contrast requirements.
Screen reader support
AccessibleLabel must be present.
Keyboard support
TabIndex must be zero or greater so that keyboard users can navigate to it.
Focus indicators must be clearly visible. Use FocusedBorderColor and FocusedBorderThickness
to achieve this.

NOTE
The tab key navigates to or away from the List box. Arrow keys navigate the contents of the List box.
Microphone control in Power Apps
3/17/2020 • 5 minutes to read • Edit Online

A control that enables app users to record sounds from their device.

Description
Use the Microphone control to capture audio with a device's microphone. The device must have a
microphone and the user must authorize the app to use the microphone. The microphone control is
supported when running in a web browser.
The most recently recorded audio clip is available through the Audio property. With this property, recorded
audio can be:
Played back with the Audio control. Use the Audio control to listen to the recording. For more
information, see the examples.
Temporarily put in a variable or a collection. Use the Set or Collect functions to store audio clips in a
variable or a collection. Use caution with multiple audio clips in a collection at the same time with device's
limited memory. Use the SaveData and LoadData functions to move audio clips to the local storage on the
device and for offline scenarios.
Stored in a database. Use the Patch function to store audio clips in a database.
Transmitted as a base64 encoded text string. Use the JSON function to base64 encode audio clips.
Format of the recorded audio:
3gp format for Android.
AAC format for iOS.
OGG format for web browsers.
Captured media is referenced by a text string URI. For more information, read the data type documentation.

Key properties
Audio – The audio clip captured when the user records with the device's microphone.
Mic – Numeric ID of the microphone on a device that has more than one microphone.
OnStop – How the app responds when the user stops recording with a microphone control.

Additional properties
AccessibleLabel – Label for screen readers. Should describe the purpose of the microphone.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
Color – The color of text in a control.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled
(Disabled).
DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to
Disabled.
DisabledColor – The color of text in a control if its DisplayMode property is set to Disabled.
DisabledFill – The background color of a control if its DisplayMode property is set to Disabled.
Fill – The background color of a control.
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Height – The distance between a control's top and bottom edges.
HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that control.
HoverColor – The color of the text in a control when the user keeps the mouse pointer on it.
HoverFill – The background color of a control when the user keeps the mouse pointer on it.
Image – The name of the image that appears in an image, audio, or microphone control.
ImagePosition – The position (Fill, Fit, Stretch, Tile, or Center) of an image in a screen or a control if it isn't
the same size as the image.
OnSelect – How the app responds when the user selects a control.
OnStart – How the app responds when the user starts to record with a microphone control.
PressedBorderColor – The color of a control's border when the user selects that control.
PressedColor – The color of text in a control when the user selects that control.
PressedFill – The background color of a control when the user selects that control.
Reset – Whether a control reverts to its default value.
TabIndex – Keyboard navigation order compared to other controls.
Tooltip – Explanatory text that appears when the user hovers over a control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container or screen.
Y – The distance between the top edge of a control and the top edge of the parent container or screen.

Examples
Simple direct playback
In this example, we'll directly connect a Microphone control with an Audio control for immediate playback:
1. Add a Microphone control to your app.
2. Authorize the app to use device's microphone if prompted.
3. Add an Audio control to your app.
4. Set the Audio control's Media property to the formula:
Microphone1.Audio

NOTE
Replace microphone control name Microphone1 as appropriate.

5. Preview the app.


6. Select the Microphone control to begin recording.
7. Speak to record audio.
8. Select the Microphone control again to end the recording.
9. Select the Audio control to hear the recording.
Add sounds to a Gallery control
In this example, we'll create a gallery of audio clips stored in a collection that can be individually selected for
playback:
1. Add a Microphone control.
2. Set its OnStop property to this formula using the Collect function:

Collect( MySounds, MyMic.Audio )

3. Add a Gallery control, move it below MyMic.


4. Set the Items property for the gallery to this formula:

MySounds

5. In the template for the Custom gallery control, add an Audio control.
6. Set the audio control's Media property to this formula:

ThisItem.Url

7. Press F5 to preview the app.


8. Select MyMic to start recording, and then select it again to stop recording.
9. In the Gallery control, select the play button in the Audio control to play back your recording.
10. Add as many recordings as you want, and then return to the default workspace by pressing the Esc
key.
11. (optional) In the template for the Gallery control, add a Button control.
12. Set its OnSelect property to the formula:

Remove( MySounds, ThisItem )

13. Press F5, and then remove a recording by selecting the corresponding Button control.
Use the SaveData function to save the recordings locally or the Patch function to update a data source.

Accessibility guidelines
The same guidelines for Button apply because Microphone is just a specialized button. Also, consider:
Audio alternatives
Consider adding an alternative form of input for users with speech disabilities or without a microphone. For
example, Text input to allow users to enter text.
Color contrast
Read the standard color contrast requirements.
Ensure adequate color contrast between Image and the button text and icon (if applicable).
Screen reader support
AccessibleLabel must be present.
PDF viewer control (experimental) in Power Apps
12/3/2019 • 3 minutes to read • Edit Online

An experimental control that shows the content of a PDF file.

Description
Show text, graphics, and other content in a PDF file by adding this type of control and setting its
Document property to the URL, enclosed in double quotation marks, of the file that you want to show.

Limitations
1. The security architecture of Power Apps requires the PDF Viewer to support only HTTPS links, not
HTTP.
2. The Document property must link directly to the PDF file. Server redirects or HTML views of the
document aren't supported.
3. The server that hosts the document must not require authentication.
4. You may not be able to view a PDF document in your app if the document resides on a server that
has restrictive cross-origin resource sharing (CORS ) settings. To resolve this issue, the server that
hosts PDF documents must permit cross-origin requests from powerapps.com.
App users can work around these limitations by opening PDF documents in an external browser, as
prompted if the control can't open a document. This option is also available in the control menu for all
external documents.
App makers can work around these limitations by including PDF documents as media resources in the
app. That way, the PDF Viewer control can always show the document.

Key properties
Document – The URL, enclosed in double-quotation marks, of a PDF file.

Additional properties
ActualZoom – The actual zoom of the control, which may differ from the zoom requested with the Zoom
property.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
CurrentFindText – The current search term that is in use.
CurrentPage – The number of the page in a PDF file that is actually being shown.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled
(Disabled).
DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to
Disabled.
Fill – The background color of a control.
FindNext – Finds the next instance of FindText in the document.
FindPrevious – Finds the previous instance of FindText in the document.
FindText – The search term to look for in the document.
Height – The distance between a control's top and bottom edges.
HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that
control.
OnSelect – How the app responds when the user taps or clicks a control.
OnStateChange – How an app responds when the state of the control changes.
PaddingBottom – The distance between text in a control and the bottom edge of that control.
PaddingLeft – The distance between text in a control and the left edge of that control.
PaddingRight – The distance between text in a control and the right edge of that control.
PaddingTop – The distance between text in a control and the top edge of that control.
Page – The number of the page that you want to show.
PageCount – The number of pages in a document.
PressedBorderColor – The color of a control's border when the user taps or clicks that control.
ShowControls – Whether an audio or video player shows, for example, a play button and a volume slider,
and a pen control shows, for example, icons for drawing, erasing, and clearing.
Tooltip – Explanatory text that appears when the user hovers over a control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no
parent container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no
parent container).
Zoom – The percentage by which an image from a camera is magnified or the view of a file in a PDF
viewer.

Example
Add a PDF viewer control, and set its Document property to the URL, enclosed in double quotation
marks, of a PDF file as in this example:
"https://blog.mozilla.org/security/files/2015/05/HTTPS -FAQ.pdf"
The control shows the PDF file.
Don't know how to add and configure a control?

Accessibility guidelines
Not all accessibility features of PDF documents are supported because the PDF viewer is still in the
experimental stage. Therefore, ShowControls should be set to true to allow users to open the document
in an external application.
Learn how to create accessible PDF documents with the WCAG 2.0 and PDF/UA standards.
Screen reader support
Consider adding a heading using a Label, if the PDF document does not have a title. The heading can
be positioned immediately before the PDF viewer.
Pen input control in Power Apps
12/3/2019 • 3 minutes to read • Edit Online

A control in which the user can draw, erase, and highlight areas of an image.

Description
The user can use this control like a whiteboard, drawing diagrams and writing words that can be converted to
typed text.

Key properties
Image – Output property that represents the image drawn by the end user.
Color – The color of input strokes.
Mode – The control is in Draw or Erase mode. Select mode has been deprecated.

Additional properties
AccessibleLabel – Label for screen readers. Can be used to describe the purpose of the control as well as
alternative methods of input.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled
(Disabled).
Fill – The background color of a control.
Height – The distance between a control's top and bottom edges.
Input – Deprecated. Whether the input supports mouse, pen, or touch inputs. Defalut value (7) supports all
three.
OnSelect – How the app responds when the user taps or clicks a control.
SelectionColor – The text color of a selected item or items in a list or the color of the selection tool in a pen
control.
SelectionThickness – The thickness of the selection tool for a pen-input control.
ShowControls – Whether an audio or video player shows, for example, a play button and a volume slider, and
a pen control shows, for example, icons for drawing, erasing, and clearing.
Size – The font size of the text that appears on a control.
Tooltip – Explanatory text that appears when the user hovers over a control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent
container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no
parent container).

Related functions
Collect( CollectionName, DatatoCollect )

Example
Create a set of images
1. Add a Pen input control, name it MyDoodles, and set its ShowControls property to true.
Don't know how to add, name, and configure a control?
2. Add a Button control, move it below MyDoodles, and set the Text property of the Button control to
show Add.
3. Set the OnSelect property of the Button control to this formula:
Collect(Doodles, {Sketch:MyDoodles.Image})
4. Add an Image gallery control, move it below the Button control, and shrink the width of the Image
gallery control until it shows three items.
5. Set the Items property of the Image gallery control to Doodles, and then press F5.
6. Draw an image in MyDoodles, and then click or tap the Button control.
The image that you drew appears in the Image gallery control.
7. (optional) In the Pen input control, click or tap the icon to clear the image that you drew, draw another
image, and then click or tap the Button control.
8. In the Image gallery control, set the OnSelect property of the Image control to this formula:
Remove(Doodles, ThisItem )
9. Remove a drawing by clicking or tapping it in the Image gallery control.
Use the SaveData function to save your drawings locally or the Patch function to save them to a data source.

Accessibility guidelines
Color contrast
There must be adequate color contrast between:
BorderColor and the color outside the control (if there is a border)
Fill and the color outside the control (if there is no border)
Screen reader support
AccessibleLabel should be present.
IMPORTANT
Pen input is not accessible to screen reader users. Always provide an alternative form of input. For example, if a
sketch is required, consider adding an Add picture control for users to upload an image. Both methods can be
offered and the user can choose the one they are more comfortable with.

Keyboard support

IMPORTANT
Pen input is not accessible to keyboard users. Always provide an alternative form of input. For example, if a signature is
required, consider adding a Text input for users to enter their name. Both methods can be offered and the user can
choose the one they are more comfortable with.
Pie chart control in Power Apps
12/3/2019 • 3 minutes to read • Edit Online

A control that shows relative values in comparison to each other.

Description
Add a Pie chart control if you want to show relative data from a table that contains labels in the leftmost
column and values in the second column from the left.
This control is a grouped control containing three controls: a Label for the title, the chart graphic, and a
Legend.

Chart key properties


Items – The source of data that appears in a control such as a gallery, a list, or a chart.
ShowLabels – Whether a pie chart shows the value that's associated with each of its wedges.

Additional chart properties


BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
Color – The color of text in a control.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled
(Disabled).
DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to
Disabled.
Explode – The distance between wedges in a pie chart.
Font – The name of the family of fonts in which text appears.
Height – The distance between a control's top and bottom edges.
HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that control.
ItemBorderColor – The color of the border around each wedge in a pie chart.
ItemBorderThickness – The thickness of the border around each wedge in a pie chart.
ItemColorSet – The color of each data point in a chart.
LabelPosition – The location of labels in a pie chart relative to its wedges.
OnSelect – How the app responds when the user taps or clicks a control.
PressedBorderColor – The color of a control's border when the user taps or clicks that control.
Size – The font size of the text that appears on a control.
TabIndex – Keyboard navigation order in relation to other controls.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no
parent container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no
parent container).

Related functions
Max( DataSource, ColumnName )

Example
1. Add a Button control, and set its OnSelect property to this formula:
Collect(Revenue2015, {Product:"Europa", Revenue:27000}, {Product:"Ganymede",
Revenue:26300}, {Product:"Callisto", Revenue:29200})
Don't know how to add and configure a control?
Want more information about the Collect function or other functions?
2. Press F5, click or tap the Button control, and then press Esc to return to the default workspace.
3. Add a Pie chart control, and set its Items property to Revenue2015.
The Pie chart control shows revenue data for each product in relation to the other products.

Accessibility guidelines
Color contrast
There must be adequate color contrast between:
each item in ItemColorSet
every item in ItemColorSet and the background color
Color and the background color
Screen reader support
There must be a Label immediately before the chart graphic to serve as the title.

NOTE
Chart graphics and Legend are hidden from screen reader users. As an alternative, a tabular form of the data is
presented to them. They can also cycle through buttons that select data in the chart.

Low vision support


There must be a Legend.
Consider setting ShowLabels to true. This helps low -vision users quickly determine what each pie slice
represents.
Consider setting LabelPosition to LabelPosition.Outside. This increases legibility of labels because of a
more consistent color contrast.
Keyboard support
TabIndex must be zero or greater so that keyboard users can navigate to it.

NOTE
When keyboard users navigate to the chart, they can cycle through buttons that select data in the chart.
Power BI tile control in Power Apps
12/3/2019 • 3 minutes to read • Edit Online

A control that shows a Power BI tile inside an app.


Don't have Power BI? Sign up.

Description
Take advantage of your existing data analysis and reporting by displaying your Power BI tiles inside your apps.
Specify the tile that you want to show by setting its Workspace, Dashboard, and Tile properties in the Data tab
of the options panel.

Sharing and security


When you share an app that contains Power BI content, you must share not only the app itself but also the
dashboard where the tile comes from. Otherwise, the Power BI content won't appear even for users who open the
app. Apps that contain Power BI content respect the permissions for that content.

Performance
It's not recommended to have more than three Power BI tiles loaded at the same time within an app. You can
control tile loading and unloading by setting the LoadPowerBIContent property.

Pass a parameter
By passing a single parameter from the app, you can filter the results that appear in a Power BI tile. However, only
string values and the equals operator are supported, and the filter might not work if the table name or the column
name contains spaces.
To pass a single filter value, modify the value of the TileURL property, which follows this syntax:

"https://app.powerbi.com/embed?dashboardId=<DashboardID>&tileId=<TileID>&config=<SomeHash>"

To that value, append this syntax:

&$filter=<TableName>/<ColumnName> eq '<Value>'

The parameter will filter a value in the dataset of the report where the tile originates.

Key properties
Workspace – The Power BI workspace where the tile comes from.
Dashboard – The Power BI dashboard where the tile comes from.
Tile – The name of the Power BI tile that you want to display.
LoadPowerBIContent – When set to true, the Power BI content is loaded and shown. When set to false, the
Power BI content is unloaded, which releases memory and optimizes performance.
Additional properties
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled (Disabled).
Height – The distance between a control's top and bottom edges.
OnSelect – How the app responds when the user taps or clicks a control. By default, the Power BI report that's
associated with the tile opens.
TileUrl – The URL by which the tile is requested from the Power BI service. You can pass a single parameter into
the Power BI tile by appending the parameter to the URL (for example: … & "&$filter=Town/Province eq '" &
ListBox1.Selected.Abbr & "'"). You can use only the equals operator in the parameter.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent
container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent
container).

Example
1. On the Insert tab, open the Controls menu, and then add a Power BI tile control.
Don't know how to add and configure a control?
2. On the Data tab of the options panel, click or tap My Workspace for the Workspace setting.
3. Select a dashboard in the list of dashboards, and then select a tile in the list of tiles.
The control renders the Power BI tile.

Accessibility guidelines
The Power BI tile is simply a container for Power BI content. Learn how to create accessible content with these
Power BI accessibility tips.
If the Power BI content doesn't have a title, consider adding a heading using a Label control to support screen
readers. You can position the label immediately before the Power BI tile.
Radio control in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

An input control that shows multiple options, of which users can select only one at a time.

Description
A Radio control, a standard HTML input control, is best used with only a few, mutually exclusive options.
The control can have a horizontal or vertical layout.

Key properties
Default – The value of a control before the user changes it.
Items – The source of data that appears in a control such as a gallery, a list, or a chart.
Layout – Whether the options are laid out vertically or horizontally.
Value – The value of an input control.
Selected – The data record that represents the selected item.

All properties
Align – The location of text in relation to the horizontal center of its control.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
Color – The color of text in a control.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled
(Disabled).
DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to
Disabled.
DisabledColor – The color of text in a control if its DisplayMode property is set to Disabled.
DisabledFill – The background color of a control if its DisplayMode property is set to Disabled.
Fill – The background color of a control.
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Font – The name of the family of fonts in which text appears.
FontWeight – The weight of the text in a control: Bold, Semibold, Normal, or Lighter.
Height – The distance between a control's top and bottom edges.
HoverColor – The color of the text in a control when the user keeps the mouse pointer on it.
HoverFill – The background color of a control when the user keeps the mouse pointer on it.
Italic – Whether the text in a control is italic.
LineHeight – The distance between, for example, lines of text or items in a list.
OnChange – How the app responds when the user changes the value of a control (for example, by
adjusting a slider).
OnSelect – How the app responds when the user taps or clicks a control.
PaddingBottom – The distance between text in a control and the bottom edge of that control.
PaddingLeft – The distance between text in a control and the left edge of that control.
PaddingRight – The distance between text in a control and the right edge of that control.
PaddingTop – The distance between text in a control and the top edge of that control.
PressedColor – The color of text in a control when the user taps or clicks that control.
PressedFill – The background color of a control when the user taps or clicks that control.
RadioBackgroundFill – The background color of the circles in a radio-button control.
RadioBorderColor – The color of the circle for each option in a radio-button control.
RadioSelectionFill – The color that appears inside the circle of the selected option in a radio-button
control.
RadioSize – The diameter of the circles in a radio-button control.
Reset – Whether a control reverts to its default value.
SelectedText (Deprecated) – A string value that represents the selected item.
Size – The font size of the text that appears on a control.
Strikethrough – Whether a line appears through the text that appears on a control.
TabIndex – Keyboard-navigation order in relation to other controls.
Tooltip – Explanatory text that appears when the user hovers over a control.
Underline – Whether a line appears under the text that appears on a control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no
parent container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no
parent container).

Related functions
Distinct( DataSource, ColumnName )

Example
1. Add a Radio control, name it Pricing, and set its Items property to this formula:
["Standard", "Premium"]
Don't know how to add, name, and configure a control?
2. Add a Label control, move it below the Radio control, and set the Text property of the Label
control to this formula:
If("Premium" in Pricing.Selected.Value, "$200 per day", "$150 per day")
Want more information about the If function or other functions?
3. While holding down the Alt key, select either option in the Radio control.
The Label control shows the appropriate text for your choice.
4. (optional) While holding down the Alt key, select the other option to confirm that the appropriate
text appears.

Accessibility guidelines
Color contrast
In addition to the standard color contrast requirements, ensure adequate color contrast between:
RadioSelectionFill and RadioBackgroundFill
RadioBackgroundFill and Fill
Screen-reader support
Ensure that every option has a Value.
Consider adding a Label immediately before the Radio control to serve as the heading.
Keyboard support
Set the TabIndex property to zero or greater so that keyboard users can navigate to it.
Set the FocusedBorderColor and FocusedBorderThickness properties so that focus indicators are
clearly visible.
Rating control in Power Apps
12/3/2019 • 3 minutes to read • Edit Online

A control with which users can indicate a value between 1 and a maximum number that you specify.

Description
In this control, the user can indicate, for example, how much they liked something by selecting a certain
number of stars.

Key properties
Default – The initial value of a control before it is changed by the user.
Max – The maximum value to which the user can set a slider or a rating.

Additional properties
AccessibleLabel – Label for screen readers.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled
(Disabled).
Fill – The background color of a control.
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Height – The distance between a control's top and bottom edges.
OnChange – How the app responds when the user changes the value of a control (for example, by adjusting a
slider).
OnSelect – How the app responds when the user taps or clicks a control.
RatingFill – The color of the stars in a rating control.
ReadOnly – Whether a user can change the value of a slider or rating control.
Reset – Whether a control reverts to its default value.
ShowValue – Whether a slider's or rating's value appears as the user changes that value or hovers over the
control.
TabIndex – Keyboard navigation order in relation to other controls.
Tooltip – Explanatory text that appears when the user hovers over a control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent
container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no
parent container).

Related functions
Average( Value1, Value2, ... )

Example
1. Add a Rating control, and name it Quantitative.
Don't know how to add, name, and configure a control?
2. Add a Text input control, name it Qualitative, and move it below the Rating control.
3. Set the Default property of the Text input control to "", and set its HintText to this formula:
If(Quantitative.Value > 3, "What did you especially like?", "How might we do better?")
Want more information about the If function or other functions?
4. Press F5, and then click or tap either four or five stars in the Rating control.
The hint text in the Text input control changes to reflect the high rating.
5. Click or tap fewer than four stars in Quantitative.
The hint text in the Text input control changes to reflect the low rating.
6. To return to the default workspace, press Esc.

Accessibility guidelines
Color contrast
There must be adequate color contrast between:
RatingFill and Fill
This is in addition to the standard color contrast requirements.
Screen reader support
AccessibleLabel must be present.

NOTE
Screen readers treat the Rating control as radio buttons.

Keyboard support
TabIndex must be zero or greater so that keyboard users can navigate to it.
Focus indicators must be clearly visible. Use FocusedBorderColor and FocusedBorderThickness to
achieve this.
Consider using a different control if there are too many stars. It can be tedious to navigate with a
keyboard and difficult to select accurately with a touch screen.
NOTE
The same keyboard interactions for radio buttons can be used on Rating.
Rich text editor control in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Allows end users to format text inside a WYSIWYG editing area. Output format is HTML.

Description
The Rich text editor control provides the app user a WYSIWYG editing area for formatting text. Control's input
and output format is HTML.
Control allows copied rich text (i.e from web browser or Word) to be pasted into the control.
Control's intended use is to format text and does not guarantee to preserve the integrity of the input HTML. All
script, style, object and other potentially compromising tags will be removed by the editor. This means that if rich
text was created outside of Power Apps, it may not look the same as in the product where it was created.
Currently supported features include:
Bold, Italic, Underline
Text color, highlight Color
Text Size
Numbered lists, bullet lists
Hyperlinks
Clear formatting
To use the control inside a form, select the "Edit multi-line text" card, and customize it by inserting the RTE control.

Key properties
Default – Input property for the initial text value shown in editor.
HtmlText – Output property for the resulting rich text in HTML format.

Additional properties
AccessibleLabel – Label for screen readers. Should describe the purpose of the attachments.
DisplayMode – Whether the control allows adding and deleting files (Edit), only displays data (View), or is
disabled (Disabled).
EnableSpellCheck – Whether the browser spell checker is enabled. Note that the this functionality will provide
spell checking only in the default language of the browser. Power Apps for Windows doesn't support this property.
Height – The distance between a control's top and bottom edges.
TabIndex – Keyboard navigation order in relation to other controls.
Visible – Whether a control is visible or hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (or screen, if no parent
container).
Y – The distance between the top edge of a control and the top edge of the parent container (or screen, if no parent
container).

Accessibility guidelines
Screen reader support
AccessibleLabel must be present.
Keyboard support
TabIndex must be zero or greater so that keyboard users can navigate to it.

TIP
Use Alt+0 while the editor is focused to learn about other keyboard shortcuts.
Screen control in Power Apps
12/3/2019 • 3 minutes to read • Edit Online

A UI element that contains one or more other controls in an app.

Description
Most apps have multiple Screen controls that contain Label controls, Button controls, and other controls
that show data and support navigation. For information about how to add a screen, reorder screens, and
configure navigation, review Add a screen.

Key properties
BackgroundImage – The name of an image file that appears in the background of a screen.
Fill – The background color of a control.

Additional properties
Height - The height of the screen. If the app is responsive (Scale to fit is Off) and the device on which the
app is running is shorter than this property, the screen can scroll vertically.
ImagePosition – The position (Fill, Fit, Stretch, Tile, or Center) of an image in a screen or a control if it
isn't the same size as the image.
Name - The name of the screen.
OnHidden – The behavior of an app when the user navigates away from a screen.
OnVisible – The behavior of an app when the user navigates to a screen. Use this property to set up
variables and preload data used by the screen. Use the App.OnStart property for set up once when the app
is started.
Orientation - The orientation of the screen. If its Width is greater than its Height, the orientation will be
Layout.Horizontal; otherwise, it will be Layout.Vertical.
Size - A positive integer that classifies the size of the screen. The classification is determined by comparing
the screen's Width property to the values in the App.SizeBreakpoints property. The ScreenSize type
consists of four values (Small, Medium, Large, and ExtraLarge) that correspond to the integers 1 through
4.
Width - The width of the screen. If the app is responsive (Scale to fit is Off) and the device on which the
app is running is narrower than this property, the screen can scroll horizontally.

Related functions
Distinct( DataSource, ColumnName )

Example
1. Add a Radio control, name it ScreenFills, and set its Items property to this value:
["Red", "Green"]
Don't know how to add, name, and configure a control?
2. Name the default Screen control Source, add another Screen control, and name it Target.
3. In Source, add a Shape control (such as an arrow ), and set its OnSelect property to this formula:
Navigate(Target, ScreenTransition.Fade)

Want more information about the Navigate function or other functions?


4. In Target, add a Shape control (such as an arrow ), and set its OnSelect property to this formula:
Navigate(Source, ScreenTransition.Fade)

5. Set the Fill property of Target to this formula:


If("Red" in ScreenFills.Selected.Value, RGBA(255, 0, 0, 1), RGBA(54, 176, 75, 1))

6. Select the Source screen and then, while holding down the Alt key, select either option in the Radio
control, and then select the Shape control.
Target appears in the color that you selected.
7. In Target, select the Shape control to return to Source.
8. (optional) Select the other option in the Radio control, and then select the Shape control to confirm
that Target appears in the other color.
9. (optional) Reorder the screens by hovering over Target in the left navigation bar, selecting the ellipsis
that appears, and then selecting Move up.
Target appears first when the user opens the app.

Accessibility guidelines
Color contrast
When the Screen is the effective background for text, there must be adequate color contrast between:
Fill and text
BackgroundImage and text (if applicable)
For example, if a Screen contains a Label and the label has transparent fill, then the screen's Fill effectively
becomes the background color for the label.
In addition to text, consider checking color contrast with essential graphical objects like the star images in a
Rating control.
Screen reader support
There must be a meaningful name for each Screen. The screen name can be viewed and edited in the
same way as other controls: in the tree view of the controls pane or in the header of the properties
pane.

NOTE
When a new Screen is loaded, screen readers will announce its name.
Shape controls and Icon controls in Power Apps
12/3/2019 • 3 minutes to read • Edit Online

Graphics for which you can configure appearance and behavior properties.

Description
These controls include arrows, geometric shapes, action icons, and symbols for which you can configure
properties such as fill, size, and location. You can also configure their OnSelect property so that the app
responds if the user selects the control.

Key properties (icons and shapes)


Fill – The background color of a control.
OnSelect – How the app responds when the user selects a control.

Key properties (icons only)


Icon - The type of icon to display (for example, ArrowDown or ShoppingCart).
Rotation - The number of degrees to rotate the icon.
Color - The color of the icon by name or RGBA values.

Additional properties
AccessibleLabel – Label for screen readers.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled
(Disabled).
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Height – The distance between a control's top and bottom edges.
HoverFill – The background color of a control when the user keeps the mouse pointer on it.
PressedBorderColor – The color of a control's border when the user selects that control.
PressedFill – The background color of a control when the user selects that control.
TabIndex – Keyboard-navigation order in relation to other controls.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no
parent container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no
parent container).
Related functions
Navigate( ScreenName, ScreenTransition )

Example
1. Name the default Screen control Target, add a Label control, and set its Text property to show
Target.
Don't know how to add and configure a control?
2. Add a Screen control, and name it Source.
3. In Source, add a Shape control, and set its OnSelect property to this formula:
Navigate(Target, ScreenTransition.Fade)

1. Press F5, and then select the Shape control.


The Target screen appears.
2. (optional) Press Esc to return to the default workspace, add a Shape control to Target, and set the
OnSelect property of the Shape control to this formula:
Navigate(Source, ScreenTransition.Fade)

Accessibility guidelines
Color contrast
The following applies only to graphics that are used as buttons or are otherwise not just for decoration.
For icons:
Color and Fill
Other standard color contrast requirements apply (if used as a button)
For shapes with borders:
BorderColor and the color outside the control
FocusedBorderColor and the color outside the control (if used as a button)
For shapes without borders:
Fill and the color outside the control
PressedFill and the color outside the control (if used as a button)
HoverFill and the color outside the control (if used as a button)
Screen-reader support
AccessibleLabel must be set to a non-empty string if the graphic is used as a button or is otherwise
not just for decoration.
AccessibleLabel must be empty or the empty string "" if the graphic provides redundant
information or is purely for decoration. This value causes screen readers to ignore the graphic.
For example, you might set the AccessibleLabel property of a Settings icon to Settings. This icon isn't
used as a button. It's next to a Label that also says Settings. Screen readers will read both the icon and the
label as Settings, which is unnecessarily verbose. In this case, the icon doesn't need an AccessibleLabel.
IMPORTANT
Screen readers will read an icon or shape as button if its AccessibleLabel is set to an empty string and its TabIndex
is set to zero or greater. Such icons or shapes are rendered as buttons.

Keyboard support
TabIndex must be zero or greater if the graphic is used as a button. If you set this value for an icon
or shape, keyboard users can navigate to it.
Focus indicators must be clearly visible if the graphic is used as a button. Use FocusedBorderColor
and FocusedBorderThickness to achieve this result.

NOTE
When TabIndex is zero or greater, the icon or shape is rendered as a button. Its appearance doesn't change,
but screen readers will correctly identify the image as a button. When TabIndex is less than zero, the icon or
shape is identified as an image.
Slider control in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

A control with which the user can specify a value by dragging a handle.

Description
The user can indicate a value, between a minimum and a maximum value that you specify, by dragging the
handle of a slider left-right or up-down, depending on the direction that you choose.

Key properties
Default – The initial value of a control before it is changed by the user.
Max – The maximum value to which the user can set a slider or a rating.
Min – The minimum value to which the user can set a slider.
Value – The value of an input control.

Additional properties
AccessibleLabel – Label for screen readers.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled
(Disabled).
DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to
Disabled.
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
HandleActiveFill – The color of the handle for a slider as the user changes its value.
HandleFill – The color of the handle (the element that changes position) in a toggle or slider control.
HandleHoverFill – The color of the handle in a slider when the user keeps the mouse pointer on it.
HandleSize – The diameter of the handle.
Height – The distance between a control's top and bottom edges.
HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that
control.
Layout – Whether the user scrolls through a gallery or adjusts a slider top to bottom ( Vertical) or left to
right (Horizontal).
OnChange – How the app responds when the user changes the value of a control (for example, by
adjusting a slider).
OnSelect – How the app responds when the user taps or clicks a control.
PressedBorderColor – The color of a control's border when the user taps or clicks that control.
RailFill – The background color of the rectangle in a toggle control when its value is false or the color of
the line to the right of the handle in a slider control.
RailHoverFill – When you hover on a toggle control or a slider, the background color of the rectangle in a
toggle control when its value is false or the color of the line to the right of the handle in a slider control.
ReadOnly – Whether a user can change the value of a slider or rating control.
Reset – Whether a control reverts to its default value.
ShowValue – Whether a slider's or rating's value appears as the user changes that value or hovers over
the control.
TabIndex – Keyboard navigation order in relation to other controls.
Tooltip – Explanatory text that appears when the user hovers over a control.
ValueFill – The background color of the rectangle in a toggle control when its value is true or the color of
the line to the left of the handle in a slider control.
ValueHoverFill – When you keep the mouse pointer on a toggle control or a slider, the background color
of the rectangle in a toggle control when its value is true or the color of the line to the left of the handle in a
slider control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no
parent container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no
parent container).

Related functions
Sum ( Value1, Value2 )

Example
1. Add a button, and set its OnSelect property to this formula:
ClearCollect(CityPopulations, {City:"London", Country:"United Kingdom",
Population:8615000}, {City:"Berlin", Country:"Germany", Population:3562000},
{City:"Madrid", Country:"Spain", Population:3165000}, {City:"Rome", Country:"Italy",
Population:2874000}, {City:"Paris", Country:"France", Population:2273000},
{City:"Hamburg", Country:"Germany", Population:1760000}, {City:"Barcelona",
Country:"Spain", Population:1602000}, {City:"Munich", Country:"Germany",
Population:1494000}, {City:"Milan", Country:"Italy", Population:1344000})
Don't know how to add, name, and configure a control?
Want more information about the ClearCollect function or other functions?
2. Press F5, select the button, and then press Esc.
3. Add a slider, move it below the button, and name the slider MinPopulation.
4. Set the slider's Max property to 5000000 and its Min property to 1000000.
5. Add a text gallery in vertical/portrait orientation, move it below the slider, and set the gallery's Items
property to this formula:
Filter(CityPopulations, Population > MinPopulation)
6. In the first item of the gallery, set the Text property of the top label to ThisItem.City, and set the
Text property of the bottom label to this formula:
Text(ThisItem.Population, "##,###")
7. Press F5, and then adjust MinPopulation to show only those cities that have a population that's
greater than the value that you specify.
8. To return to the default workspace, press Esc.

Accessibility guidelines
Color contrast
There must be adequate color contrast between:
ValueFill and RailFill
ValueHoverFill and RailHoverFill
FocusedBorderColor and color outside the control
ValueFill and background color
RailFill and background color
ValueHoverFill and background color
RailHoverFill and background color
Screen reader support
AccessibleLabel must be present.
Keyboard support
TabIndex must be zero or greater so that keyboard users can navigate to it.
Focus indicators must be clearly visible. Use FocusedBorderColor and FocusedBorderThickness to
achieve this.
Slider value must be shown when interacting with the keyboard. This can be achieved by any one of
these methods:
Set ShowValue to true.
Add a Label adjacent to the slider. Set the label's Text to the slider's Value.
Microsoft Stream video control in Power Apps
12/11/2019 • 3 minutes to read • Edit Online

A video player for Microsoft Stream videos and channels.

Description
The control will allow app users to play videos and browse through channels from the Microsoft Stream service.

Limitations
The control is currently not supported in the native Windows player for Power Apps. It works successfully in web
browsers as well as the Android and iOS Power Apps players.

Key properties
StreamUrl – The URL of the Microsoft Stream video or channel to be shown in the control.
ShowControls – Whether video playback controls are shown to the end user.

Additional properties
AccessibleLabel – Label for screen readers. Should be the title of the video or audio clip.
AutoStart – Whether an audio or video control automatically starts to play a clip when the user navigates to the
screen that contains that control.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled (Disabled).
Fill – The background color of a control.
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Height – The distance between a control's top and bottom edges.
StartTime – The time after the start of an audio or video clip when the clip starts to play.
TabIndex – Keyboard navigation order in relation to other controls.
Tooltip – Explanatory text that appears when the user hovers over a control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent
container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent
container).

Example
Play an audio or video file from Microsoft Stream
1. On the File menu, select Insert and then open Media drop-down menu.
2. Select Microsoft Stream from the list of media controls:

3. Paste the video link inside Stream URL property on the left:

4. Press F5, select the play button of the control that you added.

NOTE
Microsoft Stream requires authentication to play the video. Ensure the app user has the required permission.

5. Press Esc to exit the preview mode.

Browser considerations
iOS
The Power Apps iOS player does not support direct playback of videos embedded in the app. To watch the video,
click on the Stream icon to launch the video player in a full-screen mode.
Safari
In order to view Microsoft Stream videos in an app in the Safari browser, you will need to turn off the option to
prevent cross-site tracking.

Accessibility guidelines
Audio and video alternatives
ShowControls must be true so that users can listen or watch multimedia at their own pace. This also allows
users to toggle closed captions and full-screen mode on video players.
Closed captions must be provided for videos.
Consider providing an audio or video transcript using one of these methods:
1. Put the text in a Label and position it adjacent to the multimedia player. Optionally, create a Button to toggle
the display of the text.
2. Put the text in a different screen. Create a Button that navigates to the screen and position the button adjacent
to the multimedia player.
3. If the description is short, it can be put it in the AccessibleLabel.
Color contrast
There must be adequate color contrast between:
FocusedBorderColor and the outside color
Fill and the multimedia player controls (if the fill is visible)
Provide closed captions and/or transcript if the video content has color contrast issues.
Screen reader support
AccessibleLabel must be present.
Keyboard support
TabIndex must be zero or greater so that keyboard users can navigate to it.
Focus indicators must be clearly visible. Use FocusedBorderColor and FocusedBorderThickness to achieve
this.
AutoStart should be false because it can be difficult for keyboard users to stop playback quickly.
Label control in canvas apps
11/6/2019 • 6 minutes to read • Edit Online

A box that shows data such as text, numbers, dates, or currency.

Description
A label shows data that you specify as a literal string of text, which appears exactly the
way you type it, or as a formula that evaluates to a string of text. Labels often appear
outside of any other control (such as a banner that identifies a screen), as a label that
identifies another control (such as a rating or audio control), or in a gallery to show a
specific type of information about an item.

Key properties
AutoHeight – Set to true to allow the label to auto-grow its height to show all text. Set
to false to truncate the text to the height assigned.
Color – The color of text in a control.
Font – The name of the family of fonts in which text appears.
Text – Text that appears on a control or that the user types into a control.
DelayOutput – Set to true to delay action during text input.

Additional properties
Align – The location of text in relation to the horizontal center of its control.
AutoHeight – Whether a label automatically increases its Height property if its Text
property contains more characters than the control can show at one time.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
DisplayMode – Whether the control allows user input (Edit), only displays data
(View), or is disabled (Disabled).
DisabledBorderColor – The color of a control's border if the control's DisplayMode
property is set to Disabled.
DisabledColor – The color of text in a control if its DisplayMode property is set to
Disabled.
DisabledFill – The background color of a control if its DisplayMode property is set
to Disabled.
Fill – The background color of a control.
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is
focused.
FontWeight – The weight of the text in a control: Bold, Semibold, Normal, or
Lighter.
Height – The distance between a control's top and bottom edges.
HoverBorderColor – The color of a control's border when the user keeps the mouse
pointer on that control.
HoverColor – The color of the text in a control when the user keeps the mouse pointer
on it.
HoverFill – The background color of a control when the user keeps the mouse pointer
on it.
Italic – Whether the text in a control is italic.
LineHeight – The distance between, for example, lines of text or items in a list.
Live – How a screen reader announces changes to the value of the label's Text
property.
When set to Off, the screen reader doesn't announce changes.
When set to Polite, the screen reader finishes speaking before announcing any
changes that occurred while the screen reader was speaking.
When set to Assertive, the screen reader interrupts itself to announce any changes
that occurred while the screen reader was speaking.
OnSelect – How the app responds when the user taps or clicks a control.
Overflow – Whether a scrollbar appears in a label if its Wrap property is set to true
and the value of the control's Text property contains more characters than the control
can show at one time.
PaddingBottom – The distance between text in a control and the bottom edge of that
control.
PaddingLeft – The distance between text in a control and the left edge of that control.
PaddingRight – The distance between text in a control and the right edge of that
control.
PaddingTop – The distance between text in a control and the top edge of that control.
PressedBorderColor – The color of a control's border when the user taps or clicks that
control.
PressedColor – The color of text in a control when the user taps or clicks that control.
PressedFill – The background color of a control when the user taps or clicks that
control.
Role - The semantic role of the label text, such as Heading 1. Doesn't change the style
of the label but makes the output semantically correct for interpretation by screen
readers.
Size – The font size of the text that appears on a control.
Strikethrough – Whether a line appears through the text that appears on a control.
TabIndex – Keyboard navigation order in relation to other controls.
Tooltip – Explanatory text that appears when the user hovers over a control.
Underline – Whether a line appears under the text that appears on a control.
VerticalAlign – The location of text on a control in relation to the vertical center of
that control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
Wrap – Whether text that's too long to fit in a label wraps to the next line.
X – The distance between the left edge of a control and the left edge of its parent
container (screen if no parent container).
Y – The distance between the top edge of a control and the top edge of the parent
container (screen if no parent container).

Related functions
Text( Number, "FormatCodes" )

Examples
Show a literal string
Add a label, and set its Text property to "Hello, world" (including the double
quotation marks).
Don't know how to add and configure a control?
Show the result of a formula
Add a label, and set its Text property to a formula such as this one:
Today()

NOTE
When you specify a formula, you don't use quotation marks unless an argument of
the formula is a literal string. In that case, enclose the argument, not the formula, in
double quotation marks.

Want more information about the Today function or other functions?


Show data in a gallery
In this procedure, you'll create a collection, called CityPopulations, that contains data
about the population of various cities in Europe. Next, you'll show that data in a gallery
that contains three labels, and you'll specify the type of data that each label will show.
1. Add a button, and set its OnSelect property to this formula:
ClearCollect(CityPopulations, {City:"London", Country:"United
Kingdom", Population:8615000}, {City:"Berlin", Country:"Germany",
Population:3562000}, {City:"Madrid", Country:"Spain",
Population:3165000}, {City:"Rome", Country:"Italy",
Population:2874000}, {City:"Paris", Country:"France",
Population:2273000}, {City:"Hamburg", Country:"Germany",
Population:1760000}, {City:"Barcelona", Country:"Spain",
Population:1602000}, {City:"Munich", Country:"Germany",
Population:1494000}, {City:"Milan", Country:"Italy",
Population:1344000})
2. Press F5, select the button, and then press Esc.
3. Add a text gallery, and set its Items property to CityPopulations.
When the gallery is selected, the right pane shows options for that gallery.
4. In the Gallery1 pane, set the top list to Population, set the middle list to City,
and set the bottom list to Country.

Accessibility guidelines
Despite its name, a Label control does not have to be used as a label for another
control. It can be used to display any piece of text.
A Label can be used as a button or link by specifying OnSelect behavior. When used
this way, there are similar accessibility considerations as with buttons.
Color contrast
There must be adequate color contrast between:
Color and Fill
Other standard color contrast requirements apply (if used as a button or link)
Screen-reader support
Text must be present.
Live should be set to Polite or Assertive if a screen reader should announce
changes to the value of the Text property.

NOTE
Screen readers will treat Labels as buttons when TabIndex is zero or greater.

Low vision support


Label should look like a link, if it is used as a link.
Set Underline to true
HoverColor should be different from Color
Keyboard support
TabIndex must be zero or greater, if the text is used as a button or link. This allows
keyboard users to navigate to it.
Focus indicators must be clearly visible, if the text is used as a button or link. Use
FocusedBorderColor and FocusedBorderThickness to achieve this.
Text input control in Power Apps
12/3/2019 • 6 minutes to read • Edit Online

A box in which the user can type text, numbers, and other data.

Description
The user can specify data by typing into a text-input control. Depending on how you configure
the app, that data might be added to a data source, used to calculate a temporary value, or
incorporated in some other way.

Key properties
Default – The initial value of a control before it is changed by the user.
Text – Text that appears on a control or that the user types into a control.

Additional properties
AccessibleLabel – Label for screen readers.
Align – The location of text in relation to the horizontal center of its control.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
Clear – Whether a text-input control shows an "X" that the user can tap or click to clear the
contents of that control.
Color – The color of text in a control.
DelayOutput – When set to true, user input is registered after half a second delay. Useful for
delaying expensive operations until user completes inputting text (i.e. for filtering when input is
used in other formulas).
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is
disabled (Disabled).
DisabledBorderColor – The color of a control's border if the control's DisplayMode property
is set to Disabled.
DisabledColor – The color of text in a control if its DisplayMode property is set to Disabled.
DisabledFill – The background color of a control if its DisplayMode property is set to
Disabled.
EnableSpellCheck – Whether a text-input control should use the browser spell check function.
Power Apps for Windows doesn't support this property.
Fill – The background color of a control.
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Font – The name of the family of fonts in which text appears.
FontWeight – The weight of the text in a control: Bold, Semibold, Normal, or Lighter.
Format – Whether the user input is restricted to numbers only or can be any text.
Height – The distance between a control's top and bottom edges.
HintText – Light-grey text that appears in an input-text control if it's empty.
HoverBorderColor – The color of a control's border when the user keeps the mouse pointer
on that control.
HoverColor – The color of the text in a control when the user keeps the mouse pointer on it.
HoverFill – The background color of a control when the user keeps the mouse pointer on it.
Italic – Whether the text in a control is italic.
LineHeight – The distance between, for example, lines of text or items in a list.
MaxLength – The number of characters that the user can type into a text-input control.
Mode – The control is in SingleLine, MultiLine, or Password mode.
OnChange – How the app responds when the user changes the value of a control (for example,
by adjusting a slider).
OnSelect – How the app responds when the user taps or clicks a control.
PaddingBottom – The distance between text in a control and the bottom edge of that control.
PaddingLeft – The distance between text in a control and the left edge of that control.
PaddingRight – The distance between text in a control and the right edge of that control.
PaddingTop – The distance between text in a control and the top edge of that control.
PressedBorderColor – The color of a control's border when the user taps or clicks that control.
PressedColor – The color of text in a control when the user taps or clicks that control.
PressedFill – The background color of a control when the user taps or clicks that control.
RadiusBottomLeft – The degree to which the bottom-left corner of a control is rounded.
RadiusBottomRight – The degree to which the bottom-right corner of a control is rounded.
RadiusTopLeft – The degree to which the top-left corner of a control is rounded.
RadiusTopRight – The degree to which the top-right corner of a control is rounded.
Reset – Whether a control reverts to its default value.
Size – The font size of the text that appears on a control.
Strikethrough – Whether a line appears through the text that appears on a control.
TabIndex – Keyboard navigation order in relation to other controls.
Tooltip – Explanatory text that appears when the user hovers over a control.
Underline – Whether a line appears under the text that appears on a control.
VirtualKeyboardMode – Type of virtual keyboard, text or numeric, that appears on an app
user's touch screen. The Format property determines the default value. Device support varies.
Devices that are running iOS must have at least version 12.2. The recommended version of
Android is 9.0, and capabilities of numeric keyboards vary for Android devices. Windows 10
doesn't support this property.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container
(screen if no parent container).
Y – The distance between the top edge of a control and the top edge of the parent container
(screen if no parent container).

Related functions
DateTimeValue( String )

Examples
Collect data
1. Add two text-input controls, and name them inputFirst and inputLast.
Don't know how to add, name, and configure a control?
2. Add a button, set its Text property to Add, and set its OnSelect property to this
formula:
Collect(Names, {FirstName:inputFirst.Text, LastName:inputLast.Text})
Want more information about the Collect function or other functions?
3. Add a text gallery in portrait/vertical orientation, set its Items property to Names, and
set the Text property of Subtitle1 to ThisItem.FirstName.
4. (optional) In the template gallery, delete the bottom label, named Body1, and set the
TemplateSize property of the gallery to 80.
5. Press F5, type a string of text into inputFirst and inputLast, and then click or tap the
Add button.
6. (optional) Add more names to the collection, and then press Esc to return to the default
workspace.
Prompt for a password
1. Add a text-input control, name it inputPassword, and set its Mode property to
Password.
2. Add a label, and set its Text property to this formula:
If(inputPassword.Text = "P@ssw0rd", "Access granted", "Access denied")
Want more information about the If function or other functions?
3. Press F5, and then type **P@ssw0rd** in inputPassword.
When you finish typing the password, the label stops showing Access denied and starts
to show Access granted.
4. To return to the default workspace, press Esc.
5. (optional) Add a control such as an arrow, configure it to navigate to another screen, and
show it only after the user types the password.
6. (optional) Add a button, configure its Text property to show Sign in, add a timer, and
disable the input-text control for a certain amount of time if the user types the wrong
password and then clicks or taps the Sign in button.

Accessibility guidelines
Color contrast
Standard color contrast requirements apply.
Screen reader support
AccessibleLabel must be present.
Keyboard support
TabIndex must be zero or greater so that keyboard users can navigate to it.
Focus indicators must be clearly visible. Use FocusedBorderColor and
FocusedBorderThickness to achieve this.
Timer control in Power Apps
12/3/2019 • 5 minutes to read • Edit Online

A control that can determine how your app responds after a certain amount of time passes.

Description
Timers can, for example, determine how long a control appears or change other properties of a control
after a certain amount of time has passed.

NOTE
In Power Apps Studio, timers run only in Preview mode.

Key properties
Duration – How long a timer runs in milliseconds. There is no maximum value.
OnTimerEnd – How an app responds when a timer finishes running.
Repeat – Whether a timer automatically restarts when it finishes running.

Additional properties
Align – The location of text in relation to the horizontal center of its control.
AutoPause – Whether the timer control automatically pauses if the user navigates to a different screen.
AutoStart – Whether the timer control automatically starts to play when the user navigates to the screen
that contains that control.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
Color – The color of text in a control.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled
(Disabled).
DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to
Disabled.
DisabledColor – The color of text in a control if its DisplayMode property is set to Disabled.
DisabledFill – The background color of a control if its DisplayMode property is set to Disabled.
Fill – The background color of a control.
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Font – The name of the family of fonts in which text appears.
FontWeight – The weight of the text in a control: Bold, Semibold, Normal, or Lighter.
Height – The distance between a control's top and bottom edges.
HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that
control.
HoverColor – The color of the text in a control when the user keeps the mouse pointer on it.
HoverFill – The background color of a control when the user keeps the mouse pointer on it.
Italic – Whether the text in a control is italic.
OnSelect – How the app responds when the user taps or clicks a control.
OnTimerStart – How an app responds when a timer starts to run.
PressedBorderColor – The color of a control's border when the user taps or clicks that control.
PressedColor – The color of text in a control when the user taps or clicks that control.
PressedFill – The background color of a control when the user taps or clicks that control.
Reset – Whether a control reverts to its default value.
Size – The font size of the text that appears on a control.
Start – Whether the timer starts.
Strikethrough – Whether a line appears through the text that appears on a control.
TabIndex – Keyboard navigation order in relation to other controls.
Text – Text that appears on a control or that the user types into a control.
Tooltip – Explanatory text that appears when the user hovers over a control.
Underline – Whether a line appears under the text that appears on a control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no
parent container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no
parent container).

Related functions
Refresh( DataSource )

Examples
Show a countdown
1. Add a timer, and name it Countdown.
Don't know how to add, name, and configure a control?
2. Set the timer's Duration property to 10000 and its Repeat and Autostart properties to true.
3. (optional) Make the timer easier to read by setting its Height property to 160, its Width property to
600, and its Size property to 60.
4. Add a label, and set its Text property to this formula:
"Number of seconds remaining: " & RoundUp(10-Countdown.Value/1000, 0)
Want more information about the RoundUp function or other functions?
The label shows how many seconds remain before the timer restarts.
Animate a control
1. Add a timer, and name it FadeIn.
Don't know how to add, name, and configure a control?
2. Set the timer's Duration property to 5000, its Repeat property to true, and its Text property to
Toggle animation.
3. (optional) Make the timer easier to read by setting its Height property to 160, its Width property to
600, and its Size property to 60.
4. Add a label, set its Text property to show Welcome! and set its Color property to this formula:
ColorFade(Color.BlueViolet, FadeIn.Value/5000)
Want more information about the ColorFade function or other functions?
5. Select the timer button to start or stop the animation. The text in the label fades to white, returns to
full intensity, and repeats the process.

Accessibility guidelines
The same guidelines for the Button control apply to the Timer control if users can interact with it.
Background timers
Background timers run automatically and are hidden. Use them in a supporting role where the elapsed
time is of little interest to the user. For example, you can refresh data every minute or show a notification
message only for a certain amount of time.
Background timers should have their Visible property set to false so that they are hidden from all users.
Timing considerations
If a Timer runs automatically, consider whether users have enough time to read and use content. Keyboard
and screen-reader users may need more time to react to a timed event.
Any of these strategies is sufficient:
Allow users to cancel the timed event.
Allow users to adjust the time limit before it begins.
Warn 20 seconds before the time limit expires and provide an easy way to extend the limit.
Some scenarios are exempt from these requirements. Learn more in the WCAG 2.0 guideline for time
limits.
Screen reader support
If a timer triggers changes on the current screen, use a live region to tell screen-reader users what
changed.
NOTE
If the timer is visible and running, screen readers will announce the elapsed time every five seconds.

Don't use the Text property of a control for time-sensitive and important information. Screen
readers won't announce changes to Text.
For interactive timers:
Text must be present.
Consider adding a Label control to show the elapsed time. Use the timer's Text property to
instruct the user to start or stop the timer.
Toggle control in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

A control that the user can turn on or off by moving its handle.

Description
A toggle is designed for recent GUIs but behaves the same way as a check box.

Key properties
Default – The initial value of a control before it is changed by the user.
Value – The value of an input control.

Additional properties
AccessibleLabel – Label for screen readers.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled
(Disabled).
DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to
Disabled.
FalseFill – The toggle fill color when the toggle is off.
FalseHoverFill – The toggle hover fill color when toggle is off.
FalseText – The text shown when the toggle is off.
Fill – The background color of a control.
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
HandleFill – The fill color of the toggle handle.
Height – The distance between a control's top and bottom edges.
HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that control.
OnChange – How the app responds when the user changes the value of a control (for example, by adjusting a
slider).
OnCheck – How an app responds when the value of a checkbox or a toggle changes to true.
OnSelect – How the app responds when the user taps or clicks a control.
OnUncheck – How an app responds when the value of a checkbox or a toggle changes to false.
PressedBorderColor – The color of a control's border when the user taps or clicks that control.
RailFill – The background color of the rectangle in a toggle control when its value is false or the color of the
line to the right of the handle in a slider control.
RailHoverFill – When you hover on a toggle control or a slider, the background color of the rectangle in a
toggle control when its value is false or the color of the line to the right of the handle in a slider control.
Reset – Whether a control reverts to its default value.
ShowLabel – Whether a text label is shown beside the toggle control.
TabIndex – Keyboard navigation order in relation to other controls.
TextPosition – Whether the label is to the left or the right of the toggle control.
Tooltip – Explanatory text that appears when the user hovers over a control.
TrueFill – Toggle fill color when the toggle is on.
TrueHoverFill – Toggle hover fill color when the toggle is on.
TrueText – Text shown when the toggle is on.
ValueFill – The background color of the rectangle in a toggle control when its value is true or the color of the
line to the left of the handle in a slider control.
ValueHoverFill – When you keep the mouse pointer on a toggle control or a slider, the background color of
the rectangle in a toggle control when its value is true or the color of the line to the left of the handle in a
slider control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent
container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no
parent container).

Related functions
If( Condition, Result )

Example
1. Add a toggle, and name it MemberDiscount.
Don't know how to add, name, and configure a control?
2. Add a label, and set its Text property to this formula:
If(MemberDiscount.Value = true, "Price: $75", "Price: $100")
Want more information about the If function or other functions?
3. Press F5, and change the value of MemberDiscount.
The label shows a different price, depending on whether MemberDiscount is on or off.
4. To return to the default workspace, press Esc.
Accessibility guidelines
Color contrast
There must be adequate color contrast between:
HandleFill and FalseFill
HandleFill and FalseHoverFill
HandleFill and TrueFill
HandleFill and TrueHoverFill
FalseFill and color outside the control
FalseHoverFill and color outside the control
TrueFill and color outside the control
TrueHoverFill and color outside the control
This is in addition to the standard color contrast requirements.
Screen reader support
AccessibleLabel must be present.
FalseText must be present.
TrueText must be present.
Low vision support
Consider setting ShowLabel to true so that users can quickly determine the toggle value.
Keyboard support
TabIndex must be zero or greater so that keyboard users can navigate to it.
Focus indicators must be clearly visible. Use FocusedBorderColor and FocusedBorderThickness to
achieve this.
Audio and Video controls in Power Apps
12/3/2019 • 5 minutes to read • Edit Online

A control that plays an audio file, a video file, or a video on YouTube.

Description
An Audio control plays a sound clip from a file, a recording from a Microphone control, or the
audio track from a video file.
A Video control plays a video clip from a file or from YouTube or Azure Media Services. Closed
captions can optionally be shown when specified.

Key properties
Loop – Whether an audio or video clip automatically starts over as soon as it finishes playing.
Media – An identifier for the clip that an audio or video control plays.
ShowControls – Whether an audio or video player shows, for example, a play button and a volume
slider, and a pen control shows, for example, icons for drawing, erasing, and clearing.

Additional properties
AccessibleLabel – Label for screen readers. Should be the title of the video or audio clip.
AutoPause – Whether an audio or video clip automatically pauses if the user navigates to a different
screen.
AutoStart – Whether an audio or video control automatically starts to play a clip when the user
navigates to the screen that contains that control.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
ClosedCaptionsUrl – Video control only. URL of closed captions file in WebVTT format. Both video
and captions URLs must be HTTPS. Server hosting both video and captions file needs to be CORS
enabled.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is
disabled (Disabled).
Fill – The background color of a control.
FocusedBorderColor – The color of a control's border when the control is focused.
FocusedBorderThickness – The thickness of a control's border when the control is focused.
Height – The distance between a control's top and bottom edges.
Image – The name of the image that appears in an image, audio, or microphone control.
ImagePosition – The position (Fill, Fit, Stretch, Tile, or Center) of an image in a screen or a
control if it isn't the same size as the image.
OnEnd – How an app responds when an audio or video clip finishes playing.
OnPause – How an app responds when the user pauses the clip that an audio or video control is
playing.
OnStart – How the app responds when the user starts to record with a microphone control.
Paused – True if a media playback control is currently paused, false otherwise.
Reset – Whether a control reverts to its default value.
Start – Whether an audio or video clip plays.
StartTime – The time after the start of an audio or video clip when the clip starts to play.
Time – A media control's current position.
TabIndex – Keyboard navigation order in relation to other controls.
Tooltip – Explanatory text that appears when the user hovers over a control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if
no parent container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen
if no parent container).

Related functions
First( TableName )

Examples
Play an audio or video file
1. On the File menu, click or tap Media, click or tap Videos or Audio, and then click or tap
Browse.
2. Browse to the file you want to use, click or tap it, and then click or tap Open.
3. Press Esc to return to the default workspace, add an Audio or Video control, and set its
Media property to the file that you added.
Don't know how to add and configure a control?
4. Press F5, and then play the clip by clicking or tapping the play button of the control that you
added.

TIP
The play button of the Video control appears when you hover over the control.

5. Press Esc to return to the default workspace.


Play a YouTube video
1. Add a Video control, and set its Media property to the URL of the YouTube video, enclosed in
double quotation marks.
2. Press F5, and then play the clip by clicking or tapping the play button of the Video control.
3. Press Esc to return to the default workspace.
Play a video from Azure Media Services
1. After the videos are published on AMS, copy the manifest URL. Start the streaming endpoint of
your service, if not already.
2. Add a Video control, and set its Media property to the URL of the AMS video, enclosed in
double quotation marks.
3. Press F5, and then play the clip by clicking or tapping the play button of the Video control.
4. Press Esc to return to the default workspace.

Accessibility guidelines
Audio and video alternatives
ShowControls must be true so that users can listen or watch multimedia at their own pace. This
also allows users to toggle closed captions and full-screen mode on video players.
Closed captions must be provided for videos.
For YouTube videos, use authoring tools provided by YouTube to add captions.
For other videos, create captions in WebVTT format, upload them, and set
ClosedCaptionsUrl to the url location. There are several limitations. Server(s) hosting
video and captions needs to be CORS -enabled and serve them using HTTPS protocol.
Captioning does not work on Internet Explorer.
Consider providing an audio or video transcript using one of these methods:
1. Put the text in a Label and position it adjacent to the multimedia player. Optionally, create
a Button to toggle the display of the text.
2. Put the text in a different screen. Create a Button that navigates to the screen and position
the button adjacent to the multimedia player.
3. If the description is short, it can be put it in the AccessibleLabel.
Color contrast
There must be adequate color contrast between:
FocusedBorderColor and the outside color
Image and the multimedia player controls (if applicable)
Fill and the multimedia player controls (if the fill is visible)
Provide closed captions and/or transcript if the video content has color contrast issues.
Screen reader support
AccessibleLabel must be present.
Keyboard support
TabIndex must be zero or greater so that keyboard users can navigate to it.
Focus indicators must be clearly visible. Use FocusedBorderColor and
FocusedBorderThickness to achieve this.
AutoStart should be false because it can be difficult for keyboard users to stop playback quickly.
Web barcode-scanner control (experimental) in
Power Apps
12/3/2019 • 2 minutes to read • Edit Online

The legacy barcode-scanning control, which is obsolete but might be useful for scanning codes in a web browser.

Description
The control shows the camera feed in the app so that users can scan barcodes on all devices. The control is
obsolete due to poor performance, and the mobile Barcode scanner control replaces this control.

Key properties
barcode scanner – On a device that has more than one barcode scanner, the numeric ID of the barcode scanner
that the app uses.

Additional properties
AccessibleLabel – Label for screen readers.
BorderColor – The color of a control's border.
BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.
BorderThickness – The thickness of a control's border.
DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled (Disabled).
Height – The distance between a control's top and bottom edges.
ShowLiveBarcodeDetection – Whether visual cues are shown to indicate the status of barcode detection. Yellow
rectangles represent areas that are being examined. A green line across a rectangle indicates successful barcode
identification.
Stream – Automatically updated image based on the StreamRate property.
StreamRate – How often to update the image on the Stream property, in milliseconds. This value can range from
100 (1/10th of a second) to 3,600,000 (1 hour).
Text – Value of barcode that was last identified by the scanner.
Tooltip – Explanatory text that appears when the user hovers over a control.
Visible – Whether a control appears or is hidden.
Width – The distance between a control's left and right edges.
X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent
container).
Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent
container).

Related functions
Patch( DataSource, BaseRecord, ChangeRecord )

Example
Add photos to an Image gallery control
1. Add a barcode scanner control, name it Mybarcode scanner
Don't know how to add, name, and configure a control?
2. Add a Label control, and set its output to the barcode scanner's Text property.
3. Scan a barcode of the type set under BarcodeType property.
The label displays the scanned barcode.

Accessibility guidelines
Video alternatives
Consider adding a Label with its Text set to the barcode scanner's Text. Since the barcode scanner does not
display the identified barcode value, doing the above makes the scanner accessible to everyone, not just those
with visual disabilities.
Screen reader support
AccessibleLabel must be present.

NOTE
Screen readers will announce when a new barcode has been found. The value won't be announced. As long as the
barcode is in view, screen readers will remind the user every five seconds that the same barcode is still being
identified.
Accessibility properties for canvas
apps
11/6/2019 • 3 minutes to read • Edit Online

Configuration of properties that aid alternative ways of interacting with


controls suitable for users with disabilities.

Properties
AccessibleLabel – Label for screen readers. An empty value for Image, Icon
and Shape controls will make the controls invisible to the screen reader and
treated as decorations.
Live – How screen readers should announce changes to content. Available
only in the Label control.
When set to Off, the screen reader doesn't announce changes.
When set to Polite, the screen reader finishes speaking before announcing
any changes that occurred while the screen reader was speaking.
When set to Assertive, the screen reader interrupts itself to announce any
changes that occurred while the screen reader was speaking.
Learn how to announce dynamic changes with live regions.
TabIndex – Determines if the control participates in keyboard navigation.
Keyboard navigation is an important aspect of any app. For many the
keyboard is more efficient than using touch or a mouse and it enables screen
readers for the visually impaired. The navigation order should:
Mirror what is seen visually.
Only have a tab stop at controls that are interactive.
Follow either an intuitive across and then down "Z" order or a down and
then across "reverse-N" order.
The above requirements will be met with the default TabIndex values and we
recommend that you do not change them. The default is what most users
expect visually and it will work well with a screen reader. But there may be
cases in which you will want to override the default. Use the TabIndex
property and the Enhanced group control (experimental) to make
adjustments to the navigation order.
The TabIndex property has two recommended values:

TABINDEX VALUE BEHAVIOR DEFAULT FOR

0 Control participates in Button, Text input,


keyboard navigation. Combo box, and other
typically interactive
controls.
TABINDEX VALUE BEHAVIOR DEFAULT FOR

−1 Control does not Label, Image, Icon, and


participate in keyboard other typically non-
navigation. interactive controls.

Navigation order generally goes from left-to-right, then top-to-bottom, in a


"Z" pattern. The order is based on the X and Y property values of the controls.
If controls are dynamically moved on the screen, for example by having a
formula for X or Y based on a timer or other control, the navigation order will
change dynamically too.
Use the Enhanced group control (experimental) to bundle controls that
should be navigated together or to create columns in a "reverse-N" pattern. At
the top of the following example, the name fields are contained within an
enhanced group control which causes navigation to proceed down before
moving across. At the bottom of the example, no group controls are used, and
navigation proceeds across and then down as normal which is not intuitive
given the control groupings.

Similarly, tabbing through containers such as Form and Gallery controls will
navigate through all elements of the container before proceeding to the next
control outside of the container.
Controls which have a Visible property value of false or a DisplayMode
property value of Disabled are not included in the navigation.
When using a browser, navigating from the last control of the screen will
move to the browser's built-in controls, such as the URL address.
WARNING
Avoid TabIndex values that are greater than 0. Ultimately controls are rendered in
HTML where even the W3C has warned "Authors are strongly advised NOT to use
these values." Many HTML tools warn for values greater than 0 as does the App
Checker when it reports "Check the order of the screen items." All for good reason:
using TabIndex in this manner can be very difficult to get right and can make
assistive technologies such as screen readers unusable.
When controls exist with TabIndex greater than 0, users will navigate to controls
with increasing TabIndex values (1, then 2, etc). When users have navigated all
controls with positive TabIndex values, they will finally navigate to controls with
TabIndex of 0 including the browser's built-in controls. When there are multiple
controls with the same TabIndex, their X and Y position determines their relative
order.
Color and border
properties in Power
Apps
12/3/2019 • 5 minutes to read • Edit Online

Overview
Configure the style of a control based on how the user
interacts with it.
You can specify colors in many ways:
Color enumeration: Specify color names from
cascading style sheets, as in these examples:
Color.Red
Color.Indigo
ColorValue function: Specify text strings such
as color names from cascading style sheets and
hex-code notation (#), as in these examples:
ColorValue( "AliceBlue" )
ColorValue( "#ff00ff" )
ColorFade function: Specify how faded a color
is, from fully black (-100%) to fully white
(100%), as in this example:
ColorFade( Color.Red, 50% )
RGBA function: Specify the red, green, and blue
components of a color from 0 to 255, and
specify an alpha channel from 0% (fully
transparent) to 100% (fully opaque), as in this
example:
RGBA( 255, 0, 255, 25% )
Color properties can also reference other color
properties. For example, Label.PressedColor may be
set to the formula Label1.Color, automatically
cascading a change from one property to another.

Normal
These properties are in effect normally, when the user
is not interacting with the control.
BorderColor – The color of a control's border.
Applies to Add picture, Audio, Button, Camera,
Card, Check box, Column chart, Date Picker,
Display form, Drop down, Edit form, Export,
Gallery, HTML text, Image, Import, Label, Line
chart, List Box, Microphone, PDF viewer, Pen
input, Pie chart, Radio, Rating, Slider, Text
input, Timer, Toggle, and Video controls.
BorderStyle – Whether a control's border is Solid,
Dashed, Dotted, or None.
Applies to Add picture, Audio, Button, Camera,
Card, Check box, Column chart, Date Picker,
Display form, Drop down, Edit form, Export,
Gallery, HTML text, Image, Import, Label, Line
chart, List Box, Microphone, PDF viewer, Pen
input, Pie chart, Radio, Rating, Slider, Text
input, Timer, Toggle, and Video controls.
BorderThickness – The thickness of a control's
border.
Applies to Add picture, Audio, Button, Camera,
Card, Check box, Column chart, Date Picker,
Display form, Drop down, Edit form, Export,
Gallery, HTML text, Image, Import, Label, Line
chart, List Box, Microphone, PDF viewer, Pen
input, Pie chart, Radio, Rating, Slider, Text
input, Timer, Toggle, and Video controls.
Color – The color of text in a control.
Applies to Add picture, Button, Check box,
Column chart, Date Picker, Drop down, Export,
HTML text, Import, Label, Line chart, List Box,
Microphone, Pen input, Pie chart, Radio, Text
input, and Timer controls.
Fill – The background color of a control.
Applies to Add picture, Audio, Button, Card,
Check box, Date Picker, Display form, Drop
down, Edit form, Export, Gallery, HTML text,
Icon, Image, Import, Label, List Box,
Microphone, PDF viewer, Pen input, Radio,
Rating, Screen, Shape, Text input, Timer,
Toggle, and Video controls.

Focused
These properties are in effect when the control is
focused.
FocusedBorderColor – The color of a control's
border when it has focus.
FocusedBorderThickness – The thickness of a
control's border when it has focus.
These properties apply to Add picture,
Attachments, Audio, Button, Camera, Check
box, Combo box, Date Picker, Drop down,
Export, Gallery, Icon, Image, Import, Label, List
Box, Microphone, Radio, Rating, Shape, Slider,
Text input, Timer, Toggle, and Video controls.

Disabled
These properties are in effect when the control is
disabled. A control can be disabled if the Disabled
property is set to true.
DisabledBorderColor – The color of a control's
border if the control's DisplayMode property is set to
Disabled.
Applies to Add picture, Button, Check box,
Column chart, Date Picker, Drop down, Export,
HTML text, Image, Import, Label, Line chart,
List Box, Microphone, PDF viewer, Pie chart,
Radio, Slider, Text input, Timer, and Toggle
controls.
DisabledColor – The color of text in a control if its
DisplayMode property is set to Disabled.
Applies to Add picture, Button, Check box, Date
Picker, Drop down, Export, Import, Label, List
Box, Microphone, Radio, Text input, and Timer
controls.
DisabledFill – The background color of a control if its
DisplayMode property is set to Disabled.
Applies to Add picture, Button, Check box, Date
Picker, Drop down, Export, HTML text, Image,
Import, Label, List Box, Microphone, Radio,
Text input, and Timer controls.

Hover
These properties are in effect when the user hovers
over the control with a mouse.
HoverBorderColor – The color of a control's border
when the user keeps the mouse pointer on that
control.
Applies to Add picture, Button, Check box,
Column chart, Drop down, Export, HTML text,
Image, Import, Label, Line chart, List Box,
Microphone, PDF viewer, Pie chart, Slider, Text
input, Timer, and Toggle controls.
HoverColor – The color of the text in a control when
the user keeps the mouse pointer on it.
Applies to Add picture, Button, Check box,
Drop down, Export, Import, Label, List Box,
Microphone, Radio, Text input, and Timer
controls.
HoverFill – The background color of a control when
the user keeps the mouse pointer on it.
Applies to Add picture, Button, Check box,
Drop down, Export, Icon, Image, Import, Label,
List Box, Microphone, Radio, Shape, Text input,
and Timer controls.

Pressed
These properties are in effect when a button or image
control is pressed.
PressedBorderColor – The color of a control's border
when the user taps or clicks that control.
Applies to Add picture, Button, Check box,
Column chart, Drop down, Export, Icon, Image,
Import, Label, Line chart, List Box,
Microphone, PDF viewer, Pie chart, Shape,
Slider, Text input, Timer, and Toggle controls.
PressedColor – The color of text in a control when
the user taps or clicks that control.
Applies to Add picture, Button, Check box,
Drop down, Export, Import, Label, List Box,
Microphone, Radio, Text input, and Timer
controls.
PressedFill – The background color of a control when
the user taps or clicks that control.
Applies to Add picture, Button, Check box,
Drop down, Export, Image, Import, Label, List
Box, Microphone, Radio, Text input, and Timer
controls.

Selection
These properties are in effect when the user selects an
item in a control.
SelectionColor – The text color of a selected item or
items in a list or the color of the selection tool in a pen
control.
Applies to Drop down, List Box, and Pen input
controls.
SelectionFill – The background color of a selected
item or items in a list or a selected area of a pen
control.
Applies to Drop down and List Box controls.
Core
properties
in Power
Apps
12/3/2019 • 2 minutes to
read • Edit Online

Configure whether the user


can see and interact with a
control.
Properties
Default – The initial value of a
control before it is changed by
the user.
Applies to Card, Check
box, Drop down, Gallery,
List Box, Radio, Rating,
Slider, Text input, and
Toggle controls.
DelayOutput – Set to true to
delay action during text input.
Applies to Text input, Card
DisplayMode – Values can be
Edit, View, or Disabled.
Configures whether the control
allows user input (Edit), only
displays data (View) or is
disabled (Disabled). In View
mode, input controls such as
Text input, Drop down, Date
Picker will only display the
text value and will not render
any interactive elements or
decorations. This makes them
suitable to be displayed in
Forms or as readable output.
Applies to Add picture,
Audio, Button, Camera,
Check box, Column chart,
Date Picker, Drop down,
Export, Gallery, HTML
text, Icon, Image, Import,
Label, Line chart, List
Box, Microphone, PDF
viewer, Pen input, Pie
chart, Radio, Rating,
Shape, Slider, Text input,
Timer, Toggle, and Video
controls.
Items – The source of data
that appears in a control such
as a gallery, a list, or a chart.
Applies to Column chart,
Drop down, Gallery, Line
chart, List Box, Pie chart,
and Radio controls.
OnChange – How the app
responds when the user
changes the value of a control
(for example, by adjusting a
slider).
Applies to Add picture,
Drop down, List Box,
Radio, Rating, Slider, Text
input, and Toggle controls.
OnSelect – How the app
responds when the user taps
or clicks a control.
Applies to Add picture,
Button, Camera, Check
box, Column chart, Date
Picker, Drop down,
Export, HTML text, Icon,
Image, Import, Label,
Line chart, List Box,
Microphone, PDF viewer,
Pen input, Pie chart,
Radio, Rating, Shape,
Slider, Text input, Timer,
and Toggle controls.
Reset – Whether a control
reverts to its default value.
Also see the Reset function.
Applies to Audio, Check
box, Drop down, List Box,
Microphone, Radio,
Rating, Slider, Text input,
Timer, Toggle, and Video
controls.
Text – Text that appears on a
control or that the user types
into a control.
Applies to Add picture,
Button, Check box,
Export, Import, Label,
Text input, and Timer
controls.
Tooltip – Explanatory text that
appears when the user hovers
over a control.
Applies to Audio, Button,
Camera, Check box, Drop
down, HTML text, Image,
Label, List Box,
Microphone, PDF viewer,
Pen input, Radio, Rating,
Slider, Text input, Timer,
Toggle, and Video
controls.
Value – The value of an input
control.
Applies to Check box,
Radio, Slider, and Toggle
controls.
Visible – Whether a control
appears or is hidden.
Applies to Add picture,
Audio, Button, Camera,
Card, Check box, Column
chart, Date Picker,
Display form, Drop down,
Edit form, Export,
Gallery, HTML text, Icon,
Image, Import, Label,
Line chart, List Box,
Microphone, PDF viewer,
Pen input, Pie chart,
Radio, Rating, Shape,
Slider, Text input, Timer,
Toggle, and Video
controls.
Image properties in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Configure graphical elements in your app, including images, photos, and elements of a pen control.
BackgroundImage – The name of an image file that appears in the background of a screen.
Applies to the Screen control.
Image – The name of the image that appears in an image, audio, or microphone control.
Applies to Audio, Image, Microphone, and Video controls.
ImagePosition – The position (Fill, Fit, Stretch, Tile, or Center) of an image in a screen or a control if it
isn't the same size as the image.
Applies to Audio, Image, Microphone, Screen, and Video controls.
Size and
location
properties in
Power Apps
12/3/2019 • 3 minutes to read
• Edit Online

Overview
Configure how big a control (or an
element of a control) is and where it is
in relation to the screen it's on.

Position
X – The distance between the left edge
of a control and the left edge of its
parent container (screen if no parent
container). For a Card control in a
container that has multiple columns,
this property determines the column in
which the card appears.
Applies to Add picture, Audio,
Button, Camera, Card, Check
box, Column chart, Date Picker,
Display form, Drop down, Edit
form, Export, Gallery, HTML
text, Icon, Image, Import, Label,
Line chart, List Box, Microphone,
PDF viewer, Pen input, Pie chart,
Radio, Rating, Shape, Slider, Text
input, Timer, Toggle, and Video
controls.
Y – The distance between the top edge
of a control and the top edge of the
parent container (screen if no parent
container). For a Card control in a
container that has multiple rows, this
property determines the row in which
the card appears.
Applies to Add picture, Audio,
Button, Camera, Card, Check
box, Column chart, Date Picker,
Display form, Drop down, Edit
form, Export, Gallery, HTML
text, Icon, Image, Import, Label,
Line chart, List Box, Microphone,
PDF viewer, Pen input, Pie chart,
Radio, Rating, Shape, Slider, Text
input, Timer, Toggle, and Video
controls.

Size
Height – The distance between a
control's top and bottom edges.
Applies to Add picture, Audio,
Button, Camera, Card, Check
box, Column chart, Date Picker,
Display form, Drop down, Edit
form, Export, Gallery, HTML
text, Icon, Image, Import, Label,
Line chart, List Box, Microphone,
PDF viewer, Pen input, Pie chart,
Radio, Rating, Shape, Slider, Text
input, Timer, Toggle, and Video
controls.
AutoHeight – Whether a label
automatically increases its height if its
Text property contains more
characters than the control can show.
Applies to Label
Width – The distance between a
control's left and right edges.
Applies to Add picture, Audio,
Button, Camera, Card, Check
box, Column chart, Date Picker,
Display form, Drop down, Edit
form, Export, Gallery, HTML
text, Icon, Image, Label, Import,
Line chart, List Box, Microphone,
PDF viewer, Pen input, Pie chart,
Radio, Rating, Shape, Slider, Text
input, Timer, Toggle, and Video
controls.
WidthFit – Whether a control
automatically grows horizontally to fill
any empty space of a container control
such as an Edit form control. If
multiple cards have this property set to
true, the space is divided between
them. For more information, see
Understand data form layout.
Applies to Card

Padding
Padding – The distance between the
text on an import or export button and
the edges of that button.
Applies to Add picture, Export,
and Import controls.
PaddingBottom – The distance
between text in a control and the
bottom edge of that control.
Applies to Button, Check box,
Column chart, Date Picker, Drop
down, HTML text, Image, Label,
Line chart, List Box, PDF viewer,
Radio, and Text input controls.
PaddingLeft – The distance between
text in a control and the left edge of
that control.
Applies to Button, Check box,
Column chart, Date Picker, Drop
down, HTML text, Image, Label,
Line chart, List Box, PDF viewer,
Radio, and Text input controls.
PaddingRight – The distance
between text in a control and the right
edge of that control.
Applies to Button, Check box,
Column chart, Date Picker, Drop
down, HTML text, Image, Label,
Line chart, List Box, PDF viewer,
Radio, and Text input controls.
PaddingTop – The distance between
text in a control and the top edge of
that control.
Applies to Button, Check box,
Column chart, Date Picker, Drop
down, HTML text, Image, Label,
Line chart, List Box, PDF viewer,
Radio, and Text input controls.

Radius
RadiusBottomLeft – The degree to
which the bottom-left corner of a
control is rounded.
Applies to Button, Export, Image,
Import, and Text input controls.
RadiusBottomRight – The degree to
which the bottom-right corner of a
control is rounded.
Applies to Button, Export, Image,
Import, and Text input controls.
RadiusTopLeft – The degree to which
the top-left corner of a control is
rounded.
Applies to Button, Export, Image,
Import, and Text input controls.
RadiusTopRight – The degree to
which the top-right corner of a control
is rounded.
Applies to Button, Export, Image,
Import, and Text input controls.
Text properties in Power Apps
3/10/2020 • 2 minutes to read • Edit Online

Configure the text that appears on a control, as a hint when the user types data, and
specify other text-related characteristics.

Text appearance
Font – The name of the family of fonts in which text appears.
Applies to Add picture, Button, Check box, Column chart, Date Picker, Drop
down, Export, HTML text, Import, Label, Line chart, List Box, Pie chart,
Radio, Text input, and Timer controls.
FontWeight – The weight of the text in a control: Bold, Semibold, Normal, or
Lighter.
Applies to Add picture, Button, Check box, Date Picker, Drop down, Export,
Import, Label, List Box, Radio, Text input, and Timer controls.
Italic – Whether the text in a control is italic.
Applies to Add picture, Button, Check box, Date Picker, Drop down, Export,
Import, Label, List Box, Radio, Text input, and Timer controls.
Size – The font size of the text that appears on a control.
Applies to Add picture, Button, Check box, Column chart, Date Picker, Drop
down, Export, HTML text, Import, Label, Line chart, List Box, Pen input, Pie
chart, Radio, Text input, and Timer controls.
Strikethrough – Whether a line appears through the text that appears on a control.
Applies to Add picture, Button, Check box, Drop down, Export, Import,
Label, List Box, Radio, Text input, and Timer controls.
Underline – Whether a line appears under the text that appears on a control.
Applies to Add picture, Button, Check box, Drop down, Export, Import,
Label, List Box, Radio, Text input, and Timer controls.

Text placement
Align – The location of text in relation to the horizontal center of its control.
Applies to Add picture, Button, Export, Import, Label, Radio, Text input, and
Timer controls.
LineHeight – The distance between, for example, lines of text or items in a list.
Applies to List Box, Label, Radio, and Text input controls.
VerticalAlign – The location of text on a control in relation to the vertical center of
that control.
Applies to Add picture, Button, Check box, Export, Import, and Label
controls.
Get started with canvas-app formulas in Power Apps
12/3/2019 • 7 minutes to read • Edit Online

Configure your canvas app with formulas that not only calculate values and perform other tasks (as they do in
Excel) but also respond to user input (as an app requires).
In Excel, you build formulas that, for example, populate cells and create tables and charts.
In Power Apps, you build similar formulas as you configure controls instead of cells. In addition, you build
formulas that apply specifically to apps instead of spreadsheets.
For example, you build a formula to determine how your app responds when users select a button, adjust a slider,
or provide other input. These formulas might show a different screen, update a data source that's external to the
app, or create a table that contains a subset of the data in an existing table.
You can use formulas for a wide variety of scenarios. For example, you can use your device's GPS, a map control,
and a formula that uses Location.Latitude and Location.Longitude to display your current location. As you
move, the map automatically tracks your location.
This topic provides only an overview of working with formulas. Browse the formula reference for more details
and the complete list of functions, operators, and other building blocks you can use.

Prerequisites
Sign up for Power Apps, and then sign in by providing the same credentials that you used to sign up.
Learn how to configure a control in Power Apps.

Show a simple value


In Excel, you can enter a specific piece of data, such as the number 42 or the phrase Hello World, by typing it into
a cell. That cell will always show that data exactly as you typed it. In Power Apps, you can similarly specify a piece
of data that doesn't change by setting the Text property of a label to the exact sequence of characters that you
want, surrounded by double quotation marks.
1. Select New on the File menu (near the left edge of the screen).
2. Under Create an app, select Phone layout on the Blank app tile.
The formula bar sits at the top of the screen.
This bar has two parts:
Property list: Each control and screen has a set of properties. Use this list to select a specific
property.
Formula: The formula to be calculated for this property, made up of values, operators, and functions.
In the formula bar, you can see and edit properties for the selected control or for the screen if no
controls are selected. You can see the name of the selected control on the Content tab:

You can change the name of the selected control in the Content tab by clicking the name.
3. Add a Label control to the screen.
When you add a label, the property list automatically shows the Text property, which drives what the
control shows. By default, the value of this property is "Text".
4. Set the value of the Text property to "Hello World" by typing that string, surrounded by double quotes,
into the formula bar:

The label reflects this new value as you type it. The screen may show yellow exclamation-point icons while
you type. These icons indicate errors, but they'll go away when you finish entering a valid value. For
example, a string without double quotation marks on both ends isn't valid.
In Excel, you can show a number, such as 42, by typing it into a cell or by typing a formula that resolves to
that number, such as =SUM (30,12). In Power Apps, you can achieve the same effect by setting the Text
property of a control, such as a label, to 42 or Sum (30,12). The cell and the label will always show that
number regardless of what else changes in the worksheet or the app.

NOTE
In Power Apps, you don't precede a formula with an equals sign or a plus sign as you do in Excel. The formula bar
treats anything you type there as a formula by default. You also don't surround a formula with double quotation
marks ("), as you did earlier to specify a string of text.

5. In the Text property of the label, replace "Hello World" with Sum (1,2,3).
While you type, the formula bar helps you by showing the description and the expected arguments for this
function. As with the final double quotation mark in "Hello World", the screen shows yellow exclamation
points to indicate an error until you type the final parenthesis of this formula:

Change a value based on input


In Excel, you type =A1+A2 into a cell to show the sum of whatever values cells A1 and A2 contain. If either or
both of those values change, the cell that contains the formula automatically shows the updated result.

In Power Apps, you can achieve a similar result by adding controls to a screen and setting their properties. This
example shows a label control named Label1 and two Text input controls, named TextInput1 and TextInput2.
Regardless of what numbers you type in the text-input controls, the label always shows the sum of those numbers
because its Text property is set to this formula:
TextInput1 + TextInput2

In Excel, you can use conditional-formatting formulas to show, for example, negative values in red. In Power Apps,
you can use formulas to determine not only the primary value of a control but also properties such as formatting.
In the next example, a formula for the Color property of the label automatically shows negative values in red. The
If function should look very familiar from Excel:
If( Value(Label1.Text) < 0, Red, Black )
Change a color based on user input
You can configure your app with formulas so that users can change your app's appearance or behavior. For
example, you can create a filter to show only data that contains a string of text that the user specifies, or you can
let users sort a set of data based on a certain column in the data set. In this procedure, you'll let users change the
color of the screen by adjusting one or more sliders.
1. Remove the controls from the previous procedures, or create a blank app as you did previously, and add
three slider controls to it:

2. Arrange the sliders so they don't overlap, add three labels, and configure them to show Red, Green, and
Blue:
3. Set the Max property of each slider to 255, which is the maximum value of a color component for the
RGBA function.
You can specify the Max property by selecting it on the Content tab or in the property list:
4. Select the screen by clicking away from any control, and then set the screen's Fill property to this formula:
RGBA ( Slider1.Value, Slider2.Value, Slider3.Value, 1 )
As already described, you access control properties by using the . operator. Slider1.Value refers to the
slider's Value property, which reflects where the user has placed the slider between the Min and Max
values. As you type this formula, each control that it contains is color coded between the screen and the
formula bar:

As you type the closing parenthesis, the screen's background will change to dark gray based on the default
value of each slider, which is 50. At the moment when you finish typing the formula, it's calculated and used
as the value of the background fill color. You can interact with your app while in the default workspace
without needing to open Preview:
5. Adjust the sliders, and see how your changes affect the background color.
As each slider changes, the formula that contains the RGBA function is recalculated, which immediately
changes how the screen appears.
Manage app behavior
You can use formulas not only to perform calculations and change appearance but also to take action. For
example, you can set the OnSelect property of a button to a formula that includes the Navigate function. When
a user selects that button, the screen that you specify in the formula appears.
You can use some functions, such as Navigate and Collect, only in behavior formulas. The formula reference
calls out if you can use a function only in this context.
You can take more than one action in a behavior formula if you separate functions with a semi-colon (;). For
example, you might want to update a context variable, push data to a data source, and finally navigate to another
screen.

View a list of properties by category


The properties list shows properties alphabetically, but you can also view all the properties of a control, organized
by category, if you select the Advanced option on the View tab:
You can edit formulas directly within this view. With the control selector at the top of the pane, you can quickly
find a control to work with. And with the property search, you can quickly find a property of that control.
Initially, this view shows the most important properties. To reveal all the properties, click the down arrow at the
bottom of the pane. Each control has a long list of properties that govern all aspects of the control's behavior and
appearance. You can scroll through the list or search for a property by typing in the box at the top of the pane.

Formula syntax
As you type a formula in the formula bar, different syntax elements appear in different colors to improve
readability and help you understand long formulas. Here is the color code list in Power Apps.
Understand canvas-app variables in Power Apps
2/8/2020 • 15 minutes to read • Edit Online

If you've used another programming tool, such as Visual Basic or JavaScript, you may be asking: Where are the variables? Power Apps is a little different and requires a
different approach. Instead of reaching for a variable when you build a canvas app, ask yourself: What would I do in Excel?
In other tools, you may have explicitly performed a calculation and stored the result in a variable. However, Power Apps and Excel both automatically recalculate formulas as
the input data changes, so you usually don't need to create and update variables. By taking this approach whenever possible, you can more easily create, understand, and
maintain your app.
In some cases, you'll need to use variables in Power Apps, which extends Excel's model by adding behavior formulas. These formulas run when, for example, a user selects a
button. Within a behavior formula, it's often helpful to set a variable to be used in other formulas.
In general, avoid using variables. But sometimes only a variable can enable the experience you want. Variables are implicitly created and typed when they appear in functions
that set their values.

Translate Excel into Power Apps


Excel
Let's review how Excel works. A cell can contain a value, such as a number or a string, or a formula that's based on the values of other cells. After the user enters a different
value into a cell, Excel automatically recalculates any formulas that depend on the new value. You don't have to do any programming to enable this behavior.
In the following example, cell A3 is set to the formula A1+A2. If A1 or A2 changes, A3 automatically recalculates to reflect the change. This behavior requires no coding
outside of the formula itself.

Excel doesn't have variables. The value of a cell that contains a formula changes based on its input, but there's no way to remember the result of a formula and store it in a cell
or anywhere else. If you change a cell's value, the entire spreadsheet may change, and any previously calculated values are lost. An Excel user can copy and paste cells, but
that's under the user's manual control and isn't possible with formulas.
Power Apps
Apps that you create in Power Apps behave very much like Excel. Instead of updating cells, you can add controls wherever you want on a screen and name them for use in
formulas.
For example, you can replicate the Excel behavior in an app by adding a Label control, named Label1, and two Text input controls, named TextInput1 and TextInput2. If
you then set the Text property of Label1 to TextInput1 + TextInput2, it will always show the sum of whatever numbers are in TextInput1 and TextInput2 automatically.

Notice that the Label1 control is selected, showing its Text formula in the formula bar at the top of the screen. Here we find the formula TextInput1 + TextInput2. This
formula creates a dependency between these controls, just as dependencies are created between cells in an Excel workbook. Let's change the value of TextInput1:
The formula for Label1 has been automatically recalculated, showing the new value.
In Power Apps, you can use formulas to determine not only the primary value of a control but also properties such as formatting. In the next example, a formula for the Color
property of the label will automatically show negative values in red. The If function should look very familiar from Excel:
If( Value(Label1.Text) < 0, Red, Black )

You can use formulas for a wide variety of scenarios:


By using your device's GPS, a map control can display your current location with a formula that uses Location.Latitude and Location.Longitude. As you move, the map
will automatically track your location.
Other users can update data sources. For example, others on your team might update items in a SharePoint list. When you refresh a data source, any dependent formulas
are automatically recalculated to reflect the updated data. Furthering the example, you might set a gallery's Items property to the formula Filter( SharePointList ), which
will automatically display the newly filtered set of records.
Benefits
Using formulas to build apps has many advantages:
If you know Excel, you know Power Apps. The model and formula language are the same.
If you've used other programming tools, think about how much code would be required to accomplish these examples. In Visual Basic, you'd need to write an event
handler for the change event on each text-input control. The code to perform the calculation in each of these is redundant and could get out of sync, or you'd need to write
a common subroutine. In Power Apps, you accomplished all of that with a single, one-line formula.
To understand where Label1's text is coming from, you know exactly where to look: the formula in the Text property. There's no other way to affect the text of this control.
In a traditional programming tool, any event handler or subroutine could change the value of the label, from anywhere in the program. This can make it hard to track down
when and where a variable was changed.
If the user changes a slider control and then changes their mind, they can change the slider back to its original value. And it's as if nothing had ever changed: the app shows
the same control values as it did before. There are no ramifications for experimenting and asking "what if," just as there are none in Excel.
In general, if you can achieve an effect by using a formula, you'll be better off. Let the formula engine in Power Apps work for you.

Know when to use variables


Let's change our simple adder to act like an old-fashioned adding machine, with a running total. If you select an Add button, you'll add a number to the running total. If you
select a Clear button, you'll reset the running total to zero.

DISPLAY DESCRIPTION

When the app starts, the running total is 0.

The red dot represents the user's finger in the text-input box, where the user enters 77.
DISPLAY DESCRIPTION

The user selects the Add button.

77 is added to the running total.

The user selects the Add button again.

77 is again added to the running total, resulting in 154.

The user selects the Clear button.

The running total is reset to 0.

Our adding machine uses something that doesn't exist in Excel: a button. In this app, you can't use only formulas to calculate the running total because its value depends on a
series of actions that the user takes. Instead, our running total must be recorded and updated manually. Most programming tools store this information in a variable.
You'll sometimes need a variable for your app to behave the way you want. But the approach comes with caveats:
You must manually update the running total. Automatic recalculation won't do it for you.
The running total can no longer be calculated based on the values of other controls. It depends on how many times the user selected the Add button and what value was
in the text-input control each time. Did the user enter 77 and select Add twice, or did they specify 24 and 130 for each of the additions? You can't tell the difference after
the total has reached 154.
Changes to the total can come from different paths. In this example, both the Add and Clear buttons can update the total. If the app doesn't behave the way you expect,
which button is causing the problem?

Use a global variable


To create our adding machine, we require a variable to hold the running total. The simplest variables to work with in Power Apps are global variables.
How global variables work:
You set the value of the global variable with the Set function. Set( MyVar, 1 ) sets the global variable MyVar to a value of 1.
You use the global variable by referencing the name used with the Set function. In this case, MyVar will return 1.
Global variables can hold any value, including strings, numbers, records, and tables.
Let's rebuild our adding machine by using a global variable:
1. Add a text-input control, named TextInput1, and two buttons, named Button1 and Button2.
2. Set the Text property of Button1 to "Add", and set the Text property of Button2 to "Clear".
3. To update the running total whenever a user selects the Add button, set its OnSelect property to this formula:
Set( RunningTotal, RunningTotal + TextInput1 )
The mere existence of this formula establishes RunningTotal as a global variable that holds a number because of the + operator. You can reference RunningTotal
anywhere in the app. Whenever the user opens this app, RunningTotal has an initial value of blank.
The first time that a user selects the Add button and Set runs, RunningTotal is set to the value RunningTotal + TextInput1.

4. To set the running total to 0 whenever the user selects the Clear button, set its OnSelect property to this formula:
Set( RunningTotal, 0 )

5. Add a Label control, and set its Text property to RunningTotal.


This formula will automatically be recalculated and show the user the value of RunningTotal as it changes based on the buttons that the user selects.

6. Preview the app, and we have our adding machine as described above. Enter a number in the text box and press the Add button a few times. When ready, return to the
authoring experience using the Esc key.

7. To show the global variable's value, select the File menu, and select Variables in the left-hand pane.
8. To show all the places where the variable is defined and used, select it.

Types of variables
Power Apps has three types of variables:

VARIABLES TYPE SCOPE DESCRIPTION FUNCTIONS THAT ESTABLISH

Global variables App Simplest to use. Holds a number, text string, Set
Boolean, record, table, etc. that can be
references from anywhere in the app.
VARIABLES TYPE SCOPE DESCRIPTION FUNCTIONS THAT ESTABLISH

Context variables Screen Great for passing values to a screen, much UpdateContext
like parameters to a procedure in other Navigate
languages. Can be referenced from only one
screen.

Collections App Holds a table that can be referenced from Collect


anywhere in the app. Allows the contents of ClearCollect
the table to be modified rather than being
set as a whole. Can be saved to the local
device for later use.

Create and remove variables


All variables are created implicitly when they appear in a Set, UpdateContext, Navigate, Collect, or ClearCollect function. To declare a variable and its type, you need only
include it in any of these functions anywhere in your app. None of these functions create variables; they only fill variables with values. You never declare variables explicitly as
you might in another programming tool, and all typing is implicit from usage.
For example, you might have a button control with an OnSelect formula equal to Set( X, 1 ). This formula establishes X as a variable with a type of number. You can use X in
formulas as a number, and that variable has a value of blank after you open the app but before you select the button. When you select the button, you give X the value of 1.
If you added another button and set its OnSelect property to Set( X, "Hello" ), an error would occur because the type (text string) doesn't match the type in the previous Set
(number). All implicit definitions of the variable must agree on type. Again, all this happened because you mentioned X in formulas, not because any of those formulas had
actually run.
You remove a variable by removing all the Set, UpdateContext, Navigate, Collect, or ClearCollect functions that implicitly establish the variable. Without these functions,
the variable doesn't exist. You must also remove any references to the variable because they will cause an error.

Variable lifetime and initial value


All variables are held in memory while the app runs. After the app closes, the values that the variables held are lost.
You can store the contents of a variable in a data source by using the Patch or Collect functions. You can also store values in collections on the local device by using the
SaveData function.
When the user opens the app, all variables have an initial value of blank.

Reading variables
You use the variable's name to read its value. For example, you can define a variable with this formula:
Set( Radius, 12 )

Then you can simply use Radius anywhere that you can use a number, and it will be replaced with 12:
Pi() * Power( Radius, 2 )

If you give a context variable the same name as a global variable or a collection, the context variable takes precedence. However, you can still reference the global variable or
collection if you use the disambiguation operator [@Radius].

Use a context variable


Let's look at how our adding machine would be created using a context variable instead of a global variable.
How context variables work:
You implicitly establish and set context variables by using the UpdateContext or Navigate function. When the app starts, the initial value of all context variables is blank.
You update context variables with records. In other programming tools, you commonly use "=" for assignment, as in "x = 1". For context variables, use { x: 1 } instead.
When you use a context variable, use its name directly without the record syntax.
You can also set a context variable when you use the Navigate function to show a screen. If you think of a screen as a kind of procedure or subroutine, this approach
resembles parameter passing in other programming tools.
Except for Navigate, context variables are limited to the context of a single screen, which is where they get their name. You can't use or set them outside of this context.
Context variables can hold any value, including strings, numbers, records, and tables.
Let's rebuild our adding machine by using a context variable:
1. Add a text-input control, named TextInput1, and two buttons, named Button1 and Button2.
2. Set the Text property of Button1 to "Add", and set the Text property of Button2 to "Clear".
3. To update the running total whenever a user selects the Add button, set its OnSelect property to this formula:
UpdateContext( { RunningTotal: RunningTotal + TextInput1 } )
The mere existence of this formula establishes RunningTotal as a context variable that holds a number because of the + operator. You can reference RunningTotal
anywhere in this screen. Whenever the user opens this app, RunningTotal has an initial value of blank.
The first time that the user selects the Add button and UpdateContext runs, RunningTotal is set to the value RunningTotal + TextInput1.
4. To set the running total to 0 whenever the user selects the Clear button, set its OnSelect property to this formula:
UpdateContext( { RunningTotal: 0 } )
Again, UpdateContext is used with the formula UpdateContext( { RunningTotal: 0 } ).

5. Add a Label control, and set its Text property to RunningTotal.


This formula will automatically be recalculated and show the user the value of RunningTotal as it changes based on the buttons that the user selects.

6. Preview the app and we have our adding machine as described above. Enter a number in the text box and press the Add button a few times. When ready, return to the
authoring experience using the Esc key.

7. You can set the value of a context variable while navigating to a screen. This is useful for passing "context" or "parameters" from one screen to another. To demonstrate
this technique, insert a screen, insert a button, and set its OnSelect property to this formula:
Navigate( Screen1, None, { RunningTotal: -1000 } )
Hold down the Alt key while you select this button to both show Screen1 and set the context variable RunningTotal to -1000.

8. To show the value of the context variable, select the File menu, and then select Variables in the left-hand pane.

9. To show where the context variable is defined and used, select it.
Use a collection
Finally, let's look at creating our adding machine with a collection. Since a collection holds a table that is easy to modify, we will make this adding machine keep a "paper tape"
of each value as they are entered.
How collections work:
Create and set collections by using the ClearCollect function. You can use the Collect function instead, but it will effectively require another variable instead of replacing
the old one.
A collection is a kind of data source and, therefore, a table. To access a single value in a collection, use the First function, and extract one field from the resulting record. If
you used a single value with ClearCollect, this will be the Value field, as in this example:
First( VariableName ).Value
Let's recreate our adding machine by using a collection:
1. Add a Text input control, named TextInput1, and two buttons, named Button1 and Button2.
2. Set the Text property of Button1 to "Add", and set the Text property of Button2 to "Clear".
3. To update the running total whenever a user selects the Add button, set its OnSelect property to this formula:
Collect( PaperTape, TextInput1.Text )
The mere existence of this formula establishes PaperTape as a collection that holds a single-column table of text strings. You can reference PaperTape anywhere in
this app. Whenever a user opens this app, PaperTape is an empty table.
When this formula runs, it adds the new value to the end of the collection. Because we're adding a single value, Collect automatically places it in a single-column table,
and the column's name is Value, which you'll use later.

4. To clear the paper tape when the user selects the Clear button, set its OnSelect property to this formula:
Clear( PaperTape )
5. To display the running total, add a label, and set its Text property to this formula:
Sum( PaperTape, Value )

6. To run the adding machine, press F5 to open Preview, enter numbers in the text-input control, and select buttons.

7. To return to the default workspace, press the Esc key.


8. To display the paper tape, insert a Data table control, and set its Items property to this formula:
PaperTape
In the right-hand pane, select the Value column to show it.

9. To see the values in your collection, select Collections on the File menu.
10. To store and retrieve your collection, add two additional button controls, and set their Text properties to Load and Save. Set the OnSelect property of the Load
button to this formula:
Clear( PaperTape ); LoadData( PaperTape, "StoredPaperTape", true )
You need to clear the collection first because LoadData will append the stored values to the end of the collection.

11. Set the OnSelect property of the Save button to this formula:
SaveData( PaperTape, "StoredPaperTape" )
12. Preview again by pressing the F5 key, enter numbers in the text-input control, and select buttons. Select the Save button. Close and reload the app, and select the Load
button to reload your collection.

NOTE
SaveData and LoadData function in Power Apps Mobile but not Power Apps Studio or the web player for Power Apps.
Understand behavior formulas for canvas apps in
Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Most formulas calculate a value. Like an Excel spreadsheet, recalculation happens automatically as values
change. For example, you might want to show the value in a Label control in red if the value is less than zero
or in black otherwise. So you can set the Color property of that control to this formula:
If( Value(TextBox1.Text) >= 0, Color.Black, Color.Red )
In this context, what does it mean when the user selects a Button control? No value has changed, so there is
nothing new to calculate. Excel has no equivalent to a Button control.
By selecting a Button control, the user initiates a sequence of actions, or behaviors, that will change the state
of the app:
Change the screen that's displayed: Back and Navigate functions.
Control a signal: Enable and Disable functions.
Refresh, update, or remove items in a data source: Refresh, Update, UpdateIf, Patch, Remove,
RemoveIf functions.
Update a context variable: UpdateContext function.
Create, update, or remove items in a collection: Collect, Clear, ClearCollect functions.
Because these functions change the state of the app, they can't be automatically recalculated. You can use
them in the formulas for the OnSelect, OnVisible, OnHidden, and other On... properties, which are called
behavior formulas.
More than one action
Use semicolons to create a list of actions to perform. For example, you might want to update a context
variable and then return to the previous screen:
UpdateContext( { x: 1 } ); Back()
Actions are performed in the order in which they appear in the formula. The next function won't start until the
current function has completed. If an error occurs, subsequent functions might not start.
Show text, dates, and times in Power Apps
12/3/2019 • 8 minutes to read • Edit Online

In Power Apps, add dates and times to a canvas app, and format them to show the right level of detail or to
reflect your locale. Calculate the amount of time between two dates, or calculate a date that's a certain amount of
time before or after a date that you specify. Convert dates to or from separate values for days, months, and
years, and convert times to or from separate values for hours, minutes, and seconds.
For example, add data from users about stock trades or client meetings, data from an external source, or data
from another app created in Power Apps. If that data includes times down to the millisecond, round it to the
nearest minute for simplicity. Calculate how many days remain before a major milestone. If you want to
schedule client meetings every five days, calculate those dates automatically. If May 10, 1985, is stored in
separate fields for the day, the month, and the year, consolidate them into a single value. Conversely, break each
date into separate values if your app manages them separately.

Prerequisites
Sign up for Power Apps, and then sign in by providing the same credentials that you used to sign up.
Create an app or open an existing app in Power Apps.
Learn how to configure a control in Power Apps.

Show text in a Label control


Show text in a Label control by setting the value of its Text property. Set this property by typing directly into the
control or by typing an expression in the formula bar.
If you type directly into the control, it shows exactly what you type.
If you type an expression in the formula bar, the control shows the result of the expression.
Here are some examples.
1. Add a Label control named ShowText, and set its Text property to this formula:
Now()
If your computer is set to the "en-us" locale, the current date and time appears in this format:
mm/dd/yyyy hh:mm AM/PM
If your computer is set to a locale such as "fr-fr", the current date and time appears in this format:
dd/mm/yyyy hh:mm AM/PM
2. Set the Text property of ShowText to this formula:
DateDiff(Today(), DateValue("01/01/2020"))

The control shows the number of days between today and January 1, 2020, by using these functions:
DateDiff, which calculates the number of days, quarters, or years between two dates.
Today, which calculates the current day as a value.
DateValue, which converts a literal string, as shown between double quotation marks, to a value on
which calculations can be performed.
3. Add a Text input control named BirthDate, and move it under ShowText.
4. In BirthDate, type the month and the day of your birth (for example, 05/18).
5. Set the Text property of ShowText to this formula:
DateDiff(Today(), DateValue(BirthDate.Text))

ShowText shows the number of days between today and whatever date you type into BirthDate. If your
birthday has already occurred this year, ShowText displays a negative value.

Format dates and times by using DateTimeValue


Convert dates and times from strings of text to values, which you can format in a variety of ways and use in
calculations. Specify the format by using built-in and custom options.

NOTE
The DateTimeValue and DateValue functions can convert dates in any of these formats into values:
MM/DD/YYYY
DD/MM/YYYY
DD Mon YYYY
Month DD, YYYY

1. Add a Text input control named ArrivalDateTime, and type a date and time in this format:
5/10/85 6:15 AM
2. Add a Label control named ShowDate, and set its Text property to this formula:
DateTimeValue(ArrivalDateTime.Text)

ShowDate shows the same information that you typed, but it's been converted from text to a value and
formatted differently. For example, the year appears as four digits instead of just two.
3. Change the Text property of ShowDate to this formula:
DateTimeValue(ArrivalDateTime.Text, "fr")

ShowDate shows the day before the month, as a French user would expect.

TIP
To display a list of other locales in Intellisense, remove the closing quotation mark and fr from the formula, but
leave the open quotation mark:

4. To use one of several built-in formats, change the Text property of ShowDate to this formula:
Text(DateTimeValue(ArrivalDateTime.Text), DateTimeFormat.LongDateTime)

ShowDate shows the day of the week, the date, and the time.

TIP
The DateTimeFormat parameter supports several other built-in formats. To display that list, remove
LongDateTime from the formula.

5. To use a custom format, change the Text property of ShowDate to this formula:
Text(DateTimeValue(ArrivalDateTime.Text), "mm/dd/yyyy hh:mm:ss.fff AM/PM")
ShowDate shows the date/time value in the format that you specified, including milliseconds.

TIP
To round the time to the nearest tenth or hundredth of a second, specify hh:mm:ss.f or hh:mm:ss.ff in the
formula.

Format a date by using DateValue


1. Add a Text input control named ArrivalDate, and then type a date in it (for example, 5/10/85).
2. Add a Label control named FormatDate, and set its Text property to this formula:
DateValue(ArrivalDate.Text)
FormatDate shows the date that you typed, except the year appears as four digits.
3. Set the Text property of FormatDate to this formula:
DateValue(ArrivalDate.Text, "fr")
FormatDate shows the day before the month, just as a French user would expect.
4. To use one of several built-in formats, set the Text property of FormatDate to this formula:
Text(DateValue(ArrivalDate.Text), DateTimeFormat.LongDate)
FormatDate shows the day of the week, the month, the day, and the year.
5. To use a custom format, set the Text property of FormatDate to this formula:
Text(DateValue(ArrivalDate.Text), "yy/mm/dd")
FormatDate shows the date in the format that you specified.

Format a time using DateTimeValue


1. Add a Text input control named ArrivalTime, and then type 6:15 AM in it.
2. Add a Label control named ShowTime.
3. To use one of several built-in formats, set the Text property of ShowTime to this formula:
Text(DateTimeValue(ArrivalTime.Text), DateTimeFormat.LongTime)
ShowTime shows the time that you specified, including seconds.
4. To use a custom format, set the Text property of ShowTime to this formula:
Text(DateTimeValue(ArrivalTime.Text), "hh:mm:ss.fff AM/PM")
ShowTime shows the time that you specified, including seconds and milliseconds.
TIP
To round the time to the nearest tenth or hundredth of a second, enter hh:mm:ss.f or hh:mm:ss.ff in the formula.

Show the time between dates


1. Add two Text input controls named Start and End.
2. Type 4/1/2015 in Start, and type 1/1/2016 in End.
3. Add a Label control named DateDiff, and set its Text property to this formula:
DateDiff(DateValue(Start.Text), DateValue(End.Text))

DateDiff shows 275, which is the number of days between April 1, 2015, and January 1, 2016.
4. Set the Text property of DateDiff to this formula:
DateDiff(DateValue(Start.Text), DateValue(End.Text), Months)
DateDiff shows 9, which is the number of months between April 1, 2015, and January 1, 2016. Replace
Months with Quarters or Years to show the time in those units.

Identify a date before or after another date


1. Add a Text input control named Start, and type 5/10/1985 in it.
2. Add a Label control named DateAdd, and set its Text property to this formula:
DateAdd(DateValue(Start.Text), 3)

DateAdd shows 5/13/1985, which is three days after the date in Start.
3. Set the Text property of DateAdd to this formula:
DateAdd(DateValue(Start.Text), -3)
DateAdd shows 5/7/1985, which is three days before the date in Start.
4. Change the Text property of DateAdd to this formula:
DateAdd(DateValue(Start.Text), 3, Months)

The label shows 8/10/1985, which is three months after the date in Start. Replace Months with
Quarters or Years to identify a date that's the specified number of quarters or years before or after the
date in Start.

Calculate dates based on years, months, and days


1. Add three Drop down controls named Year, Month, and Day.
2. Set the Items property of Year to this formula:
Table({Year:"2014"}, {Year:"2015"}, {Year:"2016"})
3. Set the Items property of Month to this formula:
Table({Month:"1"}, {Month:"2"}, {Month:"3"}, {Month:"4"}, {Month:"5"}, {Month:"6"},
{Month:"7"}, {Month:"8"}, {Month:"9"}, {Month:"10"}, {Month:"11"}, {Month:"12"})
4. Set the Items property of Day to this formula:
Table({Day:"1"}, {Day:"2"}, {Day:"3"}, {Day:"4"}, {Day:"5"}, {Day:"6"}, {Day:"7"}, {Day:"8"},
{Day:"9"}, {Day:"10"}, {Day:"11"}, {Day:"12"}, {Day:"13"}, {Day:"14"}, {Day:"15"}, {Day:"16"},
{Day:"17"}, {Day:"18"}, {Day:"19"}, {Day:"20"}, {Day:"21"}, {Day:"22"}, {Day:"23"}, {Day:"24"},
{Day:"25"}, {Day:"26"}, {Day:"27"}, {Day:"28"}, {Day:"29"}, {Day:"30"}, {Day:"31"})
5. Add a Label control, and set its Text property to this formula:
Text(Date(Value(Year.Selected.Value), Value(Month.Selected.Value),
Value(Day.Selected.Value)), DateTimeFormat.LongDate)
Wednesday, January 1, 2014 is listed by default. Select different values in the Drop down controls to
change the date in the Label control.
You may need to convert data that you didn't expect. If you add Text input controls instead of Drop down
controls, a user may enter an incorrect date, such as May 45. The Date function handles atypical data in the
following ways:
If a year value is between 0 and 1899 (inclusive), the function adds that value to 1900 to calculate the year.
If a year value is between 1900 and 9999 (inclusive), the function uses that value as the year.
If a year value is less than 0 or is 10000 or greater, the function returns an error value.
If a month value is greater than 12, the function adds that number of months to the first month of the
specified year.
If a month value is less than 1, the function subtracts that many months, plus 1, from the first month of the
specified year.
If a day value is greater than the number of days in the specified month, the function adds that many days to
the first day of the month and returns the corresponding date from a subsequent month.
If a day value is less than 1, the function subtracts that many days, plus 1, from the first day of the specified
month.

Calculate times based on hours, minutes, and seconds


1. Add two Drop-down lists named Hour and Minute.
2. Set the Items property of Hour to this formula:
Table({Hour:"9"}, {Hour:"10"}, {Hour:"11"}, {Hour:"12"}, {Hour:"13"}, {Hour:"14"}, {Hour:"15"},
{Hour:"16"}, {Hour:"17"})
3. Set the Items property of Minute to this formula:
Table({Minute:"0"}, {Minute:"15"}, {Minute:"30"}, {Minute:"45"})
4. Add a Label control, and set its Text property to this formula:

Text(Time(Value(Hour.Selected.Value), Value(Minute.Selected.Value), 0),


DateTimeFormat.ShortTime)
5. Select 15 in Hour and 45 in Minute.
The Label control shows 3:45 PM.
You can add entries to Hour and Minute so that users can select from a bigger range of hours and a
more precise number of minutes. You can also add a third Drop down control so that users can specify
seconds. If you add a third list, set the Text property of the Label control to the following expression:
Text(Time(Value(Hour.Selected.Value), Value(Minute.Selected.Value),
Value(Second.Selected.Value)), DateTimeFormat.LongTime)
Create and update a collection in a canvas app
12/3/2019 • 2 minutes to read • Edit Online

Use a collection to store data that users can manage in your app. A collection is a group of items that are similar,
such as products in a product list. For more information about different types of variables such as collections:
Understand canvas-app variables.

Prerequisites
Sign up for Power Apps, and then sign in by providing the same credentials that you used to sign up.
Create an app or open an existing app in Power Apps.
Learn how to configure a control in Power Apps.

Create a multicolumn collection


1. In Power Apps Studio, add a Text input control.

2. Rename the control by selecting its ellipsis in the left navigation pane, selecting Rename, and then typing
ProductName.

3. Add a Drop down control.

4. Rename the Drop down control Colors, and make sure that the Items property is selected in the property
list.
5. In the formula bar, replace DropDownSample with this expression:
["Red","Green","Blue"]

6. Add a Button control, set its Text property to "Add", and set its OnSelect property to this formula:

Collect(
ProductList,
{
Product: ProductName.Text,
Color: Colors.Selected.Value
}
)

7. Press F5, type some text into ProductName, select an option in Colors, and then select Add.

8. Repeat the previous step at least two more times, and then press Esc.
9. On the File menu, select Collections to show the collection that you created.

Show a collection
1. Add a vertical Gallery control.
2. Set the gallery's Items property to ProductList.
3. In the Data pane, set the subtitle field to Color, and set the title field to Product.

4. Close the Data pane, select the gallery, and then set the Layout field to Title and subtitle.

Your screen resembles this example:

Remove one or all items


1. Select the gallery template by clicking or tapping near the bottom of the gallery and then clicking or
tapping the pencil icon near the upper-left corner.
2. Add a Trash icon to the gallery template.

3. Set the icon's OnSelect property to this formula:


Remove(ProductList, ThisItem)

4. Outside the gallery, add a button, set its Text property to "Clear", and set its OnSelect property to this
formula:
Clear(ProductList)

5. While holding down the Alt key, select the Trash icon for an item to remove that item from the collection, or
select the Clear button to remove all items from the collection.

Put a SharePoint list into a collection


1. Create a connection to a SharePoint list.
2. Add a button, and set its OnSelect property to this function, replacing ListName with the name of your
SharePoint list:
Collect(MySPCollection, ListName)

This function creates a collection that's named MySPCollection and that contains the same data as your
SharePoint list.
3. While holding down the Alt key, select the button.
4. (optional) To preview the collection that you created, select Collections on the File menu.
For information about how to show data from a SharePoint list (such as dates, choices, and people) in a gallery:
Show list columns in a gallery. For information about how to show data in a form (with drop-down lists, date
pickers, and people pickers): Edit form and Display form controls.

Next steps
Review the reference topic for the Collect function.
Learn how to shape data in a collection by using the AddColumns, DropColumns, RenameColumns, and
ShowColumns functions.
Show information about a Power Apps user in a
canvas app
12/2/2019 • 2 minutes to read • Edit Online

In Power Apps, show the full name, the email address, and the picture that's associated with the user who's signed
in to a canvas app. You can use this information, for example, to automatically fill in a form.
For example, you can use this feature to:
Create a sign-up "sheet" for users to attend training, volunteer for events, check in at a kiosk, and more.
Display the full name on a Human Resources app.
Automatically enter an email address when contacting your helpdesk.
Basically, you can use this anywhere users would benefit from a form or labels that are populated automatically

Prerequisites
1. Sign up for PowerApps.
2. Sign in using the same credentials that you used to sign up.
3. Under Make your own app, hover over the Canvas app from blank tile, select the phone icon, and then
select Make this app.
4. Learn how to add and configure controls.

Show user details


1. On the Insert tab, click or tap Media, and then click or tap Image.

2. Set the Image property to this formula:


User().Image

3. On the Insert tab, click or tap Text, and then click or tap Label:
4. Set the Text property to this formula:
User().FullName

When you do this, the label is automatically populated with your full name. Move the label so it's below the
image control, similar to the following:

5. Add another label, and set its Text property to this formula:
User().Email

When you do this, the label is automatically populated with your email address. Move the label so it's below
the first label, similar to the following:
How to link SharePoint lists using a lookup field in
Power Apps
12/3/2019 • 4 minutes to read • Edit Online

This tutorial shows how you can connect two SharePoint lists with a lookup field in a canvas app.

Overview
SharePoint provides two types of lookup fields:
Lookup: links to another list: for example an Orders list may have a lookup field that links to customers in a
Customer list;
Choice: clicking or tapping the field displays a small menu of items that you choose from.
In this tutorial, you build an app that uses these kinds of lookup fields.
Why use a lookup field
Data in an enterprise is large and complex. Data in one SharePoint list often relates to data in another list. Lookup
fields are the primary way such business data comes together.
For example, you might have an Orders list which has a lookup field that links to a Customers list, to show which
customer placed the order. The lookup field in the Orders list lets you get other data from the Customers list as
well. You might also use a lookup field to connect the Orders list to a Product list, and bring in information you
need about the product ordered, such as product pictures, specifications, manufacturer details, etc.
What are Choice fields used for?
Choice fields are used for very short lists, but instead of actually creating a separate list, you include the list values
in a small menu, which appears when you click or tap on the Choice field, and you select one of the values.
Examples include data like Customer Status Code, Product Availability, State Codes; basically any fixed list that is
relatively short. This data could in fact be implemented as separate lists, and then you would use a Lookup field to
link to them, but it is usually easier and quicker to implement them as Choice fields.

Create the lists in SharePoint


In this tutorial, you link two SharePoint custom lists together, Assets and RepairShop. The Assets list is used to
track hardware equipment in a team. Since hardware gets broken from time to time, we use the RepairShop list to
track the local shops which can fix it.
The lookup fields used in this example
The RepairShop list uses the ContactEmail field to identify the shop. This list is defined first so that each row in
the Assets list has something to point to.
The Assets list has two lookup fields:
one called RepairShop, of type Lookup, which uses email addresses to point to entries in the RepairShop list;
one called AssetType, of type Choice, which lists the kinds of hardware that this asset might be.
You most likely would define additional fields, depending on the information you need to track.
Define the RepairShop list and add data
You do this first, so that when you add data to the Assets list, RepairShop entries are available for you to choose
from the Assets.RepairShop lookup field.
1. On your SharePoint site, create a new RepairShop list.

2. Add a ContactEmail field of type Single line of text.

3. Add any other fields you need.


4. Click or tap + New to enter sample data into the list, at least 3 rows with different ContactEmail values.
When an asset needs to be repaired, you choose one of these.

Define the Assets list


1. On your SharePoint site, create a new Assets list.
2. Click or tap the plus sign and choose More.
3. Add an AssetType field of type Choice, and in the Type each choice on a separate line text box, fill in the
values you want to appear in the choice menu. Then click or tap OK.

4. Start to add another field, just like in step 2: click or tap the plus sign and choose More.
5. Add a RepairShop field of type Lookup, choose RepairShop from the Get information from text box, and
choose ContactEmail from the In this column text box. Then click or tap OK.
6. Add any additional fields you want.

Create an app from the Assets list


You use this app to add data to the Assets list.
1. Sign in to Power Apps Studio. If you are new to Power Apps, sign up for free using your organizational
email address.
2. In the File menu (along the left edge), click or tap New, and then click or tap SharePoint.

3. Choose your SharePoint site from the Recent sites list or enter your site's url directly into the text box. Click
or tap GO.
4. Choose the main list from your SharePoint site, in this example, Assets. Click or tap the Connect button in
the lower-right corner.

Add data to the Assets list


Now you can run the app and see how the view details screen looks for the lookup fields.

1. Press F5 or select Preview ( ).


2. Click or tap the + symbol in the upper right corner to add an entry.
3. Enter a Title for this asset.
4. Click or tap the AssetType dropdown arrow. The values displayed are those you entered when you created
this field. Choose one of the entries.

5. Click or tap the RepairShop dropdown arrow. Choose one of the entries.
6. In the upper-right corner, click or tap the check mark to save the new entry.
7. (optional) Repeat this procedure to add as many items to the list as you want.
8. Press Esc to return to the default workspace.

For more information


Introducing support for lookups and a new sample app
Performance, Refresh button, ForAll, and multiple field lookups
Generate an app by using a Common Data Service database
Create an app from scratch using a Common Data Service database
Start a flow in a canvas app
12/3/2019 • 2 minutes to read • Edit Online

You can use Power Automate to create logic that performs one or more tasks when an event occurs in a canvas
app. For example, configure a button so that, when a user selects it, an item is created in a SharePoint list, an email
or meeting request is sent, a file is added to the cloud, or all of these. You can configure any control in the app to
start the flow, which continues to run even if you close Power Apps.

NOTE
When a user runs a flow from within an app, that user must have permission to perform the tasks that are specified in the
flow. Otherwise, the flow will fail.

Prerequisites
Sign up for Power Apps.
Learn how to configure a control.

Create a flow
1. Sign in to Power Apps.
2. In the left navigation bar, select Business logic, and then select Flows.
3. In the upper-left corner of the My Flows page, select New, and then select Create from blank.

4. Near the bottom of the page that appears, select Search hundreds of connections and triggers.
5. In the search box, type PowerApps, and then select the PowerApps icon.

6. On the next page, select the Power Apps icon again, and then select New step.
7. In the box that says Search connectors and actions, specify an action for your flow, as in this example:
a. Type SharePoint in the box, and then select Create item in the list under Actions.
b. If prompted, provide credentials to connect to SharePoint.
c. In the Site Address box, type or paste the URL of a SharePoint Online site that contains a list.

NOTE
Don't append the name of the list to the URL.

d. In the List Name box, specify the list that you want to use.

e. Select the input box for a field in your list (such as Title), select See more in the dynamic-content
pane, and then select Ask in Power Apps.
8. (optional) Specify one or more additional steps, such as sending approval mail to an address that you
specify or creating a related entry in another data source.
9. Near the upper-left corner, type or paste a name for your flow, and then select Save near the upper-right
corner.

Add a flow to an app


1. In the left navigation bar, select Create.
2. Hover over the Canvas app from blank tile, and then select Make this app.
3. Add a Text input control, and name it RecordTitle.
4. Add a Button control, and move it under RecordTitle.
5. With the Button control selected, select Flows on the Action tab.

6. In the pane that appears, select the flow that you created in the previous procedure.

NOTE
If the flow that you created isn't available, confirm whether Power Apps is set to the environment in which you
created the flow.

7. In the formula bar, type or paste RecordTitle.Text) at the end of the formula that's been automatically
added.
Test the flow
1. Double-click the Text input control, and type or paste some text into it.
2. While holding down the Alt key, select the Button control.
A SharePoint item is created in the list that you specified with the text that you specified as the title. If the list
was open when the flow ran, you might need to refresh your browser window to show the changes.
Create a rule in canvas apps
12/2/2019 • 2 minutes to read • Edit Online

Create rules to automatically modify an app based on criteria that you specify. For example, show list items in red,
yellow, or green based on their status, or show an approval button only for certain users (such as managers). You
can add rules to a variety of controls. In this topic, you'll add a rule to change the text color of a Label control if the
value of a Slider control is greater than 70.

IMPORTANT
Effective October 14, 2019, the rules feature in canvas apps is deprecated. More information: Blog: Canvas Rules feature
deprecation.

Add a rule
1. Select a control (or add a control and leave it selected).
For this topic, add a label and a slider, set the label's Text property to Slider1.Value, and then select the
slider.
2. In the right-hand panel, click or tap Rules, and then click or tap New rule.

If you select a control for which one or more rules has already been defined, you can edit any of them if you
click or tap it.

Add a condition
A condition is an expression that evaluates to true or false, such as whether a value is greater than 70. You can write
the expression based on a template or start from scratch, and you can customize the expression based on guidance
in the UI (Intellisense).
1. Click or tap Add a condition, and then click a template or Custom condition.
For this topic, click or tap Greater than.
2. Update the expression to define when the rule applies.
For this topic, change 0 to 70 to get this expression:
Slider1.Value > 70

Add an action
Actions define what happens when the rule is applied. Power Apps can create actions automatically based on
changes you make to controls.
1. Click or tap Define actions.

2. In the confirmation dialog box, click or tap Let's go so that Power Apps will capture your next change or
changes as one or more actions.
3. Configure one or more controls to match your expectations when the condition is true.
For this topic, change the color of the label.
4. (optional) Review your changes by clicking or tapping Show actions.

5. When you finish adding actions, click or tap Done.


6. Review the condition and actions for the rule.

Rename the rule


1. Hover over Rule1 and click or tap the edit button.

2. Enter a new name for the rule.


3. Click or tap Done to dismiss the editor.

Test the rule


1. Preview the app by pressing F5 (or by clicking the play button near the upper-right corner).

2. Make the condition that you specified true, and then confirm that the actions work as you expect.
For this topic, set the slider to a value that's greater than 70, and confirm that the label text changes color.

See all rules


By default, the Rules tab shows only the rules for the selected control and all child controls that are used in a rule
condition or action. To show all rules in the app, clear the Show rules for this control only check box.

Known limitations
As of this writing:
You can't specify the ThisItem property of a form or a gallery as part of a condition.
Formula reference for Power Apps
3/24/2020 • 10 minutes to read • Edit Online

Formulas combine many elements. Listed below are:


Functions take parameters, perform an operation, and return a value. For example, Sqrt(25) returns 5.
Functions are modeled after Microsoft Excel functions. Some functions have side effects, such as
SubmitForm, which are appropriate only in a behavior formula such as Button.OnSelect.
Signals return information about the environment. For example, Location returns the device's current
GPS coordinates. Signals don't take parameters or have side effects.
Enumerations return a pre-defined constant value. For example, Color is an enumeration that has
pre-defined values for Color.Red, Color.Blue, and so forth. Common enumerations are included here;
function-specific enumerations are described with the function.
Named operators, such as ThisItem and Parent, provide access to information from within a
container.
Other elements include:
Operators and identifiers
Controls and their properties
Data types

A
Abs – Absolute value of a number.
Acceleration – Reads the acceleration sensor in your device.
Acos – Returns the arccosine of a number, in radians.
Acot – Returns the arccotangent of a number, in radians.
AddColumns – Returns a table with columns added.
And – Boolean logic AND. Returns true if all arguments are true. You can also use the && operator.
App – Provides information about the currently running app and control over the app's behavior.
Asin – Returns the arcsine of a number, in radians.
Assert – Evaluates to true or false in a test.
AsType – Treats a record reference as a specific entity type.
Atan – Returns the arctangent of a number, in radians.
Atan2 – Returns the arctangent based on an (x,y) coordinate, in radians.
Average – Calculates the average of a table expression or a set of arguments.

B
Back – Displays the previous screen.
Blank – Returns a blank value that can be used to insert a NULL value in a data source.
C
Calendar – Retrieves information about the calendar for the current locale.
Char – Translates a character code into a string.
Choices – Returns a table of the possible values for a lookup column.
Clear – Deletes all data from a collection.
ClearCollect – Deletes all data from a collection and then adds a set of records.
Clock – Retrieves information about the clock for the current locale.
Coalesce – Replaces blank values while leaving non-blank values unchanged.
Collect – Creates a collection or adds data to a data source.
Color – Sets a property to a built-in color value.
ColorFade – Fades a color value.
ColorValue – Translates a CSS color name or a hex code to a color value.
Compass – Returns your compass heading.
Concat – Concatenates strings in a data source.
Concatenate – Concatenates strings.
Concurrent – Evaluates multiple formulas concurrently with one another.
Connection – Returns information about your network connection.
Count – Counts table records that contain numbers.
Cos – Returns the cosine of an angle specified in radians.
Cot – Returns the cotangent of an angle specified in radians.
CountA – Counts table records that aren't empty.
CountIf – Counts table records that satisfy a condition.
CountRows – Counts table records.

D
DataSourceInfo – Provides information about a data source.
Date – Returns a date/time value, based on Year, Month, and Day values.
DateAdd – Adds days, months, quarters, or years to a date/time value.
DateDiff – Subtracts two date values, and shows the result in days, months, quarters, or years.
DateTimeValue – Converts a date and time string to a date/time value.
DateValue – Converts a date-only string to a date/time value.
Day – Retrieves the day portion of a date/time value.
Defaults – Returns the default values for a data source.
Degrees - Converts radians to degrees.
Disable – Disables a signal, such as Location for reading the GPS.
Distinct – Summarizes records of a table, removing duplicates.
Download – Downloads a file from the web to the local device.
DropColumns – Returns a table with one or more columns removed.

E
EditForm – Resets a form control for editing of an item.
Enable – Enables a signal, such as Location for reading the GPS.
EndsWith – Checks whether a text string ends with another text string.
Errors – Provides error information for previous changes to a data source.
EncodeUrl – Encodes special characters using URL encoding.
Exit – Exits the currently running app and optionally signs out the current user.
Exp - Returns e raised to a power.

F
Filter – Returns a filtered table based on one or more criteria.
Find – Checks whether one string appears within another and returns the location.
First – Returns the first record of a table.
FirstN – Returns the first set of records (N records) of a table.
ForAll – Calculates values and performs actions for all records of a table.

G
GroupBy – Returns a table with records grouped together.
GUID – Converts a GUID string to a GUID value or creates a new GUID value.

H
HashTags – Extracts the hashtags (#strings) from a string.
Hour – Returns the hour portion of a date/time value.

I
If – Returns one value if a condition is true and another value if not.
IfError - Detects errors and provides an alternative value or takes action.
IsBlank – Checks for a blank value.
IsEmpty – Checks for an empty table.
IsMatch – Checks a string against a pattern. Regular expressions can be used.
IsNumeric – Checks for a numeric value.
IsToday – Checks whether a date/time value is sometime today.
IsType – Checks whether a record reference refers to a specific entity type.

J
JSON - Generates a JSON text string for a table, a record, or a value.

L
Language – Returns the language tag of the current user.
Last – Returns the last record of a table.
LastN – Returns the last set of records (N records) of a table.
Launch – Launches a web address or an app.
Left – Returns the left-most portion of a string.
Len – Returns the length of a string.
Ln – Returns the natural log.
LoadData – Loads a collection from a local device's storage.
Location – Returns your location as a map coordinate by using the Global Positioning System (GPS ) and
other information.
LookUp – Looks up a single record in a table based on one or more criteria.
Lower – Converts letters in a string of text to all lowercase.

M
Match – Extracts a substring based on a pattern. Regular expressions can be used.
MatchAll – Extracts multiple substrings based on a pattern. Regular expressions can be used.
Max – Maximum value of a table expression or a set of arguments.
Mid – Returns the middle portion of a string.
Min – Minimum value of a table expression or a set of arguments.
Minute – Retrieves the minute portion of a date/time value.
Mod – Returns the remainder after a dividend is divided by a divisor.
Month – Retrieves the month portion of a date/time value.

N
Navigate – Changes which screen is displayed.
NewForm – Resets a form control for creation of an item.
Not – Boolean logic NOT. Returns true if its argument is false, and returns false if its argument is true.
You can also use the ! operator.
Notify – Displays a banner message to the user.
Now – Returns the current date/time value.

O
Or – Boolean logic OR. Returns true if any of its arguments are true. You can also use the || operator.

P
Param – Provides access to parameters passed to the app when the user opened it.
Parent – Provides access to a container control's properties.
Patch – Modifies or creates a record in a data source, or merges records outside of a data source.
Pi – Returns the number π.
PlainText – Removes HTML and XML tags from a string.
Power – Returns a number raised to a power. You can also use the ^ operator.
Proper – Converts the first letter of each word in a string to uppercase, and converts the rest to lowercase.

R
Radians - Converts degrees to radians.
Rand – Returns a pseudo-random number.
Refresh – Refreshes the records of a data source.
Relate – Relates records of two entities through a one-to-many or many-to-many relationship.
Remove – Removes one or more specific records from a data source.
RemoveIf – Removes records from a data source based on a condition.
RenameColumns – Renames columns of a table.
Replace – Replaces part of a string with another string, by starting position of the string.
Reset – Resets an input control to its default value, discarding any user changes.
ResetForm – Resets a form control for editing of an existing item.
Revert – Reloads and clears errors for the records of a data source.
RGBA – Returns a color value for a set of red, green, blue, and alpha components.
Right – Returns the right-most portion of a string.
Round – Rounds to the closest number.
RoundDown – Rounds down to the largest previous number.
RoundUp – Rounds up to the smallest next number.

S
SaveData – Saves a collection to a local device's storage.
Search – Finds records in a table that contain a string in one of their columns.
Second – Retrieves the second portion of a date/time value.
Select – Simulates a select action on a control, causing the OnSelect formula to be evaluated.
Set – Sets the value of a global variable.
SetFocus – Moves input focus to a specific control.
SetPropertry – Simulates interactions with input controls.
ShowColumns – Returns a table with only selected columns.
Shuffle – Randomly reorders the records of a table.
Sin – Returns the sine of an angle specified in radians.
Sort – Returns a sorted table based on a formula.
SortByColumns – Returns a sorted table based on one or more columns.
Split – Splits a text string into a table of substrings.
Sqrt – Returns the square root of a number.
StartsWith – Checks if a text string begins with another text string.
StdevP – Returns the standard deviation of its arguments.
Substitute – Replaces part of a string with another string, by matching strings.
SubmitForm – Saves the item in a form control to the data source.
Sum – Calculates the sum of a table expression or a set of arguments.
Switch – Matches with a set of values and then evaluates a corresponding formula.

T
Table – Creates a temporary table.
Tan - Returns the tangent of an angle specified in radians.
Text – Converts any value and formats a number or date/time value to a string of text.
ThisItem – When in a gallery or form, returns the data for the current item from the container.
Time – Returns a date/time value, based on Hour, Minute, and Second values.
TimeValue – Converts a time-only string to a date/time value.
TimeZoneOffset – Returns the difference between UTC and the user's local time in minutes.
Today – Returns the current date/time value.
Trace - Provide additional information in your test results.
Trim – Removes extra spaces from the ends and interior of a string of text.
TrimEnds – Removes extra spaces from the ends of a string of text only.

U
Ungroup – Removes a grouping.
Unrelate – Unrelates records of two entities from a one-to-many or many-to-many relationship.
Update – Replaces a record in a data source.
UpdateContext – Sets the value of one or more context variables of the current screen.
UpdateIf – Modifies a set of records in a data source based on a condition.
Upper – Converts letters in a string of text to all uppercase.
User – Returns information about the current user.

V
Validate – Checks whether the value of a single column or a complete record is valid for a data source.
Value – Converts a string to a number.
VarP – Returns the variance of its arguments.
ViewForm – Resets a form control for viewing of an existing item.

W
Weekday – Retrieves the weekday portion of a date/time value.
With – Calculates values and performs actions for a single record, including inline records of named
values.

Y
Year – Retrieves the year portion of a date/time value.
Abs, Exp, Ln, Power, and Sqrt functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Calculates absolute values, natural logarithms, square roots, and the results of raising e or any number to specified
powers.

Description
The Abs function returns the non-negative value of its argument. If a number is negative, Abs returns the positive
equivalent.
The Exp function returns e raised to the power of its argument. The transcendental number e begins 2.7182818...
The Ln function returns the natural logarithm (base e) of its argument.
The Power function returns a number raised to a power. It is equivalent to using the ^ operator.
The Sqrt function returns the number that, when multiplied by itself, equals its argument.
If you pass a single number, the return value is a single result based on the function called. If you pass a single-
column table that contains numbers, the return value is a single-column table of results, one result for each record
in the argument's table. If you have a multi-column table, you can shape it into a single-column table, as working
with tables describes.
If an argument would result in an undefined valued, the result is blank. This can happen, for example, with square
roots and logarithms of negative numbers.

Syntax
Abs( Number )
Exp( Number )
Ln( Number )
Sqrt( Number )
Number - Required. Number to operate on.
Power( Base, Exponent )
Base - Required. Base number to raise.
Exponent - Required. The exponent to which the base number is raised.
Abs( SingleColumnTable )
Exp( SingleColumnTable )
Ln( SingleColumnTable )
Sqrt( SingleColumnTable )
SingleColumnTable - Required. A single-column table of numbers to operate on.

Examples
Single number
FORMULA DESCRIPTION RESULT

Abs( -55 ) Returns the number without the 55


negative sign.

Exp( 2 ) Returns e raised to the power of 2, or e 7.389056...


* e.

Ln( 100 ) Returns the natural logarithm (base e) 4.605170...


of the number 100.

Power( 5, 3 ) Returns 5 raised to the power of 3, or 5 125


* 5 * 5.

Sqrt( 9 ) Returns the number that, when 3


multiplied by itself, results in 9.

Single -column table


The examples in this section use a data source that's named ValueTable and that contains this data:

FORMULA DESCRIPTION RESULT

Abs( ValueTable ) Returns the absolute value of each


number in the table.

Exp( ValueTable ) Returns e raised to the power of each


number in the table.

Ln( ValueTable ) Returns the natural logarithm of each


number in the table.

Sqrt( ValueTable ) Returns the square root of each number


in the table

Step-by-step example
1. Add a Text input control, and name it Source.
2. Add a Label control, and set its Text property to this formula:
Sqrt( Value( Source.Text ) )
3. Type a number into Source, and confirm that the Label control shows the square root of the number that you
typed.
Acceleration, App, Compass, Connection, and
Location signals in Power Apps
2/11/2020 • 4 minutes to read • Edit Online

Returns information about the app's environment, such as where the user is located in the world and which screen
is displayed.

Description and syntax


Signals are values that can change at any time, independent of how the user may be interacting with the app.
Formulas that are based on signals automatically recalculate as these values change.
Signals typically return a record of information. You can use and store this information as a record, or you can
extract individual properties by using the . operator.

NOTE
The Acceleration and Compass functions return accurate values in a native player such as on iOS or Android, but those
functions return zero values as you create or modify an app in the browser.

Acceleration
The Acceleration signal returns the device's acceleration in three dimensions relative to the device's screen.
Acceleration is measured in g units of 9.81 m/second2 or 32.2 ft/second2 (the acceleration that the Earth imparts to
objects at its surface due to gravity).

PROPERTY DESCRIPTION

Acceleration.X Right and left. Right is a positive number.

Acceleration.Y Forward and back. Forward is a positive number.

Acceleration.Z Up and down. Up is a positive number.

App
Among other properties, the App object includes a signal that indicates which screen is showing.

PROPERTY DESCRIPTION

App.ActiveScreen Screen that's showing. Returns a screen object, which you can
use to reference properties of the screen or compare to
another screen to determine which screen is showing. You can
use the Back or Navigate function to change the screen
that's showing.

More information: App object documentation.


Compass
The Compass signal returns the compass heading of the top of the screen. The heading is based on magnetic
north.
PROPERTY DESCRIPTION

Compass.Heading Heading in degrees. Returns a number 0 to 360, and 0 is


north.

Connection
The Connection signal returns the information about the network connection. When on a metered connection, you
may want to limit how much data you send or receive over the network.

PROPERTY DESCRIPTION

Connection.Connected Returns a Boolean true or false value that indicates whether


the device is connected to a network.

Connection.Metered Returns a Boolean true or false value that indicates whether


the connection is metered.

Location
The Location signal returns the location of the device based on the Global Positioning System (GPS ) and other
device information, such as cell-tower communications and IP address.
When a user accesses the location information for the first time, the device may prompt that user to allow access to
this information.
As the location changes, dependencies on the location will continuously recalculate, which will consume power
from the device's battery. To conserve battery life, you can use the Enable and Disable functions to turn location
updates on and off. Location is automatically turned off if the displayed screen doesn't depend on location
information.

PROPERTY DESCRIPTION

Location.Altitude Returns a number that indicates the altitude, measured in feet,


above sea level.

Location.Latitude Returns a number, from –90 to 90, that indicates the latitude,
as measured in degrees from the equator. A positive number
indicates a location that's north of the equator.

Location.Longitude Returns a number, from –180 to 180, that indicates the


longitude, as measured in degrees from Greenwich, England. A
positive number indicates a location that's east of Greenwhich.

Examples
In a baseball field, a pitcher throws a phone from the pitcher's mound to a catcher at home plate. The phone is lying
flat with respect to the ground, the top of the screen is pointed at the catcher, and the pitcher adds no spin. At this
location, the phone has cellular network service that's metered but no WiFi. The PlayBall screen is displayed.

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Location.Latitude Returns the latitude of the current 47.591


location. The field is located at map
coordinates 47.591 N, 122.333 W. The latitude will change continuously as
the ball moves between the pitcher and
the catcher.

Location.Longitude Returns the longitude of the current 122.333


location.
The longitude will change continuously
as the ball moves between the pitcher
and the catcher.

Location Returns the latitude and longitude of { Latitude: 47.591, Longitude: 122.333 }
the current location, as a record.

Compass.Heading Returns the compass heading of the top 230.25


of the screen. At this field, home plate is
roughly southwest from the pitcher's
mound.

Acceleration.X Returns the acceleration of the device 0


side to side. The pitcher is throwing the
phone straight ahead with respect to
the screen's top, so the device isn't
accelerating side to side.

Acceleration.Y Returns the acceleration of the device 8.2, while the pitcher throws the device.
front to back. The pitcher initially gives
the device a large acceleration when 0, while the device is in the air.
throwing the device, going from 0 to 90
miles per hour (132 feet per second) in -8.2, as the catcher catches the device.
half a second. After the device is in the
air, ignoring air friction, the device
doesn't accelerate further. The device
decelerates when the catcher catches it,
bringing it to a stop.

Acceleration.Z Returns the acceleration of the device 0, before the pitcher throws the device.
top to bottom. While in the air, the
device experiences the effects of gravity. 1, while the device is in the air.

0, after the catcher catches the device.

Acceleration Returns the acceleration as a record. { X: 0, Y: 264, Z: 0 } as the pitcher


throws the device.

Connection.Connected Returns a Boolean value that indicates true


whether the device is connected to a
network

Connection.Metered Returns a Boolean value that indicates true


whether the connection is metered

App.ActiveScreen = PlayBall Returns a Boolean value that indicates true


whether PlayBall is displayed.
FORMULA DESCRIPTION RESULT

App.ActiveScreen.Fill Returns the background color for the Color.Green


displayed screen.
Acos, Acot, Asin, Atan, Atan2, Cos, Cot, Degrees, Pi,
Radians, Sin, and Tan functions in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Calculates trigonometric values.

Description
Primary functions
The Cos function returns the cosine of its argument, an angle specified in radians.
The Cot function returns the cotangent of its argument, an angle specified in radians.
The Sin function returns the sine of its argument, an angle specified in radians.
The Tan function returns the tangent of its argument, an angle specified in radians.
Inverse functions
The Acos function returns the arccosine, or inverse cosine, of its argument. The arccosine is the angle whose cosine
is the argument. The returned angle is given in radians in the range 0 (zero) to π.
The Acot function returns the principal value of the arccotangent, or inverse cotangent, of its argument. The
returned angle is given in radians in the range 0 (zero) to π.
The Asin function returns the arcsine, or inverse sine, of its argument. The arcsine is the angle whose sine is the
argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan function returns the arctangent, or inverse tangent, of its argument. The arctangent is the angle whose
tangent is the argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan2 function returns the arctangent, or inverse tangent, of the specified x and y coordinates as arguments.
The arctangent is the angle from the x-axis to a line that contains the origin (0, 0) and a point with coordinates (x, y).
The angle is given in radians between -π and π, excluding -π. A positive result represents a counterclockwise angle
from the x-axis; a negative result represents a clockwise angle. Atan2( a, b ) equals Atan( b/a ), except that a can
equal 0 (zero) with the Atan2 function.
Helper functions
The Degrees function converts radians to degrees. π radians equals 180 degrees.
The Pi function returns the transcendental number π, which begins 3.141592...
The Radians function converts degrees to radians.
Notes
If you pass a single number to these functions, the return value is a single result. If you pass a single-column table
that contains numbers, the return value is a single-column table of results, one result for each record in the
argument's table. If you have a multi-column table, you can shape it into a single-column table, as working with
tables describes.
If an argument would result in an undefined value, the result is blank. This can happen, for example, when using
inverse functions with arguments that are out of range.
Syntax
Primary Functions
Cos( Radians )
Cot( Radians )
Sin( Radians )
Tan( Radians )
Radians - Required. Angle to operate on.
Cos( SingleColumnTable )
Cot( SingleColumnTable )
Sin( SingleColumnTable )
Tan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of angles to operate on.
Inverse Functions
Acos( Number )
Acot( Number )
Asin( Number )
Atan( Number )
Number - Required. Number to operate on.
Acos( SingleColumnTable )
Acot( SingleColumnTable )
Asin( SingleColumnTable )
Atan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of numbers to operate on.
Atan2( X, Y )
X - Required. X-axis coordinate.
Y - Required. Y -axis coordinate.
Helper Functions
Degrees( Radians )
Radians - Required. Angle in radians to convert to degrees.
Pi()
Radians( Degrees )
Degrees - Required. Angle in degrees to convert to radians.

Examples
Single number
FORMULA DESCRIPTION RESULT

Cos( 1.047197 ) Returns the cosine of 1.047197 radians 0.5


or 60 degrees.
FORMULA DESCRIPTION RESULT

Cot( Pi()/4 ) Returns the cotangent of 0.785398... 1


radians or 45 degrees.

Sin( Pi()/2 ) Returns the sine of 1.570796... radians 1


or 90 degrees.

Tan( Radians(60) ) Returns the tangent of 1.047197... 1.732050...


radians or 60 degrees.

Acos( 0.5 ) Returns the arccosine of 0.5, in radians. 1.047197...

Acot( 1 ) Returns the arccotangent of 1, in 0.785398...


radians.

Asin( 1 ) Returns the arcsine of 1, in radians. 1.570796...

Atan( 1.732050 ) Returns the arctangent of 1.732050, in 1.047197...


radians.

Atan2( 5, 3 ) Returns the arctangent of the angle 0.540419...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (5,3),
which is approximately 31 degrees.

Atan2( 4, 4 ) Returns the arctangent of the angle 0.785398...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (4,4),
which is exactly π/4 radians or 45
degrees.

Degrees( 1.047197 ) Returns the equivalent number of 60


degrees for 1.047197 radians.

Pi() Returns the transcendental number π. 3.141592...

Radians( 15 ) Returns the equivalent number of 0.261799...


radians for 15 degrees.

Single -column table


The examples in this section use a data source that's named ValueTable and that contains the following data. The
last record in the table is π/2 radians or 90 degrees.

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Cos( ValueTable ) Returns the cosine of each number in


the table.

Cot( ValueTable ) Returns the cotangent of each number


in the table.

Sin( ValueTable ) Returns the sine of each number in the


table.

Tan( ValueTable ) Returns the tangent of each number in


the table.

Acos( ValueTable ) Returns the arccosine of each number in


the table.

Acot( ValueTable ) Returns the arccotangent of each


number in the table.

Asin( ValueTable ) Returns the arcsine of each number in


the table.

Atan( ValueTable ) Returns the arctangent of each number


in the table.
FORMULA DESCRIPTION RESULT

Degrees( ValueTable ) Returns the equivalent number of


degrees for each number in the table,
assumed to be angles in radians.

Radians( ValueTable ) Returns the equivalent number of


radians for each number in the table,
assumed to be angles in degrees.
Acos, Acot, Asin, Atan, Atan2, Cos, Cot, Degrees, Pi,
Radians, Sin, and Tan functions in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Calculates trigonometric values.

Description
Primary functions
The Cos function returns the cosine of its argument, an angle specified in radians.
The Cot function returns the cotangent of its argument, an angle specified in radians.
The Sin function returns the sine of its argument, an angle specified in radians.
The Tan function returns the tangent of its argument, an angle specified in radians.
Inverse functions
The Acos function returns the arccosine, or inverse cosine, of its argument. The arccosine is the angle whose cosine
is the argument. The returned angle is given in radians in the range 0 (zero) to π.
The Acot function returns the principal value of the arccotangent, or inverse cotangent, of its argument. The
returned angle is given in radians in the range 0 (zero) to π.
The Asin function returns the arcsine, or inverse sine, of its argument. The arcsine is the angle whose sine is the
argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan function returns the arctangent, or inverse tangent, of its argument. The arctangent is the angle whose
tangent is the argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan2 function returns the arctangent, or inverse tangent, of the specified x and y coordinates as arguments.
The arctangent is the angle from the x-axis to a line that contains the origin (0, 0) and a point with coordinates (x, y).
The angle is given in radians between -π and π, excluding -π. A positive result represents a counterclockwise angle
from the x-axis; a negative result represents a clockwise angle. Atan2( a, b ) equals Atan( b/a ), except that a can
equal 0 (zero) with the Atan2 function.
Helper functions
The Degrees function converts radians to degrees. π radians equals 180 degrees.
The Pi function returns the transcendental number π, which begins 3.141592...
The Radians function converts degrees to radians.
Notes
If you pass a single number to these functions, the return value is a single result. If you pass a single-column table
that contains numbers, the return value is a single-column table of results, one result for each record in the
argument's table. If you have a multi-column table, you can shape it into a single-column table, as working with
tables describes.
If an argument would result in an undefined value, the result is blank. This can happen, for example, when using
inverse functions with arguments that are out of range.
Syntax
Primary Functions
Cos( Radians )
Cot( Radians )
Sin( Radians )
Tan( Radians )
Radians - Required. Angle to operate on.
Cos( SingleColumnTable )
Cot( SingleColumnTable )
Sin( SingleColumnTable )
Tan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of angles to operate on.
Inverse Functions
Acos( Number )
Acot( Number )
Asin( Number )
Atan( Number )
Number - Required. Number to operate on.
Acos( SingleColumnTable )
Acot( SingleColumnTable )
Asin( SingleColumnTable )
Atan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of numbers to operate on.
Atan2( X, Y )
X - Required. X-axis coordinate.
Y - Required. Y -axis coordinate.
Helper Functions
Degrees( Radians )
Radians - Required. Angle in radians to convert to degrees.
Pi()
Radians( Degrees )
Degrees - Required. Angle in degrees to convert to radians.

Examples
Single number
FORMULA DESCRIPTION RESULT

Cos( 1.047197 ) Returns the cosine of 1.047197 radians 0.5


or 60 degrees.
FORMULA DESCRIPTION RESULT

Cot( Pi()/4 ) Returns the cotangent of 0.785398... 1


radians or 45 degrees.

Sin( Pi()/2 ) Returns the sine of 1.570796... radians 1


or 90 degrees.

Tan( Radians(60) ) Returns the tangent of 1.047197... 1.732050...


radians or 60 degrees.

Acos( 0.5 ) Returns the arccosine of 0.5, in radians. 1.047197...

Acot( 1 ) Returns the arccotangent of 1, in 0.785398...


radians.

Asin( 1 ) Returns the arcsine of 1, in radians. 1.570796...

Atan( 1.732050 ) Returns the arctangent of 1.732050, in 1.047197...


radians.

Atan2( 5, 3 ) Returns the arctangent of the angle 0.540419...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (5,3),
which is approximately 31 degrees.

Atan2( 4, 4 ) Returns the arctangent of the angle 0.785398...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (4,4),
which is exactly π/4 radians or 45
degrees.

Degrees( 1.047197 ) Returns the equivalent number of 60


degrees for 1.047197 radians.

Pi() Returns the transcendental number π. 3.141592...

Radians( 15 ) Returns the equivalent number of 0.261799...


radians for 15 degrees.

Single -column table


The examples in this section use a data source that's named ValueTable and that contains the following data. The
last record in the table is π/2 radians or 90 degrees.

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Cos( ValueTable ) Returns the cosine of each number in


the table.

Cot( ValueTable ) Returns the cotangent of each number


in the table.

Sin( ValueTable ) Returns the sine of each number in the


table.

Tan( ValueTable ) Returns the tangent of each number in


the table.

Acos( ValueTable ) Returns the arccosine of each number in


the table.

Acot( ValueTable ) Returns the arccotangent of each


number in the table.

Asin( ValueTable ) Returns the arcsine of each number in


the table.

Atan( ValueTable ) Returns the arctangent of each number


in the table.
FORMULA DESCRIPTION RESULT

Degrees( ValueTable ) Returns the equivalent number of


degrees for each number in the table,
assumed to be angles in radians.

Radians( ValueTable ) Returns the equivalent number of


radians for each number in the table,
assumed to be angles in degrees.
AddColumns, DropColumns, RenameColumns, and
ShowColumns functions in Power Apps
12/3/2019 • 6 minutes to read • Edit Online

Shapes a table by adding, dropping, renaming, and selecting its columns.

Overview
These functions shape a table by adjusting its columns:
Reduce a table that contains multiple columns down to a single column for use with single-column functions, such as Lower or Abs.
Add a calculated column to a table (for example, a Total Price column that shows the results of multiplying Quantity by Unit Price).
Rename a column to something more meaningful, for display to users or for use in formulas.
A table is a value in Power Apps, just like a string or a number. You can specify a table as an argument in a formula, and functions can
return a table as a result.

NOTE
The functions that this topic describes don't modify the original table. Instead, they take that table as an argument and return a new table with a
transform applied. See working with tables for more details.

You can't modify the columns of a data source by using these functions. You must modify the data at its source. You can add columns to
a collection with the Collect function. See working with data sources for more details.

Description
The AddColumns function adds a column to a table, and a formula defines the values in that column. Existing columns remain
unmodified.
The formula is evaluated for each record of the table.
Fields of the record currently being processed are available within the formula. You simply reference them by name as you would any
other value. You can also reference control properties and other values from throughout your app. For more details, see the examples
below and working with record scope.
The DropColumns function excludes columns from a table. All other columns remain unmodified. DropColumns excludes columns,
and ShowColumns includes columns.
Use the RenameColumns function to rename one or more columns of a table by providing at least one argument pair that specifies the
name of a column that the table contains (the old name, which you want to replace) and the name of a column that the table doesn't
contain (the new name, which you want to use). The old name must already exist in the table, and the new name must not exist. Each
column name may appear only once in the argument list as either an old column name or a new column name. To rename a column to
an existing column name, first drop the existing column with DropColumns, or rename the existing column out of the way by nesting
one RenameColumns function within another.
The ShowColumns function includes columns of a table and drops all other columns. You can use ShowColumns to create a single-
column table from a multi-column table. ShowColumns includes columns, and DropColumns excludes columns.
For all these functions, the result is a new table with the transform applied. The original table isn't modified. You can't modify an existing
table with a formula. SharePoint, Common Data Service, SQL Server, and other data sources provide tools for modifying the columns of
lists, entities, and tables, which are often referred to as the schema. The functions in this topic only transform an input table, without
modifying the original, into an output table for further use.
The arguments to these functions support delegation. For example, a Filter function used as an argument to pull in related records
searches through all listings, even if the '[dbo].[AllListings]' data source contains a million rows:

AddColumns( RealEstateAgents,
"Listings",
Filter( '[dbo].[AllListings]', ListingAgentName = AgentName )
)
However, the output of these functions is subject to the non-delegation record limit. In this example, only 500 records are returned even
if the RealEstateAgents data source has 501 or more records.
If you use AddColumns in this manner, Filter must make separate calls to the data source for each of those first records in
RealEstateAgents, which causes a lot of network chatter. If [dbo].[AllListings] is small enough and doesn't change often, you could
call the Collect function in OnStart to cache the data source in your app when it starts. As an alternative, you could restructure your app
so that you pull in the related records only when the user asks for them.

Syntax
AddColumns( Table, ColumnName1, Formula1 [, ColumnName2, Formula2, ... ] )
Table - Required. Table to operate on.
ColumnName(s) - Required. Name(s) of the column(s) to add. You must specify a string (for example, "Name" with double quotes
included) for this argument.
Formula (s) - Required. Formula(s) to evaluate for each record. The result is added as the value of the corresponding new column. You
can reference other columns of the table in this formula.
DropColumns( Table, ColumnName1 [, ColumnName2, ... ] )
Table - Required. Table to operate on.
ColumnName(s) - Required. Name(s) of the column(s) to drop. You must specify a string (for example, "Name" with double quotes
included) for this argument.
RenameColumns( Table, OldColumnName1, NewColumnName1 [, OldColumnName2, NewColumnName2, ... ] )
Table - Required. Table to operate on.
OldColumnName - Required. Name of a column to rename from the original table. This element appears first in the argument pair
(or first in each argument pair if the formula includes more than one pair). This name must be a string (for example "Name" with
double quotation marks included).
NewColumnName - Required. Replacement name. This element appears last in the argument pair (or last in each argument pair if
the formula includes more than one pair). You must specify a string (for example, "Customer Name" with double quotation marks
included) for this argument.
ShowColumns( Table, ColumnName1 [, ColumnName2, ... ] )
Table - Required. Table to operate on.
ColumnName(s) - Required. Name(s) of the column(s) to include. You must specify a string (for example, "Name" with double
quotes included) for this argument.

Examples
The examples in this section use the IceCreamSales data source, which contains the data in this table:

None of these examples modify the IceCreamSales data source. Each function transforms the value of the data source as a table and
returns that value as the result.

FORMULA DESCRIPTION RESULT

AddColumns( IceCreamSales, "Revenue", Adds a Revenue column to the result. For each
UnitPrice * QuantitySold ) record, UnitPrice * QuantitySold is evaluated,
and the result is placed in the new column.

DropColumns( IceCreamSales, "UnitPrice" ) Excludes the UnitPrice column from the result.
Use this function to exclude columns, and use
ShowColumns to include them.
FORMULA DESCRIPTION RESULT

ShowColumns( IceCreamSales, "Flavor" ) Includes only the Flavor column in the result.
Use this function include columns, and use
DropColumns to exclude them.

RenameColumns( IceCreamSales, Renames the UnitPrice column in the result.


"UnitPrice", "Price")

RenameColumns( IceCreamSales, Renames the UnitPrice and QuantitySold


"UnitPrice", "Price", "QuantitySold", columns in the result.
"Number")

DropColumns( Performs the following table transforms in


RenameColumns( order, starting from the inside of the formula:
AddColumns( IceCreamSales, "Revenue", 1. Adds a Revenue column based on the
UnitPrice * QuantitySold ), per-record calculation of UnitPrice *
"UnitPrice", "Price" ), Quantity.
"Quantity" ) 2. Renames UnitPrice to Price.
3. Excludes the Quantity column.
Note that order is important. For example, we
can't calculate with UnitPrice after it has been
renamed.

Step by step
Let's try some of the examples from earlier in this topic.
1. Create a collection by adding a Button control and setting its OnSelect property to this formula:

ClearCollect( IceCreamSales,
Table(
{ Flavor: "Strawberry", UnitPrice: 1.99, QuantitySold: 20 },
{ Flavor: "Chocolate", UnitPrice: 2.99, QuantitySold: 45 },
{ Flavor: "Vanilla", UnitPrice: 1.50, QuantitySold: 35 }
)
)

2. Run the formula by selecting the button while holding down the Alt key.
3. Add a second Button control, set its OnSelect property to this formula, and then run it:

ClearCollect( FirstExample,
AddColumns( IceCreamSales, "Revenue", UnitPrice * QuantitySold )
)

4. On the File menu, select Collections, and then select IceCreamSales to show that collection.
As this graphic shows, the second formula didn't modify this collection. The AddColumns function used IceCreamSales as a
read-only argument; the function didn't modify the table to which that argument refers.
5. Select FirstExample.
As this graphic shows, the second formula returned a new table with the added column. The ClearCollect function captured the
new table in the FirstExample collection, adding something to the original table as it flowed through the function without
modifying the source:
And, Or, and Not functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Boolean logic functions, commonly used to manipulate the results of comparisons and tests.

Description
The And function returns true if all of its arguments are true.
The Or function returns true if any of its arguments are true.
The Not function returns true if its argument is false; it returns false if its argument is true.
These functions work the same way as they do in Excel. You can also use operators to perform these same
operations, using either Visual Basic or JavaScript syntax:

FUNCTION NOTATION VISUAL BASIC OPERATOR NOTATION JAVASCRIPT OPERATOR NOTATION

And( x, y ) x And y x && y

Or( x, y ) x Or y x || y

Not( x ) Not x !x

These functions work with logical values. You can't pass them a number or a string directly; instead, you must make
a comparison or a test. For example, this logical formula x > 1 evaluates to the Boolean value true if x is greater
than 1. If x is less than 1, the formula evaluates to false.

Syntax
And( LogicalFormula1, LogicalFormula2 [, LogicalFormula3, ... ] )
Or( LogicalFormula1, LogicalFormula2 [, LogicalFormula3, ... ] )
Not( LogicalFormula )
LogicalFormula (s) - Required. Logical formulas to evaluate and operate on.

Examples
The examples in this section use these global variables:
a = false
b = true
x = 10
y = 100
s = "Hello World"
To create these global variables in an app, insert a Button control, and set its OnSelect property to this formula:

Set( a, false ); Set( b, true ); Set( x, 10 ); Set( y, 100 ); Set( s, "Hello World" )

Select the button (by clicking it while you hold down the Alt key), and then set the Text property of a Label control
to a formula in the first column of the next table.

FORMULA DESCRIPTION RESULT

And( a, b ) Tests the values of a and b. One of the false


arguments is false, so the function
returns false.

a And b Same as the previous example, using false


Visual Basic notation.

a && b Same as the previous example, using false


JavaScript notation.

Or( a, b ) Tests the values of a and b. One of the true


arguments is true, so the function
returns true.

a Or b Same as the previous example, using true


Visual Basic notation.

a || b Same as the previous example, using true


JavaScript notation.

Not( a ) Tests the value of a. The argument is true


false, so the function returns the
opposite result.

Not a Same as the previous example, using true


Visual Basic notation.

!a Same as the previous example, using true


JavaScript notation.

Len( s ) < 20 And Not IsBlank( s ) Tests whether the length of s is less true
than 20 and whether it isn't a blank
value. The length is less than 20, and
the value isn't blank. Therefore, the
result is true.

Or( Len( s ) < 10, x < 100, y < 100 ) Tests whether the length of s is less true
than 10, whether x is less than 100, and
whether y is less than 100. The first and
third arguments are false, but the
second one is true. Therefore, the
function returns true.

Not IsBlank( s ) Tests whether s is blank, which returns true


false. Not returns the opposite of this
result, which is true.
App object in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Provides information about the currently running app and control over the app's behavior.

Description
Like a control, the App object provides properties that identify which screen is showing and that prompt the user
to save changes so that they're not lost. Every app has an App object.
You can write formulas for some properties of the App object. At the top of the Tree view pane, select the App
object as you would any other control or screen. View and edit one of the object's properties by selecting it in the
drop-down list to the left of the formula bar.

ActiveScreen property
The ActiveScreen property identifies the screen that's showing.
This property returns a screen object, which you can use to reference properties of the screen or compare to
another screen to determine which screen is showing. You can also use the expression App.ActiveScreen.Name
to retrieve the name of the screen that's showing.
Use the Back or Navigate function to change the screen that's showing.

OnStart property
The OnStart property runs when the user starts the app. App makers often use this property to perform these
tasks:
Retrieve and cache data into collections by using the Collect function.
Set up global variables by using the Set function.
Navigate to an initial screen by using the Navigate function.
This formula is evaluated before the first screen appears. No screen is loaded, so you can't set context variables
with the UpdateContext function. However, you can pass context variables with the Navigate function.
After you change the OnStart property, test it by hovering over the App object in the Tree view pane, selecting
the ellipsis (...) that appears, and then selecting Run OnStart. Unlike when the app is loaded for the first time,
existing collections and variables will already be set. To start with empty collections, use the ClearCollect function
instead of the Collect function.
ConfirmExit properties
Nobody wants to lose unsaved changes. Use the ConfirmExit and ConfirmExitMessage properties to warn the
user before they close your app.

NOTE
ConfirmExit doesn't work in apps that are embedded in, for example, Power BI and SharePoint.

NOTE
At present, these properties can reference controls on only the first screen if the Delayed load preview feature is enabled
(which it is by default for new apps). If references are made, Power Apps Studio doesn't show an error, but the resulting
published app doesn't open in Power Apps Mobile or a browser. We're actively working to lift this limitation. In the
meantime, you can turn off Delayed load in File > App settings > Advanced settings (under Preview features).

ConfirmExit
ConfirmExit is a Boolean property that, when true, opens a confirmation dialog box before the app is closed. By
default, this property is false, and no dialog box appears.
Use this property to show a confirmation dialog box if the user has made changes but not saved them. Use a
formula that can check variables and control properties (for example, the Unsaved property of the Edit form
control).
The confirmation dialog box appears in any situation where data could be lost, as in these examples:
Running the Exit function.
If the app is running in a browser:
Closing the browser or the browser tab in which the app is running.
Selecting the browser's back button.
If the app is running in Power Apps Mobile (iOS or Android):
Running the Launch function.
The Launch function doesn't trigger the dialog box in a browser because another tab opens so that data
isn't lost.
Swiping to switch to a different app in Power Apps Mobile.
Selecting the back button on an Android device.
The exact look of the confirmation dialog box might vary across devices and versions of Power Apps.
The confirmation dialog box doesn't appear in Power Apps Studio.
ConfirmExitMessage
By default, the confirmation dialog box shows a generic message, such as "You may have unsaved changes." in
the user's language.
Use ConfirmExitMessage to provide a custom message in the confirmation dialog box. If this property is blank,
the default value is used. Custom messages are truncated as necessary to fit within the confirmation dialog box, so
keep the message to a few lines at most.
In a browser, the confirmation dialog box might appear with a generic message from the browser.
Example
1. Create an app that contains two form controls, AccountForm and ContactForm.
2. Set the App object's ConfirmExit property to this expression:

AccountForm.Unsaved Or ContactForm.Unsaved

This dialog box appears if the user changes data in either form and then tries to close the app without
saving those changes.

3. Set the App object's ConfirmExitMessage property to this formula:

If( AccountsForm.Unsaved,
"Accounts form has unsaved changes.",
"Contacts form has unsaved changes."
)

This dialog box appears if the user changes data in the Account form and then tries to close the app without
saving those changes.
Acos, Acot, Asin, Atan, Atan2, Cos, Cot, Degrees, Pi,
Radians, Sin, and Tan functions in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Calculates trigonometric values.

Description
Primary functions
The Cos function returns the cosine of its argument, an angle specified in radians.
The Cot function returns the cotangent of its argument, an angle specified in radians.
The Sin function returns the sine of its argument, an angle specified in radians.
The Tan function returns the tangent of its argument, an angle specified in radians.
Inverse functions
The Acos function returns the arccosine, or inverse cosine, of its argument. The arccosine is the angle whose cosine
is the argument. The returned angle is given in radians in the range 0 (zero) to π.
The Acot function returns the principal value of the arccotangent, or inverse cotangent, of its argument. The
returned angle is given in radians in the range 0 (zero) to π.
The Asin function returns the arcsine, or inverse sine, of its argument. The arcsine is the angle whose sine is the
argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan function returns the arctangent, or inverse tangent, of its argument. The arctangent is the angle whose
tangent is the argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan2 function returns the arctangent, or inverse tangent, of the specified x and y coordinates as arguments.
The arctangent is the angle from the x-axis to a line that contains the origin (0, 0) and a point with coordinates (x, y).
The angle is given in radians between -π and π, excluding -π. A positive result represents a counterclockwise angle
from the x-axis; a negative result represents a clockwise angle. Atan2( a, b ) equals Atan( b/a ), except that a can
equal 0 (zero) with the Atan2 function.
Helper functions
The Degrees function converts radians to degrees. π radians equals 180 degrees.
The Pi function returns the transcendental number π, which begins 3.141592...
The Radians function converts degrees to radians.
Notes
If you pass a single number to these functions, the return value is a single result. If you pass a single-column table
that contains numbers, the return value is a single-column table of results, one result for each record in the
argument's table. If you have a multi-column table, you can shape it into a single-column table, as working with
tables describes.
If an argument would result in an undefined value, the result is blank. This can happen, for example, when using
inverse functions with arguments that are out of range.
Syntax
Primary Functions
Cos( Radians )
Cot( Radians )
Sin( Radians )
Tan( Radians )
Radians - Required. Angle to operate on.
Cos( SingleColumnTable )
Cot( SingleColumnTable )
Sin( SingleColumnTable )
Tan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of angles to operate on.
Inverse Functions
Acos( Number )
Acot( Number )
Asin( Number )
Atan( Number )
Number - Required. Number to operate on.
Acos( SingleColumnTable )
Acot( SingleColumnTable )
Asin( SingleColumnTable )
Atan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of numbers to operate on.
Atan2( X, Y )
X - Required. X-axis coordinate.
Y - Required. Y -axis coordinate.
Helper Functions
Degrees( Radians )
Radians - Required. Angle in radians to convert to degrees.
Pi()
Radians( Degrees )
Degrees - Required. Angle in degrees to convert to radians.

Examples
Single number
FORMULA DESCRIPTION RESULT

Cos( 1.047197 ) Returns the cosine of 1.047197 radians 0.5


or 60 degrees.
FORMULA DESCRIPTION RESULT

Cot( Pi()/4 ) Returns the cotangent of 0.785398... 1


radians or 45 degrees.

Sin( Pi()/2 ) Returns the sine of 1.570796... radians 1


or 90 degrees.

Tan( Radians(60) ) Returns the tangent of 1.047197... 1.732050...


radians or 60 degrees.

Acos( 0.5 ) Returns the arccosine of 0.5, in radians. 1.047197...

Acot( 1 ) Returns the arccotangent of 1, in 0.785398...


radians.

Asin( 1 ) Returns the arcsine of 1, in radians. 1.570796...

Atan( 1.732050 ) Returns the arctangent of 1.732050, in 1.047197...


radians.

Atan2( 5, 3 ) Returns the arctangent of the angle 0.540419...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (5,3),
which is approximately 31 degrees.

Atan2( 4, 4 ) Returns the arctangent of the angle 0.785398...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (4,4),
which is exactly π/4 radians or 45
degrees.

Degrees( 1.047197 ) Returns the equivalent number of 60


degrees for 1.047197 radians.

Pi() Returns the transcendental number π. 3.141592...

Radians( 15 ) Returns the equivalent number of 0.261799...


radians for 15 degrees.

Single -column table


The examples in this section use a data source that's named ValueTable and that contains the following data. The
last record in the table is π/2 radians or 90 degrees.

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Cos( ValueTable ) Returns the cosine of each number in


the table.

Cot( ValueTable ) Returns the cotangent of each number


in the table.

Sin( ValueTable ) Returns the sine of each number in the


table.

Tan( ValueTable ) Returns the tangent of each number in


the table.

Acos( ValueTable ) Returns the arccosine of each number in


the table.

Acot( ValueTable ) Returns the arccotangent of each


number in the table.

Asin( ValueTable ) Returns the arcsine of each number in


the table.

Atan( ValueTable ) Returns the arctangent of each number


in the table.
FORMULA DESCRIPTION RESULT

Degrees( ValueTable ) Returns the equivalent number of


degrees for each number in the table,
assumed to be angles in radians.

Radians( ValueTable ) Returns the equivalent number of


radians for each number in the table,
assumed to be angles in degrees.
Assert function in Power Apps Test Studio
1/21/2020 • 2 minutes to read • Edit Online

An assertion is a condition or an expression that evaluates to true or false in a test. If the expression returns false,
the test case will fail. Assertions are used to validate the expected result of a test or test step, against the actual
result and to fail the test if the condition is false. Assertions can be used to validate the state of controls in your app
such as label values, list box selections and other control properties.
Assertion messages, for both passed and failed assertions, are also contained in a Traces table in the
TestCaseResult record.

Syntax
Assert(expression, message)
Expression – Required. An expression that evaluates to true or false.
Message – Not Required. A message that describes the assertion failure.

Examples
Assert(lblResult.Text = "Success", "lblResult value Expected : Success , Actual : " & lblResult.Text)
Assert(ListBox1.Selected.Value = "Success", "ListBox1 selection Expected : Success, Actual : " &
ListBox1.Selected.Value)
Assert(kudosAfterTest = kudosBeforeTest + 1, "Kudos count. Expected : " & kudosBeforeTest + 1 & " Actual :" &
kudosAfterTest)

See Also
Test Studio Overview
Working with Test Studio
AsType and IsType functions in canvas apps
10/7/2019 • 4 minutes to read • Edit Online

Checks a record reference for a specific entity type (IsType) and treats the reference as a specific type (AsType).

Description
Read Understand record references and polymorphic lookups for a broader introduction and more details.
A lookup field usually refers to records in a particular entity. Because the entity type is well established, you can
access the fields of the lookup by using a simple dot notation. For example, First( Accounts ).'Primary
Contact'.'Full Name' walks from the Accounts entity to the Primary Contact record in the Contacts entity and
extracts the Full Name field.
Common Data Service also supports polymorphic lookup fields, which can refer to records from a set of entities, as
in these examples.

LOOKUP FIELD CAN REFER TO

Owner Users or Teams

Customer Accounts or Contacts

Regarding Accounts, Contacts, Knowledge Articles, etc.

In canvas-app formulas, you can use record references to work with polymorphic lookups. Because a record
reference can refer to different entities, you don't know which fields will be available when you write a formula. The
.Field notation isn't available. Those formulas must adapt to the records that the app encounters when it runs.
The IsType function tests whether a record reference refers to a specific entity type. The function returns a Boolean
TRUE or FALSE.
The AsType function treats a record reference as a specific entity type, sometimes referred to as casting. You can
use the result as if it were a record of the entity and, again, use the .Field notation to access all of the fields of that
record. An error occurs if the reference isn't of the specific type.
Use these functions together to first test the entity type of a record and then treat it as a record of that type so that
the fields are available:

If( IsType( First( Accounts ).Owner, Users ),


AsType( First( Accounts ).Owner, Users ).'Full Name',
AsType( First( Accounts ).Owner, Teams ).'Team Name'
)

You need these functions only if you're accessing the fields of a record reference. For example, you can use record
references in the Filter function without IsType or AsType:

Filter( Accounts, Owner = First( Users ) )

Similarly, you can use record references with the Patch function:
Patch( Accounts, First( Accounts ), { Owner: First( Teams ) } )

If used in a record context, such as within a Gallery or Edit form control, you might need to use the global
disambiguation operator to reference the entity type. For example, this formula would be effective for a gallery
that's displaying a list of contacts where Company Name is a Customer lookup:

If( IsType( ThisItem.'Company Name', [@Accounts] ),


AsType( ThisItem.'Company Name', [@Accounts] ).'Account Name',
AsType( ThisItem.'Company Name', [@Contacts] ).'Full Name'
)

For both functions, you specify the type through the name of the data source that's connected to the entity. For the
formula to work, you must also add a data source to the app for any types that you want to test or cast. For
example, you must add the Users entity as a data source if you want to use IsType and AsType with an Owner
lookup and records from that entity. You can add only the data sources that you actually use in your app; you don't
need to add all the entities that a lookup could reference.
If the record reference is blank, IsType returns FALSE, and AsType returns blank. All fields of a blank record will
be blank.

Syntax
AsType( RecordReference, EntityType )
RecordReference - Required. A record reference, often a lookup field that can refer to a record in any of multiple
entities.
EntityType - Required. The specific entity for which to test.
IsType( RecordReference, EntityType )
RecordReference - Required. A record reference, often a lookup field that can refer to a record in any of multiple
entities.
EntityType - Required. The specific entity to which the record should be cast.

Example
Understand record references and polymorphic lookups contains extensive examples.
1. Create a blank canvas app for tablets.
2. On the View tab, select Data sources, and then add the Contacts and Accounts entities as data sources.
3. Insert a Gallery control with a Blank vertical orientation.

4. On the Properties tab near the right side of the screen, set the gallery's Items property to Contacts.

5. Set the gallery's layout to Title and subtitle.


6. In the Data pane, open the Title1 list, and then select Full Name.

7. Select the Subtitle1 label control.


8. Set the Text property of Subtitle1 to this formula:

If( IsBlank( ThisItem.'Company Name' ), "--",


IsType( ThisItem.'Company Name', [@Accounts] ),
"Account: " & AsType( ThisItem.'Company Name', [@Accounts] ).'Account Name',
"Contact: " & AsType( ThisItem.'Company Name', [@Contacts] ).'Full Name'
)

The subtitle in the gallery shows these values:


"--" if the 'Company Name' is blank.
"Account: " and then the Account Name field from the Accounts entity if the Company Name field
refers to an account.
"Contact: " and then the Full Name field from the Contacts entity if the Company Name field refers to
a contact.
Your results might differ from those in this topic because it uses sample data that was modified to show
additional types of results.
Acos, Acot, Asin, Atan, Atan2, Cos, Cot, Degrees, Pi,
Radians, Sin, and Tan functions in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Calculates trigonometric values.

Description
Primary functions
The Cos function returns the cosine of its argument, an angle specified in radians.
The Cot function returns the cotangent of its argument, an angle specified in radians.
The Sin function returns the sine of its argument, an angle specified in radians.
The Tan function returns the tangent of its argument, an angle specified in radians.
Inverse functions
The Acos function returns the arccosine, or inverse cosine, of its argument. The arccosine is the angle whose cosine
is the argument. The returned angle is given in radians in the range 0 (zero) to π.
The Acot function returns the principal value of the arccotangent, or inverse cotangent, of its argument. The
returned angle is given in radians in the range 0 (zero) to π.
The Asin function returns the arcsine, or inverse sine, of its argument. The arcsine is the angle whose sine is the
argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan function returns the arctangent, or inverse tangent, of its argument. The arctangent is the angle whose
tangent is the argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan2 function returns the arctangent, or inverse tangent, of the specified x and y coordinates as arguments.
The arctangent is the angle from the x-axis to a line that contains the origin (0, 0) and a point with coordinates (x, y).
The angle is given in radians between -π and π, excluding -π. A positive result represents a counterclockwise angle
from the x-axis; a negative result represents a clockwise angle. Atan2( a, b ) equals Atan( b/a ), except that a can
equal 0 (zero) with the Atan2 function.
Helper functions
The Degrees function converts radians to degrees. π radians equals 180 degrees.
The Pi function returns the transcendental number π, which begins 3.141592...
The Radians function converts degrees to radians.
Notes
If you pass a single number to these functions, the return value is a single result. If you pass a single-column table
that contains numbers, the return value is a single-column table of results, one result for each record in the
argument's table. If you have a multi-column table, you can shape it into a single-column table, as working with
tables describes.
If an argument would result in an undefined value, the result is blank. This can happen, for example, when using
inverse functions with arguments that are out of range.
Syntax
Primary Functions
Cos( Radians )
Cot( Radians )
Sin( Radians )
Tan( Radians )
Radians - Required. Angle to operate on.
Cos( SingleColumnTable )
Cot( SingleColumnTable )
Sin( SingleColumnTable )
Tan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of angles to operate on.
Inverse Functions
Acos( Number )
Acot( Number )
Asin( Number )
Atan( Number )
Number - Required. Number to operate on.
Acos( SingleColumnTable )
Acot( SingleColumnTable )
Asin( SingleColumnTable )
Atan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of numbers to operate on.
Atan2( X, Y )
X - Required. X-axis coordinate.
Y - Required. Y -axis coordinate.
Helper Functions
Degrees( Radians )
Radians - Required. Angle in radians to convert to degrees.
Pi()
Radians( Degrees )
Degrees - Required. Angle in degrees to convert to radians.

Examples
Single number
FORMULA DESCRIPTION RESULT

Cos( 1.047197 ) Returns the cosine of 1.047197 radians 0.5


or 60 degrees.
FORMULA DESCRIPTION RESULT

Cot( Pi()/4 ) Returns the cotangent of 0.785398... 1


radians or 45 degrees.

Sin( Pi()/2 ) Returns the sine of 1.570796... radians 1


or 90 degrees.

Tan( Radians(60) ) Returns the tangent of 1.047197... 1.732050...


radians or 60 degrees.

Acos( 0.5 ) Returns the arccosine of 0.5, in radians. 1.047197...

Acot( 1 ) Returns the arccotangent of 1, in 0.785398...


radians.

Asin( 1 ) Returns the arcsine of 1, in radians. 1.570796...

Atan( 1.732050 ) Returns the arctangent of 1.732050, in 1.047197...


radians.

Atan2( 5, 3 ) Returns the arctangent of the angle 0.540419...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (5,3),
which is approximately 31 degrees.

Atan2( 4, 4 ) Returns the arctangent of the angle 0.785398...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (4,4),
which is exactly π/4 radians or 45
degrees.

Degrees( 1.047197 ) Returns the equivalent number of 60


degrees for 1.047197 radians.

Pi() Returns the transcendental number π. 3.141592...

Radians( 15 ) Returns the equivalent number of 0.261799...


radians for 15 degrees.

Single -column table


The examples in this section use a data source that's named ValueTable and that contains the following data. The
last record in the table is π/2 radians or 90 degrees.

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Cos( ValueTable ) Returns the cosine of each number in


the table.

Cot( ValueTable ) Returns the cotangent of each number


in the table.

Sin( ValueTable ) Returns the sine of each number in the


table.

Tan( ValueTable ) Returns the tangent of each number in


the table.

Acos( ValueTable ) Returns the arccosine of each number in


the table.

Acot( ValueTable ) Returns the arccotangent of each


number in the table.

Asin( ValueTable ) Returns the arcsine of each number in


the table.

Atan( ValueTable ) Returns the arctangent of each number


in the table.
FORMULA DESCRIPTION RESULT

Degrees( ValueTable ) Returns the equivalent number of


degrees for each number in the table,
assumed to be angles in radians.

Radians( ValueTable ) Returns the equivalent number of


radians for each number in the table,
assumed to be angles in degrees.
Acos, Acot, Asin, Atan, Atan2, Cos, Cot, Degrees, Pi,
Radians, Sin, and Tan functions in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Calculates trigonometric values.

Description
Primary functions
The Cos function returns the cosine of its argument, an angle specified in radians.
The Cot function returns the cotangent of its argument, an angle specified in radians.
The Sin function returns the sine of its argument, an angle specified in radians.
The Tan function returns the tangent of its argument, an angle specified in radians.
Inverse functions
The Acos function returns the arccosine, or inverse cosine, of its argument. The arccosine is the angle whose cosine
is the argument. The returned angle is given in radians in the range 0 (zero) to π.
The Acot function returns the principal value of the arccotangent, or inverse cotangent, of its argument. The
returned angle is given in radians in the range 0 (zero) to π.
The Asin function returns the arcsine, or inverse sine, of its argument. The arcsine is the angle whose sine is the
argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan function returns the arctangent, or inverse tangent, of its argument. The arctangent is the angle whose
tangent is the argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan2 function returns the arctangent, or inverse tangent, of the specified x and y coordinates as arguments.
The arctangent is the angle from the x-axis to a line that contains the origin (0, 0) and a point with coordinates (x, y).
The angle is given in radians between -π and π, excluding -π. A positive result represents a counterclockwise angle
from the x-axis; a negative result represents a clockwise angle. Atan2( a, b ) equals Atan( b/a ), except that a can
equal 0 (zero) with the Atan2 function.
Helper functions
The Degrees function converts radians to degrees. π radians equals 180 degrees.
The Pi function returns the transcendental number π, which begins 3.141592...
The Radians function converts degrees to radians.
Notes
If you pass a single number to these functions, the return value is a single result. If you pass a single-column table
that contains numbers, the return value is a single-column table of results, one result for each record in the
argument's table. If you have a multi-column table, you can shape it into a single-column table, as working with
tables describes.
If an argument would result in an undefined value, the result is blank. This can happen, for example, when using
inverse functions with arguments that are out of range.
Syntax
Primary Functions
Cos( Radians )
Cot( Radians )
Sin( Radians )
Tan( Radians )
Radians - Required. Angle to operate on.
Cos( SingleColumnTable )
Cot( SingleColumnTable )
Sin( SingleColumnTable )
Tan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of angles to operate on.
Inverse Functions
Acos( Number )
Acot( Number )
Asin( Number )
Atan( Number )
Number - Required. Number to operate on.
Acos( SingleColumnTable )
Acot( SingleColumnTable )
Asin( SingleColumnTable )
Atan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of numbers to operate on.
Atan2( X, Y )
X - Required. X-axis coordinate.
Y - Required. Y -axis coordinate.
Helper Functions
Degrees( Radians )
Radians - Required. Angle in radians to convert to degrees.
Pi()
Radians( Degrees )
Degrees - Required. Angle in degrees to convert to radians.

Examples
Single number
FORMULA DESCRIPTION RESULT

Cos( 1.047197 ) Returns the cosine of 1.047197 radians 0.5


or 60 degrees.
FORMULA DESCRIPTION RESULT

Cot( Pi()/4 ) Returns the cotangent of 0.785398... 1


radians or 45 degrees.

Sin( Pi()/2 ) Returns the sine of 1.570796... radians 1


or 90 degrees.

Tan( Radians(60) ) Returns the tangent of 1.047197... 1.732050...


radians or 60 degrees.

Acos( 0.5 ) Returns the arccosine of 0.5, in radians. 1.047197...

Acot( 1 ) Returns the arccotangent of 1, in 0.785398...


radians.

Asin( 1 ) Returns the arcsine of 1, in radians. 1.570796...

Atan( 1.732050 ) Returns the arctangent of 1.732050, in 1.047197...


radians.

Atan2( 5, 3 ) Returns the arctangent of the angle 0.540419...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (5,3),
which is approximately 31 degrees.

Atan2( 4, 4 ) Returns the arctangent of the angle 0.785398...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (4,4),
which is exactly π/4 radians or 45
degrees.

Degrees( 1.047197 ) Returns the equivalent number of 60


degrees for 1.047197 radians.

Pi() Returns the transcendental number π. 3.141592...

Radians( 15 ) Returns the equivalent number of 0.261799...


radians for 15 degrees.

Single -column table


The examples in this section use a data source that's named ValueTable and that contains the following data. The
last record in the table is π/2 radians or 90 degrees.

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Cos( ValueTable ) Returns the cosine of each number in


the table.

Cot( ValueTable ) Returns the cotangent of each number


in the table.

Sin( ValueTable ) Returns the sine of each number in the


table.

Tan( ValueTable ) Returns the tangent of each number in


the table.

Acos( ValueTable ) Returns the arccosine of each number in


the table.

Acot( ValueTable ) Returns the arccotangent of each


number in the table.

Asin( ValueTable ) Returns the arcsine of each number in


the table.

Atan( ValueTable ) Returns the arctangent of each number


in the table.
FORMULA DESCRIPTION RESULT

Degrees( ValueTable ) Returns the equivalent number of


degrees for each number in the table,
assumed to be angles in radians.

Radians( ValueTable ) Returns the equivalent number of


radians for each number in the table,
assumed to be angles in degrees.
Average, Max, Min, StdevP, Sum, and VarP functions
in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Aggregate functions that summarize a set of numbers.

Description
The Average function calculates the average, or arithmetic mean, of its arguments.
The Max function finds the maximum value.
The Min function finds the minimum value.
The Sum function calculates the sum of its arguments.
The StdevP function calculates the standard deviation of its arguments.
The VarP function calculates the variance of its arguments.
You can supply the values for these functions as:
Separate arguments. For example, Sum ( 1, 2, 3 ) returns 6.
A table and a formula to operate over that table. The aggregate will be calculated on the values of the formula
for each record.
Fields of the record currently being processed are available within the formula. You simply reference them by name
as you would any other value. You can also reference control properties and other values from throughout your
app. For more details, see the examples below and working with record scope.
These functions operate on numeric values only. Other types of values, such as strings or records, are ignored. Use
the Value function to convert a string into a number.
The Average, Max, Min, and Sum functions can be delegated when used with a data source that supports
delegation for these functions. However, StdevP and VarP can't be delegated for any data sources. If delegation is
not supported, only the first portion of the data will be retrieved and then the function applied locally. The result
may not represent the complete story. A delegation warning will appear at authoring time to remind you of this
limitation and to suggest switching to delegable alternatives where possible. For more information, see the
delegation overview.

Syntax
Average( NumericalFormula1, [ NumericalFormula2, ... ] )
Max( NumericalFormula1, [ NumericalFormula2, ... ] )
Min( NumericalFormula1, [ NumericalFormula2, ... ] )
Sum ( NumericalFormula1, [ NumericalFormula2, ... ] )
StdevP ( NumericalFormula1, [ NumericalFormula2, ... ] )
VarP ( NumericalFormula1, [ NumericalFormula2, ... ] )
NumericalFormula (s) - Required. Numeric values to operate on.
Average( Table, NumericalFormula )
Max( Table, NumericalFormula )
Min( Table, NumericalFormula )
Sum ( Table, NumericalFormula )
StdevP ( Table, NumericalFormula )
VarP ( Table, NumericalFormula )
Table - Required. Table to operate on.
NumericalFormula - Required. Formula to evaluate for each record. The result of this formula is used for the
aggregation. You can use columns of the table in the formula.

Examples
Step by step
Let's say that you had a data source named Sales that contained a CostPerUnit column and a UnitsSold column,
and you set the Text property of a label to this function:
Sum (Sales, CostPerUnit * UnitsSold)
The label would show total sales by multiplying the values in those columns for each record and then adding the
results from all records together:

As a different example, let's say that you had sliders that were named Slider1, Slider2, and Slider3 and a label
with its Text property set to this formula:
Sum (Slider1.Value, Slider2.Value, Slider3.Value)
The label would show the sum of all values to which the sliders were set.
Back and Navigate functions in Power Apps
12/3/2019 • 5 minutes to read • Edit Online

Changes which screen is displayed.

Overview
Most apps contain multiple screens. Use the Back and Navigate function to change which screen is displayed. For
example, set the OnSelect property of a button to a formula that includes a Navigate function if you want to show
a different screen when a user selects that button. In that formula, you can specify a visual transition, such as Fade,
to control how one screen changes to another.
Back and Navigate change only which screen is displayed. Screens that aren't currently displayed continue to
operate behind the scenes. You can build formulas that refer to properties of controls on other screens. For
example, a user can change the value of a slider on one screen, navigate to a different screen that uses that value in
a formula, and ascertain how it affects what happens in the new screen. The user can then navigate back to the
original screen and confirm that the slider has retained its value.
Context variables are also preserved when a user navigates between screens. You can use Navigate to set one or
more context variables for the screen that the formula will display, which is the only way to set a context variable
from outside the screen. You can use this approach to pass parameters to a screen. If you've used another
programming tool, this approach is similar to passing parameters to procedures.
You can use either function only within a behavior formula.

Navigate
In the first argument, specify the name of the screen to display.
In the second argument, specify how the old screen changes to the new screen:

TRANSITION ARGUMENT DESCRIPTION DEMONSTRATION

ScreenTransition.Cover The new screen slides into view, moving


right to left, to cover the current screen.

ScreenTransition.CoverRight The new screen slides into view, moving


left to right, to cover the current screen.
TRANSITION ARGUMENT DESCRIPTION DEMONSTRATION

ScreenTransition.Fade The current screen fades away to reveal


the new screen.

ScreenTransition.None (Default) The new screen quickly replaces the


current screen.

ScreenTransition.UnCover The current screen slides out of view,


moving right to left, to uncover the new
screen.

ScreenTransition.UnCoverRight The current screen slides out of view,


moving left to right, to uncover the new
screen.

You can use Navigate to create or update context variables of the new screen. As an optional third argument, pass
a record that contains the context-variable name as a column name and the new value for the context variable. This
record is the same as the record that you use with the UpdateContext function.
Set the OnHidden property of the old screen, the OnVisible property of the new screen, or both to make
additional changes during the transition. The App.ActiveScreen property will be updated to reflect the change.
Navigate normally returns true but will return false if an error is encountered.

Back
The Back function returns to the screen that was most recently displayed.
For each Navigate call, the app tracks the screen that appeared and the transition. You can use successive Back
calls to return all the way to the screen that appeared when the user started the app.
When the Back function runs, the inverse transition is used by default. For example, if a screen appeared through
the CoverRight transition, Back uses UnCover (which is to the left) to return. Fade and None are their own
inverses. Pass an optional argument to Back to force a specific transition.
Back normally returns true but returns false if the user hasn't navigated to another screen since starting the app.

Syntax
Back( [ Transition ] )
Transition - Optional. The visual transition to use between the current screen and the previous screen. Refer to
the list of valid values for this argument earlier in this topic. By default, the transition through which a screen
returns is the inverse of the transition through which it appeared.
Navigate( Screen [, Transition [, UpdateContextRecord ] ] )
Screen - Required. The screen to display.
Transition - Optional. The visual transition to use between the current screen and the next screen. See the list of
valid values for this argument earlier in this topic. The default value is None.
UpdateContextRecord - Optional. A record that contains the name of at least one column and a value for each
column. This record updates the context variables of the new screen as if passed to the UpdateContext
function.

Examples
FORMULA DESCRIPTION RESULT

Navigate( Details ) Displays the Details screen with no The Details screen appears quickly.
transition or change in value for a
context variable.

Navigate( Details, Displays the Details screen with a Fade The current screen fades away to show
ScreenTransition.Fade ) transition. No value of a context variable the Details screen.
is changed.

Navigate( Details, Displays the Details screen with a Fade The current screen fades away to show
ScreenTransition.Fade, { ID: 12 } ) transition, and updates the value of the the Details screen, and the context
ID context variable to 12. variable ID on that screen is set to 12.

Navigate( Details, Displays the Details screen with a Fade The current screen fades away to show
ScreenTransition.Fade, transition. Updates the value of the ID the Details screen. The context variable
{ ID: 12 , Shade: Color.Red } ) context variable to 12, and updates the ID on the Details screen is set to 12,
value of the Shade context variable to and the context variable Shade is set to
Color.Red. Color.Red. If you set the Fill property
of a control on the Details screen to
Shade, that control would display as
red.

Back() Displays the previous screen with the Displays the previous screen through
default return transition. the inverse transition of the transition
through which the current screen
appeared.

Back( ScreenTransition.Cover ) Displays the previous screen with the Displays the previous screen through
Cover transition. the Cover transition, regardless of the
transition through which the current
screen appeared.

Step-by-step
1. Create a blank app.
2. Add a second screen to it.
The app contains two blank screens: Screen1 and Screen2.
3. Set the Fill property of Screen2 to the value Gray .
4. On Screen2, add a button, and set its OnSelect property to this formula:
Navigate( Screen1, ScreenTransition.Cover )

5. While holding down the Alt key, select the button.


Screen1 appears with a white background through a transition that covers to the left.
6. On Screen1, add a button, and set its OnSelect property to this formula:

Back()

7. While holding down the Alt key, select the button.


The second screen appears with a gray background through a transition that uncovers to the right (the
inverse of Cover).
8. Select the button on each screen repeatedly to bounce back and forth.
Another example
Blank, Coalesce, IsBlank, and IsEmpty functions in
Power Apps
12/3/2019 • 7 minutes to read • Edit Online

Tests whether a value is blank or a table contains no records, and provides a way to create blank values.

Overview
Blank is a placeholder for "no value" or "unknown value." For example, a Combo box control's Selected property
is blank if the user hasn't made a selection. Many data sources can store and return NULL values, which are
represented in Power Apps as blank.
Any property or calculated value in Power Apps can be blank. For example, a Boolean value normally has one of
two values: true or false. But in addition to these two, it can also be blank indicating that the state is not known.
This is similar to Microsoft Excel, where a worksheet cell starts out as blank with no contents but can hold the
values TRUE or FALSE (among others). At any time, the contents of the cell can again be cleared, returning it to a
blank state.
Empty string refers to a string that contains no characters. The Len function returns zero for such a string and it can
be written in a formulas as two double quotes with nothing in between "" . Some controls and data sources use an
empty string to indicate a "no value" condition. To simplify app creation, the IsBlank and Coalesce functions test
for both blank values or empty strings.
In the context of the IsEmpty function, empty is specific to tables that contain no records. The table structure may
be intact, complete with column names, but no data is in the table. A table may start as empty, take on records and
no longer be empty, and then have the records removed and again be empty.

NOTE
We are in a period of transition. Until now, blank has also been used to report errors, making it impossible to differentiate a
valid "no value" from an error. For this reason, at this time, storing blank values is supported only for local collections. You can
store blank values in other data sources if you turn on the "Formula-level error management" experimental feature under the
File menu, App settings, Advanced settings, Experimental features. We are actively working to finish this feature and complete
the proper separation of blank values from errors.

Description
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.
The IsBlank function tests for a blank value or an empty string. The test includes empty strings to ease app
creation since some data sources and controls use an empty string when there is no value present. To test
specifically for a blank value use if( Value = Blank(), ... instead of IsBlank.
The Coalesce function evaluates its arguments in order and returns the first value that isn't blank or an empty
string. Use this function to replace a blank value or empty string with a different value but leave non-blank and
non-empty string values unchanged. If all of the arguments are blank or empty strings then the function returns
blank, making Coalesce a good way to convert empty strings to blank values. All arguments to Coalesce must be
of the same type; for example, you can't mix numbers with text strings.
Coalesce( value1, value2 ) is the more concise equivalent of
If( Not IsBlank( value1 ), value1, Not IsBlank( value2 ), value2 ) and doesn't require value1 and value2 to be
evaluated twice. The If function returns blank if there is no "else" formula as is the case here.
The IsEmpty function tests whether a table contains any records. It's equivalent to using the CountRows function
and checking for zero. You can check for data-source errors by combining IsEmpty with the Errors function.
The return value for both IsBlank and IsEmpty is a Boolean true or false.

Syntax
Blank()
Coalesce( Value1 [, Value2, ... ] )
Value(s) – Required. Values to test. Each value is evaluated in order until a value that is not blank and not an
empty string is found. Values after this point are not evaluated.
IsBlank( Value )
Value – Required. Value to test for a blank value or empty string.
IsEmpty( Table )
Table - Required. Table to test for records.

Examples
Blank

NOTE
At this time, the following example only works for local collections. You can store blank values in other data sources if you
turn on the "Formula-level error management" experimental feature under the File menu, App settings, Advanced settings,
Experimental features. We are actively working to finish this feature and complete the separation of blank values from errors.

1. Create an app from scratch, and add a Button control.


2. Set the button's OnSelect property to this formula:

ClearCollect( Cities, { Name: "Seattle", Weather: "Rainy" } )

3. Preview your app, click or tap the button that you added, and then close Preview.
4. On the File menu, click or tap Collections.
The Cities collection appears, showing one record with "Seattle" and "Rainy":
5. Click or tap the back arrow to return to the default workspace.
6. Add a Label control, and set its Text property to this formula:

IsBlank( First( Cities ).Weather )

The label shows false because the Weather field contains a value ("Rainy").
7. Add a second button, and set its OnSelect property to this formula:

Patch( Cities, First( Cities ), { Weather: Blank() } )

8. Preview your app, click or tap the button that you added, and then close Preview.
The Weather field of the first record in Cities is replaced with a blank, removing the "Rainy" that was there
previously.

The label shows true because the Weather field no longer contains a value.
Coalesce
FORMULA DESCRIPTION RESULT

Coalesce( Blank(), 1 ) Tests the return value from the Blank 1


function, which always returns a blank
value. Because the first argument is
blank, evaluation continues with the
next argument until a non-blank value
and non-empty string is found.
FORMULA DESCRIPTION RESULT

Coalesce( "", 2 ) Tests the first argument which is an 2


empty string. Because the first
argument is an empty string, evaluation
continues with the next argument until
a non-blank value and non-empty
string is found.

Coalesce( Blank(), "", Blank(), "", 3, 4 Coalesce starts at the beginning of the 3
) argument list and evaluates each
argument in turn until a non-blank
value and non-empty string is found. In
this case, the first four arguments all
return blank or an empty string, so
evaluation continues to the fifth
argument. The fifth argument is
non-blank and non-empty string, so
evaluation stops here. The value of the
fifth argument is returned, and the sixth
argument isn't evaluated.

Coalesce( "" ) Tests the first argument which is an blank


empty string. Because the first
argument is an empty string, and there
are no more arguments, the function
returns blank.

IsBlank
1. Create an app from scratch, add a text-input control, and name it FirstName.
2. Add a label, and set its Text property to this formula:

If( IsBlank( FirstName.Text ), "First Name is a required field." )

By default, the Text property of a text-input control is set to "Text input". Because the property contains a
value, it isn't blank, and the label doesn't display any message.
3. Remove all the characters from the text-input control, including any spaces.
Because the Text property no longer contains any characters, it's an empty string, and IsBlank(
FirstName.Text ) will be true. The required field message is displayed.
For information about how to perform validation by using other tools, see the Validate function and working with
data sources.
Other examples:

FORMULA DESCRIPTION RESULT

IsBlank( Blank() ) Tests the return value from the Blank true
function, which always returns a blank
value.

IsBlank( "" ) A string that contains no characters. true

IsBlank( "Hello" ) A string that contains one or more false


characters.
FORMULA DESCRIPTION RESULT

IsBlank( AnyCollection ) Because the collection exists, it isn't false


blank, even if it doesn't contain any
records. To check for an empty
collection, use IsEmpty instead.

IsBlank( Mid( "Hello", 17, 2 ) ) The starting character for Mid is true
beyond the end of the string. The result
is an empty string.

IsBlank( If( false, false ) ) An If function with no ElseResult. true


Because the condition is always false,
this If always returns blank.

IsEmpty
1. Create an app from scratch, and add a Button control.
2. Set the button's OnSelect property to this formula:
Collect( IceCream, { Flavor: "Strawberry", Quantity: 300 }, { Flavor: "Chocolate", Quantity: 100 } )
3. Preview your app, click or tap the button that you added, and then close Preview.
A collection named IceCream is created and contains this data:

This collection has two records and isn't empty. IsEmpty( IceCream ) returns false, and CountRows(
IceCream ) returns 2.
4. Add a second button, and set its OnSelect property to this formula:
Clear( IceCream )
5. Preview your app, click or tap the second button, and then close Preview.
The collection is now empty:

The Clear function removes all the records from a collection, resulting in an empty collection. IsEmpty(
IceCream ) returns true, and CountRows( IceCream ) returns 0.
You can also use IsEmpty to test whether a calculated table is empty, as these examples show:

FORMULA DESCRIPTION RESULT

IsEmpty( [ 1, 2, 3 ] ) The single-column table contains three false


records and, therefore, isn't empty.

IsEmpty( [ ] ) The single-column table contains no true


records and is empty.
FORMULA DESCRIPTION RESULT

IsEmpty( Filter( [ 1, 2, 3 ], Value > 5 ) The single-column table contains no true


) values that are greater than 5. The
result from the filter doesn't contain any
records and is empty.
Calendar and Clock functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Retrieves calendar and clock information about the current locale.

Description
The Calendar and Clock functions are a set of functions that retrieve information about the current locale.
You can use these functions to display dates and times in the language of the current user. The single-column tables
returned by Calendar and Clock functions can be used directly with the Items property of Dropdown and Listbox
controls.

FUNCTION DESCRIPTION

Calendar.MonthsLong() Single-column table containing the full names of each month,


starting with "January".

Calendar.MonthsShort() Single-column table containing the abbreviated names of each


month, starting with "Jan" for January.

Calendar.WeekdaysLong() Single-column table containing the full names of each


weekday, starting with "Sunday".

Calendar.WeekdaysShort() Single-column table containing the full names of each


weekday, starting with "Sun" for Sunday.

Clock.AmPm() Single-column table containing the long uppercase "AM" and


"PM" designations. If the language uses a 24-hour clock, the
table will be empty.

Clock.AmPmShort() Single-column table containing the short uppercase "A" and


"P" designations. If the language uses a 24-hour clock, the
table will be empty.

Clock.IsClock24() Boolean indicating if a 24-hour clock is used in this locale.

Use the Text function to format date and time values using this same information. The Language function returns
the current language and region code.

Syntax
Calendar.MonthsLong()
Calendar.MonthsShort()
Calendar.WeekdaysLong()
Calendar.WeekdaysShort()
Clock.AmPm ()
Clock.AmPmShort()
Clock.IsClock24()

Examples
1. Insert a Dropdown control.
2. Set the formula for the Items property to:
Calendar.MonthsLong()
3. Users of your app can now select a month in their own language. MonthsLong can be replaced with any of
the single-column tables that are returned by Calendar to create weekday and time selectors.
In the United States, with Language returning "en-US", the following is returned by the Calendar functions:

FORMULA DESCRIPTION RESULT

Calendar.MonthsLong() The return value contains the full name [ "January", "February", "March", "April",
of each month, starting with "January". "May", "June", "July", "August",
"September", "October", "November",
"December" ]

Calendar.MonthsShort() The return value contains the [ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
abbreviated name of each month, "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]
starting with "January".

Calendar.WeekdaysLong() The return value contains the full name [ "Sunday", "Monday", "Tuesday",
of each day, starting with "Sunday". "Wednesday", "Thursday", "Friday",
"Saturday" ]

Calendar.WeekdaysShort() The return value contains the [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri",
abbreviated name of each day, starting "Sat" ]
with "Sunday".

Clock.AmPm() This language uses a 12-hour clock. The [ "AM", "PM" ]


return value contains the uppercase
versions of the full AM and PM
designations.

Clock.AmPmShort() This language uses a 12-hour clock. The [ "A", "P" ]


return value contains the uppercase
versions of the short AM and PM
designations.

Clock.IsClock24() This language uses a 12-hour clock. false


Char function in Power Apps
3/1/2020 • 2 minutes to read • Edit Online

Translates a character code into a string.

Description
The Char function translates a number into a string with the corresponding ASCII character.

Syntax
Char( CharacterCode )
CharacterCode - Required. ASCII character code to translate.

Examples
FORMULA DESCRIPTION RESULT

Char( 65 ) Returns the character that corresponds "A"


to ASCII code 65.

Char( 105 ) Returns the character that corresponds "i"


to ASCII code 105.

Char( 35 ) Returns the character that corresponds "#"


to ASCII code 35.

Display a character map


1. On an empty screen in a tablet app, add a Gallery control with a Blank Horizontal layout, and then set
these properties:
Items: [0,1,2,3,4,5,6,7]
Width: 800
Height: 500
TemplateSize: 100
TemplatePadding: 0
2. Inside that gallery, add a Gallery control with a Blank Vertical layout, and then set these properties:
Items: ForAll( [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15], Value + ThisItem.Value * 16 )
Width: 100
Height: 500
TemplateSize: 30
TemplatePadding: 0
The value of the Items property multiplies 16 by the column number provided by the Value column of the
Items property from the first gallery (0-7 in ThisItem.Value ). The formula then adds the result to one of
the row numbers from the second gallery (0-15 in the record scope that the ForAll function provides).
3. Inside the second (vertical) gallery, add a Label control, and set these properties:
Text: ThisItem.Value
Width: 50
4. Inside the second (vertical) gallery, add another Label control, and set these properties:
Text: Char( ThisItem.Value )
Width: 50
X: 50
You've created a chart of the first 128 ASCII characters. Characters that appear as a small square can't be printed.

To show the extended ASCII characters, set the Items property of the second gallery to this formula, which adds
128 to each character value:
ForAll( [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15], Value + ThisItem.Value * 16 + 128)

To show the characters in a different font, set the Font property of the second label to a value such as 'Dancing
Script'.
Choices function in Power Apps
2/8/2020 • 3 minutes to read • Edit Online

Returns a table of the possible values for a lookup column.

Description
The Choices function returns a table of the possible values for a lookup column.
Use the Choices function to provide a list of choices for your user to select from. This function is commonly used
with the Combo box control in edit forms.
For a lookup, the table that Choices returns matches the foreign table that's associated with the lookup. By using
Choices, you eliminate the need to add the foreign table as an additional data source. Choices returns all columns
of the foreign table.
Because Choices returns a table, you can use Filter, Sort, AddColumns, and all the other table-manipulation
functions to filter, sort, and shape the table.
At this time, you can't delegate Choices. If this limitation poses a problem in your app, add the foreign entity as a
data source, and use it directly.
Choices doesn't require column names to be strings and enclosed in double quotes, unlike the ShowColumns,
Search, and other table functions. Provide the formula as if you were referencing the column directly.
Column references must be direct to the data source. For example, if the data source is Accounts and the lookup
is SLA, the column reference would be Accounts.SLA. The reference can't pass through a function, a variable, or a
control. Furthering this example, if Accounts is fed to a Gallery control, use the formula Gallery.Selected.SLA
to reference the SLA for the selected account. However, this reference has passed through a control, so it can't be
passed to the Columns function - you must still use Accounts.SLA.
At this time, you can use lookup columns only with SharePoint and Common Data Service.

Syntax
Choices( column-reference )
column-reference – Required. A lookup column of a data source. Don't enclose the column name in double
quotes. The reference must be directly to the column of the data source and not pass through a function or a
control.

Examples
Choices for a lookup
1. Create a database in Common Data Service, and select the Include sample apps and data box.
Many entities, such as Accounts, are created.
Note: Entity names are singular on make.powerapps.com and plural in Power Apps Studio.
The Accounts entity has a Primary Contact column, which is a lookup to the Contacts entity.

For each account, a contact is designated as the primary contact, or the primary contact is blank.
2. Generate an app from the Accounts entity.
3. In the list of screens and controls near the left edge, scroll down until EditScreen1 appears, and then select
EditForm1 just under it.

4. On the Properties tab of the right pane, select Edit fields.

5. In the Fields pane, select Add field.


6. Search for the Primary Contact field, select its check box, and then select Add.
The Primary Contact field appears at the bottom of the form. If the field shows an error, select Data
sources on the View tab, select the ellipsis (...) for the Accounts data source, and then select Refresh.
7. (optional) Drag the Primary Contact field from the bottom to the top of the list of fields.
8. In the card for Primary Contact, select the Combo box control.
The Items property of that control is set to a formula that identifies the column by either its display name,
as in the first example, or its logical name, as in the second example:
Choices( Accounts.'Primary Contact' )
Choices( Accounts.primarycontactid )

9. For illustration purposes, we can view the complete table returned by the Choices function in a Data table
control. On the Home tab, select New screen, and then select Blank.
10. On the Insert tab, select Data table.
11. Set the Items property of the Data table control to this formula:
Choices( Accounts.'Primary Contact' )
12. In the middle of the Data table control, select the link that starts Choose the fields..., and then select the
check boxes for the field or fields that you want to show (for example, firstname and lastname).
Collect, Clear, and ClearCollect functions in Power
Apps
12/3/2019 • 3 minutes to read • Edit Online

Creates and clears collections and adds records to any data source.

Description
Collect
The Collect function adds records to a data source. The items to be added can be:
A single value: The value is placed in the Value field of a new record. All other properties are left blank.
A record: Each named property is placed in the corresponding property of a new record. All other properties are
left blank.
A table: Each record of the table is added as a separate record of the data source as described above. The table is
not added as a nested table to a record. To accomplish this, wrap the table in a record first.
When used with a collection, additional columns will be created as needed. The columns for other data sources are
fixed by the data source and new columns cannot be added.
If the data source doesn't already exist, a collection is created.
Collections are sometimes used to hold global variables or make a temporary copy of a data source. Power Apps
are based on formulas that automatically recalculate as the user interacts with an app. Collections do not enjoy this
benefit and their use can make your app harder to create and understand. Before using a collection in this manner,
review working with variables.
You can also use the Patch function to create records in a data source.
Collect returns the modified data source as a table. Collect can only be used in a behavior formula.
Clear
The Clear function deletes all the records of a collection. The columns of the collection will remain.
Note that Clear only operates on collections and not other data sources. You can use RemoveIf( DataSource, true
) for this purpose. Use caution as this will remove all records from the data source's storage and can affect other
users.
You can use the Remove function to selectively remove records.
Clear has no return value. It can only be used in a behavior formula.
ClearCollect
The ClearCollect function deletes all the records from a collection and then adds a different set of records to the
same collection. With a single function, ClearCollect offers the combination of Clear and then Collect.
ClearCollect returns the modified collection as a table. ClearCollect can only be used in a behavior formula.

Syntax
Collect( DataSource, Item, ... )
DataSource – Required. The data source that you want to add data to. If it does not already exist, a new
collection is created.
Item (s) - Required. One or more records or tables to add to the data source.
Clear( Collection )
Collection – Required. The collection that you want to clear.
ClearCollect( Collection, Item, ... )
Collection – Required. The collection that you want to clear and then add data to.
Item (s) - Required. One or more records or tables to add to the data source.

Examples
Clearing and adding records to a data source
In these examples, you'll erase and add to a collection that's named IceCream. The data source begins with these
contents:

FORMULA DESCRIPTION RESULT

ClearCollect( IceCream, Clears all data from the IceCream


{ Flavor: "Strawberry", Quantity: 300 collection and then adds a record that
}) includes a quantity of strawberry ice
cream.
The IceCream collection has also been
modified.

Collect( IceCream, Adds two records to the IceCream


{ Flavor: "Pistachio", Quantity: 40 }, collection that includes a quantity of
{ Flavor: "Orange", Quantity: 200 } ) pistachio and orange ice cream.

The IceCream collection has also been


modified.

Clear( IceCream ) Removes all records from the IceCream


collection.
The IceCream collection has also been
modified.

For step-by-step examples of how to create a collection, see Create and update a collection.
Records and tables
These examples examine how record and table arguments to Collect and ClearCollect are handled.

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

ClearCollect( IceCream, Clear all data and then adds two records
{ Flavor: "Chocolate", Quantity: 100 } to the IceCream collection that includes
, { Flavor: "Vanilla", Quantity: 200 } ) a quantity of chocolate and vanilla ice
cream. The records to be added are
provided as individual arguments to the
function. The IceCream collection has also been
modified.

ClearCollect( IceCream, Table( Same as the previous example except


{ Flavor: "Chocolate", Quantity: 100 } that the records are combined in a table
, { Flavor: "Vanilla", Quantity: 200 } ) and passed in through a single
) argument. The contents of the table are
extracted record by record before being
added to the IceCream collection. The IceCream collection has also been
modified.

ClearCollect( IceCream, Same as the previous example except


{ MyFavorites: Table( that the table is wrapped in a record.
{ Flavor: "Chocolate", Quantity: 100 } The records of the table are not
, { Flavor: "Vanilla", Quantity: 200 } ) extracted and instead the entire table is
}) added as a sub-table of the record.

The IceCream collection has also been


modified.
Collect, Clear, and ClearCollect functions in Power
Apps
12/3/2019 • 3 minutes to read • Edit Online

Creates and clears collections and adds records to any data source.

Description
Collect
The Collect function adds records to a data source. The items to be added can be:
A single value: The value is placed in the Value field of a new record. All other properties are left blank.
A record: Each named property is placed in the corresponding property of a new record. All other properties are
left blank.
A table: Each record of the table is added as a separate record of the data source as described above. The table is
not added as a nested table to a record. To accomplish this, wrap the table in a record first.
When used with a collection, additional columns will be created as needed. The columns for other data sources are
fixed by the data source and new columns cannot be added.
If the data source doesn't already exist, a collection is created.
Collections are sometimes used to hold global variables or make a temporary copy of a data source. Power Apps
are based on formulas that automatically recalculate as the user interacts with an app. Collections do not enjoy this
benefit and their use can make your app harder to create and understand. Before using a collection in this manner,
review working with variables.
You can also use the Patch function to create records in a data source.
Collect returns the modified data source as a table. Collect can only be used in a behavior formula.
Clear
The Clear function deletes all the records of a collection. The columns of the collection will remain.
Note that Clear only operates on collections and not other data sources. You can use RemoveIf( DataSource, true
) for this purpose. Use caution as this will remove all records from the data source's storage and can affect other
users.
You can use the Remove function to selectively remove records.
Clear has no return value. It can only be used in a behavior formula.
ClearCollect
The ClearCollect function deletes all the records from a collection and then adds a different set of records to the
same collection. With a single function, ClearCollect offers the combination of Clear and then Collect.
ClearCollect returns the modified collection as a table. ClearCollect can only be used in a behavior formula.

Syntax
Collect( DataSource, Item, ... )
DataSource – Required. The data source that you want to add data to. If it does not already exist, a new
collection is created.
Item (s) - Required. One or more records or tables to add to the data source.
Clear( Collection )
Collection – Required. The collection that you want to clear.
ClearCollect( Collection, Item, ... )
Collection – Required. The collection that you want to clear and then add data to.
Item (s) - Required. One or more records or tables to add to the data source.

Examples
Clearing and adding records to a data source
In these examples, you'll erase and add to a collection that's named IceCream. The data source begins with these
contents:

FORMULA DESCRIPTION RESULT

ClearCollect( IceCream, Clears all data from the IceCream


{ Flavor: "Strawberry", Quantity: 300 collection and then adds a record that
}) includes a quantity of strawberry ice
cream.
The IceCream collection has also been
modified.

Collect( IceCream, Adds two records to the IceCream


{ Flavor: "Pistachio", Quantity: 40 }, collection that includes a quantity of
{ Flavor: "Orange", Quantity: 200 } ) pistachio and orange ice cream.

The IceCream collection has also been


modified.

Clear( IceCream ) Removes all records from the IceCream


collection.
The IceCream collection has also been
modified.

For step-by-step examples of how to create a collection, see Create and update a collection.
Records and tables
These examples examine how record and table arguments to Collect and ClearCollect are handled.

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

ClearCollect( IceCream, Clear all data and then adds two records
{ Flavor: "Chocolate", Quantity: 100 } to the IceCream collection that includes
, { Flavor: "Vanilla", Quantity: 200 } ) a quantity of chocolate and vanilla ice
cream. The records to be added are
provided as individual arguments to the
function. The IceCream collection has also been
modified.

ClearCollect( IceCream, Table( Same as the previous example except


{ Flavor: "Chocolate", Quantity: 100 } that the records are combined in a table
, { Flavor: "Vanilla", Quantity: 200 } ) and passed in through a single
) argument. The contents of the table are
extracted record by record before being
added to the IceCream collection. The IceCream collection has also been
modified.

ClearCollect( IceCream, Same as the previous example except


{ MyFavorites: Table( that the table is wrapped in a record.
{ Flavor: "Chocolate", Quantity: 100 } The records of the table are not
, { Flavor: "Vanilla", Quantity: 200 } ) extracted and instead the entire table is
}) added as a sub-table of the record.

The IceCream collection has also been


modified.
Calendar and Clock functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Retrieves calendar and clock information about the current locale.

Description
The Calendar and Clock functions are a set of functions that retrieve information about the current locale.
You can use these functions to display dates and times in the language of the current user. The single-column
tables returned by Calendar and Clock functions can be used directly with the Items property of Dropdown and
Listbox controls.

FUNCTION DESCRIPTION

Calendar.MonthsLong() Single-column table containing the full names of each month,


starting with "January".

Calendar.MonthsShort() Single-column table containing the abbreviated names of


each month, starting with "Jan" for January.

Calendar.WeekdaysLong() Single-column table containing the full names of each


weekday, starting with "Sunday".

Calendar.WeekdaysShort() Single-column table containing the full names of each


weekday, starting with "Sun" for Sunday.

Clock.AmPm() Single-column table containing the long uppercase "AM" and


"PM" designations. If the language uses a 24-hour clock, the
table will be empty.

Clock.AmPmShort() Single-column table containing the short uppercase "A" and


"P" designations. If the language uses a 24-hour clock, the
table will be empty.

Clock.IsClock24() Boolean indicating if a 24-hour clock is used in this locale.

Use the Text function to format date and time values using this same information. The Language function
returns the current language and region code.

Syntax
Calendar.MonthsLong()
Calendar.MonthsShort()
Calendar.WeekdaysLong()
Calendar.WeekdaysShort()
Clock.AmPm ()
Clock.AmPmShort()
Clock.IsClock24()

Examples
1. Insert a Dropdown control.
2. Set the formula for the Items property to:
Calendar.MonthsLong()
3. Users of your app can now select a month in their own language. MonthsLong can be replaced with any
of the single-column tables that are returned by Calendar to create weekday and time selectors.
In the United States, with Language returning "en-US", the following is returned by the Calendar functions:

FORMULA DESCRIPTION RESULT

Calendar.MonthsLong() The return value contains the full name [ "January", "February", "March", "April",
of each month, starting with "January". "May", "June", "July", "August",
"September", "October", "November",
"December" ]

Calendar.MonthsShort() The return value contains the [ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
abbreviated name of each month, "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]
starting with "January".

Calendar.WeekdaysLong() The return value contains the full name [ "Sunday", "Monday", "Tuesday",
of each day, starting with "Sunday". "Wednesday", "Thursday", "Friday",
"Saturday" ]

Calendar.WeekdaysShort() The return value contains the [ "Sun", "Mon", "Tue", "Wed", "Thu",
abbreviated name of each day, starting "Fri", "Sat" ]
with "Sunday".

Clock.AmPm() This language uses a 12-hour clock. [ "AM", "PM" ]


The return value contains the
uppercase versions of the full AM and
PM designations.

Clock.AmPmShort() This language uses a 12-hour clock. [ "A", "P" ]


The return value contains the
uppercase versions of the short AM
and PM designations.

Clock.IsClock24() This language uses a 12-hour clock. false


Blank, Coalesce, IsBlank, and IsEmpty functions in
Power Apps
12/3/2019 • 7 minutes to read • Edit Online

Tests whether a value is blank or a table contains no records, and provides a way to create blank values.

Overview
Blank is a placeholder for "no value" or "unknown value." For example, a Combo box control's Selected property
is blank if the user hasn't made a selection. Many data sources can store and return NULL values, which are
represented in Power Apps as blank.
Any property or calculated value in Power Apps can be blank. For example, a Boolean value normally has one of
two values: true or false. But in addition to these two, it can also be blank indicating that the state is not known.
This is similar to Microsoft Excel, where a worksheet cell starts out as blank with no contents but can hold the
values TRUE or FALSE (among others). At any time, the contents of the cell can again be cleared, returning it to a
blank state.
Empty string refers to a string that contains no characters. The Len function returns zero for such a string and it can
be written in a formulas as two double quotes with nothing in between "" . Some controls and data sources use an
empty string to indicate a "no value" condition. To simplify app creation, the IsBlank and Coalesce functions test
for both blank values or empty strings.
In the context of the IsEmpty function, empty is specific to tables that contain no records. The table structure may
be intact, complete with column names, but no data is in the table. A table may start as empty, take on records and
no longer be empty, and then have the records removed and again be empty.

NOTE
We are in a period of transition. Until now, blank has also been used to report errors, making it impossible to differentiate a
valid "no value" from an error. For this reason, at this time, storing blank values is supported only for local collections. You can
store blank values in other data sources if you turn on the "Formula-level error management" experimental feature under the
File menu, App settings, Advanced settings, Experimental features. We are actively working to finish this feature and complete
the proper separation of blank values from errors.

Description
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.
The IsBlank function tests for a blank value or an empty string. The test includes empty strings to ease app
creation since some data sources and controls use an empty string when there is no value present. To test
specifically for a blank value use if( Value = Blank(), ... instead of IsBlank.
The Coalesce function evaluates its arguments in order and returns the first value that isn't blank or an empty
string. Use this function to replace a blank value or empty string with a different value but leave non-blank and
non-empty string values unchanged. If all of the arguments are blank or empty strings then the function returns
blank, making Coalesce a good way to convert empty strings to blank values. All arguments to Coalesce must be
of the same type; for example, you can't mix numbers with text strings.
Coalesce( value1, value2 ) is the more concise equivalent of
If( Not IsBlank( value1 ), value1, Not IsBlank( value2 ), value2 ) and doesn't require value1 and value2 to be
evaluated twice. The If function returns blank if there is no "else" formula as is the case here.
The IsEmpty function tests whether a table contains any records. It's equivalent to using the CountRows function
and checking for zero. You can check for data-source errors by combining IsEmpty with the Errors function.
The return value for both IsBlank and IsEmpty is a Boolean true or false.

Syntax
Blank()
Coalesce( Value1 [, Value2, ... ] )
Value(s) – Required. Values to test. Each value is evaluated in order until a value that is not blank and not an
empty string is found. Values after this point are not evaluated.
IsBlank( Value )
Value – Required. Value to test for a blank value or empty string.
IsEmpty( Table )
Table - Required. Table to test for records.

Examples
Blank

NOTE
At this time, the following example only works for local collections. You can store blank values in other data sources if you
turn on the "Formula-level error management" experimental feature under the File menu, App settings, Advanced settings,
Experimental features. We are actively working to finish this feature and complete the separation of blank values from errors.

1. Create an app from scratch, and add a Button control.


2. Set the button's OnSelect property to this formula:

ClearCollect( Cities, { Name: "Seattle", Weather: "Rainy" } )

3. Preview your app, click or tap the button that you added, and then close Preview.
4. On the File menu, click or tap Collections.
The Cities collection appears, showing one record with "Seattle" and "Rainy":
5. Click or tap the back arrow to return to the default workspace.
6. Add a Label control, and set its Text property to this formula:

IsBlank( First( Cities ).Weather )

The label shows false because the Weather field contains a value ("Rainy").
7. Add a second button, and set its OnSelect property to this formula:

Patch( Cities, First( Cities ), { Weather: Blank() } )

8. Preview your app, click or tap the button that you added, and then close Preview.
The Weather field of the first record in Cities is replaced with a blank, removing the "Rainy" that was there
previously.

The label shows true because the Weather field no longer contains a value.
Coalesce
FORMULA DESCRIPTION RESULT

Coalesce( Blank(), 1 ) Tests the return value from the Blank 1


function, which always returns a blank
value. Because the first argument is
blank, evaluation continues with the
next argument until a non-blank value
and non-empty string is found.
FORMULA DESCRIPTION RESULT

Coalesce( "", 2 ) Tests the first argument which is an 2


empty string. Because the first
argument is an empty string, evaluation
continues with the next argument until
a non-blank value and non-empty
string is found.

Coalesce( Blank(), "", Blank(), "", 3, 4 Coalesce starts at the beginning of the 3
) argument list and evaluates each
argument in turn until a non-blank
value and non-empty string is found. In
this case, the first four arguments all
return blank or an empty string, so
evaluation continues to the fifth
argument. The fifth argument is
non-blank and non-empty string, so
evaluation stops here. The value of the
fifth argument is returned, and the sixth
argument isn't evaluated.

Coalesce( "" ) Tests the first argument which is an blank


empty string. Because the first
argument is an empty string, and there
are no more arguments, the function
returns blank.

IsBlank
1. Create an app from scratch, add a text-input control, and name it FirstName.
2. Add a label, and set its Text property to this formula:

If( IsBlank( FirstName.Text ), "First Name is a required field." )

By default, the Text property of a text-input control is set to "Text input". Because the property contains a
value, it isn't blank, and the label doesn't display any message.
3. Remove all the characters from the text-input control, including any spaces.
Because the Text property no longer contains any characters, it's an empty string, and IsBlank(
FirstName.Text ) will be true. The required field message is displayed.
For information about how to perform validation by using other tools, see the Validate function and working with
data sources.
Other examples:

FORMULA DESCRIPTION RESULT

IsBlank( Blank() ) Tests the return value from the Blank true
function, which always returns a blank
value.

IsBlank( "" ) A string that contains no characters. true

IsBlank( "Hello" ) A string that contains one or more false


characters.
FORMULA DESCRIPTION RESULT

IsBlank( AnyCollection ) Because the collection exists, it isn't false


blank, even if it doesn't contain any
records. To check for an empty
collection, use IsEmpty instead.

IsBlank( Mid( "Hello", 17, 2 ) ) The starting character for Mid is true
beyond the end of the string. The result
is an empty string.

IsBlank( If( false, false ) ) An If function with no ElseResult. true


Because the condition is always false,
this If always returns blank.

IsEmpty
1. Create an app from scratch, and add a Button control.
2. Set the button's OnSelect property to this formula:
Collect( IceCream, { Flavor: "Strawberry", Quantity: 300 }, { Flavor: "Chocolate", Quantity: 100 } )
3. Preview your app, click or tap the button that you added, and then close Preview.
A collection named IceCream is created and contains this data:

This collection has two records and isn't empty. IsEmpty( IceCream ) returns false, and CountRows(
IceCream ) returns 2.
4. Add a second button, and set its OnSelect property to this formula:
Clear( IceCream )
5. Preview your app, click or tap the second button, and then close Preview.
The collection is now empty:

The Clear function removes all the records from a collection, resulting in an empty collection. IsEmpty(
IceCream ) returns true, and CountRows( IceCream ) returns 0.
You can also use IsEmpty to test whether a calculated table is empty, as these examples show:

FORMULA DESCRIPTION RESULT

IsEmpty( [ 1, 2, 3 ] ) The single-column table contains three false


records and, therefore, isn't empty.

IsEmpty( [ ] ) The single-column table contains no true


records and is empty.
FORMULA DESCRIPTION RESULT

IsEmpty( Filter( [ 1, 2, 3 ], Value > 5 ) The single-column table contains no true


) values that are greater than 5. The
result from the filter doesn't contain any
records and is empty.
Collect, Clear, and ClearCollect functions in
Power Apps
12/3/2019 • 3 minutes to read • Edit Online

Creates and clears collections and adds records to any data source.

Description
Collect
The Collect function adds records to a data source. The items to be added can be:
A single value: The value is placed in the Value field of a new record. All other properties are left
blank.
A record: Each named property is placed in the corresponding property of a new record. All other
properties are left blank.
A table: Each record of the table is added as a separate record of the data source as described
above. The table is not added as a nested table to a record. To accomplish this, wrap the table in a
record first.
When used with a collection, additional columns will be created as needed. The columns for other
data sources are fixed by the data source and new columns cannot be added.
If the data source doesn't already exist, a collection is created.
Collections are sometimes used to hold global variables or make a temporary copy of a data source.
Power Apps are based on formulas that automatically recalculate as the user interacts with an app.
Collections do not enjoy this benefit and their use can make your app harder to create and
understand. Before using a collection in this manner, review working with variables.
You can also use the Patch function to create records in a data source.
Collect returns the modified data source as a table. Collect can only be used in a behavior formula.
Clear
The Clear function deletes all the records of a collection. The columns of the collection will remain.
Note that Clear only operates on collections and not other data sources. You can use RemoveIf(
DataSource, true ) for this purpose. Use caution as this will remove all records from the data
source's storage and can affect other users.
You can use the Remove function to selectively remove records.
Clear has no return value. It can only be used in a behavior formula.
ClearCollect
The ClearCollect function deletes all the records from a collection and then adds a different set of
records to the same collection. With a single function, ClearCollect offers the combination of Clear
and then Collect.
ClearCollect returns the modified collection as a table. ClearCollect can only be used in a behavior
formula.
Syntax
Collect( DataSource, Item, ... )
DataSource – Required. The data source that you want to add data to. If it does not already exist, a
new collection is created.
Item (s) - Required. One or more records or tables to add to the data source.
Clear( Collection )
Collection – Required. The collection that you want to clear.
ClearCollect( Collection, Item, ... )
Collection – Required. The collection that you want to clear and then add data to.
Item (s) - Required. One or more records or tables to add to the data source.

Examples
Clearing and adding records to a data source
In these examples, you'll erase and add to a collection that's named IceCream. The data source
begins with these contents:

FORMULA DESCRIPTION RESULT

ClearCollect( IceCream, Clears all data from the IceCream


{ Flavor: "Strawberry", Quantity collection and then adds a record
: 300 } ) that includes a quantity of
strawberry ice cream.
The IceCream collection has also
been modified.

Collect( IceCream, Adds two records to the


{ Flavor: "Pistachio", Quantity: IceCream collection that includes
40 }, a quantity of pistachio and orange
{ Flavor: "Orange", Quantity: 20 ice cream.
0})

The IceCream collection has also


been modified.

Clear( IceCream ) Removes all records from the


IceCream collection.
The IceCream collection has also
been modified.

For step-by-step examples of how to create a collection, see Create and update a collection.
Records and tables
These examples examine how record and table arguments to Collect and ClearCollect are handled.
FORMULA DESCRIPTION RESULT

ClearCollect( IceCream, Clear all data and then adds two


{ Flavor: "Chocolate", Quantity: records to the IceCream
100 }, collection that includes a quantity
{ Flavor: "Vanilla", Quantity: 20 of chocolate and vanilla ice cream.
0}) The records to be added are
provided as individual arguments The IceCream collection has also
to the function. been modified.

ClearCollect( IceCream, Table( Same as the previous example


{ Flavor: "Chocolate", Quantity: except that the records are
100 }, combined in a table and passed in
{ Flavor: "Vanilla", Quantity: 20 through a single argument. The
0})) contents of the table are extracted
record by record before being The IceCream collection has also
added to the IceCream collection. been modified.

ClearCollect( IceCream, Same as the previous example


{ MyFavorites: Table( except that the table is wrapped in
{ Flavor: "Chocolate", Quantity: a record. The records of the table
100 }, are not extracted and instead the
{ Flavor: "Vanilla", Quantity: 20 entire table is added as a sub-
0})}) table of the record.

The IceCream collection has also


been modified.
Color enumeration and ColorFade, ColorValue, and
RGBA functions in Power Apps
12/3/2019 • 7 minutes to read • Edit Online

Use built-in color values, define custom colors, and use the alpha channel.

Description
By using the Color enumeration, you can easily access the colors that are defined by HTML's Cascading Style
Sheets (CSS ). For example, Color.Red returns pure red. You can find a list of these colors at the end of this topic.
The ColorValue function returns a color based on a color string in a CSS. The string can take any of these forms:
CSS color name: "RoxyBrown" and "OliveDrab" are examples. These names don't include spaces. The list of
supported colors appears later in this topic.
6-digit hex value: As an example "#ffd700" is the same as "Gold". The string is in the format "#rrggbb"
where rr is the red portion in two hexadecimal digits, gg is the green, and bb is the blue.
8-digit hex value: As an example, "#ff7f5080" is the same as "Coral" with a 50% alpha channel. The string is
in the format "#rrggbbaa" where rr, gg, and bb are identical to the 6-digit form. The alpha channel is
represented by aa: 00 represents fully transparent, and ff represents fully opaque.
The RGBA function returns a color based on red, green, and blue components. The function also includes an alpha
channel for mixing colors of controls that are layered in front of one another. An alpha channel varies from 0 or 0%
(which is fully transparent and invisible) to 1 or 100% (which is fully opaque and completely blocks out any layers
behind a control).
The ColorFade function returns a brighter or darker version of a color. The amount of fade varies from -1 (which
fully darkens a color to black) to 0 (which doesn't affect the color) to 1 (which fully brightens a color to white).

Alpha channel
In a canvas app, you can layer controls in front of one another and specify the transparency of a control to any
controls that are behind it. As a result, colors will blend through the layers. For example, this diagram shows how
the three primary colors mix with an alpha setting of 50%:

You can also blend images in file formats that support alpha channels. For example, you can't blend .jpeg files, but
you can blend .png files. The next graphic shows the same red, green, and blue colors from the previous example,
but the red color appears as a squiggle (instead of a circle) in a .png file with a 50% alpha channel:

If you specify a Color enumeration value or you build a ColorValue formula with a color name or a 6-digit
hexadecimal value, the alpha setting is 100%, which is fully opaque.

Syntax
Color.ColorName
ColorName - Required. A Cascading Style Sheet (CSS ) color name. The list of possible enumeration values
appears at the end of this topic.
ColorValue( CSSColor )
CSSColor - Required. A Cascading Style Sheet (CSS ) color definition. You can specify either a name, such as
OliveDrab, or a hex value, such as #6b8e23 or #7fffd420. Hex values can take the form of either #rrggbb or
#rrggbbaa.
RGBA ( Red, Green, Blue, Alpha )
Red, Green, Blue - Required. Color-component values, which range from 0 (no saturation) to 255 (full
saturation).
Alpha - Required. Alpha component, which ranges from 0 (fully transparent) to 1 (fully opaque). You can also
use a percentage, 0% to 100%.
ColorFade( Color, FadeAmount )
Color - Required. A color value such as Color.Red or the output from ColorValue or RGBA.
FadeAmount - Required. A number between -1 and 1. -1 fully darkens a color to black, 0 doesn't affect the color,
and 1 fully brightens a color to white. You can also use a percentage from -100% to 100%.

Built-in colors
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.AliceBlue ColorValue( "#f0f8ff" ) RGBA( 240, 248, 255, 1 )


ColorValue( "aliceblue" )

Color.AntiqueWhite ColorValue( "#faebd7" ) RGBA( 250, 235, 215, 1 )


ColorValue(
"AntiqueWhite" )

Color.Aqua ColorValue( "#00ffff" ) RGBA( 0, 255, 255, 1 )


ColorValue( "AQUA" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.Aquamarine ColorValue( "#7fffd4" ) RGBA( 127, 255, 212, 1 )


ColorValue(
"Aquamarine" )

Color.Azure ColorValue( "#f0ffff" ) RGBA( 240, 255, 255, 1 )


ColorValue( "azure" )

Color.Beige ColorValue( "#f5f5dc" ) RGBA( 245, 245, 220, 1 )


ColorValue( "Beige" )

Color.Bisque ColorValue( "#ffe4c4" ) RGBA( 255, 228, 196, 1 )


ColorValue( "BISQUE" )

Color.Black ColorValue( "#000000" ) RGBA( 0, 0, 0, 1 )


ColorValue( "Black" )

Color.BlanchedAlmond ColorValue( "#ffebcd" ) RGBA( 255, 235, 205, 1 )


ColorValue(
"blanchedalmond" )

Color.Blue ColorValue( "#0000ff" ) RGBA( 0, 0, 255, 1 )


ColorValue( "Blue" )

Color.BlueViolet ColorValue( "#8a2be2" ) RGBA( 138, 43, 226, 1 )


ColorValue(
"BLUEVIOLET" )

Color.Brown ColorValue( "#a52a2a" ) RGBA( 165, 42, 42, 1 )


ColorValue( "Brown" )

Color.Burlywood ColorValue( "#deb887" ) RGBA( 222, 184, 135, 1 )


ColorValue( "burlywood" )

Color.CadetBlue ColorValue( "#5f9ea0" ) RGBA( 95, 158, 160, 1 )


ColorValue( "CadetBlue" )

Color.Chartreuse ColorValue( "#7fff00" ) RGBA( 127, 255, 0, 1 )


ColorValue(
"CHARTREUSE" )

Color.Chocolate ColorValue( "#d2691e" ) RGBA( 210, 105, 30, 1 )


ColorValue( "Chocolate" )

Color.Coral ColorValue( "#ff7f50" ) RGBA( 255, 127, 80, 1 )


ColorValue( "coral" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.CornflowerBlue ColorValue( "#6495ed" ) RGBA( 100, 149, 237, 1 )


ColorValue(
"CornflowerBlue" )

Color.Cornsilk ColorValue( "#fff8dc" ) RGBA( 255, 248, 220, 1 )


ColorValue( "CORNSILK" )

Color.Crimson ColorValue( "#dc143c" ) RGBA( 220, 20, 60, 1 )


ColorValue( "Crimson" )

Color.Cyan ColorValue( "#00ffff" ) RGBA( 0, 255, 255, 1 )


ColorValue( "cyan" )

Color.DarkBlue ColorValue( "#00008b" ) RGBA( 0, 0, 139, 1 )


ColorValue( "DarkBlue" )

Color.DarkCyan ColorValue( "#008b8b" ) RGBA( 0, 139, 139, 1 )


ColorValue(
"DARKCYAN" )

Color.DarkGoldenRod ColorValue( "#b8860b" ) RGBA( 184, 134, 11, 1 )


ColorValue(
"DarkGoldenRod" )

Color.DarkGray ColorValue( "#a9a9a9" ) RGBA( 169, 169, 169, 1 )


ColorValue( "darkgray" )

Color.DarkGreen ColorValue( "#006400" ) RGBA( 0, 100, 0, 1 )


ColorValue( "DarkGreen" )

Color.DarkGrey ColorValue( "#a9a9a9" ) RGBA( 169, 169, 169, 1 )


ColorValue( "DARKGREY" )

Color.DarkKhaki ColorValue( "#bdb76b" ) RGBA( 189, 183, 107, 1 )


ColorValue( "DarkKhaki" )

Color.DarkMagenta ColorValue( "#8b008b" ) RGBA( 139, 0, 139, 1 )


ColorValue(
"darkmagenta" )

Color.DarkOliveGreen ColorValue( "#556b2f" ) RGBA( 85, 107, 47, 1 )


ColorValue(
"DarkOliveGreen" )

Color.DarkOrange ColorValue( "#ff8c00" ) RGBA( 255, 140, 0, 1 )


ColorValue(
"DARKORANGE" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.DarkOrchid ColorValue( "#9932cc" ) RGBA( 153, 50, 204, 1 )


ColorValue(
"DarkOrchid" )

Color.DarkRed ColorValue( "#8b0000" ) RGBA( 139, 0, 0, 1 )


ColorValue( "darkred" )

Color.DarkSalmon ColorValue( "#e9967a" ) RGBA( 233, 150, 122, 1 )


ColorValue(
"DarkSalmon" )

Color.DarkSeaGreen ColorValue( "#8fbc8f" ) RGBA( 143, 188, 143, 1 )


ColorValue(
"DARKSEAGREEN" )

Color.DarkSlateBlue ColorValue( "#483d8b" ) RGBA( 72, 61, 139, 1 )


ColorValue(
"DarkSlateBlue" )

Color.DarkSlateGray ColorValue( "#2f4f4f" ) RGBA( 47, 79, 79, 1 )


ColorValue(
"darkslategray" )

Color.DarkSlateGrey ColorValue( "#2f4f4f" ) RGBA( 47, 79, 79, 1 )


ColorValue(
"DarkSlateGrey" )

Color.DarkTurquoise ColorValue( "#00ced1" ) RGBA( 0, 206, 209, 1 )


ColorValue(
"DARKTURQUOISE" )

Color.DarkViolet ColorValue( "#9400d3" ) RGBA( 148, 0, 211, 1 )


ColorValue( "DarkViolet" )

Color.DeepPink ColorValue( "#ff1493" ) RGBA( 255, 20, 147, 1 )


ColorValue( "deeppink" )

Color.DeepSkyBlue ColorValue( "#00bfff" ) RGBA( 0, 191, 255, 1 )


ColorValue(
"DeepSkyBlue" )

Color.DimGray ColorValue( "#696969" ) RGBA( 105, 105, 105, 1 )


ColorValue( "DIMGRAY" )

Color.DimGrey ColorValue( "#696969" ) RGBA( 105, 105, 105, 1 )


ColorValue( "DimGrey" )

Color.DodgerBlue ColorValue( "#1e90ff" ) RGBA( 30, 144, 255, 1 )


ColorValue(
"dodgerblue" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.FireBrick ColorValue( "#b22222" ) RGBA( 178, 34, 34, 1 )


ColorValue( "FireBrick" )

Color.FloralWhite ColorValue( "#fffaf0" ) RGBA( 255, 250, 240, 1 )


ColorValue(
"FLORALWHITE" )

Color.ForestGreen ColorValue( "#228b22" ) RGBA( 34, 139, 34, 1 )


ColorValue(
"ForestGreen" )

Color.Fuchsia ColorValue( "#ff00ff" ) RGBA( 255, 0, 255, 1 )


ColorValue( "fuchsia" )

Color.Gainsboro ColorValue( "#dcdcdc" ) RGBA( 220, 220, 220, 1 )


ColorValue( "Gainsboro" )

Color.GhostWhite ColorValue( "#f8f8ff" ) RGBA( 248, 248, 255, 1 )


ColorValue(
"GHOSTWHITE" )

Color.Gold ColorValue( "#ffd700" ) RGBA( 255, 215, 0, 1 )


ColorValue( "Gold" )

Color.GoldenRod ColorValue( "#daa520" ) RGBA( 218, 165, 32, 1 )


ColorValue( "goldenrod" )

Color.Gray ColorValue( "#808080" ) RGBA( 128, 128, 128, 1 )


ColorValue( "Gray" )

Color.Green ColorValue( "#008000" ) RGBA( 0, 128, 0, 1 )


ColorValue( "GREEN" )

Color.GreenYellow ColorValue( "#adff2f" ) RGBA( 173, 255, 47, 1 )


ColorValue(
"GreenYellow" )

Color.Grey ColorValue( "#808080" ) RGBA( 128, 128, 128, 1 )


ColorValue( "grey" )

Color.Honeydew ColorValue( "#f0fff0" ) RGBA( 240, 255, 240, 1 )


ColorValue( "Honeydew" )

Color.HotPink ColorValue( "#ff69b4" ) RGBA( 255, 105, 180, 1 )


ColorValue( "HOTPINK" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.IndianRed ColorValue( "#cd5c5c" ) RGBA( 205, 92, 92, 1 )


ColorValue( "IndianRed" )

Color.Indigo ColorValue( "#4b0082" ) RGBA( 75, 0, 130, 1 )


ColorValue( "indigo" )

Color.Ivory ColorValue( "#fffff0" ) RGBA( 255, 255, 240, 1 )


ColorValue( "Ivory" )

Color.Khaki ColorValue( "#f0e68c" ) RGBA( 240, 230, 140, 1 )


ColorValue( "KHAKI" )

Color.Lavender ColorValue( "#e6e6fa" ) RGBA( 230, 230, 250, 1 )


ColorValue( "Lavender" )

Color.LavenderBlush ColorValue( "#fff0f5" ) RGBA( 255, 240, 245, 1 )


ColorValue(
"lavenderblush" )

Color.LawnGreen ColorValue( "#7cfc00" ) RGBA( 124, 252, 0, 1 )


ColorValue( "LawnGreen" )

Color.LemonChiffon ColorValue( "#fffacd" ) RGBA( 255, 250, 205, 1 )


ColorValue(
"LEMONCHIFFON" )

Color.LightBlue ColorValue( "#add8e6" ) RGBA( 173, 216, 230, 1 )


ColorValue( "LightBlue" )

Color.LightCoral ColorValue( "#f08080" ) RGBA( 240, 128, 128, 1 )


ColorValue( "lightcoral" )

Color.LightCyan ColorValue( "#e0ffff" ) RGBA( 224, 255, 255, 1 )


ColorValue( "LightCyan" )

Color.LightGoldenRodYell ColorValue( "#fafad2" ) RGBA( 250, 250, 210, 1 )


ow ColorValue(
"lightgoldenrodyellow" )

Color.LightGray ColorValue( "#d3d3d3" ) RGBA( 211, 211, 211, 1 )


ColorValue( "LightGray" )

Color.LightGreen ColorValue( "#90ee90" ) RGBA( 144, 238, 144, 1 )


ColorValue( "lightgreen" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.LightGrey ColorValue( "#d3d3d3" ) RGBA( 211, 211, 211, 1 )


ColorValue( "LightGrey" )

Color.LightPink ColorValue( "#ffb6c1" ) RGBA( 255, 182, 193, 1 )


ColorValue( "LIGHTPINK" )

Color.LightSalmon ColorValue( "#ffa07a" ) RGBA( 255, 160, 122, 1 )


ColorValue(
"LightSalmon" )

Color.LightSeaGreen ColorValue( "#20b2aa" ) RGBA( 32, 178, 170, 1 )


ColorValue(
"lightseagreen" )

Color.LightSkyBlue ColorValue( "#87cefa" ) RGBA( 135, 206, 250, 1 )


ColorValue(
"LightSkyBlue" )

Color.LightSlateGray ColorValue( "#778899" ) RGBA( 119, 136, 153, 1 )


ColorValue(
"LIGHTSLATEGRAY" )

Color.LightSlateGrey ColorValue( "#778899" ) RGBA( 119, 136, 153, 1 )


ColorValue(
"LightSlateGrey" )

Color.LightSteelBlue ColorValue( "#b0c4de" ) RGBA( 176, 196, 222, 1 )


ColorValue(
"lightsteelblue" )

Color.LightYellow ColorValue( "#ffffe0" ) RGBA( 255, 255, 224, 1 )


ColorValue(
"LightYellow" )

Color.Lime ColorValue( "#00ff00" ) RGBA( 0, 255, 0, 1 )


ColorValue( "LIME" )

Color.LimeGreen ColorValue( "#32cd32" ) RGBA( 50, 205, 50, 1 )


ColorValue( "LimeGreen" )

Color.Linen ColorValue( "#faf0e6" ) RGBA( 250, 240, 230, 1 )


ColorValue( "linen" )

Color.Magenta ColorValue( "#ff00ff" ) RGBA( 255, 0, 255, 1 )


ColorValue( "Magenta" )

Color.Maroon ColorValue( "#800000" ) RGBA( 128, 0, 0, 1 )


ColorValue( "MAROON" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.MediumAquamarine ColorValue( "#66cdaa" ) RGBA( 102, 205, 170, 1 )


ColorValue(
"MediumAquamarine" )

Color.MediumBlue ColorValue( "#0000cd" ) RGBA( 0, 0, 205, 1 )


ColorValue(
"mediumblue" )

Color.MediumOrchid ColorValue( "#ba55d3" ) RGBA( 186, 85, 211, 1 )


ColorValue(
"MediumOrchid" )

Color.MediumPurple ColorValue( "#9370db" ) RGBA( 147, 112, 219, 1 )


ColorValue(
"MEDIUMPURPLE" )

Color.MediumSeaGreen ColorValue( "#3cb371" ) RGBA( 60, 179, 113, 1 )


ColorValue(
"MediumSeaGreen" )

Color.MediumSlateBlue ColorValue( "#7b68ee" ) RGBA( 123, 104, 238, 1 )


ColorValue(
"mediumslateblue" )

Color.MediumSpringGree ColorValue( "#00fa9a" ) RGBA( 0, 250, 154, 1 )


n ColorValue(
"MediumSpringGreen" )

Color.MediumTurquoise ColorValue( "#48d1cc" ) RGBA( 72, 209, 204, 1 )


ColorValue(
"MEDIUMTURQUOISE" )

Color.MediumVioletRed ColorValue( "#c71585" ) RGBA( 199, 21, 133, 1 )


ColorValue(
"MediumVioletRed" )

Color.MidnightBlue ColorValue( "#191970" ) RGBA( 25, 25, 112, 1 )


ColorValue(
"midnightblue" )

Color.MintCream ColorValue( "#f5fffa" ) RGBA( 245, 255, 250, 1 )


ColorValue(
"MintCream" )

Color.MistyRose ColorValue( "#ffe4e1" ) RGBA( 255, 228, 225, 1 )


ColorValue(
"MISTYROSE" )

Color.Moccasin ColorValue( "#ffe4b5" ) RGBA( 255, 228, 181, 1 )


ColorValue( "Moccasin" )

Color.NavajoWhite ColorValue( "#ffdead" ) RGBA( 255, 222, 173, 1 )


ColorValue(
"navajowhite" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.Navy ColorValue( "#000080" ) RGBA( 0, 0, 128, 1 )


ColorValue( "Navy" )

Color.OldLace ColorValue( "#fdf5e6" ) RGBA( 253, 245, 230, 1 )


ColorValue( "OLDLACE" )

Color.Olive ColorValue( "#808000" ) RGBA( 128, 128, 0, 1 )


ColorValue( "Olive" )

Color.OliveDrab ColorValue( "#6b8e23" ) RGBA( 107, 142, 35, 1 )


ColorValue( "olivedrab" )

Color.Orange ColorValue( "#ffa500" ) RGBA( 255, 165, 0, 1 )


ColorValue( "Orange" )

Color.OrangeRed ColorValue( "#ff4500" ) RGBA( 255, 69, 0, 1 )


ColorValue(
"ORANGERED" )

Color.Orchid ColorValue( "#da70d6" ) RGBA( 218, 112, 214, 1 )


ColorValue( "Orchid" )

Color.PaleGoldenRod ColorValue( "#eee8aa" ) RGBA( 238, 232, 170, 1 )


ColorValue(
"palegoldenrod" )

Color.PaleGreen ColorValue( "#98fb98" ) RGBA( 152, 251, 152, 1 )


ColorValue( "PaleGreen" )

Color.PaleTurquoise ColorValue( "#afeeee" ) RGBA( 175, 238, 238, 1 )


ColorValue(
"PALETURQUOISE" )

Color.PaleVioletRed ColorValue( "#db7093" ) RGBA( 219, 112, 147, 1 )


ColorValue(
"PaleVioletRed" )

Color.PapayaWhip ColorValue( "#ffefd5" ) RGBA( 255, 239, 213, 1 )


ColorValue(
"papayawhip" )

Color.PeachPuff ColorValue( "#ffdab9" ) RGBA( 255, 218, 185, 1 )


ColorValue( "PeachPuff" )

Color.Peru ColorValue( "#cd853f" ) RGBA( 205, 133, 63, 1 )


ColorValue( "PERU" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.Pink ColorValue( "#ffc0cb" ) RGBA( 255, 192, 203, 1 )


ColorValue( "Pink" )

Color.Plum ColorValue( "#dda0dd" ) RGBA( 221, 160, 221, 1 )


ColorValue( "plum" )

Color.PowderBlue ColorValue( "#b0e0e6" ) RGBA( 176, 224, 230, 1 )


ColorValue(
"PowderBlue" )

Color.Purple ColorValue( "#800080" ) RGBA( 128, 0, 128, 1 )


ColorValue( "PURPLE" )

Color.Red ColorValue( "#ff0000" ) RGBA( 255, 0, 0, 1 )


ColorValue( "Red" )

Color.RosyBrown ColorValue( "#bc8f8f" ) RGBA( 188, 143, 143, 1 )


ColorValue( "rosybrown" )

Color.RoyalBlue ColorValue( "#4169e1" ) RGBA( 65, 105, 225, 1 )


ColorValue( "RoyalBlue" )

Color.SaddleBrown ColorValue( "#8b4513" ) RGBA( 139, 69, 19, 1 )


ColorValue(
"SADDLEBROWN" )

Color.Salmon ColorValue( "#fa8072" ) RGBA( 250, 128, 114, 1 )


ColorValue( "Salmon" )

Color.SandyBrown ColorValue( "#f4a460" ) RGBA( 244, 164, 96, 1 )


ColorValue(
"sandybrown" )

Color.SeaGreen ColorValue( "#2e8b57" ) RGBA( 46, 139, 87, 1 )


ColorValue( "SeaGreen" )

Color.SeaShell ColorValue( "#fff5ee" ) RGBA( 255, 245, 238, 1 )


ColorValue( "SEASHELL" )

Color.Sienna ColorValue( "#a0522d" ) RGBA( 160, 82, 45, 1 )


ColorValue( "Sienna" )

Color.Silver ColorValue( "#c0c0c0" ) RGBA( 192, 192, 192, 1 )


ColorValue( "silver" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.SkyBlue ColorValue( "#87ceeb" ) RGBA( 135, 206, 235, 1 )


ColorValue( "SkyBlue" )

Color.SlateBlue ColorValue( "#6a5acd" ) RGBA( 106, 90, 205, 1 )


ColorValue(
"SLATEBLUE" )

Color.SlateGray ColorValue( "#708090" ) RGBA( 112, 128, 144, 1 )


ColorValue( "SlateGray" )

Color.SlateGrey ColorValue( "#708090" ) RGBA( 112, 128, 144, 1 )


ColorValue( "slategrey" )

Color.Snow ColorValue( "#fffafa" ) RGBA( 255, 250, 250, 1 )


ColorValue( "Snow" )

Color.SpringGreen ColorValue( "#00ff7f" ) RGBA( 0, 255, 127, 1 )


ColorValue(
"SPRINGGREEN" )

Color.SteelBlue ColorValue( "#4682b4" ) RGBA( 70, 130, 180, 1 )


ColorValue( "SteelBlue" )

Color.Tan ColorValue( "#d2b48c" ) RGBA( 210, 180, 140, 1 )


ColorValue( "tan" )

Color.Teal ColorValue( "#008080" ) RGBA( 0, 128, 128, 1 )


ColorValue( "Teal" )

Color.Thistle ColorValue( "#d8bfd8" ) RGBA( 216, 191, 216, 1 )


ColorValue( "THISTLE" )

Color.Tomato ColorValue( "#ff6347" ) RGBA( 255, 99, 71, 1 )


ColorValue( "Tomato" )

Color.Transparent ColorValue( "#00000000" ) RGBA( 0, 0, 0, 0 )


ColorValue(
"Transparent" )

Color.Turquoise ColorValue( "#40e0d0" ) RGBA( 64, 224, 208, 1 )


ColorValue( "turquoise" )

Color.Violet ColorValue( "#ee82ee" ) RGBA( 238, 130, 238, 1 )


ColorValue( "Violet" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.Wheat ColorValue( "#f5deb3" ) RGBA( 245, 222, 179, 1 )


ColorValue( "WHEAT" )

Color.White ColorValue( "#ffffff" ) RGBA( 255, 255, 255, 1 )


ColorValue( "White" )

Color.WhiteSmoke ColorValue( "#f5f5f5" ) RGBA( 245, 245, 245, 1 )


ColorValue(
"whitesmoke" )

Color.Yellow ColorValue( "#ffff00" ) RGBA( 255, 255, 0, 1 )


ColorValue( "Yellow" )

Color.YellowGreen ColorValue( "#9acd32" ) RGBA( 154, 205, 50, 1 )


ColorValue(
"YELLOWGREEN" )
Color enumeration and ColorFade, ColorValue, and
RGBA functions in Power Apps
12/3/2019 • 7 minutes to read • Edit Online

Use built-in color values, define custom colors, and use the alpha channel.

Description
By using the Color enumeration, you can easily access the colors that are defined by HTML's Cascading Style
Sheets (CSS ). For example, Color.Red returns pure red. You can find a list of these colors at the end of this topic.
The ColorValue function returns a color based on a color string in a CSS. The string can take any of these forms:
CSS color name: "RoxyBrown" and "OliveDrab" are examples. These names don't include spaces. The list of
supported colors appears later in this topic.
6-digit hex value: As an example "#ffd700" is the same as "Gold". The string is in the format "#rrggbb"
where rr is the red portion in two hexadecimal digits, gg is the green, and bb is the blue.
8-digit hex value: As an example, "#ff7f5080" is the same as "Coral" with a 50% alpha channel. The string is
in the format "#rrggbbaa" where rr, gg, and bb are identical to the 6-digit form. The alpha channel is
represented by aa: 00 represents fully transparent, and ff represents fully opaque.
The RGBA function returns a color based on red, green, and blue components. The function also includes an alpha
channel for mixing colors of controls that are layered in front of one another. An alpha channel varies from 0 or 0%
(which is fully transparent and invisible) to 1 or 100% (which is fully opaque and completely blocks out any layers
behind a control).
The ColorFade function returns a brighter or darker version of a color. The amount of fade varies from -1 (which
fully darkens a color to black) to 0 (which doesn't affect the color) to 1 (which fully brightens a color to white).

Alpha channel
In a canvas app, you can layer controls in front of one another and specify the transparency of a control to any
controls that are behind it. As a result, colors will blend through the layers. For example, this diagram shows how
the three primary colors mix with an alpha setting of 50%:

You can also blend images in file formats that support alpha channels. For example, you can't blend .jpeg files, but
you can blend .png files. The next graphic shows the same red, green, and blue colors from the previous example,
but the red color appears as a squiggle (instead of a circle) in a .png file with a 50% alpha channel:

If you specify a Color enumeration value or you build a ColorValue formula with a color name or a 6-digit
hexadecimal value, the alpha setting is 100%, which is fully opaque.

Syntax
Color.ColorName
ColorName - Required. A Cascading Style Sheet (CSS ) color name. The list of possible enumeration values
appears at the end of this topic.
ColorValue( CSSColor )
CSSColor - Required. A Cascading Style Sheet (CSS ) color definition. You can specify either a name, such as
OliveDrab, or a hex value, such as #6b8e23 or #7fffd420. Hex values can take the form of either #rrggbb or
#rrggbbaa.
RGBA ( Red, Green, Blue, Alpha )
Red, Green, Blue - Required. Color-component values, which range from 0 (no saturation) to 255 (full
saturation).
Alpha - Required. Alpha component, which ranges from 0 (fully transparent) to 1 (fully opaque). You can also
use a percentage, 0% to 100%.
ColorFade( Color, FadeAmount )
Color - Required. A color value such as Color.Red or the output from ColorValue or RGBA.
FadeAmount - Required. A number between -1 and 1. -1 fully darkens a color to black, 0 doesn't affect the color,
and 1 fully brightens a color to white. You can also use a percentage from -100% to 100%.

Built-in colors
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.AliceBlue ColorValue( "#f0f8ff" ) RGBA( 240, 248, 255, 1 )


ColorValue( "aliceblue" )

Color.AntiqueWhite ColorValue( "#faebd7" ) RGBA( 250, 235, 215, 1 )


ColorValue(
"AntiqueWhite" )

Color.Aqua ColorValue( "#00ffff" ) RGBA( 0, 255, 255, 1 )


ColorValue( "AQUA" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.Aquamarine ColorValue( "#7fffd4" ) RGBA( 127, 255, 212, 1 )


ColorValue(
"Aquamarine" )

Color.Azure ColorValue( "#f0ffff" ) RGBA( 240, 255, 255, 1 )


ColorValue( "azure" )

Color.Beige ColorValue( "#f5f5dc" ) RGBA( 245, 245, 220, 1 )


ColorValue( "Beige" )

Color.Bisque ColorValue( "#ffe4c4" ) RGBA( 255, 228, 196, 1 )


ColorValue( "BISQUE" )

Color.Black ColorValue( "#000000" ) RGBA( 0, 0, 0, 1 )


ColorValue( "Black" )

Color.BlanchedAlmond ColorValue( "#ffebcd" ) RGBA( 255, 235, 205, 1 )


ColorValue(
"blanchedalmond" )

Color.Blue ColorValue( "#0000ff" ) RGBA( 0, 0, 255, 1 )


ColorValue( "Blue" )

Color.BlueViolet ColorValue( "#8a2be2" ) RGBA( 138, 43, 226, 1 )


ColorValue(
"BLUEVIOLET" )

Color.Brown ColorValue( "#a52a2a" ) RGBA( 165, 42, 42, 1 )


ColorValue( "Brown" )

Color.Burlywood ColorValue( "#deb887" ) RGBA( 222, 184, 135, 1 )


ColorValue( "burlywood" )

Color.CadetBlue ColorValue( "#5f9ea0" ) RGBA( 95, 158, 160, 1 )


ColorValue( "CadetBlue" )

Color.Chartreuse ColorValue( "#7fff00" ) RGBA( 127, 255, 0, 1 )


ColorValue(
"CHARTREUSE" )

Color.Chocolate ColorValue( "#d2691e" ) RGBA( 210, 105, 30, 1 )


ColorValue( "Chocolate" )

Color.Coral ColorValue( "#ff7f50" ) RGBA( 255, 127, 80, 1 )


ColorValue( "coral" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.CornflowerBlue ColorValue( "#6495ed" ) RGBA( 100, 149, 237, 1 )


ColorValue(
"CornflowerBlue" )

Color.Cornsilk ColorValue( "#fff8dc" ) RGBA( 255, 248, 220, 1 )


ColorValue( "CORNSILK" )

Color.Crimson ColorValue( "#dc143c" ) RGBA( 220, 20, 60, 1 )


ColorValue( "Crimson" )

Color.Cyan ColorValue( "#00ffff" ) RGBA( 0, 255, 255, 1 )


ColorValue( "cyan" )

Color.DarkBlue ColorValue( "#00008b" ) RGBA( 0, 0, 139, 1 )


ColorValue( "DarkBlue" )

Color.DarkCyan ColorValue( "#008b8b" ) RGBA( 0, 139, 139, 1 )


ColorValue(
"DARKCYAN" )

Color.DarkGoldenRod ColorValue( "#b8860b" ) RGBA( 184, 134, 11, 1 )


ColorValue(
"DarkGoldenRod" )

Color.DarkGray ColorValue( "#a9a9a9" ) RGBA( 169, 169, 169, 1 )


ColorValue( "darkgray" )

Color.DarkGreen ColorValue( "#006400" ) RGBA( 0, 100, 0, 1 )


ColorValue( "DarkGreen" )

Color.DarkGrey ColorValue( "#a9a9a9" ) RGBA( 169, 169, 169, 1 )


ColorValue( "DARKGREY" )

Color.DarkKhaki ColorValue( "#bdb76b" ) RGBA( 189, 183, 107, 1 )


ColorValue( "DarkKhaki" )

Color.DarkMagenta ColorValue( "#8b008b" ) RGBA( 139, 0, 139, 1 )


ColorValue(
"darkmagenta" )

Color.DarkOliveGreen ColorValue( "#556b2f" ) RGBA( 85, 107, 47, 1 )


ColorValue(
"DarkOliveGreen" )

Color.DarkOrange ColorValue( "#ff8c00" ) RGBA( 255, 140, 0, 1 )


ColorValue(
"DARKORANGE" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.DarkOrchid ColorValue( "#9932cc" ) RGBA( 153, 50, 204, 1 )


ColorValue(
"DarkOrchid" )

Color.DarkRed ColorValue( "#8b0000" ) RGBA( 139, 0, 0, 1 )


ColorValue( "darkred" )

Color.DarkSalmon ColorValue( "#e9967a" ) RGBA( 233, 150, 122, 1 )


ColorValue(
"DarkSalmon" )

Color.DarkSeaGreen ColorValue( "#8fbc8f" ) RGBA( 143, 188, 143, 1 )


ColorValue(
"DARKSEAGREEN" )

Color.DarkSlateBlue ColorValue( "#483d8b" ) RGBA( 72, 61, 139, 1 )


ColorValue(
"DarkSlateBlue" )

Color.DarkSlateGray ColorValue( "#2f4f4f" ) RGBA( 47, 79, 79, 1 )


ColorValue(
"darkslategray" )

Color.DarkSlateGrey ColorValue( "#2f4f4f" ) RGBA( 47, 79, 79, 1 )


ColorValue(
"DarkSlateGrey" )

Color.DarkTurquoise ColorValue( "#00ced1" ) RGBA( 0, 206, 209, 1 )


ColorValue(
"DARKTURQUOISE" )

Color.DarkViolet ColorValue( "#9400d3" ) RGBA( 148, 0, 211, 1 )


ColorValue( "DarkViolet" )

Color.DeepPink ColorValue( "#ff1493" ) RGBA( 255, 20, 147, 1 )


ColorValue( "deeppink" )

Color.DeepSkyBlue ColorValue( "#00bfff" ) RGBA( 0, 191, 255, 1 )


ColorValue(
"DeepSkyBlue" )

Color.DimGray ColorValue( "#696969" ) RGBA( 105, 105, 105, 1 )


ColorValue( "DIMGRAY" )

Color.DimGrey ColorValue( "#696969" ) RGBA( 105, 105, 105, 1 )


ColorValue( "DimGrey" )

Color.DodgerBlue ColorValue( "#1e90ff" ) RGBA( 30, 144, 255, 1 )


ColorValue(
"dodgerblue" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.FireBrick ColorValue( "#b22222" ) RGBA( 178, 34, 34, 1 )


ColorValue( "FireBrick" )

Color.FloralWhite ColorValue( "#fffaf0" ) RGBA( 255, 250, 240, 1 )


ColorValue(
"FLORALWHITE" )

Color.ForestGreen ColorValue( "#228b22" ) RGBA( 34, 139, 34, 1 )


ColorValue(
"ForestGreen" )

Color.Fuchsia ColorValue( "#ff00ff" ) RGBA( 255, 0, 255, 1 )


ColorValue( "fuchsia" )

Color.Gainsboro ColorValue( "#dcdcdc" ) RGBA( 220, 220, 220, 1 )


ColorValue( "Gainsboro" )

Color.GhostWhite ColorValue( "#f8f8ff" ) RGBA( 248, 248, 255, 1 )


ColorValue(
"GHOSTWHITE" )

Color.Gold ColorValue( "#ffd700" ) RGBA( 255, 215, 0, 1 )


ColorValue( "Gold" )

Color.GoldenRod ColorValue( "#daa520" ) RGBA( 218, 165, 32, 1 )


ColorValue( "goldenrod" )

Color.Gray ColorValue( "#808080" ) RGBA( 128, 128, 128, 1 )


ColorValue( "Gray" )

Color.Green ColorValue( "#008000" ) RGBA( 0, 128, 0, 1 )


ColorValue( "GREEN" )

Color.GreenYellow ColorValue( "#adff2f" ) RGBA( 173, 255, 47, 1 )


ColorValue(
"GreenYellow" )

Color.Grey ColorValue( "#808080" ) RGBA( 128, 128, 128, 1 )


ColorValue( "grey" )

Color.Honeydew ColorValue( "#f0fff0" ) RGBA( 240, 255, 240, 1 )


ColorValue( "Honeydew" )

Color.HotPink ColorValue( "#ff69b4" ) RGBA( 255, 105, 180, 1 )


ColorValue( "HOTPINK" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.IndianRed ColorValue( "#cd5c5c" ) RGBA( 205, 92, 92, 1 )


ColorValue( "IndianRed" )

Color.Indigo ColorValue( "#4b0082" ) RGBA( 75, 0, 130, 1 )


ColorValue( "indigo" )

Color.Ivory ColorValue( "#fffff0" ) RGBA( 255, 255, 240, 1 )


ColorValue( "Ivory" )

Color.Khaki ColorValue( "#f0e68c" ) RGBA( 240, 230, 140, 1 )


ColorValue( "KHAKI" )

Color.Lavender ColorValue( "#e6e6fa" ) RGBA( 230, 230, 250, 1 )


ColorValue( "Lavender" )

Color.LavenderBlush ColorValue( "#fff0f5" ) RGBA( 255, 240, 245, 1 )


ColorValue(
"lavenderblush" )

Color.LawnGreen ColorValue( "#7cfc00" ) RGBA( 124, 252, 0, 1 )


ColorValue( "LawnGreen" )

Color.LemonChiffon ColorValue( "#fffacd" ) RGBA( 255, 250, 205, 1 )


ColorValue(
"LEMONCHIFFON" )

Color.LightBlue ColorValue( "#add8e6" ) RGBA( 173, 216, 230, 1 )


ColorValue( "LightBlue" )

Color.LightCoral ColorValue( "#f08080" ) RGBA( 240, 128, 128, 1 )


ColorValue( "lightcoral" )

Color.LightCyan ColorValue( "#e0ffff" ) RGBA( 224, 255, 255, 1 )


ColorValue( "LightCyan" )

Color.LightGoldenRodYell ColorValue( "#fafad2" ) RGBA( 250, 250, 210, 1 )


ow ColorValue(
"lightgoldenrodyellow" )

Color.LightGray ColorValue( "#d3d3d3" ) RGBA( 211, 211, 211, 1 )


ColorValue( "LightGray" )

Color.LightGreen ColorValue( "#90ee90" ) RGBA( 144, 238, 144, 1 )


ColorValue( "lightgreen" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.LightGrey ColorValue( "#d3d3d3" ) RGBA( 211, 211, 211, 1 )


ColorValue( "LightGrey" )

Color.LightPink ColorValue( "#ffb6c1" ) RGBA( 255, 182, 193, 1 )


ColorValue( "LIGHTPINK" )

Color.LightSalmon ColorValue( "#ffa07a" ) RGBA( 255, 160, 122, 1 )


ColorValue(
"LightSalmon" )

Color.LightSeaGreen ColorValue( "#20b2aa" ) RGBA( 32, 178, 170, 1 )


ColorValue(
"lightseagreen" )

Color.LightSkyBlue ColorValue( "#87cefa" ) RGBA( 135, 206, 250, 1 )


ColorValue(
"LightSkyBlue" )

Color.LightSlateGray ColorValue( "#778899" ) RGBA( 119, 136, 153, 1 )


ColorValue(
"LIGHTSLATEGRAY" )

Color.LightSlateGrey ColorValue( "#778899" ) RGBA( 119, 136, 153, 1 )


ColorValue(
"LightSlateGrey" )

Color.LightSteelBlue ColorValue( "#b0c4de" ) RGBA( 176, 196, 222, 1 )


ColorValue(
"lightsteelblue" )

Color.LightYellow ColorValue( "#ffffe0" ) RGBA( 255, 255, 224, 1 )


ColorValue(
"LightYellow" )

Color.Lime ColorValue( "#00ff00" ) RGBA( 0, 255, 0, 1 )


ColorValue( "LIME" )

Color.LimeGreen ColorValue( "#32cd32" ) RGBA( 50, 205, 50, 1 )


ColorValue( "LimeGreen" )

Color.Linen ColorValue( "#faf0e6" ) RGBA( 250, 240, 230, 1 )


ColorValue( "linen" )

Color.Magenta ColorValue( "#ff00ff" ) RGBA( 255, 0, 255, 1 )


ColorValue( "Magenta" )

Color.Maroon ColorValue( "#800000" ) RGBA( 128, 0, 0, 1 )


ColorValue( "MAROON" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.MediumAquamarine ColorValue( "#66cdaa" ) RGBA( 102, 205, 170, 1 )


ColorValue(
"MediumAquamarine" )

Color.MediumBlue ColorValue( "#0000cd" ) RGBA( 0, 0, 205, 1 )


ColorValue(
"mediumblue" )

Color.MediumOrchid ColorValue( "#ba55d3" ) RGBA( 186, 85, 211, 1 )


ColorValue(
"MediumOrchid" )

Color.MediumPurple ColorValue( "#9370db" ) RGBA( 147, 112, 219, 1 )


ColorValue(
"MEDIUMPURPLE" )

Color.MediumSeaGreen ColorValue( "#3cb371" ) RGBA( 60, 179, 113, 1 )


ColorValue(
"MediumSeaGreen" )

Color.MediumSlateBlue ColorValue( "#7b68ee" ) RGBA( 123, 104, 238, 1 )


ColorValue(
"mediumslateblue" )

Color.MediumSpringGree ColorValue( "#00fa9a" ) RGBA( 0, 250, 154, 1 )


n ColorValue(
"MediumSpringGreen" )

Color.MediumTurquoise ColorValue( "#48d1cc" ) RGBA( 72, 209, 204, 1 )


ColorValue(
"MEDIUMTURQUOISE" )

Color.MediumVioletRed ColorValue( "#c71585" ) RGBA( 199, 21, 133, 1 )


ColorValue(
"MediumVioletRed" )

Color.MidnightBlue ColorValue( "#191970" ) RGBA( 25, 25, 112, 1 )


ColorValue(
"midnightblue" )

Color.MintCream ColorValue( "#f5fffa" ) RGBA( 245, 255, 250, 1 )


ColorValue(
"MintCream" )

Color.MistyRose ColorValue( "#ffe4e1" ) RGBA( 255, 228, 225, 1 )


ColorValue(
"MISTYROSE" )

Color.Moccasin ColorValue( "#ffe4b5" ) RGBA( 255, 228, 181, 1 )


ColorValue( "Moccasin" )

Color.NavajoWhite ColorValue( "#ffdead" ) RGBA( 255, 222, 173, 1 )


ColorValue(
"navajowhite" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.Navy ColorValue( "#000080" ) RGBA( 0, 0, 128, 1 )


ColorValue( "Navy" )

Color.OldLace ColorValue( "#fdf5e6" ) RGBA( 253, 245, 230, 1 )


ColorValue( "OLDLACE" )

Color.Olive ColorValue( "#808000" ) RGBA( 128, 128, 0, 1 )


ColorValue( "Olive" )

Color.OliveDrab ColorValue( "#6b8e23" ) RGBA( 107, 142, 35, 1 )


ColorValue( "olivedrab" )

Color.Orange ColorValue( "#ffa500" ) RGBA( 255, 165, 0, 1 )


ColorValue( "Orange" )

Color.OrangeRed ColorValue( "#ff4500" ) RGBA( 255, 69, 0, 1 )


ColorValue(
"ORANGERED" )

Color.Orchid ColorValue( "#da70d6" ) RGBA( 218, 112, 214, 1 )


ColorValue( "Orchid" )

Color.PaleGoldenRod ColorValue( "#eee8aa" ) RGBA( 238, 232, 170, 1 )


ColorValue(
"palegoldenrod" )

Color.PaleGreen ColorValue( "#98fb98" ) RGBA( 152, 251, 152, 1 )


ColorValue( "PaleGreen" )

Color.PaleTurquoise ColorValue( "#afeeee" ) RGBA( 175, 238, 238, 1 )


ColorValue(
"PALETURQUOISE" )

Color.PaleVioletRed ColorValue( "#db7093" ) RGBA( 219, 112, 147, 1 )


ColorValue(
"PaleVioletRed" )

Color.PapayaWhip ColorValue( "#ffefd5" ) RGBA( 255, 239, 213, 1 )


ColorValue(
"papayawhip" )

Color.PeachPuff ColorValue( "#ffdab9" ) RGBA( 255, 218, 185, 1 )


ColorValue( "PeachPuff" )

Color.Peru ColorValue( "#cd853f" ) RGBA( 205, 133, 63, 1 )


ColorValue( "PERU" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.Pink ColorValue( "#ffc0cb" ) RGBA( 255, 192, 203, 1 )


ColorValue( "Pink" )

Color.Plum ColorValue( "#dda0dd" ) RGBA( 221, 160, 221, 1 )


ColorValue( "plum" )

Color.PowderBlue ColorValue( "#b0e0e6" ) RGBA( 176, 224, 230, 1 )


ColorValue(
"PowderBlue" )

Color.Purple ColorValue( "#800080" ) RGBA( 128, 0, 128, 1 )


ColorValue( "PURPLE" )

Color.Red ColorValue( "#ff0000" ) RGBA( 255, 0, 0, 1 )


ColorValue( "Red" )

Color.RosyBrown ColorValue( "#bc8f8f" ) RGBA( 188, 143, 143, 1 )


ColorValue( "rosybrown" )

Color.RoyalBlue ColorValue( "#4169e1" ) RGBA( 65, 105, 225, 1 )


ColorValue( "RoyalBlue" )

Color.SaddleBrown ColorValue( "#8b4513" ) RGBA( 139, 69, 19, 1 )


ColorValue(
"SADDLEBROWN" )

Color.Salmon ColorValue( "#fa8072" ) RGBA( 250, 128, 114, 1 )


ColorValue( "Salmon" )

Color.SandyBrown ColorValue( "#f4a460" ) RGBA( 244, 164, 96, 1 )


ColorValue(
"sandybrown" )

Color.SeaGreen ColorValue( "#2e8b57" ) RGBA( 46, 139, 87, 1 )


ColorValue( "SeaGreen" )

Color.SeaShell ColorValue( "#fff5ee" ) RGBA( 255, 245, 238, 1 )


ColorValue( "SEASHELL" )

Color.Sienna ColorValue( "#a0522d" ) RGBA( 160, 82, 45, 1 )


ColorValue( "Sienna" )

Color.Silver ColorValue( "#c0c0c0" ) RGBA( 192, 192, 192, 1 )


ColorValue( "silver" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.SkyBlue ColorValue( "#87ceeb" ) RGBA( 135, 206, 235, 1 )


ColorValue( "SkyBlue" )

Color.SlateBlue ColorValue( "#6a5acd" ) RGBA( 106, 90, 205, 1 )


ColorValue(
"SLATEBLUE" )

Color.SlateGray ColorValue( "#708090" ) RGBA( 112, 128, 144, 1 )


ColorValue( "SlateGray" )

Color.SlateGrey ColorValue( "#708090" ) RGBA( 112, 128, 144, 1 )


ColorValue( "slategrey" )

Color.Snow ColorValue( "#fffafa" ) RGBA( 255, 250, 250, 1 )


ColorValue( "Snow" )

Color.SpringGreen ColorValue( "#00ff7f" ) RGBA( 0, 255, 127, 1 )


ColorValue(
"SPRINGGREEN" )

Color.SteelBlue ColorValue( "#4682b4" ) RGBA( 70, 130, 180, 1 )


ColorValue( "SteelBlue" )

Color.Tan ColorValue( "#d2b48c" ) RGBA( 210, 180, 140, 1 )


ColorValue( "tan" )

Color.Teal ColorValue( "#008080" ) RGBA( 0, 128, 128, 1 )


ColorValue( "Teal" )

Color.Thistle ColorValue( "#d8bfd8" ) RGBA( 216, 191, 216, 1 )


ColorValue( "THISTLE" )

Color.Tomato ColorValue( "#ff6347" ) RGBA( 255, 99, 71, 1 )


ColorValue( "Tomato" )

Color.Transparent ColorValue( "#00000000" ) RGBA( 0, 0, 0, 0 )


ColorValue(
"Transparent" )

Color.Turquoise ColorValue( "#40e0d0" ) RGBA( 64, 224, 208, 1 )


ColorValue( "turquoise" )

Color.Violet ColorValue( "#ee82ee" ) RGBA( 238, 130, 238, 1 )


ColorValue( "Violet" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.Wheat ColorValue( "#f5deb3" ) RGBA( 245, 222, 179, 1 )


ColorValue( "WHEAT" )

Color.White ColorValue( "#ffffff" ) RGBA( 255, 255, 255, 1 )


ColorValue( "White" )

Color.WhiteSmoke ColorValue( "#f5f5f5" ) RGBA( 245, 245, 245, 1 )


ColorValue(
"whitesmoke" )

Color.Yellow ColorValue( "#ffff00" ) RGBA( 255, 255, 0, 1 )


ColorValue( "Yellow" )

Color.YellowGreen ColorValue( "#9acd32" ) RGBA( 154, 205, 50, 1 )


ColorValue(
"YELLOWGREEN" )
Color enumeration and ColorFade, ColorValue, and
RGBA functions in Power Apps
12/3/2019 • 7 minutes to read • Edit Online

Use built-in color values, define custom colors, and use the alpha channel.

Description
By using the Color enumeration, you can easily access the colors that are defined by HTML's Cascading Style
Sheets (CSS ). For example, Color.Red returns pure red. You can find a list of these colors at the end of this topic.
The ColorValue function returns a color based on a color string in a CSS. The string can take any of these forms:
CSS color name: "RoxyBrown" and "OliveDrab" are examples. These names don't include spaces. The list of
supported colors appears later in this topic.
6-digit hex value: As an example "#ffd700" is the same as "Gold". The string is in the format "#rrggbb"
where rr is the red portion in two hexadecimal digits, gg is the green, and bb is the blue.
8-digit hex value: As an example, "#ff7f5080" is the same as "Coral" with a 50% alpha channel. The string is
in the format "#rrggbbaa" where rr, gg, and bb are identical to the 6-digit form. The alpha channel is
represented by aa: 00 represents fully transparent, and ff represents fully opaque.
The RGBA function returns a color based on red, green, and blue components. The function also includes an alpha
channel for mixing colors of controls that are layered in front of one another. An alpha channel varies from 0 or 0%
(which is fully transparent and invisible) to 1 or 100% (which is fully opaque and completely blocks out any layers
behind a control).
The ColorFade function returns a brighter or darker version of a color. The amount of fade varies from -1 (which
fully darkens a color to black) to 0 (which doesn't affect the color) to 1 (which fully brightens a color to white).

Alpha channel
In a canvas app, you can layer controls in front of one another and specify the transparency of a control to any
controls that are behind it. As a result, colors will blend through the layers. For example, this diagram shows how
the three primary colors mix with an alpha setting of 50%:

You can also blend images in file formats that support alpha channels. For example, you can't blend .jpeg files, but
you can blend .png files. The next graphic shows the same red, green, and blue colors from the previous example,
but the red color appears as a squiggle (instead of a circle) in a .png file with a 50% alpha channel:

If you specify a Color enumeration value or you build a ColorValue formula with a color name or a 6-digit
hexadecimal value, the alpha setting is 100%, which is fully opaque.

Syntax
Color.ColorName
ColorName - Required. A Cascading Style Sheet (CSS ) color name. The list of possible enumeration values
appears at the end of this topic.
ColorValue( CSSColor )
CSSColor - Required. A Cascading Style Sheet (CSS ) color definition. You can specify either a name, such as
OliveDrab, or a hex value, such as #6b8e23 or #7fffd420. Hex values can take the form of either #rrggbb or
#rrggbbaa.
RGBA ( Red, Green, Blue, Alpha )
Red, Green, Blue - Required. Color-component values, which range from 0 (no saturation) to 255 (full
saturation).
Alpha - Required. Alpha component, which ranges from 0 (fully transparent) to 1 (fully opaque). You can also
use a percentage, 0% to 100%.
ColorFade( Color, FadeAmount )
Color - Required. A color value such as Color.Red or the output from ColorValue or RGBA.
FadeAmount - Required. A number between -1 and 1. -1 fully darkens a color to black, 0 doesn't affect the color,
and 1 fully brightens a color to white. You can also use a percentage from -100% to 100%.

Built-in colors
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.AliceBlue ColorValue( "#f0f8ff" ) RGBA( 240, 248, 255, 1 )


ColorValue( "aliceblue" )

Color.AntiqueWhite ColorValue( "#faebd7" ) RGBA( 250, 235, 215, 1 )


ColorValue(
"AntiqueWhite" )

Color.Aqua ColorValue( "#00ffff" ) RGBA( 0, 255, 255, 1 )


ColorValue( "AQUA" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.Aquamarine ColorValue( "#7fffd4" ) RGBA( 127, 255, 212, 1 )


ColorValue(
"Aquamarine" )

Color.Azure ColorValue( "#f0ffff" ) RGBA( 240, 255, 255, 1 )


ColorValue( "azure" )

Color.Beige ColorValue( "#f5f5dc" ) RGBA( 245, 245, 220, 1 )


ColorValue( "Beige" )

Color.Bisque ColorValue( "#ffe4c4" ) RGBA( 255, 228, 196, 1 )


ColorValue( "BISQUE" )

Color.Black ColorValue( "#000000" ) RGBA( 0, 0, 0, 1 )


ColorValue( "Black" )

Color.BlanchedAlmond ColorValue( "#ffebcd" ) RGBA( 255, 235, 205, 1 )


ColorValue(
"blanchedalmond" )

Color.Blue ColorValue( "#0000ff" ) RGBA( 0, 0, 255, 1 )


ColorValue( "Blue" )

Color.BlueViolet ColorValue( "#8a2be2" ) RGBA( 138, 43, 226, 1 )


ColorValue(
"BLUEVIOLET" )

Color.Brown ColorValue( "#a52a2a" ) RGBA( 165, 42, 42, 1 )


ColorValue( "Brown" )

Color.Burlywood ColorValue( "#deb887" ) RGBA( 222, 184, 135, 1 )


ColorValue( "burlywood" )

Color.CadetBlue ColorValue( "#5f9ea0" ) RGBA( 95, 158, 160, 1 )


ColorValue( "CadetBlue" )

Color.Chartreuse ColorValue( "#7fff00" ) RGBA( 127, 255, 0, 1 )


ColorValue(
"CHARTREUSE" )

Color.Chocolate ColorValue( "#d2691e" ) RGBA( 210, 105, 30, 1 )


ColorValue( "Chocolate" )

Color.Coral ColorValue( "#ff7f50" ) RGBA( 255, 127, 80, 1 )


ColorValue( "coral" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.CornflowerBlue ColorValue( "#6495ed" ) RGBA( 100, 149, 237, 1 )


ColorValue(
"CornflowerBlue" )

Color.Cornsilk ColorValue( "#fff8dc" ) RGBA( 255, 248, 220, 1 )


ColorValue( "CORNSILK" )

Color.Crimson ColorValue( "#dc143c" ) RGBA( 220, 20, 60, 1 )


ColorValue( "Crimson" )

Color.Cyan ColorValue( "#00ffff" ) RGBA( 0, 255, 255, 1 )


ColorValue( "cyan" )

Color.DarkBlue ColorValue( "#00008b" ) RGBA( 0, 0, 139, 1 )


ColorValue( "DarkBlue" )

Color.DarkCyan ColorValue( "#008b8b" ) RGBA( 0, 139, 139, 1 )


ColorValue(
"DARKCYAN" )

Color.DarkGoldenRod ColorValue( "#b8860b" ) RGBA( 184, 134, 11, 1 )


ColorValue(
"DarkGoldenRod" )

Color.DarkGray ColorValue( "#a9a9a9" ) RGBA( 169, 169, 169, 1 )


ColorValue( "darkgray" )

Color.DarkGreen ColorValue( "#006400" ) RGBA( 0, 100, 0, 1 )


ColorValue( "DarkGreen" )

Color.DarkGrey ColorValue( "#a9a9a9" ) RGBA( 169, 169, 169, 1 )


ColorValue( "DARKGREY" )

Color.DarkKhaki ColorValue( "#bdb76b" ) RGBA( 189, 183, 107, 1 )


ColorValue( "DarkKhaki" )

Color.DarkMagenta ColorValue( "#8b008b" ) RGBA( 139, 0, 139, 1 )


ColorValue(
"darkmagenta" )

Color.DarkOliveGreen ColorValue( "#556b2f" ) RGBA( 85, 107, 47, 1 )


ColorValue(
"DarkOliveGreen" )

Color.DarkOrange ColorValue( "#ff8c00" ) RGBA( 255, 140, 0, 1 )


ColorValue(
"DARKORANGE" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.DarkOrchid ColorValue( "#9932cc" ) RGBA( 153, 50, 204, 1 )


ColorValue(
"DarkOrchid" )

Color.DarkRed ColorValue( "#8b0000" ) RGBA( 139, 0, 0, 1 )


ColorValue( "darkred" )

Color.DarkSalmon ColorValue( "#e9967a" ) RGBA( 233, 150, 122, 1 )


ColorValue(
"DarkSalmon" )

Color.DarkSeaGreen ColorValue( "#8fbc8f" ) RGBA( 143, 188, 143, 1 )


ColorValue(
"DARKSEAGREEN" )

Color.DarkSlateBlue ColorValue( "#483d8b" ) RGBA( 72, 61, 139, 1 )


ColorValue(
"DarkSlateBlue" )

Color.DarkSlateGray ColorValue( "#2f4f4f" ) RGBA( 47, 79, 79, 1 )


ColorValue(
"darkslategray" )

Color.DarkSlateGrey ColorValue( "#2f4f4f" ) RGBA( 47, 79, 79, 1 )


ColorValue(
"DarkSlateGrey" )

Color.DarkTurquoise ColorValue( "#00ced1" ) RGBA( 0, 206, 209, 1 )


ColorValue(
"DARKTURQUOISE" )

Color.DarkViolet ColorValue( "#9400d3" ) RGBA( 148, 0, 211, 1 )


ColorValue( "DarkViolet" )

Color.DeepPink ColorValue( "#ff1493" ) RGBA( 255, 20, 147, 1 )


ColorValue( "deeppink" )

Color.DeepSkyBlue ColorValue( "#00bfff" ) RGBA( 0, 191, 255, 1 )


ColorValue(
"DeepSkyBlue" )

Color.DimGray ColorValue( "#696969" ) RGBA( 105, 105, 105, 1 )


ColorValue( "DIMGRAY" )

Color.DimGrey ColorValue( "#696969" ) RGBA( 105, 105, 105, 1 )


ColorValue( "DimGrey" )

Color.DodgerBlue ColorValue( "#1e90ff" ) RGBA( 30, 144, 255, 1 )


ColorValue(
"dodgerblue" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.FireBrick ColorValue( "#b22222" ) RGBA( 178, 34, 34, 1 )


ColorValue( "FireBrick" )

Color.FloralWhite ColorValue( "#fffaf0" ) RGBA( 255, 250, 240, 1 )


ColorValue(
"FLORALWHITE" )

Color.ForestGreen ColorValue( "#228b22" ) RGBA( 34, 139, 34, 1 )


ColorValue(
"ForestGreen" )

Color.Fuchsia ColorValue( "#ff00ff" ) RGBA( 255, 0, 255, 1 )


ColorValue( "fuchsia" )

Color.Gainsboro ColorValue( "#dcdcdc" ) RGBA( 220, 220, 220, 1 )


ColorValue( "Gainsboro" )

Color.GhostWhite ColorValue( "#f8f8ff" ) RGBA( 248, 248, 255, 1 )


ColorValue(
"GHOSTWHITE" )

Color.Gold ColorValue( "#ffd700" ) RGBA( 255, 215, 0, 1 )


ColorValue( "Gold" )

Color.GoldenRod ColorValue( "#daa520" ) RGBA( 218, 165, 32, 1 )


ColorValue( "goldenrod" )

Color.Gray ColorValue( "#808080" ) RGBA( 128, 128, 128, 1 )


ColorValue( "Gray" )

Color.Green ColorValue( "#008000" ) RGBA( 0, 128, 0, 1 )


ColorValue( "GREEN" )

Color.GreenYellow ColorValue( "#adff2f" ) RGBA( 173, 255, 47, 1 )


ColorValue(
"GreenYellow" )

Color.Grey ColorValue( "#808080" ) RGBA( 128, 128, 128, 1 )


ColorValue( "grey" )

Color.Honeydew ColorValue( "#f0fff0" ) RGBA( 240, 255, 240, 1 )


ColorValue( "Honeydew" )

Color.HotPink ColorValue( "#ff69b4" ) RGBA( 255, 105, 180, 1 )


ColorValue( "HOTPINK" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.IndianRed ColorValue( "#cd5c5c" ) RGBA( 205, 92, 92, 1 )


ColorValue( "IndianRed" )

Color.Indigo ColorValue( "#4b0082" ) RGBA( 75, 0, 130, 1 )


ColorValue( "indigo" )

Color.Ivory ColorValue( "#fffff0" ) RGBA( 255, 255, 240, 1 )


ColorValue( "Ivory" )

Color.Khaki ColorValue( "#f0e68c" ) RGBA( 240, 230, 140, 1 )


ColorValue( "KHAKI" )

Color.Lavender ColorValue( "#e6e6fa" ) RGBA( 230, 230, 250, 1 )


ColorValue( "Lavender" )

Color.LavenderBlush ColorValue( "#fff0f5" ) RGBA( 255, 240, 245, 1 )


ColorValue(
"lavenderblush" )

Color.LawnGreen ColorValue( "#7cfc00" ) RGBA( 124, 252, 0, 1 )


ColorValue( "LawnGreen" )

Color.LemonChiffon ColorValue( "#fffacd" ) RGBA( 255, 250, 205, 1 )


ColorValue(
"LEMONCHIFFON" )

Color.LightBlue ColorValue( "#add8e6" ) RGBA( 173, 216, 230, 1 )


ColorValue( "LightBlue" )

Color.LightCoral ColorValue( "#f08080" ) RGBA( 240, 128, 128, 1 )


ColorValue( "lightcoral" )

Color.LightCyan ColorValue( "#e0ffff" ) RGBA( 224, 255, 255, 1 )


ColorValue( "LightCyan" )

Color.LightGoldenRodYell ColorValue( "#fafad2" ) RGBA( 250, 250, 210, 1 )


ow ColorValue(
"lightgoldenrodyellow" )

Color.LightGray ColorValue( "#d3d3d3" ) RGBA( 211, 211, 211, 1 )


ColorValue( "LightGray" )

Color.LightGreen ColorValue( "#90ee90" ) RGBA( 144, 238, 144, 1 )


ColorValue( "lightgreen" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.LightGrey ColorValue( "#d3d3d3" ) RGBA( 211, 211, 211, 1 )


ColorValue( "LightGrey" )

Color.LightPink ColorValue( "#ffb6c1" ) RGBA( 255, 182, 193, 1 )


ColorValue( "LIGHTPINK" )

Color.LightSalmon ColorValue( "#ffa07a" ) RGBA( 255, 160, 122, 1 )


ColorValue(
"LightSalmon" )

Color.LightSeaGreen ColorValue( "#20b2aa" ) RGBA( 32, 178, 170, 1 )


ColorValue(
"lightseagreen" )

Color.LightSkyBlue ColorValue( "#87cefa" ) RGBA( 135, 206, 250, 1 )


ColorValue(
"LightSkyBlue" )

Color.LightSlateGray ColorValue( "#778899" ) RGBA( 119, 136, 153, 1 )


ColorValue(
"LIGHTSLATEGRAY" )

Color.LightSlateGrey ColorValue( "#778899" ) RGBA( 119, 136, 153, 1 )


ColorValue(
"LightSlateGrey" )

Color.LightSteelBlue ColorValue( "#b0c4de" ) RGBA( 176, 196, 222, 1 )


ColorValue(
"lightsteelblue" )

Color.LightYellow ColorValue( "#ffffe0" ) RGBA( 255, 255, 224, 1 )


ColorValue(
"LightYellow" )

Color.Lime ColorValue( "#00ff00" ) RGBA( 0, 255, 0, 1 )


ColorValue( "LIME" )

Color.LimeGreen ColorValue( "#32cd32" ) RGBA( 50, 205, 50, 1 )


ColorValue( "LimeGreen" )

Color.Linen ColorValue( "#faf0e6" ) RGBA( 250, 240, 230, 1 )


ColorValue( "linen" )

Color.Magenta ColorValue( "#ff00ff" ) RGBA( 255, 0, 255, 1 )


ColorValue( "Magenta" )

Color.Maroon ColorValue( "#800000" ) RGBA( 128, 0, 0, 1 )


ColorValue( "MAROON" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.MediumAquamarine ColorValue( "#66cdaa" ) RGBA( 102, 205, 170, 1 )


ColorValue(
"MediumAquamarine" )

Color.MediumBlue ColorValue( "#0000cd" ) RGBA( 0, 0, 205, 1 )


ColorValue(
"mediumblue" )

Color.MediumOrchid ColorValue( "#ba55d3" ) RGBA( 186, 85, 211, 1 )


ColorValue(
"MediumOrchid" )

Color.MediumPurple ColorValue( "#9370db" ) RGBA( 147, 112, 219, 1 )


ColorValue(
"MEDIUMPURPLE" )

Color.MediumSeaGreen ColorValue( "#3cb371" ) RGBA( 60, 179, 113, 1 )


ColorValue(
"MediumSeaGreen" )

Color.MediumSlateBlue ColorValue( "#7b68ee" ) RGBA( 123, 104, 238, 1 )


ColorValue(
"mediumslateblue" )

Color.MediumSpringGree ColorValue( "#00fa9a" ) RGBA( 0, 250, 154, 1 )


n ColorValue(
"MediumSpringGreen" )

Color.MediumTurquoise ColorValue( "#48d1cc" ) RGBA( 72, 209, 204, 1 )


ColorValue(
"MEDIUMTURQUOISE" )

Color.MediumVioletRed ColorValue( "#c71585" ) RGBA( 199, 21, 133, 1 )


ColorValue(
"MediumVioletRed" )

Color.MidnightBlue ColorValue( "#191970" ) RGBA( 25, 25, 112, 1 )


ColorValue(
"midnightblue" )

Color.MintCream ColorValue( "#f5fffa" ) RGBA( 245, 255, 250, 1 )


ColorValue(
"MintCream" )

Color.MistyRose ColorValue( "#ffe4e1" ) RGBA( 255, 228, 225, 1 )


ColorValue(
"MISTYROSE" )

Color.Moccasin ColorValue( "#ffe4b5" ) RGBA( 255, 228, 181, 1 )


ColorValue( "Moccasin" )

Color.NavajoWhite ColorValue( "#ffdead" ) RGBA( 255, 222, 173, 1 )


ColorValue(
"navajowhite" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.Navy ColorValue( "#000080" ) RGBA( 0, 0, 128, 1 )


ColorValue( "Navy" )

Color.OldLace ColorValue( "#fdf5e6" ) RGBA( 253, 245, 230, 1 )


ColorValue( "OLDLACE" )

Color.Olive ColorValue( "#808000" ) RGBA( 128, 128, 0, 1 )


ColorValue( "Olive" )

Color.OliveDrab ColorValue( "#6b8e23" ) RGBA( 107, 142, 35, 1 )


ColorValue( "olivedrab" )

Color.Orange ColorValue( "#ffa500" ) RGBA( 255, 165, 0, 1 )


ColorValue( "Orange" )

Color.OrangeRed ColorValue( "#ff4500" ) RGBA( 255, 69, 0, 1 )


ColorValue(
"ORANGERED" )

Color.Orchid ColorValue( "#da70d6" ) RGBA( 218, 112, 214, 1 )


ColorValue( "Orchid" )

Color.PaleGoldenRod ColorValue( "#eee8aa" ) RGBA( 238, 232, 170, 1 )


ColorValue(
"palegoldenrod" )

Color.PaleGreen ColorValue( "#98fb98" ) RGBA( 152, 251, 152, 1 )


ColorValue( "PaleGreen" )

Color.PaleTurquoise ColorValue( "#afeeee" ) RGBA( 175, 238, 238, 1 )


ColorValue(
"PALETURQUOISE" )

Color.PaleVioletRed ColorValue( "#db7093" ) RGBA( 219, 112, 147, 1 )


ColorValue(
"PaleVioletRed" )

Color.PapayaWhip ColorValue( "#ffefd5" ) RGBA( 255, 239, 213, 1 )


ColorValue(
"papayawhip" )

Color.PeachPuff ColorValue( "#ffdab9" ) RGBA( 255, 218, 185, 1 )


ColorValue( "PeachPuff" )

Color.Peru ColorValue( "#cd853f" ) RGBA( 205, 133, 63, 1 )


ColorValue( "PERU" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.Pink ColorValue( "#ffc0cb" ) RGBA( 255, 192, 203, 1 )


ColorValue( "Pink" )

Color.Plum ColorValue( "#dda0dd" ) RGBA( 221, 160, 221, 1 )


ColorValue( "plum" )

Color.PowderBlue ColorValue( "#b0e0e6" ) RGBA( 176, 224, 230, 1 )


ColorValue(
"PowderBlue" )

Color.Purple ColorValue( "#800080" ) RGBA( 128, 0, 128, 1 )


ColorValue( "PURPLE" )

Color.Red ColorValue( "#ff0000" ) RGBA( 255, 0, 0, 1 )


ColorValue( "Red" )

Color.RosyBrown ColorValue( "#bc8f8f" ) RGBA( 188, 143, 143, 1 )


ColorValue( "rosybrown" )

Color.RoyalBlue ColorValue( "#4169e1" ) RGBA( 65, 105, 225, 1 )


ColorValue( "RoyalBlue" )

Color.SaddleBrown ColorValue( "#8b4513" ) RGBA( 139, 69, 19, 1 )


ColorValue(
"SADDLEBROWN" )

Color.Salmon ColorValue( "#fa8072" ) RGBA( 250, 128, 114, 1 )


ColorValue( "Salmon" )

Color.SandyBrown ColorValue( "#f4a460" ) RGBA( 244, 164, 96, 1 )


ColorValue(
"sandybrown" )

Color.SeaGreen ColorValue( "#2e8b57" ) RGBA( 46, 139, 87, 1 )


ColorValue( "SeaGreen" )

Color.SeaShell ColorValue( "#fff5ee" ) RGBA( 255, 245, 238, 1 )


ColorValue( "SEASHELL" )

Color.Sienna ColorValue( "#a0522d" ) RGBA( 160, 82, 45, 1 )


ColorValue( "Sienna" )

Color.Silver ColorValue( "#c0c0c0" ) RGBA( 192, 192, 192, 1 )


ColorValue( "silver" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.SkyBlue ColorValue( "#87ceeb" ) RGBA( 135, 206, 235, 1 )


ColorValue( "SkyBlue" )

Color.SlateBlue ColorValue( "#6a5acd" ) RGBA( 106, 90, 205, 1 )


ColorValue(
"SLATEBLUE" )

Color.SlateGray ColorValue( "#708090" ) RGBA( 112, 128, 144, 1 )


ColorValue( "SlateGray" )

Color.SlateGrey ColorValue( "#708090" ) RGBA( 112, 128, 144, 1 )


ColorValue( "slategrey" )

Color.Snow ColorValue( "#fffafa" ) RGBA( 255, 250, 250, 1 )


ColorValue( "Snow" )

Color.SpringGreen ColorValue( "#00ff7f" ) RGBA( 0, 255, 127, 1 )


ColorValue(
"SPRINGGREEN" )

Color.SteelBlue ColorValue( "#4682b4" ) RGBA( 70, 130, 180, 1 )


ColorValue( "SteelBlue" )

Color.Tan ColorValue( "#d2b48c" ) RGBA( 210, 180, 140, 1 )


ColorValue( "tan" )

Color.Teal ColorValue( "#008080" ) RGBA( 0, 128, 128, 1 )


ColorValue( "Teal" )

Color.Thistle ColorValue( "#d8bfd8" ) RGBA( 216, 191, 216, 1 )


ColorValue( "THISTLE" )

Color.Tomato ColorValue( "#ff6347" ) RGBA( 255, 99, 71, 1 )


ColorValue( "Tomato" )

Color.Transparent ColorValue( "#00000000" ) RGBA( 0, 0, 0, 0 )


ColorValue(
"Transparent" )

Color.Turquoise ColorValue( "#40e0d0" ) RGBA( 64, 224, 208, 1 )


ColorValue( "turquoise" )

Color.Violet ColorValue( "#ee82ee" ) RGBA( 238, 130, 238, 1 )


ColorValue( "Violet" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.Wheat ColorValue( "#f5deb3" ) RGBA( 245, 222, 179, 1 )


ColorValue( "WHEAT" )

Color.White ColorValue( "#ffffff" ) RGBA( 255, 255, 255, 1 )


ColorValue( "White" )

Color.WhiteSmoke ColorValue( "#f5f5f5" ) RGBA( 245, 245, 245, 1 )


ColorValue(
"whitesmoke" )

Color.Yellow ColorValue( "#ffff00" ) RGBA( 255, 255, 0, 1 )


ColorValue( "Yellow" )

Color.YellowGreen ColorValue( "#9acd32" ) RGBA( 154, 205, 50, 1 )


ColorValue(
"YELLOWGREEN" )
Acceleration, App, Compass, Connection, and
Location signals in Power Apps
2/11/2020 • 4 minutes to read • Edit Online

Returns information about the app's environment, such as where the user is located in the world and which screen
is displayed.

Description and syntax


Signals are values that can change at any time, independent of how the user may be interacting with the app.
Formulas that are based on signals automatically recalculate as these values change.
Signals typically return a record of information. You can use and store this information as a record, or you can
extract individual properties by using the . operator.

NOTE
The Acceleration and Compass functions return accurate values in a native player such as on iOS or Android, but those
functions return zero values as you create or modify an app in the browser.

Acceleration
The Acceleration signal returns the device's acceleration in three dimensions relative to the device's screen.
Acceleration is measured in g units of 9.81 m/second2 or 32.2 ft/second2 (the acceleration that the Earth imparts to
objects at its surface due to gravity).

PROPERTY DESCRIPTION

Acceleration.X Right and left. Right is a positive number.

Acceleration.Y Forward and back. Forward is a positive number.

Acceleration.Z Up and down. Up is a positive number.

App
Among other properties, the App object includes a signal that indicates which screen is showing.

PROPERTY DESCRIPTION

App.ActiveScreen Screen that's showing. Returns a screen object, which you can
use to reference properties of the screen or compare to
another screen to determine which screen is showing. You can
use the Back or Navigate function to change the screen
that's showing.

More information: App object documentation.


Compass
The Compass signal returns the compass heading of the top of the screen. The heading is based on magnetic
north.
PROPERTY DESCRIPTION

Compass.Heading Heading in degrees. Returns a number 0 to 360, and 0 is


north.

Connection
The Connection signal returns the information about the network connection. When on a metered connection, you
may want to limit how much data you send or receive over the network.

PROPERTY DESCRIPTION

Connection.Connected Returns a Boolean true or false value that indicates whether


the device is connected to a network.

Connection.Metered Returns a Boolean true or false value that indicates whether


the connection is metered.

Location
The Location signal returns the location of the device based on the Global Positioning System (GPS ) and other
device information, such as cell-tower communications and IP address.
When a user accesses the location information for the first time, the device may prompt that user to allow access to
this information.
As the location changes, dependencies on the location will continuously recalculate, which will consume power
from the device's battery. To conserve battery life, you can use the Enable and Disable functions to turn location
updates on and off. Location is automatically turned off if the displayed screen doesn't depend on location
information.

PROPERTY DESCRIPTION

Location.Altitude Returns a number that indicates the altitude, measured in feet,


above sea level.

Location.Latitude Returns a number, from –90 to 90, that indicates the latitude,
as measured in degrees from the equator. A positive number
indicates a location that's north of the equator.

Location.Longitude Returns a number, from –180 to 180, that indicates the


longitude, as measured in degrees from Greenwich, England. A
positive number indicates a location that's east of Greenwhich.

Examples
In a baseball field, a pitcher throws a phone from the pitcher's mound to a catcher at home plate. The phone is lying
flat with respect to the ground, the top of the screen is pointed at the catcher, and the pitcher adds no spin. At this
location, the phone has cellular network service that's metered but no WiFi. The PlayBall screen is displayed.

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Location.Latitude Returns the latitude of the current 47.591


location. The field is located at map
coordinates 47.591 N, 122.333 W. The latitude will change continuously as
the ball moves between the pitcher and
the catcher.

Location.Longitude Returns the longitude of the current 122.333


location.
The longitude will change continuously
as the ball moves between the pitcher
and the catcher.

Location Returns the latitude and longitude of { Latitude: 47.591, Longitude: 122.333 }
the current location, as a record.

Compass.Heading Returns the compass heading of the top 230.25


of the screen. At this field, home plate is
roughly southwest from the pitcher's
mound.

Acceleration.X Returns the acceleration of the device 0


side to side. The pitcher is throwing the
phone straight ahead with respect to
the screen's top, so the device isn't
accelerating side to side.

Acceleration.Y Returns the acceleration of the device 8.2, while the pitcher throws the device.
front to back. The pitcher initially gives
the device a large acceleration when 0, while the device is in the air.
throwing the device, going from 0 to 90
miles per hour (132 feet per second) in -8.2, as the catcher catches the device.
half a second. After the device is in the
air, ignoring air friction, the device
doesn't accelerate further. The device
decelerates when the catcher catches it,
bringing it to a stop.

Acceleration.Z Returns the acceleration of the device 0, before the pitcher throws the device.
top to bottom. While in the air, the
device experiences the effects of gravity. 1, while the device is in the air.

0, after the catcher catches the device.

Acceleration Returns the acceleration as a record. { X: 0, Y: 264, Z: 0 } as the pitcher


throws the device.

Connection.Connected Returns a Boolean value that indicates true


whether the device is connected to a
network

Connection.Metered Returns a Boolean value that indicates true


whether the connection is metered

App.ActiveScreen = PlayBall Returns a Boolean value that indicates true


whether PlayBall is displayed.
FORMULA DESCRIPTION RESULT

App.ActiveScreen.Fill Returns the background color for the Color.Green


displayed screen.
Concat and Concatenate functions in Power Apps
12/3/2019 • 3 minutes to read • Edit Online

Concatenates individual strings of text and strings in tables.

Description
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.
Fields of the record currently being processed are available within the formula. You simply reference them by name
as you would any other value. You can also reference control properties and other values from throughout your
app. For more details, see the examples below and working with record scope.
Use the Split or MatchAll function to split a string into a table of substrings.

Syntax
Concat( Table, Formula )
Table - Required. Table to operate on.
Formula - Required. Formula to apply across the records of the table.
Concatenate( String1 [, String2, ...] )
String (s) - Required. Mix of individual strings or a single-column table of strings.

Examples
The examples in this section use these global variables:
FirstName = "Jane"
LastName = "Doe"

Products =
To create these global variables in an app, insert a Button control, and set its OnSelect property to this formula:

Set( FirstName, "Jane" ); Set( LastName, "Doe" );


Set( Products,
Table(
{ Name: "Violin", Type: "String" },
{ Name: "Cello", Type: "String" },
{ Name: "Trumpet", Type: "Wind" }
)
)

Select the button (by clicking it while you hold down the Alt key).
Concatenate function and the & operator
For these examples, set the Text property of a Label control to a formula from the first column of the next table.

FORMULA DESCRIPTION RESULT

Concatenate( LastName, ", ", FirstNa Concatenates the value in LastName, "Doe, Jane"
me ) the string ", " (a comma followed by a
space), and the value in FirstName.

LastName & ", " & FirstName Same as the previous example except "Doe, Jane"
using the & operator instead of the
function.

Concatenate( FirstName, " ", LastNa Concatenates the value in FirstName, "Jane Doe"
me ) the string " " (a single space), and the
value in LastName.

FirstName & " " & LastName Same as the previous example, using "Jane Doe"
the & operator instead of the function.

Concatenate with a single -column table


For this example, add a blank, vertical Gallery control, set its Items property to the formula in the next table, and
then add a label in the gallery template.

FORMULA DESCRIPTION RESULT

Concatenate( For each record in the Products table,


"Name: ", Products.Name, concatenates the string "Name: ", the
", Type: ", Products.Type ) name of the product, the string ",
Type: " and the type of the product.

Concat function
For these examples, set the Text property of a label to a formula from the first column of the next table.

FORMULA DESCRIPTION RESULT

Concat( Products, Name & ", " ) Evaluates the expression Name & ", " "Violin, Cello, Trumpet, "
for each record of Products and
concatenates the results together into a
single text string.

Concat( Evaluates the formula Name & ", " for "Violin, Cello, "
Filter( Products, Type = "String" ), each record of Products that satisfies
Name & ", " ) the filter Type = "String", and
concatenates the results into a single
text string.

Trimming the end


The last two examples include an extra ", " at the end of the result. The function appends a comma and a space to
the Name value of every record in the table, including the last record.
In some cases, these extra characters don't matter. For example, a single-space separator doesn't appear if you show
the result in a label. If you want to remove these extra characters, use the Left or Match function.
For these examples, set the Text property of a label to a formula from the first column of the next table.
FORMULA DESCRIPTION RESULT

Left( Returns the result of Concat but "Violin, Cello, Trumpet"


Concat( Products, Name & ", " ), removes the last two characters, which
Len( Concat( Products, Name & ", " ) form the extraneous separator.
)-2)

Match( Returns the characters of Concat from "Violin, Cello, Trumpet"


Concat( Products, Name & ", " ), the beginning of the text string (^) to
"^(?<trim>.*), $" ).trim the end ($) but doesn't include the
unwanted comma and space at the end.

Split and MatchAll


If you used Concat with a separator, you can reverse the operation by combining the Split and MatchAll
functions.
For these examples, add a blank, vertical gallery, set its Items property to a formula in the next table, and then add
a label in the gallery template.

FORMULA DESCRIPTION RESULT

Split( Splits the text string with the separator


Concat( Products, Name & ", " ), ", " ", ". The string ends with a comma and
) space, so the last row in the result is an
empty string.

MatchAll( Splits the text string based on


Concat( Products, Name & ", " ), " characters that aren't spaces or
[^\s,]+" ).FullMatch commas. This formula removes the extra
comma and space at the end of the
string.
Concat and Concatenate functions in Power Apps
12/3/2019 • 3 minutes to read • Edit Online

Concatenates individual strings of text and strings in tables.

Description
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.
Fields of the record currently being processed are available within the formula. You simply reference them by
name as you would any other value. You can also reference control properties and other values from throughout
your app. For more details, see the examples below and working with record scope.
Use the Split or MatchAll function to split a string into a table of substrings.

Syntax
Concat( Table, Formula )
Table - Required. Table to operate on.
Formula - Required. Formula to apply across the records of the table.
Concatenate( String1 [, String2, ...] )
String (s) - Required. Mix of individual strings or a single-column table of strings.

Examples
The examples in this section use these global variables:
FirstName = "Jane"
LastName = "Doe"

Products =
To create these global variables in an app, insert a Button control, and set its OnSelect property to this formula:

Set( FirstName, "Jane" ); Set( LastName, "Doe" );


Set( Products,
Table(
{ Name: "Violin", Type: "String" },
{ Name: "Cello", Type: "String" },
{ Name: "Trumpet", Type: "Wind" }
)
)

Select the button (by clicking it while you hold down the Alt key).
Concatenate function and the & operator
For these examples, set the Text property of a Label control to a formula from the first column of the next table.

FORMULA DESCRIPTION RESULT

Concatenate( LastName, ", ", FirstN Concatenates the value in LastName, "Doe, Jane"
ame ) the string ", " (a comma followed by a
space), and the value in FirstName.

LastName & ", " & FirstName Same as the previous example except "Doe, Jane"
using the & operator instead of the
function.

Concatenate( FirstName, " ", LastNa Concatenates the value in FirstName, "Jane Doe"
me ) the string " " (a single space), and the
value in LastName.

FirstName & " " & LastName Same as the previous example, using "Jane Doe"
the & operator instead of the function.

Concatenate with a single -column table


For this example, add a blank, vertical Gallery control, set its Items property to the formula in the next table, and
then add a label in the gallery template.

FORMULA DESCRIPTION RESULT

Concatenate( For each record in the Products table,


"Name: ", Products.Name, concatenates the string "Name: ", the
", Type: ", Products.Type ) name of the product, the string ",
Type: " and the type of the product.

Concat function
For these examples, set the Text property of a label to a formula from the first column of the next table.

FORMULA DESCRIPTION RESULT

Concat( Products, Name & ", " ) Evaluates the expression Name & ", " "Violin, Cello, Trumpet, "
for each record of Products and
concatenates the results together into
a single text string.

Concat( Evaluates the formula Name & ", " for "Violin, Cello, "
Filter( Products, Type = "String" ), each record of Products that satisfies
Name & ", " ) the filter Type = "String", and
concatenates the results into a single
text string.

Trimming the end


The last two examples include an extra ", " at the end of the result. The function appends a comma and a space to
the Name value of every record in the table, including the last record.
In some cases, these extra characters don't matter. For example, a single-space separator doesn't appear if you
show the result in a label. If you want to remove these extra characters, use the Left or Match function.
For these examples, set the Text property of a label to a formula from the first column of the next table.
FORMULA DESCRIPTION RESULT

Left( Returns the result of Concat but "Violin, Cello, Trumpet"


Concat( Products, Name & ", " ), removes the last two characters, which
Len( Concat( Products, Name & ", " form the extraneous separator.
))-2)

Match( Returns the characters of Concat from "Violin, Cello, Trumpet"


Concat( Products, Name & ", " ), the beginning of the text string (^) to
"^(?<trim>.*), $" ).trim the end ($) but doesn't include the
unwanted comma and space at the
end.

Split and MatchAll


If you used Concat with a separator, you can reverse the operation by combining the Split and MatchAll
functions.
For these examples, add a blank, vertical gallery, set its Items property to a formula in the next table, and then
add a label in the gallery template.

FORMULA DESCRIPTION RESULT

Split( Splits the text string with the separator


Concat( Products, Name & ", " ), ", ", ". The string ends with a comma and
") space, so the last row in the result is an
empty string.

MatchAll( Splits the text string based on


Concat( Products, Name & ", " ), " characters that aren't spaces or
[^\s,]+" ).FullMatch commas. This formula removes the
extra comma and space at the end of
the string.
Concurrent function in Power Apps
12/3/2019 • 5 minutes to read • Edit Online

Evaluates multiple formulas concurrently with one another.

Description
The Concurrent function evaluates multiple formulas at the same time. Normally, multiple formulas are evaluated
by chaining them together with the ; operator, which evaluates each sequentially in order. When the app performs
operations concurrently, users wait less for the same result.
In the OnStart property of your app, use Concurrent to improve performance when the app loads data. When
data calls don't start until the previous calls finish, the app must wait for the sum of all request times. If data calls
start at the same time, the app needs to wait only for the longest request time. Web browsers often improve
performance by performing data operations concurrently.
You can't predict the order in which formulas within the Concurrent function start and end evaluation. Formulas
within the Concurrent function shouldn't contain dependencies on other formulas within the same Concurrent
function, and Power Apps shows an error if you try. From within, you can safely take dependencies on formulas
outside the Concurrent function because they will complete before the Concurrent function starts. Formulas
after the Concurrent function can safely take dependencies on formulas within: they'll all complete before the
Concurrent function finishes and moves on to the next formula in a chain (if you use the ; operator). Watch out for
subtle order dependencies if you're calling functions or service methods that have side effects.
You can chain formulas together with the ; operator within an argument to Concurrent. For example,
Concurrent( Set( a, 1 ); Set( b, a+1 ), Set( x, 2 ); Set( y, x+2 ) ) evaluates Set( a, 1 ); Set( b, a+1 ) concurrently
with Set( x, 2 ); Set( y, x+2 ). In this case, the dependencies within the formulas are fine: a will be set before b,
and x will be set before y.
Depending on the device or browser in which the app is running, only a handful of formulas might actually be
evaluated concurrently. Concurrent uses the available capabilities and won't finish until all formulas have been
evaluated.
If you enable Formula-level error management (in advanced settings), the first error encountered in argument
order is returned from Concurrent; otherwise, blank is returned. If all formulas are successful, true is returned. If
one formula fails, the rest of that formula stops, but other formulas continue evaluating.
You can use Concurrent only in behavior formulas.

Syntax
Concurrent( Formula1, Formula2 [, ...] )
Formula (s) – Required. Formulas to evaluate concurrently. You must supply at least two formulas.

Examples
Loading data faster
1. Create an app, and add four data sources from Common Data Service, SQL Server, or SharePoint.
This example uses four tables from the sample Adventure Works database on SQL Azure. After you create
the database, connect to it from Power Apps using the fully qualified server name (for example,
srvname.database.windows.net):
2. Add a Button control, and set its OnSelect property to this formula:

ClearCollect( Product, '[SalesLT].[Product]' );


ClearCollect( Customer, '[SalesLT].[Customer]' );
ClearCollect( SalesOrderDetail, '[SalesLT].[SalesOrderDetail]' );
ClearCollect( SalesOrderHeader, '[SalesLT].[SalesOrderHeader]' )

3. In Microsoft Edge or Google Chrome, turn on developer tools to monitor network traffic while your app is
running.
4. (optional) Turn on network throttling to exaggerate the effects of this comparison.
5. While holding down the Alt key, select the button, and then watch the network traffic.
The tools show four requests performed in series, similar to this example. Actual times have been removed
as they will vary wildly. The graph shows that each call starts after the last has finished:

6. Save, close, and reopen the app.


Power Apps caches data, so selecting the button again won't necessarily cause four new requests. Each time
you want to test performance, close and reopen your app. If you turned network throttling on, you may
want to turn it off until you're ready for another test.
7. Add a second Button control, and set its OnSelect property to this formula:
Concurrent(
ClearCollect( Product, '[SalesLT].[Product]' ),
ClearCollect( Customer, '[SalesLT].[Customer]' ),
ClearCollect( SalesOrderDetail, '[SalesLT].[SalesOrderDetail]' ),
ClearCollect( SalesOrderHeader, '[SalesLT].[SalesOrderHeader]' )
)

Note that you added the same ClearCollect calls to the first button, but they're wrapped in a Concurrent
function and separated by commas this time.
8. Clear the network monitor in the browser.
9. If you were using network throttling before, turn it on again.
10. While holding down the Alt key, select the second button, and then watch the network traffic.
The tools show four requests performed concurrently, similar to this example. Again, actual times have been
removed as they will vary wildly. The graph shows that all the calls start at about the same time and do not
wait for the previous one to finish:

These graphs are based on the same scale. By using Concurrent, you halved the total amount of time these
operations took to finish.
11. Save, close, and reopen the app.
Race condition
1. Add a connection to the Microsoft Translator service to your app.
2. Add a Text input control, and rename it TextInput1 if it has a different name.
3. Add a Button control, and set its OnSelect property to this formula:

Set( StartTime, Value( Now() ) );


Concurrent(
Set( FRTrans, MicrosoftTranslator.Translate( TextInput1.Text, "fr" ) );
Set( FRTransTime, Value( Now() ) ),
Set( DETrans, MicrosoftTranslator.Translate( TextInput1.Text, "de" ) );
Set( DETransTime, Value( Now() ) )
);
Collect( Results,
{
Input: TextInput1.Text,
French: FRTrans, FrenchTime: FRTransTime - StartTime,
German: DETrans, GermanTime: DETransTime - StartTime,
FrenchFaster: FRTransTime < DETransTime
}
)

4. Add a Data table control, and set its Items property to Results.
5. On the Properties tab of the right pane, select Edit fields to open the Fields pane.
6. In the list of fields, select the check box for each field to show them all in the data table.
7. (optional) Drag the Input field to the top of the list, and drag the FrenchFaster field to the bottom of the
list.

8. In the Text input control, type or paste a phrase to translate.


9. While holding down the Alt key, select the button multiple times to fill the table.
The times are shown in milliseconds.

In some cases, the French translation is faster than the German translation, and vice versa. Both start at the
same time, but one returns before the other for a variety of reasons, including network latency and server-
side processing.
A race condition would occur if the app depended on one translation ending first. Fortunately, Power Apps
flags most timing dependencies that it can detect.
Acceleration, App, Compass, Connection, and
Location signals in Power Apps
2/11/2020 • 4 minutes to read • Edit Online

Returns information about the app's environment, such as where the user is located in the world and which screen
is displayed.

Description and syntax


Signals are values that can change at any time, independent of how the user may be interacting with the app.
Formulas that are based on signals automatically recalculate as these values change.
Signals typically return a record of information. You can use and store this information as a record, or you can
extract individual properties by using the . operator.

NOTE
The Acceleration and Compass functions return accurate values in a native player such as on iOS or Android, but those
functions return zero values as you create or modify an app in the browser.

Acceleration
The Acceleration signal returns the device's acceleration in three dimensions relative to the device's screen.
Acceleration is measured in g units of 9.81 m/second2 or 32.2 ft/second2 (the acceleration that the Earth imparts to
objects at its surface due to gravity).

PROPERTY DESCRIPTION

Acceleration.X Right and left. Right is a positive number.

Acceleration.Y Forward and back. Forward is a positive number.

Acceleration.Z Up and down. Up is a positive number.

App
Among other properties, the App object includes a signal that indicates which screen is showing.

PROPERTY DESCRIPTION

App.ActiveScreen Screen that's showing. Returns a screen object, which you can
use to reference properties of the screen or compare to
another screen to determine which screen is showing. You can
use the Back or Navigate function to change the screen
that's showing.

More information: App object documentation.


Compass
The Compass signal returns the compass heading of the top of the screen. The heading is based on magnetic
north.
PROPERTY DESCRIPTION

Compass.Heading Heading in degrees. Returns a number 0 to 360, and 0 is


north.

Connection
The Connection signal returns the information about the network connection. When on a metered connection, you
may want to limit how much data you send or receive over the network.

PROPERTY DESCRIPTION

Connection.Connected Returns a Boolean true or false value that indicates whether


the device is connected to a network.

Connection.Metered Returns a Boolean true or false value that indicates whether


the connection is metered.

Location
The Location signal returns the location of the device based on the Global Positioning System (GPS ) and other
device information, such as cell-tower communications and IP address.
When a user accesses the location information for the first time, the device may prompt that user to allow access to
this information.
As the location changes, dependencies on the location will continuously recalculate, which will consume power
from the device's battery. To conserve battery life, you can use the Enable and Disable functions to turn location
updates on and off. Location is automatically turned off if the displayed screen doesn't depend on location
information.

PROPERTY DESCRIPTION

Location.Altitude Returns a number that indicates the altitude, measured in feet,


above sea level.

Location.Latitude Returns a number, from –90 to 90, that indicates the latitude,
as measured in degrees from the equator. A positive number
indicates a location that's north of the equator.

Location.Longitude Returns a number, from –180 to 180, that indicates the


longitude, as measured in degrees from Greenwich, England. A
positive number indicates a location that's east of Greenwhich.

Examples
In a baseball field, a pitcher throws a phone from the pitcher's mound to a catcher at home plate. The phone is lying
flat with respect to the ground, the top of the screen is pointed at the catcher, and the pitcher adds no spin. At this
location, the phone has cellular network service that's metered but no WiFi. The PlayBall screen is displayed.

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Location.Latitude Returns the latitude of the current 47.591


location. The field is located at map
coordinates 47.591 N, 122.333 W. The latitude will change continuously as
the ball moves between the pitcher and
the catcher.

Location.Longitude Returns the longitude of the current 122.333


location.
The longitude will change continuously
as the ball moves between the pitcher
and the catcher.

Location Returns the latitude and longitude of { Latitude: 47.591, Longitude: 122.333 }
the current location, as a record.

Compass.Heading Returns the compass heading of the top 230.25


of the screen. At this field, home plate is
roughly southwest from the pitcher's
mound.

Acceleration.X Returns the acceleration of the device 0


side to side. The pitcher is throwing the
phone straight ahead with respect to
the screen's top, so the device isn't
accelerating side to side.

Acceleration.Y Returns the acceleration of the device 8.2, while the pitcher throws the device.
front to back. The pitcher initially gives
the device a large acceleration when 0, while the device is in the air.
throwing the device, going from 0 to 90
miles per hour (132 feet per second) in -8.2, as the catcher catches the device.
half a second. After the device is in the
air, ignoring air friction, the device
doesn't accelerate further. The device
decelerates when the catcher catches it,
bringing it to a stop.

Acceleration.Z Returns the acceleration of the device 0, before the pitcher throws the device.
top to bottom. While in the air, the
device experiences the effects of gravity. 1, while the device is in the air.

0, after the catcher catches the device.

Acceleration Returns the acceleration as a record. { X: 0, Y: 264, Z: 0 } as the pitcher


throws the device.

Connection.Connected Returns a Boolean value that indicates true


whether the device is connected to a
network

Connection.Metered Returns a Boolean value that indicates true


whether the connection is metered

App.ActiveScreen = PlayBall Returns a Boolean value that indicates true


whether PlayBall is displayed.
FORMULA DESCRIPTION RESULT

App.ActiveScreen.Fill Returns the background color for the Color.Green


displayed screen.
Count, CountA, CountIf, and CountRows functions in
Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Counts all records in a table, or counts all records that satisfy a condition.

Description
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 records in a table.
Each of these functions returns a number.
When used with a data source, these functions can't be delegated. Only the first portion of the data source will be
retrieved and then the function applied. The result may not represent the complete story. A warning will appear at
authoring time to remind you of this limitation and to suggest switching to delegable alternatives where possible.
For more information, see the delegation overview.

Syntax
Count( SingleColumnTable )
CountA ( SingleColumnTable )
SingleColumnTable - Required. Column of records to count.
CountIf( Table, LogicalFormula )
Table - Required. Table of records to count.
LogicalFormula - Required. Formula to evaluate for each record of the table. Records that return true for this
formula are counted. The formula can reference columns of the table.
CountRows( Table )
Table - Required. Table of records to count.

Example
1. Import or create a collection named Inventory, as the first subprocedure in Show images and text in a
gallery describes.
2. Add a label, and set its Text property to this formula:
CountIf(Inventory, UnitsInStock < 30)
The label shows 2 because two products (Ganymede and Callisto) have fewer than 30 units in stock.
3. Add another label, and set its Text property to this formula:
CountA (Inventory.UnitsInStock)
The label shows 5, the number of non-empty cells in the UnitsInStock column.
4. Add another label, and set its Text property to this formula:
CountRows(Inventory)
The label shows 5 because the collection contains five rows.
Acos, Acot, Asin, Atan, Atan2, Cos, Cot, Degrees, Pi,
Radians, Sin, and Tan functions in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Calculates trigonometric values.

Description
Primary functions
The Cos function returns the cosine of its argument, an angle specified in radians.
The Cot function returns the cotangent of its argument, an angle specified in radians.
The Sin function returns the sine of its argument, an angle specified in radians.
The Tan function returns the tangent of its argument, an angle specified in radians.
Inverse functions
The Acos function returns the arccosine, or inverse cosine, of its argument. The arccosine is the angle whose cosine
is the argument. The returned angle is given in radians in the range 0 (zero) to π.
The Acot function returns the principal value of the arccotangent, or inverse cotangent, of its argument. The
returned angle is given in radians in the range 0 (zero) to π.
The Asin function returns the arcsine, or inverse sine, of its argument. The arcsine is the angle whose sine is the
argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan function returns the arctangent, or inverse tangent, of its argument. The arctangent is the angle whose
tangent is the argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan2 function returns the arctangent, or inverse tangent, of the specified x and y coordinates as arguments.
The arctangent is the angle from the x-axis to a line that contains the origin (0, 0) and a point with coordinates (x, y).
The angle is given in radians between -π and π, excluding -π. A positive result represents a counterclockwise angle
from the x-axis; a negative result represents a clockwise angle. Atan2( a, b ) equals Atan( b/a ), except that a can
equal 0 (zero) with the Atan2 function.
Helper functions
The Degrees function converts radians to degrees. π radians equals 180 degrees.
The Pi function returns the transcendental number π, which begins 3.141592...
The Radians function converts degrees to radians.
Notes
If you pass a single number to these functions, the return value is a single result. If you pass a single-column table
that contains numbers, the return value is a single-column table of results, one result for each record in the
argument's table. If you have a multi-column table, you can shape it into a single-column table, as working with
tables describes.
If an argument would result in an undefined value, the result is blank. This can happen, for example, when using
inverse functions with arguments that are out of range.
Syntax
Primary Functions
Cos( Radians )
Cot( Radians )
Sin( Radians )
Tan( Radians )
Radians - Required. Angle to operate on.
Cos( SingleColumnTable )
Cot( SingleColumnTable )
Sin( SingleColumnTable )
Tan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of angles to operate on.
Inverse Functions
Acos( Number )
Acot( Number )
Asin( Number )
Atan( Number )
Number - Required. Number to operate on.
Acos( SingleColumnTable )
Acot( SingleColumnTable )
Asin( SingleColumnTable )
Atan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of numbers to operate on.
Atan2( X, Y )
X - Required. X-axis coordinate.
Y - Required. Y -axis coordinate.
Helper Functions
Degrees( Radians )
Radians - Required. Angle in radians to convert to degrees.
Pi()
Radians( Degrees )
Degrees - Required. Angle in degrees to convert to radians.

Examples
Single number
FORMULA DESCRIPTION RESULT

Cos( 1.047197 ) Returns the cosine of 1.047197 radians 0.5


or 60 degrees.
FORMULA DESCRIPTION RESULT

Cot( Pi()/4 ) Returns the cotangent of 0.785398... 1


radians or 45 degrees.

Sin( Pi()/2 ) Returns the sine of 1.570796... radians 1


or 90 degrees.

Tan( Radians(60) ) Returns the tangent of 1.047197... 1.732050...


radians or 60 degrees.

Acos( 0.5 ) Returns the arccosine of 0.5, in radians. 1.047197...

Acot( 1 ) Returns the arccotangent of 1, in 0.785398...


radians.

Asin( 1 ) Returns the arcsine of 1, in radians. 1.570796...

Atan( 1.732050 ) Returns the arctangent of 1.732050, in 1.047197...


radians.

Atan2( 5, 3 ) Returns the arctangent of the angle 0.540419...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (5,3),
which is approximately 31 degrees.

Atan2( 4, 4 ) Returns the arctangent of the angle 0.785398...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (4,4),
which is exactly π/4 radians or 45
degrees.

Degrees( 1.047197 ) Returns the equivalent number of 60


degrees for 1.047197 radians.

Pi() Returns the transcendental number π. 3.141592...

Radians( 15 ) Returns the equivalent number of 0.261799...


radians for 15 degrees.

Single -column table


The examples in this section use a data source that's named ValueTable and that contains the following data. The
last record in the table is π/2 radians or 90 degrees.

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Cos( ValueTable ) Returns the cosine of each number in


the table.

Cot( ValueTable ) Returns the cotangent of each number


in the table.

Sin( ValueTable ) Returns the sine of each number in the


table.

Tan( ValueTable ) Returns the tangent of each number in


the table.

Acos( ValueTable ) Returns the arccosine of each number in


the table.

Acot( ValueTable ) Returns the arccotangent of each


number in the table.

Asin( ValueTable ) Returns the arcsine of each number in


the table.

Atan( ValueTable ) Returns the arctangent of each number


in the table.
FORMULA DESCRIPTION RESULT

Degrees( ValueTable ) Returns the equivalent number of


degrees for each number in the table,
assumed to be angles in radians.

Radians( ValueTable ) Returns the equivalent number of


radians for each number in the table,
assumed to be angles in degrees.
Acos, Acot, Asin, Atan, Atan2, Cos, Cot, Degrees, Pi,
Radians, Sin, and Tan functions in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Calculates trigonometric values.

Description
Primary functions
The Cos function returns the cosine of its argument, an angle specified in radians.
The Cot function returns the cotangent of its argument, an angle specified in radians.
The Sin function returns the sine of its argument, an angle specified in radians.
The Tan function returns the tangent of its argument, an angle specified in radians.
Inverse functions
The Acos function returns the arccosine, or inverse cosine, of its argument. The arccosine is the angle whose cosine
is the argument. The returned angle is given in radians in the range 0 (zero) to π.
The Acot function returns the principal value of the arccotangent, or inverse cotangent, of its argument. The
returned angle is given in radians in the range 0 (zero) to π.
The Asin function returns the arcsine, or inverse sine, of its argument. The arcsine is the angle whose sine is the
argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan function returns the arctangent, or inverse tangent, of its argument. The arctangent is the angle whose
tangent is the argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan2 function returns the arctangent, or inverse tangent, of the specified x and y coordinates as arguments.
The arctangent is the angle from the x-axis to a line that contains the origin (0, 0) and a point with coordinates (x, y).
The angle is given in radians between -π and π, excluding -π. A positive result represents a counterclockwise angle
from the x-axis; a negative result represents a clockwise angle. Atan2( a, b ) equals Atan( b/a ), except that a can
equal 0 (zero) with the Atan2 function.
Helper functions
The Degrees function converts radians to degrees. π radians equals 180 degrees.
The Pi function returns the transcendental number π, which begins 3.141592...
The Radians function converts degrees to radians.
Notes
If you pass a single number to these functions, the return value is a single result. If you pass a single-column table
that contains numbers, the return value is a single-column table of results, one result for each record in the
argument's table. If you have a multi-column table, you can shape it into a single-column table, as working with
tables describes.
If an argument would result in an undefined value, the result is blank. This can happen, for example, when using
inverse functions with arguments that are out of range.
Syntax
Primary Functions
Cos( Radians )
Cot( Radians )
Sin( Radians )
Tan( Radians )
Radians - Required. Angle to operate on.
Cos( SingleColumnTable )
Cot( SingleColumnTable )
Sin( SingleColumnTable )
Tan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of angles to operate on.
Inverse Functions
Acos( Number )
Acot( Number )
Asin( Number )
Atan( Number )
Number - Required. Number to operate on.
Acos( SingleColumnTable )
Acot( SingleColumnTable )
Asin( SingleColumnTable )
Atan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of numbers to operate on.
Atan2( X, Y )
X - Required. X-axis coordinate.
Y - Required. Y -axis coordinate.
Helper Functions
Degrees( Radians )
Radians - Required. Angle in radians to convert to degrees.
Pi()
Radians( Degrees )
Degrees - Required. Angle in degrees to convert to radians.

Examples
Single number
FORMULA DESCRIPTION RESULT

Cos( 1.047197 ) Returns the cosine of 1.047197 radians 0.5


or 60 degrees.
FORMULA DESCRIPTION RESULT

Cot( Pi()/4 ) Returns the cotangent of 0.785398... 1


radians or 45 degrees.

Sin( Pi()/2 ) Returns the sine of 1.570796... radians 1


or 90 degrees.

Tan( Radians(60) ) Returns the tangent of 1.047197... 1.732050...


radians or 60 degrees.

Acos( 0.5 ) Returns the arccosine of 0.5, in radians. 1.047197...

Acot( 1 ) Returns the arccotangent of 1, in 0.785398...


radians.

Asin( 1 ) Returns the arcsine of 1, in radians. 1.570796...

Atan( 1.732050 ) Returns the arctangent of 1.732050, in 1.047197...


radians.

Atan2( 5, 3 ) Returns the arctangent of the angle 0.540419...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (5,3),
which is approximately 31 degrees.

Atan2( 4, 4 ) Returns the arctangent of the angle 0.785398...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (4,4),
which is exactly π/4 radians or 45
degrees.

Degrees( 1.047197 ) Returns the equivalent number of 60


degrees for 1.047197 radians.

Pi() Returns the transcendental number π. 3.141592...

Radians( 15 ) Returns the equivalent number of 0.261799...


radians for 15 degrees.

Single -column table


The examples in this section use a data source that's named ValueTable and that contains the following data. The
last record in the table is π/2 radians or 90 degrees.

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Cos( ValueTable ) Returns the cosine of each number in


the table.

Cot( ValueTable ) Returns the cotangent of each number


in the table.

Sin( ValueTable ) Returns the sine of each number in the


table.

Tan( ValueTable ) Returns the tangent of each number in


the table.

Acos( ValueTable ) Returns the arccosine of each number in


the table.

Acot( ValueTable ) Returns the arccotangent of each


number in the table.

Asin( ValueTable ) Returns the arcsine of each number in


the table.

Atan( ValueTable ) Returns the arctangent of each number


in the table.
FORMULA DESCRIPTION RESULT

Degrees( ValueTable ) Returns the equivalent number of


degrees for each number in the table,
assumed to be angles in radians.

Radians( ValueTable ) Returns the equivalent number of


radians for each number in the table,
assumed to be angles in degrees.
Count, CountA, CountIf, and CountRows functions in
Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Counts all records in a table, or counts all records that satisfy a condition.

Description
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 records in a table.
Each of these functions returns a number.
When used with a data source, these functions can't be delegated. Only the first portion of the data source will be
retrieved and then the function applied. The result may not represent the complete story. A warning will appear at
authoring time to remind you of this limitation and to suggest switching to delegable alternatives where possible.
For more information, see the delegation overview.

Syntax
Count( SingleColumnTable )
CountA ( SingleColumnTable )
SingleColumnTable - Required. Column of records to count.
CountIf( Table, LogicalFormula )
Table - Required. Table of records to count.
LogicalFormula - Required. Formula to evaluate for each record of the table. Records that return true for this
formula are counted. The formula can reference columns of the table.
CountRows( Table )
Table - Required. Table of records to count.

Example
1. Import or create a collection named Inventory, as the first subprocedure in Show images and text in a
gallery describes.
2. Add a label, and set its Text property to this formula:
CountIf(Inventory, UnitsInStock < 30)
The label shows 2 because two products (Ganymede and Callisto) have fewer than 30 units in stock.
3. Add another label, and set its Text property to this formula:
CountA (Inventory.UnitsInStock)
The label shows 5, the number of non-empty cells in the UnitsInStock column.
4. Add another label, and set its Text property to this formula:
CountRows(Inventory)
The label shows 5 because the collection contains five rows.
Count, CountA, CountIf, and CountRows functions in
Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Counts all records in a table, or counts all records that satisfy a condition.

Description
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 records in a table.
Each of these functions returns a number.
When used with a data source, these functions can't be delegated. Only the first portion of the data source will be
retrieved and then the function applied. The result may not represent the complete story. A warning will appear at
authoring time to remind you of this limitation and to suggest switching to delegable alternatives where possible.
For more information, see the delegation overview.

Syntax
Count( SingleColumnTable )
CountA ( SingleColumnTable )
SingleColumnTable - Required. Column of records to count.
CountIf( Table, LogicalFormula )
Table - Required. Table of records to count.
LogicalFormula - Required. Formula to evaluate for each record of the table. Records that return true for this
formula are counted. The formula can reference columns of the table.
CountRows( Table )
Table - Required. Table of records to count.

Example
1. Import or create a collection named Inventory, as the first subprocedure in Show images and text in a
gallery describes.
2. Add a label, and set its Text property to this formula:
CountIf(Inventory, UnitsInStock < 30)
The label shows 2 because two products (Ganymede and Callisto) have fewer than 30 units in stock.
3. Add another label, and set its Text property to this formula:
CountA (Inventory.UnitsInStock)
The label shows 5, the number of non-empty cells in the UnitsInStock column.
4. Add another label, and set its Text property to this formula:
CountRows(Inventory)
The label shows 5 because the collection contains five rows.
Count, CountA, CountIf, and CountRows functions
in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Counts all records in a table, or counts all records that satisfy a condition.

Description
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 records in a table.
Each of these functions returns a number.
When used with a data source, these functions can't be delegated. Only the first portion of the data source will
be retrieved and then the function applied. The result may not represent the complete story. A warning will
appear at authoring time to remind you of this limitation and to suggest switching to delegable alternatives
where possible. For more information, see the delegation overview.

Syntax
Count( SingleColumnTable )
CountA ( SingleColumnTable )
SingleColumnTable - Required. Column of records to count.
CountIf( Table, LogicalFormula )
Table - Required. Table of records to count.
LogicalFormula - Required. Formula to evaluate for each record of the table. Records that return true for
this formula are counted. The formula can reference columns of the table.
CountRows( Table )
Table - Required. Table of records to count.

Example
1. Import or create a collection named Inventory, as the first subprocedure in Show images and text in a
gallery describes.
2. Add a label, and set its Text property to this formula:
CountIf(Inventory, UnitsInStock < 30)
The label shows 2 because two products (Ganymede and Callisto) have fewer than 30 units in stock.
3. Add another label, and set its Text property to this formula:
CountA (Inventory.UnitsInStock)
The label shows 5, the number of non-empty cells in the UnitsInStock column.
4. Add another label, and set its Text property to this formula:
CountRows(Inventory)
The label shows 5 because the collection contains five rows.
Data types in canvas apps
2/11/2020 • 15 minutes to read • Edit Online

Information flows through an app in small, discrete values, very much like the cells of a spreadsheet. For example,
data in a Birthday field and an Anniversary field would both flow through as a Date value that includes the year,
the month, and the day. The app knows how to format these values, constrain input to what is appropriate for each,
and share the values with a database. Birthdays differ from anniversaries to people, but the system handles them
in exactly the same manner. In this case, Date is an example of a data type.
This article provides details for the data types that canvas apps support. When an app connects to an external data
source, each data type in that source is mapped to a data type for canvas apps.

DATA TYPE DESCRIPTION EXAMPLES

Boolean A true or false value. Can be used true


directly in If, Filter and other functions
without a comparison.

Color A color specification, including an alpha Color.Red


channel. ColorValue( "#102030" )
RGBA( 255, 128, 0, 0.5 )

Currency A currency value that's stored in a 123


floating-point number. Currency values 4.56
are the same as number values with
currency-formatting options.

Date A date without a time, in the time zone Date( 2019, 5, 16 )


of the app's user.

DateTime A date with a time, in the time zone of DateTimeValue( "May 16, 2019
the app's user. 1:23:09 PM" )

GUID A Globally Unique Identifier. GUID()


GUID( "123e4567-e89b-12d3-a456-
426655440000" )

Hyperlink A text string that holds a hyperlink. "https://powerapps.microsoft.com"

Image A Universal Resource Identifier (URI) MyImage added as an app resource


text string to an image in .jpeg, .png, "https://northwindtraders.com/logo
.svg, .gif, or other common web-image .jpg"
format. "appres://blobmanager/7b12ffa2..."

Media A URI text string to a video or audio MyVideo added as an app resource
recording. "https://northwindtraders.com/intro
.mp4"
"appres://blobmanager/3ba411c..."

Number A floating-point number. 123


-4.567
8.903e121
DATA TYPE DESCRIPTION EXAMPLES

Option set A choice from a set of options, backed ThisItem.OrderStatus


by a number. This data type combines a
localizable text label with a numeric
value. The label appears in the app, and
the numeric value is stored and used
for comparisons.

Record A record of data values. This compound { Company: "Northwind Traders",


data type contains instances of other Staff: 35,
data types that are listed in this topic. NonProfit: false }
More information: Working with tables.

Record reference A reference to a record in an entity. First(Accounts).Owner


Such references are often used with
polymorphic lookups. More
information: Working with references.

Table A table of records. All of the records Table( { FirstName: "Sidney",


must have the same names for their LastName: "Higa" },
fields with the same data types, and { FirstName: "Nancy",
omitted fields are treated as blank. This LastName: "Anderson" } )
compound data type contains instances
of other data types that are listed in
this topic. More information: Working
with tables.

Text A Unicode text string. "Hello, World"

Time A time without a date, in the time zone Time( 11, 23, 45 )
of the app's user.

Two option A choice from a set of two options, ThisItem.Taxable


backed by a boolean value. This data
type combines a localizable text label
with a boolean value. The label appears
in the app, and the boolean value is
stored and used for comparisons.

Many of these data types are similar and have the same underlying representation, such as a Hyperlink field
being treated as Text. The additional data types provide better default experiences in forms and other controls.

Blank
All data types can have a value of blank (in other words, no value). The term "null" is often used in databases for
this concept.
Use the Blank function with the Set or Patch function to set a variable or field to blank. For example, Set( x,
Blank() ) removes any value in the global variable x.
Test for a blank value by using the IsBlank function. Replace possible blank values with non-blank values by using
the Coalesce function.
Because all data types support blank, the Boolean and Two option data types effectively have three possible
values.

Text, Hyperlink, Image, and Media


All four of these data types are based on a Unicode text string.
Embedded text
Embedded text strings in a formula are enclosed in double quotation marks. Use two double quotes together to
represent a single double quote in the text string. For example, using the following formula in the OnSelect
property of a Button control:

Notify( "Jane said ""Hello, World!""" )

results in a banner when the button is pressed, where the first and last double quotes are omitted (as they delimit
the text string) and the repeated double quotes around Hello, World! are replaced with a single double quote:

Single quotation marks are not used for identifier names that contain special characters and have no significance
within a text string.
Image and Media resources
Through the File menu, you can add image, video, and audio files as app resources. The name of the imported file
becomes the resource name in the app. In this graphic, the Northwind Traders logo, which is named nwindlogo,
has been added to an app:

To use this resource in an app, specify it in the Image property of an Image control:
URIs for images and other media
You can dig a little deeper into that last example by setting the Text property of a Label control to nwindlogo.
The label shows a text string:

Canvas apps reference each image or other media file, whether it's in the cloud or added as an app resource, by a
URI text string.
For example, the Image property of an image control accepts not only app resources but also links to images on
the web, such as "https://northwindtraders.com/logo.jpg". The property also accepts inline images that use the
data URI scheme, as in this example:

"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAFAQMAAACtnVQoAAAABlBMVEUAAAB0J3UMNU6VAAAAAXRSTlMAQObYZgA
AABRJREFUCNdjUGJgCGVg6GgAkkA2AA8/AffqCEBsAAAAAElFTkSuQmCC"

That URI displays a scaled-up version of two purple diamonds:

You can show the most recent image captured in a Camera control if you set the Image property of an image
control to the Photo property of the camera control. The app holds the image in memory, and the Photo property
of the camera control returns a URI reference to the image. For example, you might take a picture, and the
camera's Photo property could return "appres://blobmanager/7b12ffa2ea4547e5b3812cb1c7b0a2a0/1".
You use a URI to reference an image or another media file stored in a database. That way, the app doesn't retrieve
the actual data until it's actually needed. For example, an attachment in a Common Data Service entity might
return "appres://datasources/Contacts/table/..." As in the camera example, you can display this image by
setting the Image property of an image control to this reference, which retrieves the binary data.
When you save a media data type, such as an image, to a database, the app sends the actual image or media data,
not the URI reference.
Size limits
As text strings and URIs, these data types have no preset limit on their length.
The binary data that these data types reference also has no preset limit on size. For example, an image captured
through the camera control that's now referenced as "appres://..." can be as large and high resolution as the
device's camera can muster. The resolution, frame rate, and other attributes of media files aren't limited by the data
type, but specific controls for playing and capturing media may have their own limitations.
However, all data sizes are subject to the amount of available memory in the app. Browsers running on a desktop
computer typically support more than 100 megabytes of data. However, the amount of available memory on a
device such as a phone might be far lower, typically in the range 30-70 megabytes. To determine whether your app
will run within these limits, test common scenarios on all devices on which it should run.
As a best practice, hold data in memory only as long as necessary. Upload images to a database as soon as you
can; download images only when the app's user requests them.

Number and Currency


Number and Currency data types use the IEEE 754 double-precision floating-point standard. This standard
provides a very large range of numbers in which to work, from –1.79769 x 10308 to 1.79769 x 10308. The smallest
value that can be represented is 5 x 10–324.
Canvas apps can exactly represent whole numbers (or integers) between –9,007,199,254,740,991 (–(253 – 1)) and
9,007,199,254,740,991 (253 – 1), inclusive. This range is larger than the 32-bit (or 4-byte) integer data types that
databases commonly use. However, canvas apps can't represent 64-bit (or 8-byte) integer data types. You might
want to store the number in a text field or use a calculated column to make a copy of the number in a text field, so
that it's mapped into a Text data type in the canvas app. In this manner, you can hold, display, and enter these
values, as well as comparing them to determine whether they're equal; however, you can't perform numerical
calculations on them in this form.
Floating-point arithmetic is approximate, so it can sometimes give unexpected results with many documented
examples. You might expect the formula 55 / 100 * 100 to return exactly 55 and (55 / 100 * 100) - 55 to return
exactly zero. However, the latter formula returns 7.1054 x 10–15, which is very small but not zero. That tiny
difference doesn't normally cause a problem, and the app rounds it away when showing the result. However, small
differences can compound in subsequent calculations and appear to give the wrong answer.
Database systems often store currencies and perform calculations by using decimal math, which offers a smaller
range but greater control over the precision. By default, canvas apps map currencies in and out of floating-point
values; therefore, the result might differ from calculations that are done in a native decimal data type. If this type of
discrepancy will cause problems, you might want to work with these values as Text, just as you might with large
integers described earlier in this section.

Date, Time, and DateTime


Time zones
Date/time values fall in these categories:
User local: These values are stored in UTC (Coordinated Universal Time), but the app user's time zone affects
how the app shows these values and how the app user specifies them. As an example, the same moment
appears differently to a user in Canada than it does to a user in Japan.
Time zone independent: The app shows these values the same way and the app user specifies them the same
way, regardless of time zone. The same moment appears the same way to a user in Canada as it does to a user
in Japan. App authors who don't expect their apps to run in different time zones use these values because
they're simpler overall.
This table shows some examples:

VALUE DISPLAYED AND VALUE DISPLAYED AND


VALUE STORED IN THE ENTERED 7 HOURS WEST OF ENTERED 4 HOURS EAST OF
DATE/TIME TYPE DATABASE UTC UTC

User local Sunday, May 19, 2019 Saturday, May 18, 2019 Sunday, May 19, 2019
4:00 AM 9:00 PM 8:00 AM

Time zone independent Sunday, May 19, 2019 Sunday, May 19, 2019 Sunday, May 19, 2019
4:00 AM 4:00 AM 4:00 AM

For User local date/times, canvas apps use the time zone of the browser or device, but model-driven apps use the
user's setting in Common Data Service. These settings typically match, but results will differ if these settings differ.
Use the DateAdd and TimeZoneInformation functions to convert local time to UTC and back again. See the
examples at the end of the documentation for these functions.
Numeric equivalents
Canvas apps hold and calculate all date/time values, whether User local or Time zone independent in UTC. The
app translates the values based on the app user's time zone when showing them and when the app user specifies
them.
When a canvas app reads a Time zone independent value from a data source or writes such a value to a data
source, the app automatically adjusts the value to compensate for the time zone of the app's user. The app then
treats the value as a UTC value, consistent with all other date/time values in the app. Because of this compensation,
the original Time zone independent value appears when the app adjusts the UTC value for the app user's time
zone.
You can observe this behavior more closely by using the Value function to access the underlying numerical value
for a date/time value. This function returns the date/time value as the number of milliseconds since January 1,
1970 00:00:00.000 UTC.
Because every date/time value is held in UTC, the formula Value( Date( 1970, 1, 1 ) ) won't return zero in most
parts of the world because the Date function returns a date in UTC. For example, the formula would return
28,800,000 in a time zone that's offset from UTC by eight hours. That number reflects the number of milliseconds
in eight hours.
Returning to our example from above:

VALUE DISPLAYED AND


VALUE STORED IN THE ENTERED 7 HOURS WEST OF
DATE/TIME TYPE DATABASE UTC VALUE FUNCTION RETURNS

User local Sunday, May 19, 2019 Saturday, May 18, 2019 1,558,238,400,000
4:00 AM 9:00 PM (Sunday, May 19, 2019
4:00 AM UTC)

Time zone independent Sunday, May 19, 2019 Sunday, May 19, 2019 1,558,263,600,000
4:00 AM 4:00 AM (Sunday, May 19, 2019
11:00 AM UTC)

Converting Unix times


Unix times reflect the number of seconds since January 1, 1970 00:00:00 UTC. Because canvas apps use
milliseconds instead of seconds, you can convert between the two by multiplying or dividing by 1,000.
For example, Unix time shows September 9, 2001, at 01:46:40 UTC as 1,000,000,000. To show that date/time value
in a canvas app, multiply that number by 1,000 to convert it to milliseconds, and then use it in a Text function. The
formula Text( 1000000000 * 1000, DateTimeFormat.UTC ) returns the string 2001-09-09T01:46:40.000Z.
However, that function returns Saturday, September 8, 2001 18:46:40 if you use the
DateTimeFormat.LongDateTime24 format in a time zone that's -7 hours offset from UTC (7 hours west of
UTC ). This result shows the DateTime value correctly based on the local time zone.
To convert to a Unix time, divide the result from Value by 1,000:
RoundDown( Value( UnixTime ) / 1000, 0 )
If you need the Unix time in a Date value for further calculations or display within Power Apps, use this formula:
DateAdd( Date( 1970,1,1 ), UnixTime, Seconds )
SQL Server
SQL Server has Datetime, Datetime2, and other date/time data types that don't include a time-zone offset and
don't indicate which time zone they're in. Canvas apps assume these values are stored in UTC and treat them as
User local. If the values are meant to be time-zone independent, correct for the UTC translations by using the
TimeZoneOffset function.
Canvas apps use the included time-zone information in Datetimeoffset fields when converting a value to the
app's internal UTC representation. The apps always use UTC as the time zone (zero time zone offset) when they
write data.
Canvas apps read and write values of the Time data type in SQL Server as text strings in the ISO 8601 duration
format. For example, you must parse this string format and use the Time function to convert the text string
"PT2H1M39S" to a Time value:

With(
Match( "PT2H1M39S", "PT(?:(?<hours>\d+)H)?(?:(?<minutes>\d+)M)?(?:(?<seconds>\d+)S)?" ),
Time( Value( hours ), Value( minutes ), Value( seconds ) )
)
// Result: 2:01 AM (as shown in a label control, use the Text function to see the seconds)

Mixing date and time information


Date, Time, and DateTime have different names, but they all hold the same information about dates and times.
A Date value can include time information with it, which is usually midnight. A Time value can carry date
information, which is usually January 1, 1970. Common Data Service also stores time information with a Date
Only field but shows only the date information by default. Similarly, canvas apps sometimes distinguish between
these data types to determine default formats and controls.
Adding and subtracting date and time values directly isn't recommended because time-zone and other conversions
could cause confusing results. Either use the Value function to convert date/time values to milliseconds first and
take into account the app user's time zone, or use the DateAdd and DateDiff functions to add or subtract from
one of these values.

Option sets and Two options


Option sets and two-option data types provide a two or more choices for an app user to select. For example, an
Order Status option set might offer the choices New, Shipped, Invoiced, and Closed. The two-option data type
offers only two choices.
Both of these data types show their labels in a text-string context. For example, a label control shows one of the
order-status options if the control's Text property is set to a formula that references that option set. Option labels
might be localized for app users in different locations.
When an app user selects an option and saves that change, the app transmits the data to the database, which
stores that data in a representation that's independent of language. An option in an option set is transmitted and
stored as a number, and an option in a two-option data type is transmitted and stored as a boolean value.
The labels are for display purposes only. You can't perform direct comparisons with the labels because they're
specific to a language. Instead, each option set has an enumeration that works with the underlying number or
boolean value. For example, you can't use this formula:
If( ThisItem.OrderStatus = "Active", ...

But you can use this formula:


If( ThisItem.OrderStatus = OrderStatus.Active, ...

For global option sets (which entities share), the name of the option-set enumeration matches the name of the
global option set. For local option sets (which are scoped to an entity), the name might contain the name of the
entity. This behavior avoids conflicts if multiple entities have option sets that have the same name. For example, the
Accounts entity might have an OrderStatus option set, and its name might be OrderStatus (Accounts). That
name contains one or more spaces and parentheses, so you must surround it with single quotation marks if you
reference it in a formula.
In addition, two-option values can also behave as boolean values. For example, a two-option value named
TaxStatus might have the labels Taxable and Non-Taxable, which correspond to true and false respectively. To
demonstrate, you can use this formula:
If( ThisItem.Taxable = TaxStatus.Taxable, ...

You can also use this equivalent formula:


If( ThisItem.Taxable, ...
DataSourceInfo function in Power Apps
12/3/2019 • 3 minutes to read • Edit Online

Provides information about a data source.

Overview
Data sources can provide a wealth of information to optimize the user experience.
You can use column-level information to validate user input and provide immediate feedback to the user before
using the Patch function. The Validate function uses this same information.
You can use information at the data-source level, for example, to disable or hide Edit and New buttons for users
who don't have permissions to edit and create records.
Data sources vary in how much information they provide, including not providing any at all. Collections provide
no information. If a piece of information isn't provided, a default is used, or blank is returned.

Description
Column information
You can use DataSourceInfo to obtain information about a particular column of a data source:

INFORMATION ARGUMENT RESULT TYPE DESCRIPTION

DataSourceInfo.DisplayName String Display name for the column. If no


display name is defined, returns the
column name.

DataSourceInfo.MaxLength Number Maximum number of characters that


the column can hold. Applies only to
columns that contain strings. If a
maximum isn't set, returns blank.

DataSourceInfo.MaxValue Number Maximum numeric value that a column


can hold. Applies only to columns that
contain numbers. If a maximum isn't
set, returns blank.

DataSourceInfo.MinValue Number Minimum numeric value that a column


can hold. Applies only to columns that
contain numbers. If a minimum isn't
set, returns blank.

DataSourceInfo.Required Boolean Is a value required for this column? If


not set by the data source, returns
false.

The third argument is the name of a column as a string. For example, column Phone in collection People would
be passed as "Phone" including the double quotes.
Data-source information
You can also use DataSourceInfo to obtain information about a data source as a whole:
INFORMATION ARGUMENT RESULT TYPE DESCRIPTION

DataSourceInfo.AllowedValues Boolean What types of permissions can users


be granted for this data source? If not
set by the data source, returns blank.

DataSourceInfo.CreatePermission Boolean Does the current user have permission


to create records in this data source? If
not set by the data source, returns
true.

DataSourceInfo.DeletePermission Boolean Does the current user have permission


to delete records in this data source? If
not set by the data source, returns
true.

DataSourceInfo.EditPermission Boolean Does the current user have permission


to edit records in this data source? If
not set by the data source, returns
true.

DataSourceInfo.ReadPermission Boolean Does the current user have permission


to read records in this data source? If
not set by the data source, returns
true.

Syntax
DataSourceInfo( DataSource, Information, ColumnName )
DataSource – Required. The data source to use.
Information – Required. The type of information that you want to retrieve.
ColumnName – Optional. For column-level information, the column name as a string. Column Phone
would be passed as "Phone", including the double quotes. For information at the data-source level, the
ColumnName argument can't be used.

NOTE
For SharePoint and Excel data sources that contain column names with spaces, specify each space as "_x0020_".
For example, specify "Column Name" as "Column_x0020_Name".

Examples
The examples in this section use this data source, named IceCream:

The data source has also provided this information:


The display name for Quantity is "Quantity on Hand".
The maximum length of Flavor is 30 characters.
The Flavor column must contain a value. The Quantity column isn't required.
The minimum Quantity is 0.
The maximum Quantity is 100.
The current user can read and edit the records of the IceCream data source but can't create or delete records.

FORMULA DESCRIPTION RESULT

DataSourceInfo( IceCream, Returns the display name for the "Quantity on Hand"
DataSourceInfo.DisplayName, "Qua Quantity column of the IceCream
ntity" ) data source.

DataSourceInfo( IceCream, Returns the maximum length of the 30


DataSourceInfo.MaxLength, "Flavor string for the Flavor column of the
") IceCream data source.

DataSourceInfo( IceCream, Is the Flavor column of the IceCream true


DataSourceInfo.Required, "Flavor" data source required?
)

DataSourceInfo( IceCream, Is the Quantity column of the false


DataSourceInfo.Required, "Quantity IceCream data source required?
")

DataSourceInfo( IceCream, Returns the maximum numeric value 100


DataSourceInfo.MaxValue, "Quantit for the Quantity column of the
y" ) IceCream data source.

DataSourceInfo( IceCream, Returns the minimum numeric value 0


DataSourceInfo.MinValue, "Quantity for the Quantity column of the
") IceCream data source.

DataSourceInfo( IceCream, Can the current user read records in true


DataSourceInfo.ReadPermission) the IceCream data source?

DataSourceInfo( IceCream, Can the current user edit records in true


DataSourceInfo.EditPermission) the IceCream data source?

DataSourceInfo( IceCream, Can the current user create records in false


DataSourceInfo.CreatePermission) the IceCream data source?

DataSourceInfo( IceCream, Can the current user delete records in false


DataSourceInfo.DeletePermission) the IceCream data source?
Date and Time functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Converts date and time components to a date/time value.

Description
The Date function converts individual Year, Month, and Day values to a Date/Time value. The time portion is
midnight.
If Year is between 0 and 1899 (inclusive), the function adds that value to 1900 to calculate the year. 70 becomes
1970.
If Month is less than 1 or more than 12, the result subtracts or adds that many months from the beginning of
the specified year.
If Day is greater than the number of days in the specified month, the function adds that many days to the first
day of the month and returns the corresponding date from a subsequent month. If Day is less than 1, the
function subtracts that many days, plus 1, from the first day of the specified month.
The Time function converts individual Hour, Minute, and Second values to a Date/Time value. The result has no
date associated with it.
See the DateValue, TimeValue, and DateTimeValue functions for information about how to convert a string to a
value.
Also see working with dates and times for more information.

Syntax
Date( Year, Month, Day )
Year - Required. Numbers greater than 1899 are interpreted as absolute (1980 is interpreted as 1980); numbers
that range from 0 to 1899 are interpreted as relative to 1900. (For example, 80 is interpreted as 1980.)
Month - Required. A number that ranges from 1 to 12.
Day - Required. A number that ranges from 1 to 31.
Time( Hour, Minute, Second )
Hour - Required. A number that ranges from 0 (12:00 AM ) to 23 (11:00 PM ).
Minute - Required. A number that ranges from 0 to 59.
Second - Required. A number that ranges from 0 to 59.

Examples
Date
If a user typed 1979 in a text-input control named HireYear, 3 in a text-input control named HireMonth, and 17 in
a text-input control named HireDay, this function would return 3/17/1979:
Date(Value(HireYear.Text), Value(HireMonth.Text), Value(HireDay.Text))
Time
If a user typed 14 in a text-input control named BirthHour, 50 in a text-input control named BirthMinute, and 24
in a text-input control named BirthSecond, this function would return 02:50:24 p.
Text(Time(Value(BirthHour.Text), Value(BirthMinute.Text), Value(BirthSecond.Text)), "hh:mm:ss a/p")
DateAdd, DateDiff, and TimeZoneOffset functions in
Power Apps
1/24/2020 • 3 minutes to read • Edit Online

Adds to or finds the difference in date/time values and converts between local time and UTC.

Description
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 number of units.
For both functions, units can be Milliseconds, Seconds, Minutes, Hours, Days, Months, Quarters, or Years. By
default, both functions use Days as units.
The TimeZoneOffset function returns the number of minutes between the user's local time and UTC (Coordinated
Universal Time).
You can use DateAdd with the TimeZoneOffset to convert between the user's local time and UTC (Coordinated
Universal Time). Adding TimeZoneOffset will convert a local time to UTC, and subtracting it (adding the negative)
will convert from UTC to local time.
Also see Date, Time, and DateTime data types and working with dates and times for more information.

Syntax
DateAdd( DateTime, Addition [, Units ] )
DateTime - Required. Date/time value to operate on.
Addition - Required. Number, in Units, to add to the DateTime.
Units - Optional. The type of Units to add: Milliseconds, Seconds, Minutes, Hours, Days, Months, Quarters,
or Years. If not specified, Days are used.
DateDiff( StartDateTime, EndDateTime [, Units ] )
StartDateTime - Required. Starting date/time value.
EndDateTime - Required. Ending date/time value.
Units - Optional. The type of Units to add: Milliseconds, Seconds, Minutes, Hours, Days, Months, Quarters,
or Years. If not specified, Days are used.
TimeZoneOffset( [ DateTime ] )
DateTime - Optional. Date/time value for which to return the offset. By default, the current date/time is used.

Examples
In all of these examples, assume that the current date and time is July 15, 2013, 1:02 PM.
Simple DateAdd
FORMULA DESCRIPTION RESULT

Text( DateAdd( Now(), 3 ), Adds three days (default units) to the "18-07-2013 13:02"
"dd-mm-yyyy hh:mm" ) current date and time.

Text( DateAdd( Now(), 4, Hours ), Add four hours to the current date and "15-07-2013 17:02"
"dd-mm-yyyy hh:mm" ) time.

Text( DateAdd( Today(), 1, Months ), Adds one month to the current date, "15-08-2013 00:00"
"dd-mm-yyyy hh:mm" ) without time as Today doesn't return a
time component.

Text( DateAdd( Now(), ‑30, Minutes Subtracts 30 minutes from the current "15-07-2013 12:32"
), date and time.
"dd-mm-yyyy hh:mm" )

Simple DateDiff
FORMULA DESCRIPTION RESULT

DateDiff( Now(), Returns the difference between the two 170


DateValue("1/1/2014") ) units in the default units of Days

DateDiff( Now(), Returns the difference between the two 6


DateValue("1/1/2014"), Months ) values in Months

DateDiff( Now(), Today(), Minutes ) Returns the difference between the -782
current date/time and the current date
only (no time) in minutes. Since the
Now is later than Today the result will
be negative.

Converting to UTC
To convert to UTC (Coordinated Universal Time), add the TimeZoneOffset for the given time.
For example, imagine the current date and time is July 15, 2013, 1:02 PM in Pacific Daylight Time (PDT, UTC -7).
To determine the current time in UTC, use:
DateAdd( Now(), TimeZoneOffset(), Minutes )
TimeZoneOffset defaults to the current time, so you don't need to pass it an argument.
To see the result, use the Text function with the format dd -mm -yyyy hh:mm, which will return 15-07-2013 20:02.
Converting from UTC
To convert from UTC, subtract the TimeZoneOffset (by adding the negative) for the given time.
For example, imagine the UTC date and time July 15, 2013, 8:02 PM is stored in a variable named StartTime. To
adjust the time for the user's time zone, use:
DateAdd( StartTime, −TimeZoneOffset( StartTime ), Minutes )
Note the negative sign before TimeZoneOffset to subtract the offset rather than add it.
To see the result, use the Text function with the format dd -mm -yyyy hh:mm, which will result in 15-07-2013 13:02
if you're in Pacific Daylight Time.
DateAdd, DateDiff, and TimeZoneOffset functions in
Power Apps
1/24/2020 • 3 minutes to read • Edit Online

Adds to or finds the difference in date/time values and converts between local time and UTC.

Description
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 number of units.
For both functions, units can be Milliseconds, Seconds, Minutes, Hours, Days, Months, Quarters, or Years. By
default, both functions use Days as units.
The TimeZoneOffset function returns the number of minutes between the user's local time and UTC (Coordinated
Universal Time).
You can use DateAdd with the TimeZoneOffset to convert between the user's local time and UTC (Coordinated
Universal Time). Adding TimeZoneOffset will convert a local time to UTC, and subtracting it (adding the negative)
will convert from UTC to local time.
Also see Date, Time, and DateTime data types and working with dates and times for more information.

Syntax
DateAdd( DateTime, Addition [, Units ] )
DateTime - Required. Date/time value to operate on.
Addition - Required. Number, in Units, to add to the DateTime.
Units - Optional. The type of Units to add: Milliseconds, Seconds, Minutes, Hours, Days, Months, Quarters,
or Years. If not specified, Days are used.
DateDiff( StartDateTime, EndDateTime [, Units ] )
StartDateTime - Required. Starting date/time value.
EndDateTime - Required. Ending date/time value.
Units - Optional. The type of Units to add: Milliseconds, Seconds, Minutes, Hours, Days, Months, Quarters,
or Years. If not specified, Days are used.
TimeZoneOffset( [ DateTime ] )
DateTime - Optional. Date/time value for which to return the offset. By default, the current date/time is used.

Examples
In all of these examples, assume that the current date and time is July 15, 2013, 1:02 PM.
Simple DateAdd
FORMULA DESCRIPTION RESULT

Text( DateAdd( Now(), 3 ), Adds three days (default units) to the "18-07-2013 13:02"
"dd-mm-yyyy hh:mm" ) current date and time.

Text( DateAdd( Now(), 4, Hours ), Add four hours to the current date and "15-07-2013 17:02"
"dd-mm-yyyy hh:mm" ) time.

Text( DateAdd( Today(), 1, Months ), Adds one month to the current date, "15-08-2013 00:00"
"dd-mm-yyyy hh:mm" ) without time as Today doesn't return a
time component.

Text( DateAdd( Now(), ‑30, Minutes Subtracts 30 minutes from the current "15-07-2013 12:32"
), date and time.
"dd-mm-yyyy hh:mm" )

Simple DateDiff
FORMULA DESCRIPTION RESULT

DateDiff( Now(), Returns the difference between the two 170


DateValue("1/1/2014") ) units in the default units of Days

DateDiff( Now(), Returns the difference between the two 6


DateValue("1/1/2014"), Months ) values in Months

DateDiff( Now(), Today(), Minutes ) Returns the difference between the -782
current date/time and the current date
only (no time) in minutes. Since the
Now is later than Today the result will
be negative.

Converting to UTC
To convert to UTC (Coordinated Universal Time), add the TimeZoneOffset for the given time.
For example, imagine the current date and time is July 15, 2013, 1:02 PM in Pacific Daylight Time (PDT, UTC -7).
To determine the current time in UTC, use:
DateAdd( Now(), TimeZoneOffset(), Minutes )
TimeZoneOffset defaults to the current time, so you don't need to pass it an argument.
To see the result, use the Text function with the format dd -mm -yyyy hh:mm, which will return 15-07-2013 20:02.
Converting from UTC
To convert from UTC, subtract the TimeZoneOffset (by adding the negative) for the given time.
For example, imagine the UTC date and time July 15, 2013, 8:02 PM is stored in a variable named StartTime. To
adjust the time for the user's time zone, use:
DateAdd( StartTime, −TimeZoneOffset( StartTime ), Minutes )
Note the negative sign before TimeZoneOffset to subtract the offset rather than add it.
To see the result, use the Text function with the format dd -mm -yyyy hh:mm, which will result in 15-07-2013 13:02
if you're in Pacific Daylight Time.
DateValue, TimeValue, and DateTimeValue functions
in Power Apps
3/17/2020 • 3 minutes to read • Edit Online

Converts date, time, or both in a string to a date/time value.

Description
DateValue function converts a date string (for example, "10/01/2014") to a date/time value.
TimeValue function converts a time string (for example, "12:15 PM") to a date/time value.
DateTimeValue function converts a date and time string (for example, "January 10, 2013 12:13 AM") to a
date/time value.
DateValue function ignores any time information in the date string, and the TimeValue function ignores any date
information in the time string.

NOTE
The DateValue, TimeValue, and DateTimeValue functions by default use the language from the current user's settings. You can
override it to ensure that strings are interpreted properly. For example, "10/1/1920" is interpreted as October 1st in "en" and
as January 10th in "fr".

Dates must be in one of these formats:


MM/DD/YYYY
DD/MM/YYYY
DD Mon YYYY
Month DD, YYYY
To convert from numeric date, month and year components, read Date.
To convert from numeric hour, minute and second components, read Time.
For more information, read:
Working with date and time.
Date/time and data types.

Syntax
DateValue( String [, Language ])
DateTimeValue( String [, Language ])
TimeValue( String [, Language ])
String - Required. A text string that contains a date, time, or combination date and time value.
Language - Optional. A language string, such as would be returned by the first two characters from the
Language function. If not provided, the language of the current user's settings is used.

Examples
DateValue
If you type 10/11/2014 into a text-input control named Startdate, and then set the Text property of a label to these
formulas:
Convert a date from a string in the user's locale and show the result as a long date.

Text( DateValue( Startdate.Text ), DateTimeFormat.LongDate )

Device set to en locale shows the label as Saturday, October 11, 2014.

NOTE
You can use several options with DateTimeFormat compared to LongDateTime. To display a list of options, type the
parameter followed by an exclamation sign (!) in the formula bar.

Convert date from a string in the French locale and show the result as a long date. In this example, the
months and day of the month are interpreted differently from English.

Text( DateValue( Startdate.Text, "fr" ), DateTimeFormat.LongDate )

Device set to en locale shows the label as Monday, November 10, 2014.
If you typed October 20, 2014 instead:
Convert a date from a string in the user's locale and calculate the difference between two days, in days

DateDiff( DateValue( Startdate.Text ), Today() )

Device set to en locale shows the label as 9, indicating the number of days between October 11 and October
20. The DateDiff function can also show the difference in months, quarters, or years.
DateTimeValue
If you typed 10/11/2014 1:50:24.765 PM into a text-input control named Start, and then set the Text property of a
label to the following formula:
Convert both a date and time string in the current locale.

Text( DateTimeValue( Start.Text ), DateTimeFormat.LongDateTime )

Device set to en locale shows the label as Saturday, October 11, 2014 1:50:24 PM.

NOTE
You can use several options with DateTimeFormat compared to LongDateTime. To display a list of options, type the
parameter followed by an exclamation sign (!) in the formula bar.

Convert both a date and time string in the French locale. Month and day of the month are interpreted
differently.

Text( DateTimeValue( Start.Text, "fr"), DateTimeFormat.LongDateTime )

Device set to en locale shows the label as Monday, November 10, 2014 1:50:24 PM.
Convert both a date and time string in the user's locale, and display the result with a fractional second.

Text( DateTimeValue( Start.Text ), "dddd, mmmm dd, yyyy hh:mm:ss.fff AM/PM" )

Device set to en locale shows the label as Saturday, October 11, 2014 01:50:24.765 PM.
As an alternative, you can specify hh:mm:ss.f or hh:mm:ss.ff to round the time to the nearest 10th or 100th
of a second.
TimeValue
Name a text-input control FinishedAt, and set the Text property of a label to this formula:

If( TimeValue( FinishedAt.Text ) < TimeValue( "5:00:00.000 PM" ),


"You made it!",
"Too late!"
)

If you type 4:59:59.999 PM in the FinishedAt control, the label shows "You made it!"
If you type 5:00:00.000 PM in the FinishedAt control, the label shows "Too late!"
DateValue, TimeValue, and DateTimeValue functions
in Power Apps
3/17/2020 • 3 minutes to read • Edit Online

Converts date, time, or both in a string to a date/time value.

Description
DateValue function converts a date string (for example, "10/01/2014") to a date/time value.
TimeValue function converts a time string (for example, "12:15 PM") to a date/time value.
DateTimeValue function converts a date and time string (for example, "January 10, 2013 12:13 AM") to a
date/time value.
DateValue function ignores any time information in the date string, and the TimeValue function ignores any date
information in the time string.

NOTE
The DateValue, TimeValue, and DateTimeValue functions by default use the language from the current user's settings. You can
override it to ensure that strings are interpreted properly. For example, "10/1/1920" is interpreted as October 1st in "en" and
as January 10th in "fr".

Dates must be in one of these formats:


MM/DD/YYYY
DD/MM/YYYY
DD Mon YYYY
Month DD, YYYY
To convert from numeric date, month and year components, read Date.
To convert from numeric hour, minute and second components, read Time.
For more information, read:
Working with date and time.
Date/time and data types.

Syntax
DateValue( String [, Language ])
DateTimeValue( String [, Language ])
TimeValue( String [, Language ])
String - Required. A text string that contains a date, time, or combination date and time value.
Language - Optional. A language string, such as would be returned by the first two characters from the
Language function. If not provided, the language of the current user's settings is used.

Examples
DateValue
If you type 10/11/2014 into a text-input control named Startdate, and then set the Text property of a label to these
formulas:
Convert a date from a string in the user's locale and show the result as a long date.

Text( DateValue( Startdate.Text ), DateTimeFormat.LongDate )

Device set to en locale shows the label as Saturday, October 11, 2014.

NOTE
You can use several options with DateTimeFormat compared to LongDateTime. To display a list of options, type the
parameter followed by an exclamation sign (!) in the formula bar.

Convert date from a string in the French locale and show the result as a long date. In this example, the
months and day of the month are interpreted differently from English.

Text( DateValue( Startdate.Text, "fr" ), DateTimeFormat.LongDate )

Device set to en locale shows the label as Monday, November 10, 2014.
If you typed October 20, 2014 instead:
Convert a date from a string in the user's locale and calculate the difference between two days, in days

DateDiff( DateValue( Startdate.Text ), Today() )

Device set to en locale shows the label as 9, indicating the number of days between October 11 and October
20. The DateDiff function can also show the difference in months, quarters, or years.
DateTimeValue
If you typed 10/11/2014 1:50:24.765 PM into a text-input control named Start, and then set the Text property of a
label to the following formula:
Convert both a date and time string in the current locale.

Text( DateTimeValue( Start.Text ), DateTimeFormat.LongDateTime )

Device set to en locale shows the label as Saturday, October 11, 2014 1:50:24 PM.

NOTE
You can use several options with DateTimeFormat compared to LongDateTime. To display a list of options, type the
parameter followed by an exclamation sign (!) in the formula bar.

Convert both a date and time string in the French locale. Month and day of the month are interpreted
differently.

Text( DateTimeValue( Start.Text, "fr"), DateTimeFormat.LongDateTime )

Device set to en locale shows the label as Monday, November 10, 2014 1:50:24 PM.
Convert both a date and time string in the user's locale, and display the result with a fractional second.

Text( DateTimeValue( Start.Text ), "dddd, mmmm dd, yyyy hh:mm:ss.fff AM/PM" )

Device set to en locale shows the label as Saturday, October 11, 2014 01:50:24.765 PM.
As an alternative, you can specify hh:mm:ss.f or hh:mm:ss.ff to round the time to the nearest 10th or 100th
of a second.
TimeValue
Name a text-input control FinishedAt, and set the Text property of a label to this formula:

If( TimeValue( FinishedAt.Text ) < TimeValue( "5:00:00.000 PM" ),


"You made it!",
"Too late!"
)

If you type 4:59:59.999 PM in the FinishedAt control, the label shows "You made it!"
If you type 5:00:00.000 PM in the FinishedAt control, the label shows "Too late!"
Day, Month, Year, Hour, Minute, Second, and
Weekday functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Returns individual components of a Date/Time value.

Description
The Day function returns the day component of a Date/Time value, ranging from 1 to 31.
The Month function returns the month component of a Date/Time value, ranging from 1 to 12.
The Year function returns the year component of a Date/Time value, starting with 1900.
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 Second function returns the second component of a Date/Time value, ranging from 0 to 59.
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:

EXCEL CODE STARTOFWEEK ENUMERATION DESCRIPTION

1, 17 StartOfWeek.Sunday Numbers 1 (Sunday) through 7


(Saturday). Default.

2, 11 StartOfWeek.Monday Numbers 1 (Monday) through 7


(Sunday).

3 StartOfWeek.MondayZero Numbers 0 (Monday) through 6


(Sunday).

12 StartOfWeek.Tuesday Numbers 1 (Tuesday) through 7


(Monday).

13 StartOfWeek.Wednesday Numbers 1 (Wednesday) through 7


(Tuesday).

14 StartOfWeek.Thursday Numbers 1 (Thursday) through 7


(Wednesday).

15 StartOfWeek.Friday Numbers 1 (Friday) through 7


(Thursday).

16 StartOfWeek.Saturday Numbers 1 (Saturday) through 7


(Friday).

All functions return a number.


See working with dates and times for more information.
Syntax
Day( DateTime )
Month( DateTime )
Year( DateTime )
Hour( DateTime )
Minute( DateTime )
Second( DateTime )
DateTime - Required. Date/Time value to operate on.
Weekday( DateTime [, WeekdayFirst ] )
DateTime - Required. Date/Time value to operate on.
WeekdayFirst - Optional. Excel code specifying which day starts the week. If not supplied, 1 (Sunday first) is
used.

Examples
For the following example, the current time is 3:59:37 PM on Thursday, April 9, 2015.

FORMULA DESCRIPTION RESULT

Year( Now() ) Returns the year component of the 2015


current time and date.

Month( Now() ) Returns the month component of the 4


current time and date.

Day( Now() ) Returns the day component of the 9


current time and date.

Hour( Now() ) Returns the hour component of the 15


current time and date.

Minute( Now() ) Returns the minute component of the 59


current time and date.

Second( Now() ) Returns the minute component of the 37


current time and date.

Weekday( Now() ) Returns the weekday component of the 5


current time and date, using the default
start of the week as Sunday.

Weekday( Now(), 14 ) Returns the weekday component of the 1


current time and date, using an Excel
code to specify the start of the week as
Thursday.

Weekday( Now(), StartOfWeek.Wed Returns the weekday component of the 2


nesday ) current time and date, using a
StartOfWeek enumeration to specify
the start of the week as Wednesday.
Defaults function in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Returns the default values for a data source.

Description
Use the Defaults function to pre-populate a data entry form, making it easier to fill.
This function returns a record that contains the default values for the data source. If a column within the data
source doesn't have a default value, that property won't be present.
Data sources vary in how much default information they provide, including not providing any at all. When you
work with a collection or another data source that doesn't support default values, the Defaults function will
return an empty record.
You can combine the Defaults function with the Patch function to create a record.

Syntax
Defaults( DataSource )
DataSource – Required. The data source for which you want default values.

Examples
FORMULA DESCRIPTION RESULT

Defaults( Scores ) Returns the default values for the { Score: 0 }


Scores data source.
Acos, Acot, Asin, Atan, Atan2, Cos, Cot, Degrees, Pi,
Radians, Sin, and Tan functions in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Calculates trigonometric values.

Description
Primary functions
The Cos function returns the cosine of its argument, an angle specified in radians.
The Cot function returns the cotangent of its argument, an angle specified in radians.
The Sin function returns the sine of its argument, an angle specified in radians.
The Tan function returns the tangent of its argument, an angle specified in radians.
Inverse functions
The Acos function returns the arccosine, or inverse cosine, of its argument. The arccosine is the angle whose cosine
is the argument. The returned angle is given in radians in the range 0 (zero) to π.
The Acot function returns the principal value of the arccotangent, or inverse cotangent, of its argument. The
returned angle is given in radians in the range 0 (zero) to π.
The Asin function returns the arcsine, or inverse sine, of its argument. The arcsine is the angle whose sine is the
argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan function returns the arctangent, or inverse tangent, of its argument. The arctangent is the angle whose
tangent is the argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan2 function returns the arctangent, or inverse tangent, of the specified x and y coordinates as arguments.
The arctangent is the angle from the x-axis to a line that contains the origin (0, 0) and a point with coordinates (x, y).
The angle is given in radians between -π and π, excluding -π. A positive result represents a counterclockwise angle
from the x-axis; a negative result represents a clockwise angle. Atan2( a, b ) equals Atan( b/a ), except that a can
equal 0 (zero) with the Atan2 function.
Helper functions
The Degrees function converts radians to degrees. π radians equals 180 degrees.
The Pi function returns the transcendental number π, which begins 3.141592...
The Radians function converts degrees to radians.
Notes
If you pass a single number to these functions, the return value is a single result. If you pass a single-column table
that contains numbers, the return value is a single-column table of results, one result for each record in the
argument's table. If you have a multi-column table, you can shape it into a single-column table, as working with
tables describes.
If an argument would result in an undefined value, the result is blank. This can happen, for example, when using
inverse functions with arguments that are out of range.
Syntax
Primary Functions
Cos( Radians )
Cot( Radians )
Sin( Radians )
Tan( Radians )
Radians - Required. Angle to operate on.
Cos( SingleColumnTable )
Cot( SingleColumnTable )
Sin( SingleColumnTable )
Tan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of angles to operate on.
Inverse Functions
Acos( Number )
Acot( Number )
Asin( Number )
Atan( Number )
Number - Required. Number to operate on.
Acos( SingleColumnTable )
Acot( SingleColumnTable )
Asin( SingleColumnTable )
Atan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of numbers to operate on.
Atan2( X, Y )
X - Required. X-axis coordinate.
Y - Required. Y -axis coordinate.
Helper Functions
Degrees( Radians )
Radians - Required. Angle in radians to convert to degrees.
Pi()
Radians( Degrees )
Degrees - Required. Angle in degrees to convert to radians.

Examples
Single number
FORMULA DESCRIPTION RESULT

Cos( 1.047197 ) Returns the cosine of 1.047197 radians 0.5


or 60 degrees.
FORMULA DESCRIPTION RESULT

Cot( Pi()/4 ) Returns the cotangent of 0.785398... 1


radians or 45 degrees.

Sin( Pi()/2 ) Returns the sine of 1.570796... radians 1


or 90 degrees.

Tan( Radians(60) ) Returns the tangent of 1.047197... 1.732050...


radians or 60 degrees.

Acos( 0.5 ) Returns the arccosine of 0.5, in radians. 1.047197...

Acot( 1 ) Returns the arccotangent of 1, in 0.785398...


radians.

Asin( 1 ) Returns the arcsine of 1, in radians. 1.570796...

Atan( 1.732050 ) Returns the arctangent of 1.732050, in 1.047197...


radians.

Atan2( 5, 3 ) Returns the arctangent of the angle 0.540419...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (5,3),
which is approximately 31 degrees.

Atan2( 4, 4 ) Returns the arctangent of the angle 0.785398...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (4,4),
which is exactly π/4 radians or 45
degrees.

Degrees( 1.047197 ) Returns the equivalent number of 60


degrees for 1.047197 radians.

Pi() Returns the transcendental number π. 3.141592...

Radians( 15 ) Returns the equivalent number of 0.261799...


radians for 15 degrees.

Single -column table


The examples in this section use a data source that's named ValueTable and that contains the following data. The
last record in the table is π/2 radians or 90 degrees.

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Cos( ValueTable ) Returns the cosine of each number in


the table.

Cot( ValueTable ) Returns the cotangent of each number


in the table.

Sin( ValueTable ) Returns the sine of each number in the


table.

Tan( ValueTable ) Returns the tangent of each number in


the table.

Acos( ValueTable ) Returns the arccosine of each number in


the table.

Acot( ValueTable ) Returns the arccotangent of each


number in the table.

Asin( ValueTable ) Returns the arcsine of each number in


the table.

Atan( ValueTable ) Returns the arctangent of each number


in the table.
FORMULA DESCRIPTION RESULT

Degrees( ValueTable ) Returns the equivalent number of


degrees for each number in the table,
assumed to be angles in radians.

Radians( ValueTable ) Returns the equivalent number of


radians for each number in the table,
assumed to be angles in degrees.
Enable and Disable functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Turns a signal on or off.

Overview
Some signals can change often, requiring the app to recalculate as they do. Rapid changes over a long period of
time can drain a device's battery. You can use these functions to manually turn a signal on or off.
When a signal isn't being used, it's automatically turned off.

Description
The Enable and Disable functions turn a signal on and off, respectively.
These functions currently only work for the Location signal.
These functions have no return value. You can use them only in behavior formulas.

Syntax
Enable( Signal )
Disable( Signal )
Signal - Required. The signal to turn on or off.
Distinct function in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Summarizes records of a table, removing duplicates.

Description
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 Result.
Fields of the record currently being processed are available within the formula. You simply reference them by
name as you would any other value. You can also reference control properties and other values from throughout
your app. For more details, see the examples below and working with record scope.
When used with a data source, this function can't be delegated. Only the first portion of the data source will be
retrieved and then the function applied. The result may not represent the complete story. A warning will appear
at authoring time to remind you of this limitation and to suggest switching to delegable alternatives where
possible. For more information, see the delegation overview.

Syntax
Distinct( Table, Formula )
Table - Required. Table to evaluate across.
Formula - Required. Formula to evaluate for each record.

Example
1. Insert a Button control, and set its OnSelect property to this formula.

ClearCollect( CityPopulations,
{ City: "London", Country: "United Kingdom", Population: 8615000 },
{ City: "Berlin", Country: "Germany", Population: 3562000 },
{ City: "Madrid", Country: "Spain", Population: 3165000 },
{ City: "Hamburg", Country: "Germany", Population: 1760000 },
{ City: "Barcelona", Country: "Spain", Population: 1602000 },
{ City: "Munich", Country: "Germany", Population: 1494000 }
);

2. Select the button while holding down the Alt key.


The formula is evaluatd and the CityPopulations collection is created which you can show by selecting
CityPopulations in the formula bar:
3. Insert a Data table control, and set its Items property to this formula:

Distinct( CityPopulations, Country )

You can view the result of this formula in the formula bar by selecting the entire formula:

4. Use the Edit fields link in the data table's properties pane to add the Result column:
5. Insert a Label control, and set its Text property to the formula:

First( Sort( Distinct( CityPopulations, Country ), Result ) ).Result

This formula sorts the results from Distinct with the Sort function, takes the first record from the
resulting table with the First function, and extracts the Result field to obtain just the country name.
Download, Launch, and Param functions in canvas
apps
11/4/2019 • 2 minutes to read • Edit Online

Downloads or launches a webpage or an app with parameters.

Description
The Download function downloads a file from the web to the local device. The user is prompted for a location to
save the file. Download returns the location where the file was stored locally as a string.
The Launch function launches a webpage or an app. Optionally, this function can pass parameters to the app.
In Internet Explorer and Microsoft Edge, the Launch function opens a website or app only if its security settings are
the same or higher than those of the app that contains the function. If, for example, you add the Launch function to
an app that will run in the Trusted sites security zone, ensure that the website or app that you want the function to
open is in the Trusted sites or Local intranet zone (not in Restricted sites). More information: Change security
and privacy settings for Internet Explorer 11.
The Param function retrieves a parameter passed to the app when it was launched. If the named parameter wasn't
passed, Param returns blank.

Syntax
Download( Address )
Address - Required. The address of a web resource to download.
Launch( Address [, ParameterName1, ParameterValue1, ... ] )
Address - Required. The address of a webpage or the ID of an app to launch.
ParameterName(s) - Optional. Parameter name.
ParameterValue(s) - Optional. Corresponding parameter values to pass to the app or the webpage.
Param ( ParameterName )
ParameterName - Required. The name of the parameter passed to the app.
AddColumns, DropColumns, RenameColumns, and
ShowColumns functions in Power Apps
12/3/2019 • 6 minutes to read • Edit Online

Shapes a table by adding, dropping, renaming, and selecting its columns.

Overview
These functions shape a table by adjusting its columns:
Reduce a table that contains multiple columns down to a single column for use with single-column functions, such as Lower or Abs.
Add a calculated column to a table (for example, a Total Price column that shows the results of multiplying Quantity by Unit Price).
Rename a column to something more meaningful, for display to users or for use in formulas.
A table is a value in Power Apps, just like a string or a number. You can specify a table as an argument in a formula, and functions can
return a table as a result.

NOTE
The functions that this topic describes don't modify the original table. Instead, they take that table as an argument and return a new table with a
transform applied. See working with tables for more details.

You can't modify the columns of a data source by using these functions. You must modify the data at its source. You can add columns to
a collection with the Collect function. See working with data sources for more details.

Description
The AddColumns function adds a column to a table, and a formula defines the values in that column. Existing columns remain
unmodified.
The formula is evaluated for each record of the table.
Fields of the record currently being processed are available within the formula. You simply reference them by name as you would any
other value. You can also reference control properties and other values from throughout your app. For more details, see the examples
below and working with record scope.
The DropColumns function excludes columns from a table. All other columns remain unmodified. DropColumns excludes columns,
and ShowColumns includes columns.
Use the RenameColumns function to rename one or more columns of a table by providing at least one argument pair that specifies the
name of a column that the table contains (the old name, which you want to replace) and the name of a column that the table doesn't
contain (the new name, which you want to use). The old name must already exist in the table, and the new name must not exist. Each
column name may appear only once in the argument list as either an old column name or a new column name. To rename a column to
an existing column name, first drop the existing column with DropColumns, or rename the existing column out of the way by nesting
one RenameColumns function within another.
The ShowColumns function includes columns of a table and drops all other columns. You can use ShowColumns to create a single-
column table from a multi-column table. ShowColumns includes columns, and DropColumns excludes columns.
For all these functions, the result is a new table with the transform applied. The original table isn't modified. You can't modify an existing
table with a formula. SharePoint, Common Data Service, SQL Server, and other data sources provide tools for modifying the columns of
lists, entities, and tables, which are often referred to as the schema. The functions in this topic only transform an input table, without
modifying the original, into an output table for further use.
The arguments to these functions support delegation. For example, a Filter function used as an argument to pull in related records
searches through all listings, even if the '[dbo].[AllListings]' data source contains a million rows:

AddColumns( RealEstateAgents,
"Listings",
Filter( '[dbo].[AllListings]', ListingAgentName = AgentName )
)
However, the output of these functions is subject to the non-delegation record limit. In this example, only 500 records are returned even
if the RealEstateAgents data source has 501 or more records.
If you use AddColumns in this manner, Filter must make separate calls to the data source for each of those first records in
RealEstateAgents, which causes a lot of network chatter. If [dbo].[AllListings] is small enough and doesn't change often, you could
call the Collect function in OnStart to cache the data source in your app when it starts. As an alternative, you could restructure your app
so that you pull in the related records only when the user asks for them.

Syntax
AddColumns( Table, ColumnName1, Formula1 [, ColumnName2, Formula2, ... ] )
Table - Required. Table to operate on.
ColumnName(s) - Required. Name(s) of the column(s) to add. You must specify a string (for example, "Name" with double quotes
included) for this argument.
Formula (s) - Required. Formula(s) to evaluate for each record. The result is added as the value of the corresponding new column. You
can reference other columns of the table in this formula.
DropColumns( Table, ColumnName1 [, ColumnName2, ... ] )
Table - Required. Table to operate on.
ColumnName(s) - Required. Name(s) of the column(s) to drop. You must specify a string (for example, "Name" with double quotes
included) for this argument.
RenameColumns( Table, OldColumnName1, NewColumnName1 [, OldColumnName2, NewColumnName2, ... ] )
Table - Required. Table to operate on.
OldColumnName - Required. Name of a column to rename from the original table. This element appears first in the argument pair
(or first in each argument pair if the formula includes more than one pair). This name must be a string (for example "Name" with
double quotation marks included).
NewColumnName - Required. Replacement name. This element appears last in the argument pair (or last in each argument pair if
the formula includes more than one pair). You must specify a string (for example, "Customer Name" with double quotation marks
included) for this argument.
ShowColumns( Table, ColumnName1 [, ColumnName2, ... ] )
Table - Required. Table to operate on.
ColumnName(s) - Required. Name(s) of the column(s) to include. You must specify a string (for example, "Name" with double
quotes included) for this argument.

Examples
The examples in this section use the IceCreamSales data source, which contains the data in this table:

None of these examples modify the IceCreamSales data source. Each function transforms the value of the data source as a table and
returns that value as the result.

FORMULA DESCRIPTION RESULT

AddColumns( IceCreamSales, "Revenue", Adds a Revenue column to the result. For each
UnitPrice * QuantitySold ) record, UnitPrice * QuantitySold is evaluated,
and the result is placed in the new column.

DropColumns( IceCreamSales, "UnitPrice" ) Excludes the UnitPrice column from the result.
Use this function to exclude columns, and use
ShowColumns to include them.
FORMULA DESCRIPTION RESULT

ShowColumns( IceCreamSales, "Flavor" ) Includes only the Flavor column in the result.
Use this function include columns, and use
DropColumns to exclude them.

RenameColumns( IceCreamSales, Renames the UnitPrice column in the result.


"UnitPrice", "Price")

RenameColumns( IceCreamSales, Renames the UnitPrice and QuantitySold


"UnitPrice", "Price", "QuantitySold", columns in the result.
"Number")

DropColumns( Performs the following table transforms in


RenameColumns( order, starting from the inside of the formula:
AddColumns( IceCreamSales, "Revenue", 1. Adds a Revenue column based on the
UnitPrice * QuantitySold ), per-record calculation of UnitPrice *
"UnitPrice", "Price" ), Quantity.
"Quantity" ) 2. Renames UnitPrice to Price.
3. Excludes the Quantity column.
Note that order is important. For example, we
can't calculate with UnitPrice after it has been
renamed.

Step by step
Let's try some of the examples from earlier in this topic.
1. Create a collection by adding a Button control and setting its OnSelect property to this formula:

ClearCollect( IceCreamSales,
Table(
{ Flavor: "Strawberry", UnitPrice: 1.99, QuantitySold: 20 },
{ Flavor: "Chocolate", UnitPrice: 2.99, QuantitySold: 45 },
{ Flavor: "Vanilla", UnitPrice: 1.50, QuantitySold: 35 }
)
)

2. Run the formula by selecting the button while holding down the Alt key.
3. Add a second Button control, set its OnSelect property to this formula, and then run it:

ClearCollect( FirstExample,
AddColumns( IceCreamSales, "Revenue", UnitPrice * QuantitySold )
)

4. On the File menu, select Collections, and then select IceCreamSales to show that collection.
As this graphic shows, the second formula didn't modify this collection. The AddColumns function used IceCreamSales as a
read-only argument; the function didn't modify the table to which that argument refers.
5. Select FirstExample.
As this graphic shows, the second formula returned a new table with the added column. The ClearCollect function captured the
new table in the FirstExample collection, adding something to the original table as it flowed through the function without
modifying the source:
EditForm, NewForm, SubmitForm, ResetForm, and
ViewForm functions in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

View, edit, or create an item, save the contents, and reset the controls in an Edit form control.

Overview
These functions change the state of the Edit form control. The form control can be in one of these modes:

MODE DESCRIPTION

FormMode.Edit The form is populated with an existing record and the user can
modify the values of the fields. Once complete, the user can
save the changes to the record.

FormMode.New The form is populates with default values and the user can
modify the values of the fields. Once complete, the user can
add the record to the data source.

FormMode.View The form is populated with an existing record but the user
cannot modify the values of the fields.

Description
These functions are often invoked from the OnSelect formula of a Button or Image control so that the user can
save edits, abandon edits, or create a record. You can use controls and these functions together to create a complete
solution.
These functions return no values.
SubmitForm
Use the SubmitForm function in the OnSelect property of a Button control to save any changes in a Form control
to the data source.
Before submitting any changes, this function checks for validation issues with any field that's marked as required or
that has one or more constraints on its value. This behavior matches that of the Validate function.
SubmitForm also checks the Valid property of the Form, which is an aggregation of all the Valid properties of the
Card controls that the Form control contains. If a problem occurs, the data isn't submitted, and the Error and
ErrorKind properties of the Form control are set accordingly.
If validation passes, SubmitForm submits the change to the data source.
If successful, the Form's OnSuccess behavior runs, and the Error and ErrorKind properties are cleared. If the
form was in FormMode.New mode, it is returned to FormMode.Edit mode.
If unsuccessful, the Form's OnFailure behavior runs, and the Error and ErrorKind properties are set
accordingly. The mode of the form is unchanged.
EditForm
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.
NewForm
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.
ResetForm
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.
ViewForm
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.
DisplayMode Property
The current mode can be read through the Mode property. The mode also determines the value of the
DisplayMode property which can be used by data cards and controls within the form control. Often, the data
card's DisplayMode property will be set to Parent.DisplayMode (referencing the form) as will the control's
DisplayMode property (referencing the data card):

MODE DISPLAYMODE DESCRIPTION

FormMode.Edit DisplayMode.Edit Data cards and controls are editable,


ready to accept changes to a record.

FormMode.New DisplayMode.Edit Data cards and controls are editable,


ready to accept a new record.

FormMode.View DisplayMode.View Data cards and controls are not editable


and optimized for viewing.

Syntax
SubmitForm ( FormName )
FormName - Required. Form control to submit to the data source.
EditForm ( FormName )
FormName - Required. Form control to switch to FormMode.Edit mode.
NewForm ( FormName )
FormName - Required. Form control to switch to FormMode.New mode.
ResetForm ( FormName )
FormName - Required. Form control to reset to initial values. Also switches the form from FormMode.New
mode to FormMode.Edit mode.
ViewForm ( FormName )
FormName - Required. Form control to switch to FormMode.View mode.
Examples
See Understand data forms for complete examples.
1. Add a Button control, set its Text property to show Save, and set its OnSelect property to this formula:
SubmitForm ( EditForm )
2. Set the OnFailure property of a Form control to blank and its OnSuccess property to this formula:
Back()
3. Name a Label control ErrorText, and set its Text property to this formula:
EditForm.Error
When the user selects the Save button, any changes in the Form control are submitted to the underlying
data source.
If the submission succeeds, any changes are saved or, if the Form control is in New mode, a record is
created. ErrorText is blank and the previous screen reappears.
If the submission fails, ErrorText shows a user-friendly error message, and the current screen remains
visible so that the user can correct the problem and try again.
4. Add a Button control, set its Text property to show Cancel, and set its OnSelect property to this formula:
ResetForm ( EditForm ); Back()
When the user selects the Cancel button, the values in the Form control are reset to what they were before
the user started to edit it, the previous screen reappears, and the Form control is returned to Edit mode if it
was in New mode.
5. Add a Button control, set its Text property to show New, and set its OnSelect property to this formula:
NewForm ( EditForm ); Navigate( EditScreen, None )
When the user selects the New button, the Form control switches to New mode, the default values for the
Form control's data source populate that control, and the screen that contains the Form control appears.
When the SubmitForm function runs, a record is created instead of updated.
Enable and Disable functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Turns a signal on or off.

Overview
Some signals can change often, requiring the app to recalculate as they do. Rapid changes over a long period of
time can drain a device's battery. You can use these functions to manually turn a signal on or off.
When a signal isn't being used, it's automatically turned off.

Description
The Enable and Disable functions turn a signal on and off, respectively.
These functions currently only work for the Location signal.
These functions have no return value. You can use them only in behavior formulas.

Syntax
Enable( Signal )
Disable( Signal )
Signal - Required. The signal to turn on or off.
EndsWith and StartsWith functions in Power Apps
12/3/2019 • 5 minutes to read • Edit Online

Tests whether a text string begins or ends another text string.

Description
The EndsWith function tests whether one text string ends with another.
The StartsWith function tests whether one text string begins with another.
For both functions, the tests are case insensitive. The return value of both is a Boolean true or false.
Use EndsWith and StartsWith with the Filter function to search the data within your app. You can also use the in
operator or the Search function to look anywhere within text strings, not just at the beginning or end. Your choice
of functions will depend on the needs of your app and which function can be delegated for your particular data
source. If one of these functions can't be delegated, a delegation warning will appear at authoring time to warn you
of this limitation.

Syntax
EndsWith( Text, EndText )
Text – Required. The text to test.
EndText – Required. The text to search for at the end of Text. If EndText is an empty string, EndsWith returns
true.
StartsWith( Text, StartText )
Text – Required. The text to test.
StartText – Required. The text to search for at the beginning of Text. If StartText is an empty string, StartsWith
returns true.

Examples
FORMULA DESCRIPTION RESULT

EndsWith( "Hello World", "world" ) Tests whether "Hello World" ends with true
"world". The test is case insensitive.

EndsWith( "Good bye", "good" ) Tests whether "Good bye" ends with false
"good". The EndText argument
("good") appears in the text but not at
the end.

EndsWith( "Always say hello", Tests whether "Always say hello" ends true
"hello" ) with "hello".

EndsWith( "Bye bye", "" ) Tests whether "Bye bye" ends with an true
empty text string (Len returns 0). Easing
its use in Filter expressions, EndsWith is
defined to return true in this case.
FORMULA DESCRIPTION RESULT

StartsWith( "Hello World", "hello" ) Tests whether "Hello World" begins true
with "hello". The test is case insensitive.

StartsWith( "Good bye", "hello" ) Tests whether "Good bye" begins with false
"hello".

StartsWith( "Always say hello", Tests whether "Always say hello" false
"hello" ) begins with "hello". Although "hello"
appears in the text, it doesn't appear at
the beginning.

StartsWith( "Bye bye", "" ) Tests whether "Bye bye" starts with an true
empty text string (Len returns 0). Easing
its use in Filter expressions, StartsWith
is defined to return true in this case.

Search user experience


In many apps, you can type one or more characters into a search box to filter a list of records in a large data set. As
you type, the list shows only those records that match the search criteria.
The examples in the rest of this topic show the results of searching a Customers list that contains this data:

To create this data source as a collection, create a Button control and set its OnSelect property to this formula:
ClearCollect( Customers, Table( { Name: "Fred Garcia", Company: "Northwind Traders" }, { Name: "Cole
Miller", Company: "Contoso" }, { Name: "Glenda Johnson", Company: "Contoso" }, { Name: "Mike
Collins", Company: "Adventure Works" }, { Name: "Colleen Jones", Company: "Adventure Works" } ) )
As in this example, you can show a list of records in a Gallery control at the bottom of a screen. Near the top of
the screen, you can add a Text input control, named SearchInput, so that users can specify which records interest
them.
As the user types characters in SearchInput, the results in the gallery are automatically filtered. In this case, the
gallery is configured to show records for which the name of the customer (not the name of the company) starts
with the sequence of characters in SearchInput.If the user types co in the search box, the gallery shows these
results:

To filter based on the Name column, set the Items property of the gallery control to one of these formulas:

FORMULA DESCRIPTION RESULT

Filter( Customers, StartsWith( Name, Filters the Customers data source for
SearchInput.Text ) ) records in which the search string
appears at the start of the Name
column. The test is case insensitive. If
the user types co in the search box, the
gallery shows Colleen Jones and Cole
Miller. The gallery doesn't show Mike
Collins because the Name column for
that record doesn't start with the search
string.
FORMULA DESCRIPTION RESULT

Filter( Customers, SearchInput.Text Filters the Customers data source for


in Name ) records in which the search string
appears anywhere in the Name column.
The test is case insensitive. If the user
types co in the search box, the gallery
shows Colleen Jones, Cole Miller, and
Mike Collins because the search string
appears somewhere in the Name
column of all of those records.

Search( Customers, Similar to using the in operator, the


SearchInput.Text, "Name" ) Search function searches for a match
anywhere within the Name column of
each record. Note that you must
enclose the column name in double
quotation marks.

You can expand your search to include the Company column as well as the Name column:

FORMULA DESCRIPTION RESULT

Filter( Customers, StartsWith( Name, Filters the Customers data source for
SearchInput.Text ) || StartsWith( records in which either the Name
Company, SearchInput.Text ) ) column or the Company column starts
with the search string (for example, co).
The || operator is true if either
StartsWith function is true.

Filter( Customers, SearchInput.Text Filters the Customers data source for


in Name || SearchInput.Text in records in which either the Name
Company ) column or the Company column
contains the search string (for example,
co) anywhere within it.

Search( Customers, Similar to using the in operator, the


SearchInput.Text, "Name", Search function searches the
"Company" ) Customers data source for records in
which either the Name column or the
Company column contains the search
string (for example, co) anywhere within
it. The Search function is easier to read
and write than Filter if you want to
specify multiple columns and multiple in
operators. Note that you must enclose
the names of the columns in double
quotation marks.
Errors function in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Provides error information for previous changes to a data source.

Overview
Errors can happen when a record of a data source is changed. Many causes are possible, including network
outages, inadequate permissions, and edit conflicts.
The Patch function and other data functions don't directly return errors. Instead they return the result of their
operation. After a data function executes, you can use the Errors function to obtain the details of any errors.
You can check for the existence of errors with the [IsEmpty] function in the formula IsEmpty( Errors ( ... ) ).
You can avoid some errors before they happen by using the Validate and DataSourceInfo functions. See
working with data sources for more suggestions on how to work with and avoid errors.

Description
The Errors function returns a table of errors that contains the following columns:
Record. The record in the data source that had the error. If the error occurred during the creation of a
record, this column will be blank.
Column. The column that caused the error, if the error can be attributed to a single column. If not, this will
be blank.
Message. A description of the error. This error string can be displayed for the end user. Be aware that this
message may be generated by the data source and could be long and contain raw column names that may
not have any meaning to the user.
Error. An error code that can be used in formulas to help resolve the error:

ERRORKIND DESCRIPTION

ErrorKind.Conflict Another change was made to the same record, resulting in a


change conflict. Use the Refresh function to reload the
record and try the change again.

ErrorKind.ConstraintViolation One or more constraints have been violated.

ErrorKind.CreatePermission An attempt was made to create a record, and the current


user doesn't have permission to create records.

ErrorKind.DeletePermission An attempt was made to delete a record, and the current


user doesn't have permission to delete records.

ErrorKind.EditPermission An attempt was made to edit a record, and the current user
doesn't have permission to edit records.

ErrorKind.GeneratedValue An attempt was made to change a column that the data


source generates automatically.

ErrorKind.MissingRequired The value for a required column is missing from the record.
ERRORKIND DESCRIPTION

ErrorKind.None There is no error.

ErrorKind.NotFound An attempt was made to edit or delete a record, but the


record couldn't be found. Another user may have changed
the record.

ErrorKind.ReadOnlyValue An attempt was made to change a column that's read only.

ErrorKind.Sync An error was reported by the data source. Check the


Message column for more information.

ErrorKind.Unknown There was an error, but of an unknown kind.

ErrorKind.Validation There was a general validation issue detected, that did not
fit one of the other kinds.

Errors can be returned for the entire data source, or for only a selected row by providing the Record argument
to the function.
Patch or another data function may return a blank value if, for example, a record couldn't be created. You can
pass blank to Errors, and it will return appropriate error information in these cases. Subsequent use of data
functions on the same data source will clear this error information.
If there are no errors, the table that Errors returns will be empty and can be tested with the IsEmpty function.

Syntax
Errors( DataSource [, Record ] )
DataSource – Required. The data source for which you want to return errors.
Record – Optional. A specific record for which you want to return errors. If you don't specify this argument,
the function returns errors for the entire data source.

Examples
Step by Step
For this example, we'll be working with the IceCream data source:

Through the app, a user loads the Chocolate record into a data-entry form and then changes the value of
Quantity to 90. The record to be worked with is placed in the context variable EditRecord:
UpdateContext( { EditRecord: First( Filter( IceCream, Flavor = "Chocolate" ) ) } )
To make this change in the data source, the Patch function is used:
Patch( IceCream, EditRecord, Gallery.Updates )
where Gallery.Updates evaluates to { Quantity: 90 }, since only the Quantity property has been modified.
Unfortunately, just before the Patch function was invoked, somebody else modifies the Quantity for
Chocolate to 80. Power Apps will detect this and not allow the conflicting change to occur. You can check for
this situation with the formula:
IsEmpty( Errors( IceCream, EditRecord ) )
which returns false, because the Errors function returned the following table:

RECORD COLUMN MESSAGE ERROR

{ Flavor: "Chocolate", blank "Another user has modified ErrorKind.Conflict


Quantity: 100 } the record that you're
trying to modify. Please
reload the record and try
again."

You can place a label on the form to show this error to the user.
To show the error, set the label's Text property to this formula:
Label.Text = First(Errors( IceCream, EditRecord )).Message
You can also add a Reload button on the form, so that the user can efficiently resolve the conflict.
To show the button only when a conflict has occurred, set the button's Visible property to this formula:
!IsEmpty( Lookup( Errors( IceCream, EditRecord ), Error = ErrorKind.Conflict ) )
To revert the change which the user selects the button, set its OnSelect property to this formula:
ReloadButton.OnSelect = Revert( IceCream, EditRecord )
EncodeUrl and PlainText functions in Power Apps
2/8/2020 • 2 minutes to read • Edit Online

Encodes and decodes strings.

Description
The EncodeUrl function encodes a URL string, replacing certain non-alphanumeric characters with % and a
hexadecimal number.
The PlainText function removes HTML and XML tags, converting certain tags such as these to an appropriate
symbol:
&nbsp;
&quot;
The return value from these functions is the encoded or decoded string. This function doesn't remove all HTML and
XML tags.

Syntax
EncodeUrl( String )
String - Required. URL to be encoded.
PlainText( String )
String - Required. String from which HTML and XML tags will be stripped.

Examples
If you show an RSS feed in a text gallery and then set the Text property of a label in that gallery to
ThisItem.description, the label might show raw HTML or XML code as in this example:

<p>We have done an unusually&nbsp;&quot;deep&quot; globalization and localization.</p>

If you set the Text property of the label to PlainText(ThisItem.description), the text appears as in this example:

We have done an unusually "deep" globalization and localization.


Exit function in Power Apps
3/24/2020 • 2 minutes to read • Edit Online

Exits the currently running app and optionally signs out the current user.

Description
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.
Exit stops any further formula evaluation. Any function calls chained with a semicolon operator after the Exit
aren't carried out.
Use the optional Signout argument to sign the current user out of Power Apps. Signout is useful when devices are
shared to ensure user security.
While authoring the app, calling Exit doesn't exit or sign out the user. However, it doesn't stop the evaluation of
the rest of the formula.
Exit can only be used in behavior formulas.

NOTE
Signing out is not supported while running the app in a web browser.

Syntax
Exit( [Signout] )
Signout – Optional. A Boolean value that if true will sign the current user out of Power Apps. The default is false
and the user remains signed in.

Examples
FORMULA DESCRIPTION

Exit() Exits the current app and leaves the user signed in. The user is
returned to the list of apps.

Exit( true ) Exits the current app and the user is signed out. The user will
need to sign back in with their credentials before running an
app.
Abs, Exp, Ln, Power, and Sqrt functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Calculates absolute values, natural logarithms, square roots, and the results of raising e or any number to specified
powers.

Description
The Abs function returns the non-negative value of its argument. If a number is negative, Abs returns the positive
equivalent.
The Exp function returns e raised to the power of its argument. The transcendental number e begins 2.7182818...
The Ln function returns the natural logarithm (base e) of its argument.
The Power function returns a number raised to a power. It is equivalent to using the ^ operator.
The Sqrt function returns the number that, when multiplied by itself, equals its argument.
If you pass a single number, the return value is a single result based on the function called. If you pass a single-
column table that contains numbers, the return value is a single-column table of results, one result for each record
in the argument's table. If you have a multi-column table, you can shape it into a single-column table, as working
with tables describes.
If an argument would result in an undefined valued, the result is blank. This can happen, for example, with square
roots and logarithms of negative numbers.

Syntax
Abs( Number )
Exp( Number )
Ln( Number )
Sqrt( Number )
Number - Required. Number to operate on.
Power( Base, Exponent )
Base - Required. Base number to raise.
Exponent - Required. The exponent to which the base number is raised.
Abs( SingleColumnTable )
Exp( SingleColumnTable )
Ln( SingleColumnTable )
Sqrt( SingleColumnTable )
SingleColumnTable - Required. A single-column table of numbers to operate on.

Examples
Single number
FORMULA DESCRIPTION RESULT

Abs( -55 ) Returns the number without the 55


negative sign.

Exp( 2 ) Returns e raised to the power of 2, or e 7.389056...


* e.

Ln( 100 ) Returns the natural logarithm (base e) 4.605170...


of the number 100.

Power( 5, 3 ) Returns 5 raised to the power of 3, or 5 125


* 5 * 5.

Sqrt( 9 ) Returns the number that, when 3


multiplied by itself, results in 9.

Single -column table


The examples in this section use a data source that's named ValueTable and that contains this data:

FORMULA DESCRIPTION RESULT

Abs( ValueTable ) Returns the absolute value of each


number in the table.

Exp( ValueTable ) Returns e raised to the power of each


number in the table.

Ln( ValueTable ) Returns the natural logarithm of each


number in the table.

Sqrt( ValueTable ) Returns the square root of each number


in the table

Step-by-step example
1. Add a Text input control, and name it Source.
2. Add a Label control, and set its Text property to this formula:
Sqrt( Value( Source.Text ) )
3. Type a number into Source, and confirm that the Label control shows the square root of the number that you
typed.
Filter, Search, and LookUp functions in Power Apps
12/3/2019 • 8 minutes to read • Edit Online

Finds one or more records in a table.

Description
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 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.
For both, the formula is evaluated for each record of the table. Records that result in true are included in the result.
Besides the normal formula operators, you can use the in and exactin operators for substring matches.
Fields of the record currently being processed are available within the formula. You simply reference them by name
as you would any other value. You can also reference control properties and other values from throughout your
app. For more details, see the examples below and working with record scope.
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.
Filter and Search return a table that contains the same columns as the original table and the records that match
the criteria. LookUp returns only the first record found, after applying a formula to reduce the record to a single
value. If no records are found, Filter and Search return an empty table, and LookUp returns blank.
Tables are a value in Power Apps, just like a string or number. They can be passed to and returned from functions.
Filter, Search, and LookUp don't modify a table. Instead, they take a table as an argument and return a table, a
record, or a single value from it. See working with tables for more details.

Delegation
When possible, Power Apps will delegate filter and sort operations to the data source and page through the results
on demand. For example, when you start an app that shows a Gallery control filled with data, only the first set of
records will be initially brought to the device. As the user scrolls, additional data is brought down from the data
source. The result is a faster start time for the app and access to very large data sets.
However, delegation may not always be possible. Data sources vary on what functions and operators they support
with delegation. If complete delegation of a formula isn't possible, the authoring environment will flag the portion
that can't be delegated with a warning. When possible, consider changing the formula to avoid functions and
operators that can't be delegated. The delegation list details which data sources and operations can be delegated.
If delegation is not possible, Power Apps will pull down only a small set of records to work on locally. Filter and sort
functions will operate on a reduced set of records. What is available in the Gallery may not be the complete story,
which could be confusing to users.
See the delegation overview for more information.

Syntax
Filter( Table, Formula1 [, Formula2, ... ] )
Table - Required. Table to search.
Formula (s) - Required. The formula by which each record of the table is evaluated. The function returns all
records that result in true. You can reference columns within the table. If you supply more than one formula, the
results of all formulas are combined with the And function.
Search( Table, SearchString, Column1 [, Column2, ... ] )
Table - Required. Table to search.
SearchString - Required. The string to search for. If blank or an empty string, all records are returned.
Column(s) - Required. The names of columns within Table to search. Columns to search must contain text.
Column names must be strings and enclosed in double quotes. However, the column names must be static and
cannot be calculated with a formula. If SearchString is found within the data of any of these columns as a partial
match, the full record will be returned.

NOTE
For SharePoint and Excel data sources that contain column names with spaces, specify each space as "_x0020_". For example,
specify "Column Name" as "Column_x0020_Name".

LookUp( Table, Formula [, ReductionFormula ] )


Table - Required. Table to search. In the UI, the syntax is shown as source above the function box.
Formula - Required. The formula by which each record of the table is evaluated. The function returns the first
record that results in true. You can reference columns within the table. In the UI, the syntax is shown as
condition above the function box.
ReductionFormula - Optional. This formula is evaluated over the record that was found, and then reduces the
record to a single value. You can reference columns within the table. If you don't use this parameter, the function
returns the full record from the table. In the UI, the syntax is shown as result above the function box.

Examples
The following examples use the IceCream data source:

FORMULA DESCRIPTION RESULT

Filter( IceCream, OnOrder > 0 ) Returns records where OnOrder is


greater than zero.

Filter( IceCream, Quantity + Returns records where the sum of


OnOrder > 225 ) Quantity and OnOrder columns is
greater than 225.
FORMULA DESCRIPTION RESULT

Filter( IceCream, "chocolate" in Returns records where the word


Lower( Flavor ) ) "chocolate" appears in the Flavor name,
independent of uppercase or lowercase
letters.

Filter( IceCream, Quantity < 10 && Returns records where the Quantity is
OnOrder < 20 ) less than 10 and OnOrder is less than
20. No records match these criteria, so
an empty table is returned.

Search( IceCream, "choc", "Flavor" ) Returns records where the string "choc"
appears in the Flavor name,
independent of uppercase or lowercase
letters.

Search( IceCream, "", "Flavor" ) Because the search term is empty, all
records are returned.

LookUp( IceCream, Flavor = Searches for a record with Flavor equal 100
"Chocolate", Quantity ) to "Chocolate", of which there is one.
For the first record that's found, returns
the Quantity of that record.

LookUp( IceCream, Quantity > 150, Searches for a record with Quantity 250
Quantity + OnOrder ) greater than 100, of which there are
multiple. For the first record that's
found, which is "Vanilla" Flavor, returns
the sum of Quantity and OnOrder
columns.

LookUp( IceCream, Flavor = Searches for a record with Flavor equal blank
"Pistachio", OnOrder ) to "Pistachio", of which there are none.
Because none were found, Lookup
returns blank.

LookUp( IceCream, Flavor = Searches for a record with Flavor equal { Flavor: "Vanilla", Quantity: 200,
"Vanilla" ) to "Vanilla", of which there is one. Since OnOrder: 75 }
no reduction formula was supplied, the
entire record is returned.

Search user experience


In many apps, you can type one or more characters into a search box to filter a list of records in a large data set. As
you type, the list shows only those records that match the search criteria.
The examples in the rest of this topic show the results of searching a list, named Customers, that contains this data:
To create this data source as a collection, create a Button control and set its OnSelect property to this formula:
ClearCollect( Customers, Table( { Name: "Fred Garcia", Company: "Northwind Traders" }, { Name: "Cole
Miller", Company: "Contoso" }, { Name: "Glenda Johnson", Company: "Contoso" }, { Name: "Mike
Collins", Company: "Adventure Works" }, { Name: "Colleen Jones", Company: "Adventure Works" } ) )
As in this example, you can show a list of records in a Gallery control at the bottom of a screen. Near the top of
the screen, you can add a Text input control, named SearchInput, so that users can specify which records interest
them.

As the user types characters in SearchInput, the results in the gallery are automatically filtered. In this case, the
gallery is configured to show records for which the name of the customer (not the name of the company) starts
with the sequence of characters in SearchInput. If the user types co in the search box, the gallery shows these
results:
To filter based on the Name column, set the Items property of the gallery control to one of these formulas:

FORMULA DESCRIPTION RESULT

Filter( Customers, StartsWith( Name, Filters the Customers data source for
SearchInput.Text ) ) records in which the search string
appears at the start of the Name
column. The test is case insensitive. If
the user types co in the search box, the
gallery shows Colleen Jones and Cole
Miller. The gallery doesn't show Mike
Collins because the Name column for
that record doesn't start with the search
string.

Filter( Customers, SearchInput.Text Filters the Customers data source for


in Name ) records in which the search string
appears anywhere in the Name column.
The test is case insensitive. If the user
types co in the search box, the gallery
shows Colleen Jones, Cole Miller, and
Mike Collins because the search string
appears somewhere in the Name
column of all of those records.

Search( Customers, Similar to using the in operator, the


SearchInput.Text, "Name" ) Search function searches for a match
anywhere within the Name column of
each record. Note that you must
enclose the column name in double
quotation marks.

You can expand your search to include the Company column as well as the Name column:

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Filter( Customers, StartsWith( Name, Filters the Customers data source for
SearchInput.Text ) || StartsWith( records in which either the Name
Company, SearchInput.Text ) ) column or the Company column starts
with the search string (for example, co).
The || operator is true if either
StartsWith function is true.

Filter( Customers, SearchInput.Text Filters the Customers data source for


in Name || SearchInput.Text in records in which either the Name
Company ) column or the Company column
contains the search string (for example,
co) anywhere within it.

Search( Customers, Similar to using the in operator, the


SearchInput.Text, "Name", Search function searches the
"Company" ) Customers data source for records in
which either the Name column or the
Company column contains the search
string (for example, co) anywhere within
it. The Search function is easier to read
and write than Filter if you want to
specify multiple columns and multiple in
operators. Note that you must enclose
the names of the columns in double
quotation marks.
Find function in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Finds a string of text, if it exists, within another string.

Description
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.
Find returns the starting position of the string that was found. Position 1 is the first character of the string. Find
returns blank if the string in which you're searching doesn't contain the string for which you're searching.

Syntax
Find( FindString, WithinString [, StartingPosition ] )
FindString - Required. The string to find.
WithinString - Required. The string to search within.
StartingPosition - Optional. The starting position to start searching. Position 1 is the first character.
First, FirstN, Last, and LastN functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Returns a table's first or last set of records.

Description
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.
First and Last return a single record. FirstN and LastN return a table, even if you specify only a single record.
When used with a data source, these functions can't be delegated. Only the first portion of the data source will be
retrieved and then the function applied. The result may not represent the complete story. A warning will appear at
authoring time to remind you of this limitation and to suggest switching to delegable alternatives where possible.
For more information, see the delegation overview.

Syntax
First( Table )
Last( Table )
Table - Required. Table to operate on.
FirstN ( Table [, NumberOfRecords ] )
LastN ( Table [, NumberOfRecords ] )
Table - Required. Table to operate on.
NumberOfRecords - Optional. Number of records to return. If you don't specify this argument, the function
returns one record.

Examples
This formula returns the first record from a table named Employees:
First(Employees)
This formula returns the last 15 records from a table named Employees:
LastN (Employees, 15)
First, FirstN, Last, and LastN functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Returns a table's first or last set of records.

Description
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.
First and Last return a single record. FirstN and LastN return a table, even if you specify only a single record.
When used with a data source, these functions can't be delegated. Only the first portion of the data source will be
retrieved and then the function applied. The result may not represent the complete story. A warning will appear at
authoring time to remind you of this limitation and to suggest switching to delegable alternatives where possible.
For more information, see the delegation overview.

Syntax
First( Table )
Last( Table )
Table - Required. Table to operate on.
FirstN ( Table [, NumberOfRecords ] )
LastN ( Table [, NumberOfRecords ] )
Table - Required. Table to operate on.
NumberOfRecords - Optional. Number of records to return. If you don't specify this argument, the function
returns one record.

Examples
This formula returns the first record from a table named Employees:
First(Employees)
This formula returns the last 15 records from a table named Employees:
LastN (Employees, 15)
ForAll function in Power Apps
12/3/2019 • 8 minutes to read • Edit Online

Calculates values and performs actions for all records of a table.

Description
The ForAll function evaluates a formula for all records of a table. The formula can calculate a value and/or
perform actions, such as modifying data or working with a connection. Use the With function to evaluate a
formula for a single record.
Fields of the record currently being processed are available within the formula. You simply reference them by
name as you would any other value. You can also reference control properties and other values from throughout
your app. For more details, see the examples below and working with record scope.
Return value
The result of each formula evaluation is returned in a table, in the same order as the input table.
If the result of the formula is a single value, the resulting table will be a single column table. If the result of the
formula is a record, the resulting table will contain records with the same columns as the result record.
If the result of the formula is a blank value, then there will be no record in the result table for that input record. In
this case, there will be fewer records in the result table than the source table.
Taking action
The formula can include functions that take action, such as modifying the records of a data source with the Patch
and Collect functions. The formula can also call methods on connections. Multiple actions can be performed per
record by using the ; operator. You can't modify the table that is the subject of the ForAll function.
When writing your formula, keep in mind that records can be processed in any order and, when possible, in
parallel. The first record of the table may be processed after the last record. Take care to avoid ordering
dependencies. For this reason, you can't use the UpdateContext, Clear, and ClearCollect functions within a
ForAll function because they could easily be used to hold variables that would be susceptible to this effect. You
can use Collect, but the order in which records are added is undefined.
Several functions that modify data sources, including Collect, Remove, and Update, return the changed data
source as their return value. These return values can be large and consume significant resources if returned for
every record of the ForAll table. You may also find that these return values are not what you expect, because
ForAll can operate in parallel and may separate the side effects of these functions from obtaining their result.
Fortunately, if the return value from ForAll is not actually used, which is often the case with data modification
functions, then the return value will not be created and there are no resource or ordering concerns. But if you are
using the result of a ForAll and one of the functions that returns a data source, think carefully about how you
structure the result and try it out first on small data sets.
Alternatives
Many functions in Power Apps can process more than one value at a time through the use of a single-column
table. For example, the Len function can process a table of text values, returning a table of lengths, in the same
manner that ForAll could. This can eliminate the need to use ForAll in many cases, can be more efficient, and is
easier to read.
Another consideration is that ForAll is not delegable while other functions may be, such as Filter.
Delegation
When used with a data source, this function can't be delegated. Only the first portion of the data source will be
retrieved and then the function applied. The result may not represent the complete story. A warning will appear at
authoring time to remind you of this limitation and to suggest switching to delegable alternatives where possible.
For more information, see the delegation overview.

Syntax
ForAll( Table, Formula )
Table - Required. Table to be acted upon.
Formula - Required. The formula to evaluate for all records of the Table.

Examples
Calculations
The following examples use the Squares data source:

To create this data source as a collection, set the OnSelect property of a Button control to this formula, open
Preview mode, and then click or tap the button:
ClearCollect( Squares, [ "1", "4", "9" ] )

FORMULA DESCRIPTION RESULT

ForAll( Squares, Sqrt( Value ) ) For all the records of the input table,
calculates the square root of the Value
Sqrt( Squares ) column. The Sqrt function can also be
used with a single-column table,
making it possible perform this example
without using ForAll.

ForAll( Squares, Power( Value, 3 ) ) For all the records of the input table,
raises the Value column to the third
power. The Power function does not
support single-column tables.
Therefore, ForAll must be used in this
case.

Using a connection
The following examples use the Expressions data source:

To create this data source as a collection, set the OnSelect property of a Button control to this formula, open
Preview mode, and then click or tap the button:
ClearCollect( Expressions, [ "Hello", "Good morning", "Thank you", "Goodbye" ] )

This example also uses a Microsoft Translator connection. To add this connection to your app, see the topic about
how to manage connections.

FORMULA DESCRIPTION RESULT

ForAll( Expressions, For all the records in the Expressions


MicrosoftTranslator.Translate( Value, table, translate the contents of the
"es" ) ) Value column into Spanish (abbreviated
"es").

ForAll( Expressions, For all the records in the Expressions


MicrosoftTranslator.Translate( Value, table, translate the contents of the
"fr" ) ) Value column into French (abbreviated
"fr").

Copying a table
Sometimes you need to filter, shape, sort, and manipulate data. Power Apps provides a number of functions for
doing this, such as Filter, AddColumns, and Sort. Power Apps treats each table as a value, allowing it to flow
through formulas and be consumed easily.
And sometime you will want to make a copy of this result for later use. Or you will want to move information
from one data source to another. Power Apps provides the Collect function to copy data.
But before you make that copy, think carefully if it is really needed. Many situations can be addressed by filtering
and shaping the underlying data source on demand with a formula. Some of the downsides to making a copy
include:
Two copies of the same information means that one of them can fall out of sync.
Making a copy can consume a lot of computer memory, network bandwidth, and/or time.
For most data sources, copying cannot be delegated, limiting how much data can be moved.
The following examples use the Products data source:

To create this data source as a collection, set the OnSelect property of a Button control to this formula, open
Preview mode, and then click or tap the button:
ClearCollect( Products,
Table(
{ Product: "Widget", 'Quantity Requested': 6, 'Quantity Available': 3 },
{ Product: "Gadget", 'Quantity Requested': 10, 'Quantity Available': 20 },
{ Product: "Gizmo", 'Quantity Requested': 4, 'Quantity Available': 11 },
{ Product: "Apparatus", 'Quantity Requested': 7, 'Quantity Available': 6 }
)
)

Our goal is to work with a derivative table that includes only the items where more has been requested than is
available, and for which we need to place an order:

We can perform this task in a couple of different ways, all of which produce the same result, with various pros and
cons.
Table shaping on demand
Don't make that copy! We can use the following formula anywhere we need:

// Table shaping on demand, no need for a copy of the result


ShowColumns(
AddColumns(
Filter( Products, 'Quantity Requested' > 'Quantity Available' ),
"Quantity To Order", 'Quantity Requested' - 'Quantity Available'
),
"Product",
"Quantity To Order"
)

A record scope is created by the Filter and AddColumns functions to perform the comparison and subtraction
operations, respectively, with the 'Quantity Requested' and 'Quantity Available' fields of each record.
In this example, the Filter function can be delegated. This is important, as it can find all the products that meet the
criteria, even if that is only a few records out of a table of millions. At this time, ShowColumns and AddColumns
cannot be delegated, so the actual number of products that needs to be ordered will be limited. If you know the
size of this result will always be relatively small, this approach is fine.
And because we didn't make a copy, there is no additional copy of the information to manage or fall out of date.
ForAll on demand
Another approach is to use the ForAll function to replace the table-shaping functions:

ForAll( Products,
If( 'Quantity Requested' > 'Quantity Available',
{
Product: Product,
'Quantity To Order': 'Quantity Requested' - 'Quantity Available'
}
)
)

This formula may be simpler for some people to read and write.
No part of the ForAll is delegable. Only the first portion of the Products table will be evaluated, which could be a
problem if this table is very large. Because Filter could be delegated in the previous example, it could work better
with large data sets.
Collect the result
In some situations, a copy of data may be required. You may need to move information from one data source to
another. In this example, orders are placed through a NewOrder table on a vendor's system. For high-speed user
interactions, you may want to cache a local copy of a table so that there is no server latency.
We use the same table shaping as the previous two examples, but we capture the result into a collection:

ClearCollect( NewOrder,
ShowColumns(
AddColumns(
Filter( Products, 'Quantity Requested' > 'Quantity Available' ),
"Quantity To Order", 'Quantity Requested' - 'Quantity Available'
),
"Product",
"Quantity To Order"
)
)

ClearCollect( NewOrder,
ForAll( Products,
If( 'Quantity Requested' > 'Quantity Available',
{
Product: Product,
'Quantity To Order': 'Quantity Requested' - 'Quantity Available'
}
}
)
)

ClearCollect and Collect can't be delegated. As a result the amount of data that can be moved in this manner is
limited.
Collect within ForAll
Finally, we can perform the Collect directly within the ForAll:

Clear( ProductsToOrder );
ForAll( Products,
If( 'Quantity Requested' > 'Quantity Available',
Collect( NewOrder,
{
Product: Product,
'Quantity To Order': 'Quantity Requested' - 'Quantity Available'
}
)
)
)

Again, the ForAll function can't be delegated at this time. If our Products table is large, ForAll will look at the
first set of records only and we may miss some products that need to be ordered. But for tables that we know will
remain small, this approach is fine.
Note that we are not capturing the result of the ForAll. The Collect function calls made from within it will return
the NewOrder data source for all the records, which could add up to a lot of data if we were capturing it.
GroupBy and Ungroup functions in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Groups and ungroups records of a table.

Description
The GroupBy function returns a table with records grouped together based on the values in one or more columns.
Records in the same group are placed into a single record, with a column added that holds a nested table of the
remaining columns.
The Ungroup function reverses the GroupBy process. This function returns a table, breaking into separate records
any records that were grouped together.
You can group records by using GroupBy, modify the table that it returns, and then ungroup records in the
modified table by using Ungroup. For example, you can remove a group of records by following this approach:
Use the GroupBy function.
Use the Filter function to remove the entire group of records.
Use the Ungroup function.
You can also aggregate results based on a grouping:
Use the GroupBy function.
Use the AddColumns function with Sum, Average, and other aggregate functions to add a new column which
is an aggregate of the group tables.
Use the DropColumns function to drop the group table.
Ungroup tries to preserve the original order of the records that were fed to GroupBy. This isn't always possible
(for example, if the original table contains blank records).
A table is a value in Power Apps, just like a string or a number. You can specify a table as an argument for a
function, and a function can return a table. GroupBy and Ungroup don't modify a table; instead they take a table
as an argument and return a different table. See working with tables for more details.

Syntax
GroupBy( Table, ColumnName1 [, ColumnName2, ... ], GroupColumnName )
Table - Required. Table to be grouped.
ColumnName(s) - Required. The column names in Table by which to group records. These columns become
columns in the resulting table.
GroupColumnName - Required. The column name for the storage of record data not in the
ColumnName(s).

NOTE
For SharePoint and Excel data sources that contain column names with spaces, specify each space as "_x0020_". For
example, specify "Column Name" as "Column_x0020_Name".
Ungroup( Table, GroupColumnName )
Table - Required. Table to be ungrouped.
GroupColumnName - Required. The column that contains the record data setup with the GroupBy function.

NOTE
For SharePoint and Excel data sources that contain column names with spaces, specify each space as "_x0020_". For
example, specify "Column Name" as "Column_x0020_Name".

Examples
Create a collection
1. Add a button, and set its Text property so that the button shows Original.
2. Set the OnSelect property of the Original button to this formula:

ClearCollect( CityPopulations,
{ City: "London", Country: "United Kingdom", Population: 8615000},
{ City: "Berlin", Country: "Germany", Population: 3562000},
{ City: "Madrid", Country: "Spain", Population: 3165000},
{ City: "Rome", Country: "Italy", Population: 2874000},
{ City: "Paris", Country: "France", Population: 2273000},
{ City: "Hamburg", Country: "Germany", Population: 1760000},
{ City: "Barcelona", Country: "Spain", Population: 1602000},
{ City: "Munich", Country: "Germany", Population: 1494000},
{ City: "Milan", Country: "Italy", Population: 1344000}
)

3. While holding down the Alt key, select the Original button.
You just created a collection, named CityPopulations, that contains this data:

4. To display this collection, select Collections on the File menu and then select the CityPopulations
collection. The first five records in the collection appear:
Group records
1. Add another button, and set its Text property to "Group".
2. Set the OnSelect property of this button to this formula:
ClearCollect( CitiesByCountry, GroupBy( CityPopulations, "Country", "Cities" ) )
3. While holding down the Alt key, select the Group button.
You just created a collection, named CitiesByCountry, in which the records of the previous collection are
grouped by the Country column.

4. To display the first five records in this collection, select Collections on the File menu.
5. To display the populations of cities in a country, select the table icon in the Cities column for that country
(for example, Germany):

Filter and ungroup records


1. Add another button, and set its Text property so that the button shows "Filter".
2. Set the OnSelect property of this button to this formula:
ClearCollect( CitiesByCountryFiltered, Filter( CitiesByCountry, "e" in Country ) )
3. While holding down the Alt key, select the button that you added.
You just created a third collection, named CitiesByCountryFiltered, that includes only those countries that
have an "e" in their names (that is, not Spain or Italy).
4. Add one more button, and set its Text property so that the button shows "Ungroup".
5. Set the OnSelect property of this button to this formula:
ClearCollect( CityPopulationsUngrouped, Ungroup( CitiesByCountryFiltered, "Cities" ) )
Which results in:

Aggregate results
Something else we can do with a grouped table is to aggregate the results. In this example, we will sum the
population of the major cities in each country.
1. Add another button, and set its Text property so that the button shows "Sum".
2. Set the OnSelect property of the "Sum" button to this formula:
ClearCollect( CityPopulationsSum, AddColumns( CitiesByCountry, "Sum of City Populations",
Sum ( Cities, Population ) ) )
Which results in:
AddColumns starts with the base CitiesByCountry collection and adds a new column Sum of City
Populations. This column's values are calculated row -by-row, based on the formula Sum ( Cities,
Population ). AddColumns provides the value of the Cities column (a table) for each row, and Sum adds
up the Population for each row of this sub table.
Now that we have the sum that we want, we can use DropColumns to remove the sub tables.
3. Add another button, and set its Text property so that the button shows "SumOnly".
4. Set the OnSelect property of the "SumOnly" button to this formula:
ClearCollect( CityPopulationsSumOnly, DropColumns( CityPopulationsSum, "Cities" ) )
Which results in:

Note that we didn't need to ungroup this table.


GUID function in Power Apps
12/3/2019 • 3 minutes to read • Edit Online

Converts a GUID (Globally Unique Identifier) string to a GUID value or creates a new GUID value.

Description
Use the GUID function to convert a string that contains the hexadecimal representation of a GUID into a GUID
value that can be passed to a database. GUID values are used as keys by database systems such as Common Data
Service and SQL Server.
The string passed can contain uppercase or lowercase letters, but it must be 32 hexadecimal digits in either of
these formats:
"123e4567-e89b-12d3-a456-426655440000" (hyphens in standard locations)
"123e4567e89b12d3a456426655440000" (no hyphens)
If you don't specify an argument, this function creates a new GUID.
To convert a GUID value to a string, simply use it in a string context. The GUID value will be converted to a
hexadecimal representation string with hyphens and lowercase letters.
When generating a new GUID, this function uses pseudo-random numbers to create a version 4 IETF RFC 4122
GUID. When converting a string to a GUID, this function supports any GUID version by accepting any string of 32
hexadecimal digits.

Volatile functions
GUID is a volatile function when used without an argument. Each time the function is evaluated, it returns a
different value.
When used in a data-flow formula, a volatile function will return a different value only if the formula in which it
appears is reevaluated. If nothing else changes in the formula, it will have the same value throughout the execution
of your app.
For example, a label control for which the Text property is set to GUID () won't change while your app is active.
Only closing and reopening the app will result in a different value.
The function will be reevaluated if it's part of a formula in which something else has changed. If we set the Text
property of a Label control to this formula, for example, a GUID is generated each time the user changes the value
of the Text input control:
TextInput1.Text & " " & GUID ()
When used in a behavior formula, GUID will be evaluated each time the formula is evaluated. For more
information, see the examples later in this topic.

Syntax
GUID ( [ GUIDString ] )
GUIDString – Optional. A text string that contains the hexadecimal representation of a GUID. If no string is
supplied, a new GUID is created.
Examples
Basic usage
To return a GUID value based on the hexadecimal string representation:
GUID ( "0f8fad5b-d9cb-469f-a165-70867728950e" )
You can also provide the GUID string without hyphens. This formula returns the same GUID value:
GUID ( "0f8fad5bd9cb469fa16570867728950e" )
Used in context, to set the Status field of a new database record to a well-established value:
Patch( Products, Default( Products ), { Status: GUID ( "F9168C5E -CEB2-4faa-B6BF-329BF39FA1E4" ) }
)

You probably don't want to show GUIDs to your users, but GUIDs can help you debug your app. To show the value
of the Status field in the record that you created in the previous example, set the Text property of a Label control
to this formula:
First( Products ).Status
The Label control will show f9168c5e-ceb2-4faa-b6bf-329bf39fa1e4.
Create a table of GUIDs
1. Set the OnSelect property of a Button control to this formula:
ClearCollect( NewGUIDs, ForAll( [ 1, 2, 3, 4, 5 ], GUID () ) )
This formula creates a single-column table that's used to iterate five times, resulting in five GUIDs.
2. Add a Data table control, set its Items property to NewGUIDs, and show the Value field.
3. While holding down the Alt key, select the button by clicking or tapping it.
The data table shows a list of GUIDs:

4. Select the button again to show a different list of GUIDs:


To generate a single GUID instead of a table, use this formula:
Set( NewGUID, GUID () )
HashTags function in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Extracts the hashtags (#strings) from a string of text.

Description
The HashTags function scans a string for hashtags. Hashtags start with a pound character (#), which is followed
by any combination of:
uppercase and lowercase letters
numerals
underscores
currency symbols (such as $)
HashTags returns a one-column table that contains the hashtags in the string. If the string contains no hashtags,
the function returns a one-column table that's empty.

Syntax
HashTags( String )
String - Required. String to scan for hashtags.

Examples
Step by step
1. Add a Text input control, name it Tweet, and type this sentence into it:
This #app is #AMAZING and can #coUnt123 or #123abc but not #1-23 or #$*(#@")
2. Add a vertical custom gallery, and set its Items property to this function:
HashTags(Tweet.Text)
3. Add a Label control to the gallery template.
The gallery shows these hashtags:
#app
#AMAZING
#coUnt123
#123abc
#1
Day, Month, Year, Hour, Minute, Second, and
Weekday functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Returns individual components of a Date/Time value.

Description
The Day function returns the day component of a Date/Time value, ranging from 1 to 31.
The Month function returns the month component of a Date/Time value, ranging from 1 to 12.
The Year function returns the year component of a Date/Time value, starting with 1900.
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 Second function returns the second component of a Date/Time value, ranging from 0 to 59.
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:

EXCEL CODE STARTOFWEEK ENUMERATION DESCRIPTION

1, 17 StartOfWeek.Sunday Numbers 1 (Sunday) through 7


(Saturday). Default.

2, 11 StartOfWeek.Monday Numbers 1 (Monday) through 7


(Sunday).

3 StartOfWeek.MondayZero Numbers 0 (Monday) through 6


(Sunday).

12 StartOfWeek.Tuesday Numbers 1 (Tuesday) through 7


(Monday).

13 StartOfWeek.Wednesday Numbers 1 (Wednesday) through 7


(Tuesday).

14 StartOfWeek.Thursday Numbers 1 (Thursday) through 7


(Wednesday).

15 StartOfWeek.Friday Numbers 1 (Friday) through 7


(Thursday).

16 StartOfWeek.Saturday Numbers 1 (Saturday) through 7


(Friday).

All functions return a number.


See working with dates and times for more information.
Syntax
Day( DateTime )
Month( DateTime )
Year( DateTime )
Hour( DateTime )
Minute( DateTime )
Second( DateTime )
DateTime - Required. Date/Time value to operate on.
Weekday( DateTime [, WeekdayFirst ] )
DateTime - Required. Date/Time value to operate on.
WeekdayFirst - Optional. Excel code specifying which day starts the week. If not supplied, 1 (Sunday first) is
used.

Examples
For the following example, the current time is 3:59:37 PM on Thursday, April 9, 2015.

FORMULA DESCRIPTION RESULT

Year( Now() ) Returns the year component of the 2015


current time and date.

Month( Now() ) Returns the month component of the 4


current time and date.

Day( Now() ) Returns the day component of the 9


current time and date.

Hour( Now() ) Returns the hour component of the 15


current time and date.

Minute( Now() ) Returns the minute component of the 59


current time and date.

Second( Now() ) Returns the minute component of the 37


current time and date.

Weekday( Now() ) Returns the weekday component of the 5


current time and date, using the default
start of the week as Sunday.

Weekday( Now(), 14 ) Returns the weekday component of the 1


current time and date, using an Excel
code to specify the start of the week as
Thursday.

Weekday( Now(), StartOfWeek.Wed Returns the weekday component of the 2


nesday ) current time and date, using a
StartOfWeek enumeration to specify
the start of the week as Wednesday.
Operators and Identifiers in Power Apps
3/4/2020 • 8 minutes to read • Edit Online

Some of these operators are dependent on the language of the author. See Global apps for more information.

SYMBOL TYPE SYNTAX DESCRIPTION

. Property Selector Slider1.Value Extracts a property from a


Color.Red table, control, signal, or
Acceleration.X enumeration. For backwards
compatibility, ! may also be
used.

. Decimal separator 1.23 Separator between whole


[language dependent] and fractional parts of a
number. The character
depends on the language.

() Parentheses Filter(T, A < 10) Enforces precedence order,


and groups sub-expressions
(1 + 2) * 3 in a larger expression

+ Arithmetic operators 1+2 Addition

- 2-1 Subtraction and sign

* 2*3 Multiplication

/ 2/3 Division (also see the Mod


function)

^ 2^3 Exponentiation, equivalent to


the Power function

% 20% Percentage (equivalent to "*


1/100")

= Comparison operators Price = 100 Equal to

> Price > 100 Greater than

>= Price >= 100 Greater than or equal to

< Price < 100 Less than

<= Price <= 100 Less than or equal to

<> Price <> 100 Not equal to

& String concatenation "hello" & " " & "world" Makes multiple strings
operator appear continuous
SYMBOL TYPE SYNTAX DESCRIPTION

&& or And Logical operators Price < 100 && Logical conjunction,
Slider1.Value = 20 equivalent to the And
or Price < 100 And function
Slider1.Value = 20

|| or Or Price < 100 || Logical disjunction,


Slider1.Value = 20 or Price equivalent to the Or
< 100 Or Slider1.Value = function
20

! or Not !(Price < 100) or Not Logical negation, equivalent


(Price < 100) to the Not function

exactin Membership operators Gallery1.Selected exactin Belonging to a collection or a


SavedItems table

exactin "Windows" exactin “To Substring test (case-


display windows in the sensitive)
Windows operating
system...”

in Gallery1.Selected in Belonging to a collection or a


SavedItems table

in "The" in "The keyboard Substring test (case-


and the monitor..." insensitive)

@ Disambiguation operator MyTable[@fieldname] Field disambiguation

@ [@MyVariable] Global disambiguation

, List separator If( X < 10, "Low", "Good" ) Separates:


[language dependent] { X: 12, Y: 32 } arguments in
[ 1, 2, 3 ] function calls
fields in a record
records in a table
This character depends on
the language.

; Formula chaining Collect(T, A); Navigate(S1, Separate invocations of


[language dependent] "") functions in behavior
properties. The chaining
operator depends on the
language.

Parent Parent operator Parent.Fill Access to properties of a


control container

ThisItem ThisItem operator ThisItem.FirstName Access to fields of a Gallery


or form control

in and exactin operators


You can use the in and exactin operators to find a string in a data source, such as a collection or an imported table.
The in operator identifies matches regardless of case, and the exactin operator identifies matches only if they're
capitalized the same way. Here's an example:
1. Create or import a collection named Inventory, and show it in a gallery, as the first procedure in Show
images and text in a gallery describes.
2. Set the Items property of the gallery to this formula:
Filter(Inventory, "E" in ProductName)
The gallery shows all products except Callisto because the name of that product is the only one that doesn't
contain the letter you specified.
3. Change the Items property of the gallery to this formula:
Filter(Inventory, "E" exactin ProductName)
The gallery shows only Europa because only its name contains the letter that you specified in the case that
you specified.

ThisItem operator
You can show data in Gallery, Edit form, or Display form controls by binding it to a table or a collection. These
controls are a container for other cards and controls. Each card or control within the container can access the bound
data through the ThisItem operator.
Use the ThisItem operator to specify the column of data to be displayed in each card or control within the outer
control. For example, that operator in the product gallery for Show images and text in a gallery specified that the
image control showed the product design, the upper label showed the product name, and the lower label showed
the number of units in stock.
For nested galleries, ThisItem refers to the innermost gallery's items. Assuming the row fields in the inner and
outer galleries don't conflict, you can also use the unqualified field (column) names directly. This approach enables
rules in an inner gallery to refer to an outer gallery's items.

Parent operator
Some controls host other controls. For example, Screen, Gallery, Card, Edit form, and Display form controls are
all containers for controls. We call the hosting control the "parent" of the controls within.
Any control in Power Apps can be referenced by name from anywhere within the app. Screen1 may be the name
of a screen in your app. To retrieve the background color of this screen, you can use Screen1.Fill.
Controls on this screen have another option. They can use a relative reference: Parent.Fill. The Parent operator
refers to the control that hosts this control, making available all of its properties. Using Parent is helpful because it
doesn't depend on the name of the control. You can copy and paste a container control without needing to adjust
any references within the container. This operator also makes the relationship between child and parent controls
clearer when reading formulas.

Identifier names
The names of variables, data sources, columns, and other objects can contain any Unicode.
Use single quotes around a name that contains a space or other special character. Use two single quotes together to
represent one single quote in the name. Names that do not contain special characters do not require single quotes.
Here are some example column names you might encounter in a table, and how they are represented in a formula:
COLUMN NAME IN A DATABASE COLUMN REFERENCE IN A FORMULA

SimpleName SimpleName

NameWith123Numbers NameWith123Numbers

Name with spaces 'Name with spaces'

Name with "double" quotes 'Name with "double" quotes'

Name with 'single' quotes 'Name with ''single'' quotes'

Name with an @ at sign 'Name with an @ at sign'

Double quotes are used to designate text strings.

Display names and logical names


Some data sources such as SharePoint and Common Data Service have two different names to refer to the same
table or column of data:
Logical name - A name that is guaranteed to be unique, does not change after being created, usually does
not allow spaces or other special characters, and is not localized into different languages. As a result the
name can be somewhat cryptic. These names are used by professional developers. For example
cra3a_customfield. This name may also be referred to as schema name or just name.
Display name - A name that is user friendly and intended to be seen by end users. This name may not be
unique, may change over time, may contain spaces and any Unicode character, and may be localized into
different languages. Corresponding to the example above, the display name may be Custom Field with a
space inbetween the words.
Since display names are easier to understand, Canvas apps will suggest them as choices and not suggest logical
names. Although logical names are not suggested, they can still be used if typed in directly.
For example, imagine you have added a Custom Field to an entity in Common Data Service. A logical name will
be assigned for you by the system which you can modify only when creating the field. The result would look similar
to:

When authoring a reference to a field of Accounts, the suggestion will be made to use 'Custom Field' since this is
the display name. Note that the single quotes must be used because this name has a space in it:
After selecting the suggestion, 'Custom Field' is shown in the formula bar and the data is retrieved:

Although it is not suggested, we could also use the logical name for this field. This will result in the same data being
retrieved. Note that no single quotes are required since this name does not contain spaces or special characters:

Behind the scenes, a mapping is maintained between the display names seen in formulas and the underlying logical
names. Since logical names must be used to interact with the data source, this mapping is used to convert from the
current display name to the logical name automatically and that is what is seen in the network traffic. This mapping
is also used to convert back to logical names in order to switch into new display names, for example if a display
name changes or a maker in a different language edits the app.
NOTE
Logical names are not translated when moving an app between environments. For Common Data Service system entity and
field names this should not be a problem as logical names are consistent across environments. But any custom fields, such as
cra3a_customfield in this example above, may have a different environment prefix (cra3a in this case). Display names are
preferred as they can be matched against display names in the new environment.

Name disambiguation
Since display names are not unique, the same display name may appear more than once in the same entity. When
this happens, the logical name will be added to the end of the display name in parenthesis for one of more of the
conflicting names. Building on the example above, if there was a second field with the same display name of
Custom Field with a logical name of cra3a_customfieldalt then the suggestions would show:

Name disambiguation strings are added in other situations where name conflicts occur, such as the names of
entities, option sets, and other Common Data Service items.

Disambiguation operator
Some functions create record scopes for accessing the fields of table while processing each record, such as Filter,
AddColumns, and Sum. Field names added with the record scope override the same names from elsewhere in the
app. When this happens, you can still access values from outside the record scope with the @ disambiguation
operator:
To access values from nested record scopes, use the @ operator with the name of the table being operated upon
using this pattern:
Table[@FieldName]
To access global values, such as data sources, collections, and context variables, use the pattern [@ObjectName]
(without a table designation).

For more information and examples, see record scopes.


If and Switch functions in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Determines whether any condition in a set is true (If) or the result of a formula matches any value in a set (Switch)
and then returns a result or executes an action.

Description
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 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.
If and Switch are very similar, but you should use the best function for your situation:
Use If to evaluate a single condition. The most common syntax for this function is If( Condition, ThenResult,
DefaultResult ), which provides the common “if … then … else …” pattern seen in other programming tools.
Use If to evaluate multiple unrelated conditions. In Power Apps (unlike Microsoft Excel), you can specify
multiple conditions without having to nest If formulas.
Use Switch to evaluate a single condition against multiple possible matches. You can also use If in this case, but
you'd need to repeat the formula for each possible match.
You can use both of these functions in behavior formulas to branch between two or more actions. Only one branch
will trigger an action. Conditions and matches are evaluated in order, and they stop if a condition is true or a match
is found.
Blank is returned if no conditions are true, no matches are found, and you don't specify a default result.

Syntax
If( Condition, ThenResult [, DefaultResult ] )
If( Condition1, ThenResult1 [, Condition2, ThenResult2, ... [ , DefaultResult ] ] )
Condition(s) - Required. Formula(s) to test for true. Such formulas commonly contain comparison operators
(such as <, >, and =) and test functions such as IsBlank and IsEmpty.
ThenResult(s) - Required. The corresponding value to return for a condition that evaluates to true.
DefaultResult - Optional. The value to return if no condition evaluates to true. If you don't specify this argument,
blank is returned.
Switch( Formula, Match1, Result1 [, Match2, Result2, ... [, DefaultResult ] ] )
Formula - Required. Formula to evaluate for matches. This formula is evaluated only once.
Match(s) - Required. Values to compare with the result from Formula. If an exact match is found, the
corresponding Result is returned.
Result(s) - Required. The corresponding value to return when an exact match is found.
DefaultResult - Optional. If an exact match isn't found, this value is returned. If you don't specify this argument,
blank is returned.
Examples
Values in formulas
In the following examples, a Slider control (named Slider1) has a value of 25.

FORMULA DESCRIPTION RESULT

If( Slider1.Value = 25, "Result1" ) The condition is true, and the "Result1"
corresponding result is returned.

If( Slider1.Value = 25, "Result1", The condition is true, and the "Result1"
"Result2" ) corresponding result is returned.

If( Slider1.Value > 1000, "Result1" ) The condition is false, and no blank
DefaultResult was provided.

If( Slider1.Value > 1000, "Result1", The condition is false, a DefaultResult "Result2"
"Result2" ) was provided, and it's returned.

If( Slider1.Value = 25, "Result1", The first condition is true, and the "Result1"
Slider1.Value > 0, "Result2" ) corresponding result is returned. The
second condition is also true, but it isn't
evaluated because it appears later in the
argument list than a condition that
evaluates to true.

If( IsBlank( Slider1.Value ), "Result1", The first condition is false because the "Result2"
IsNumeric( Slider1.Value ), "Result2" slider isn't blank. The second condition
) is true because the slider's value is a
number, and the corresponding result is
returned.

If( Slider1.Value > 1000, "Result1", Both the first and second conditions are "Result3"
Slider1.Value > 50, "Result2", false, a DefaultResult was provided,
"Result3") and it's returned.

Switch( Slider1.Value, 25, "Result1" ) The slider's value matches the first value "Result1"
to be checked, and the corresponding
result is returned.

Switch( Slider1.Value, 20, "Result1", The slider's value matches the second "Result2"
25, "Result2", 30, "Result3" ) value to be checked, and the
corresponding result is returned.

Switch( Slider1.Value, 20, "Result1", The slider's value doesn't match any "DefaultResult"
10, "Result2", 0, "Result3", value to be checked. A DefaultResult
"DefaultResult" ) was provided, so it's returned.

Branching in behavior formulas


In these examples, a Text input control named FirstName has the value "John" typed into it.

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

If( ! IsBlank( FirstName.Text ), The condition is true, so the Navigate true


Navigate( Screen1, function runs. You can use the IsBlank
ScreenTransition.None ) ) function to test whether a required form The display is changed to Screen1.
field has been filled in. If FirstName
were blank, this formula would have no
effect.

If( IsBlank( FirstName.Text ), Without the ! operator, the condition is true


Navigate( Screen1, false, so the Navigate function doesn't
ScreenTransition.None ), Back() ) run. The Back function was provided as The display goes back to the screen that
a DefaultResult, so it runs. was previously shown.

Switch( FirstName.Text, "Carlos", The value of FirstName.Text is true


Navigate( Screen1, compared against "Carlos", "Kirstin", and
ScreenTransition.None ), "Kirstin", "John" in that order. A match is found The display is changed to Screen3.
Navigate( Screen2, with "John", so the app navigates to
ScreenTransition.None ), "John", Screen3.
Navigate( Screen3,
ScreenTransition.None ) )

Step by step
1. Add a Text input control, and name it Text1 if it doesn't have that name by default.
2. In Text1, type 30.
3. Add a Label control, and set its Text property to this formula:
If( Value(Text1.Text) < 20, "Order MANY more!", Value(Text1.Text) < 40, "Order more!", Text1.Text
)
The Label control shows Order more! because the value of Text1 is more than 20 but less than 40.
4. In Text1, type 15.
The Label control shows Order MANY more! because the value of Text1 is less than 20.
5. In Text1, type 50.
The Label control shows the value that you typed because it's more than 40.
IfError function in Power Apps
12/3/2019 • 3 minutes to read • Edit Online

Detects errors and provides an alternative value or takes action.

Description
NOTE
This function is part of an experimental feature and is subject to change. The behavior that this topic describes is available
only when the Formula-level error management feature is turned on. This app-level setting is off by default. To turn this
feature on, open the File tab, select App settings in the left hand menu, and then select Experimental features. Your
feedback is very valuable to us - please let us know what you think in the Power Apps community forums.

The IfError function tests one or more values until it finds an error result . If the function finds an error, the
function returns a corresponding value. Otherwise, the function returns a default value. In either case, the function
might return a string to show, a formula to evaluate, or another form of result. The IfError function resembles the
If function: IfError tests for errors, while If tests for true.
Use IfError to replace error values with valid values. For example, use this function if user input might result in a
division by zero. Build a formula to replace the result with a 0 or another value that's appropriate for your app so
that downstream calculations can proceed. Your formula can be as simple as this example:

IfError( 1/x, 0 )

If the value of x isn't zero, the formula returns 1/x. Otherwise, 1/x produces an error, and the formula returns 0
instead.
Use IfError in behavior formulas to perform an action and check for an error before performing additional actions,
as in this pattern:

IfError(
Patch( DS1, ... ), Notify( "problem in the first action" ),
Patch( DS2, ... ), Notify( "problem in the second action" )
)

If the first patch encounters a problem, the first Notify runs, no further processing occurs, and the second patch
doesn't run. If the first patch succeeds, the second patch runs and, if it encounters a problem, the second Notify
runs.
If the formula doesn't find any errors and you've specified the optional DefaultResult argument, the formula
returns the value that you specified for that argument. If the formula doesn't find any errors and you haven't
specified that argument, the formula returns the last Value argument evaluated.

Syntax
IfError( Value1, Fallback1 [, Value2, Fallback2, ... [, DefaultResult ] ] )
Value(s) - Required. Formula(s) to test for an error value.
Fallback(s) - Required. The formulas to evaluate and values to return if matching Value arguments returned an
error.
DefaultResult - Optional. The formulas to evaluate if the formula doesn't find any errors.

Examples
FORMULA DESCRIPTION RESULT

IfError( 1, 2 ) The first argument isn't an error. The 1


function has no other errors to check
and no default return value. The
function returns the last value
argument evaluated.

IfError( 1/0, 2 ) The first argument returns an error 2


value (due to division by zero). The
function evaluates the second
argument and returns it as the result.

IfError( 1/0, Notify( "There was an The first argument returns an error 1
internal problem", value (due to division by zero). The
NotificationType.Error ) ) function evaluates the second
argument and displays a message to
the user. The return value of IfError is
the return value of Notify, coerced to
the same type as the first argument to
IfError (a number).

IfError( 1, 2, 3, 4, 5 ) The first argument isn't an error, so the 5


function doesn't evaluate that
argument's corresponding fallback. The
third argument isn't an error either, so
the function doesn't evaluate that
argument's corresponding fallback. The
fifth argument has no corresponding
fallback and is the default result. The
function returns that result because the
formula contains no errors.

Step by step
1. Add a Text input control, and name it TextInput1 if it doesn't have that name by default.
2. Add a Label control, and name it Label1 if it doesn't have that name by default.
3. Set the formula for Label1's Text property to:
IfError( Value( TextInput1.Text ), -1 )
4. In TextInput1, type 1234.
Label1 will show the value 1234 as this is a valid input to the Value function.
5. In TextInput1, type ToInfinity.
Label1 will show the value -1 as this is not a valid input to the Value function. Without wrapping the Value
function with IfError, the label would show no value as the error value is treated as a blank.
Blank, Coalesce, IsBlank, and IsEmpty functions in
Power Apps
12/3/2019 • 7 minutes to read • Edit Online

Tests whether a value is blank or a table contains no records, and provides a way to create blank values.

Overview
Blank is a placeholder for "no value" or "unknown value." For example, a Combo box control's Selected property
is blank if the user hasn't made a selection. Many data sources can store and return NULL values, which are
represented in Power Apps as blank.
Any property or calculated value in Power Apps can be blank. For example, a Boolean value normally has one of
two values: true or false. But in addition to these two, it can also be blank indicating that the state is not known.
This is similar to Microsoft Excel, where a worksheet cell starts out as blank with no contents but can hold the
values TRUE or FALSE (among others). At any time, the contents of the cell can again be cleared, returning it to a
blank state.
Empty string refers to a string that contains no characters. The Len function returns zero for such a string and it can
be written in a formulas as two double quotes with nothing in between "" . Some controls and data sources use an
empty string to indicate a "no value" condition. To simplify app creation, the IsBlank and Coalesce functions test
for both blank values or empty strings.
In the context of the IsEmpty function, empty is specific to tables that contain no records. The table structure may
be intact, complete with column names, but no data is in the table. A table may start as empty, take on records and
no longer be empty, and then have the records removed and again be empty.

NOTE
We are in a period of transition. Until now, blank has also been used to report errors, making it impossible to differentiate a
valid "no value" from an error. For this reason, at this time, storing blank values is supported only for local collections. You can
store blank values in other data sources if you turn on the "Formula-level error management" experimental feature under the
File menu, App settings, Advanced settings, Experimental features. We are actively working to finish this feature and complete
the proper separation of blank values from errors.

Description
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.
The IsBlank function tests for a blank value or an empty string. The test includes empty strings to ease app
creation since some data sources and controls use an empty string when there is no value present. To test
specifically for a blank value use if( Value = Blank(), ... instead of IsBlank.
The Coalesce function evaluates its arguments in order and returns the first value that isn't blank or an empty
string. Use this function to replace a blank value or empty string with a different value but leave non-blank and
non-empty string values unchanged. If all of the arguments are blank or empty strings then the function returns
blank, making Coalesce a good way to convert empty strings to blank values. All arguments to Coalesce must be
of the same type; for example, you can't mix numbers with text strings.
Coalesce( value1, value2 ) is the more concise equivalent of
If( Not IsBlank( value1 ), value1, Not IsBlank( value2 ), value2 ) and doesn't require value1 and value2 to be
evaluated twice. The If function returns blank if there is no "else" formula as is the case here.
The IsEmpty function tests whether a table contains any records. It's equivalent to using the CountRows function
and checking for zero. You can check for data-source errors by combining IsEmpty with the Errors function.
The return value for both IsBlank and IsEmpty is a Boolean true or false.

Syntax
Blank()
Coalesce( Value1 [, Value2, ... ] )
Value(s) – Required. Values to test. Each value is evaluated in order until a value that is not blank and not an
empty string is found. Values after this point are not evaluated.
IsBlank( Value )
Value – Required. Value to test for a blank value or empty string.
IsEmpty( Table )
Table - Required. Table to test for records.

Examples
Blank

NOTE
At this time, the following example only works for local collections. You can store blank values in other data sources if you
turn on the "Formula-level error management" experimental feature under the File menu, App settings, Advanced settings,
Experimental features. We are actively working to finish this feature and complete the separation of blank values from errors.

1. Create an app from scratch, and add a Button control.


2. Set the button's OnSelect property to this formula:

ClearCollect( Cities, { Name: "Seattle", Weather: "Rainy" } )

3. Preview your app, click or tap the button that you added, and then close Preview.
4. On the File menu, click or tap Collections.
The Cities collection appears, showing one record with "Seattle" and "Rainy":
5. Click or tap the back arrow to return to the default workspace.
6. Add a Label control, and set its Text property to this formula:

IsBlank( First( Cities ).Weather )

The label shows false because the Weather field contains a value ("Rainy").
7. Add a second button, and set its OnSelect property to this formula:

Patch( Cities, First( Cities ), { Weather: Blank() } )

8. Preview your app, click or tap the button that you added, and then close Preview.
The Weather field of the first record in Cities is replaced with a blank, removing the "Rainy" that was there
previously.

The label shows true because the Weather field no longer contains a value.
Coalesce
FORMULA DESCRIPTION RESULT

Coalesce( Blank(), 1 ) Tests the return value from the Blank 1


function, which always returns a blank
value. Because the first argument is
blank, evaluation continues with the
next argument until a non-blank value
and non-empty string is found.
FORMULA DESCRIPTION RESULT

Coalesce( "", 2 ) Tests the first argument which is an 2


empty string. Because the first
argument is an empty string, evaluation
continues with the next argument until
a non-blank value and non-empty
string is found.

Coalesce( Blank(), "", Blank(), "", 3, 4 Coalesce starts at the beginning of the 3
) argument list and evaluates each
argument in turn until a non-blank
value and non-empty string is found. In
this case, the first four arguments all
return blank or an empty string, so
evaluation continues to the fifth
argument. The fifth argument is
non-blank and non-empty string, so
evaluation stops here. The value of the
fifth argument is returned, and the sixth
argument isn't evaluated.

Coalesce( "" ) Tests the first argument which is an blank


empty string. Because the first
argument is an empty string, and there
are no more arguments, the function
returns blank.

IsBlank
1. Create an app from scratch, add a text-input control, and name it FirstName.
2. Add a label, and set its Text property to this formula:

If( IsBlank( FirstName.Text ), "First Name is a required field." )

By default, the Text property of a text-input control is set to "Text input". Because the property contains a
value, it isn't blank, and the label doesn't display any message.
3. Remove all the characters from the text-input control, including any spaces.
Because the Text property no longer contains any characters, it's an empty string, and IsBlank(
FirstName.Text ) will be true. The required field message is displayed.
For information about how to perform validation by using other tools, see the Validate function and working with
data sources.
Other examples:

FORMULA DESCRIPTION RESULT

IsBlank( Blank() ) Tests the return value from the Blank true
function, which always returns a blank
value.

IsBlank( "" ) A string that contains no characters. true

IsBlank( "Hello" ) A string that contains one or more false


characters.
FORMULA DESCRIPTION RESULT

IsBlank( AnyCollection ) Because the collection exists, it isn't false


blank, even if it doesn't contain any
records. To check for an empty
collection, use IsEmpty instead.

IsBlank( Mid( "Hello", 17, 2 ) ) The starting character for Mid is true
beyond the end of the string. The result
is an empty string.

IsBlank( If( false, false ) ) An If function with no ElseResult. true


Because the condition is always false,
this If always returns blank.

IsEmpty
1. Create an app from scratch, and add a Button control.
2. Set the button's OnSelect property to this formula:
Collect( IceCream, { Flavor: "Strawberry", Quantity: 300 }, { Flavor: "Chocolate", Quantity: 100 } )
3. Preview your app, click or tap the button that you added, and then close Preview.
A collection named IceCream is created and contains this data:

This collection has two records and isn't empty. IsEmpty( IceCream ) returns false, and CountRows(
IceCream ) returns 2.
4. Add a second button, and set its OnSelect property to this formula:
Clear( IceCream )
5. Preview your app, click or tap the second button, and then close Preview.
The collection is now empty:

The Clear function removes all the records from a collection, resulting in an empty collection. IsEmpty(
IceCream ) returns true, and CountRows( IceCream ) returns 0.
You can also use IsEmpty to test whether a calculated table is empty, as these examples show:

FORMULA DESCRIPTION RESULT

IsEmpty( [ 1, 2, 3 ] ) The single-column table contains three false


records and, therefore, isn't empty.

IsEmpty( [ ] ) The single-column table contains no true


records and is empty.
FORMULA DESCRIPTION RESULT

IsEmpty( Filter( [ 1, 2, 3 ], Value > 5 ) The single-column table contains no true


) values that are greater than 5. The
result from the filter doesn't contain any
records and is empty.
Blank, Coalesce, IsBlank, and IsEmpty functions
in Power Apps
12/3/2019 • 7 minutes to read • Edit Online

Tests whether a value is blank or a table contains no records, and provides a way to create blank values.

Overview
Blank is a placeholder for "no value" or "unknown value." For example, a Combo box control's Selected
property is blank if the user hasn't made a selection. Many data sources can store and return NULL
values, which are represented in Power Apps as blank.
Any property or calculated value in Power Apps can be blank. For example, a Boolean value normally has
one of two values: true or false. But in addition to these two, it can also be blank indicating that the state
is not known. This is similar to Microsoft Excel, where a worksheet cell starts out as blank with no
contents but can hold the values TRUE or FALSE (among others). At any time, the contents of the cell
can again be cleared, returning it to a blank state.
Empty string refers to a string that contains no characters. The Len function returns zero for such a string
and it can be written in a formulas as two double quotes with nothing in between "" . Some controls and
data sources use an empty string to indicate a "no value" condition. To simplify app creation, the IsBlank
and Coalesce functions test for both blank values or empty strings.
In the context of the IsEmpty function, empty is specific to tables that contain no records. The table
structure may be intact, complete with column names, but no data is in the table. A table may start as
empty, take on records and no longer be empty, and then have the records removed and again be empty.

NOTE
We are in a period of transition. Until now, blank has also been used to report errors, making it impossible to
differentiate a valid "no value" from an error. For this reason, at this time, storing blank values is supported only
for local collections. You can store blank values in other data sources if you turn on the "Formula-level error
management" experimental feature under the File menu, App settings, Advanced settings, Experimental features.
We are actively working to finish this feature and complete the proper separation of blank values from errors.

Description
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.
The IsBlank function tests for a blank value or an empty string. The test includes empty strings to ease
app creation since some data sources and controls use an empty string when there is no value present. To
test specifically for a blank value use if( Value = Blank(), ... instead of IsBlank.
The Coalesce function evaluates its arguments in order and returns the first value that isn't blank or an
empty string. Use this function to replace a blank value or empty string with a different value but leave
non-blank and non-empty string values unchanged. If all of the arguments are blank or empty strings
then the function returns blank, making Coalesce a good way to convert empty strings to blank values.
All arguments to Coalesce must be of the same type; for example, you can't mix numbers with text
strings.
Coalesce( value1, value2 ) is the more concise equivalent of
If( Not IsBlank( value1 ), value1, Not IsBlank( value2 ), value2 ) and doesn't require value1 and
value2 to be evaluated twice. The If function returns blank if there is no "else" formula as is the case
here.
The IsEmpty function tests whether a table contains any records. It's equivalent to using the
CountRows function and checking for zero. You can check for data-source errors by combining IsEmpty
with the Errors function.
The return value for both IsBlank and IsEmpty is a Boolean true or false.

Syntax
Blank()
Coalesce( Value1 [, Value2, ... ] )
Value(s) – Required. Values to test. Each value is evaluated in order until a value that is not blank and
not an empty string is found. Values after this point are not evaluated.
IsBlank( Value )
Value – Required. Value to test for a blank value or empty string.
IsEmpty( Table )
Table - Required. Table to test for records.

Examples
Blank

NOTE
At this time, the following example only works for local collections. You can store blank values in other data
sources if you turn on the "Formula-level error management" experimental feature under the File menu, App
settings, Advanced settings, Experimental features. We are actively working to finish this feature and complete the
separation of blank values from errors.

1. Create an app from scratch, and add a Button control.


2. Set the button's OnSelect property to this formula:

ClearCollect( Cities, { Name: "Seattle", Weather: "Rainy" } )

3. Preview your app, click or tap the button that you added, and then close Preview.
4. On the File menu, click or tap Collections.
The Cities collection appears, showing one record with "Seattle" and "Rainy":
5. Click or tap the back arrow to return to the default workspace.
6. Add a Label control, and set its Text property to this formula:

IsBlank( First( Cities ).Weather )

The label shows false because the Weather field contains a value ("Rainy").
7. Add a second button, and set its OnSelect property to this formula:

Patch( Cities, First( Cities ), { Weather: Blank() } )

8. Preview your app, click or tap the button that you added, and then close Preview.
The Weather field of the first record in Cities is replaced with a blank, removing the "Rainy" that
was there previously.

The label shows true because the Weather field no longer contains a value.
Coalesce
FORMULA DESCRIPTION RESULT

Coalesce( Blank(), 1 ) Tests the return value from the 1


Blank function, which always
returns a blank value. Because the
first argument is blank, evaluation
continues with the next argument
until a non-blank value and non-
empty string is found.
FORMULA DESCRIPTION RESULT

Coalesce( "", 2 ) Tests the first argument which is an 2


empty string. Because the first
argument is an empty string,
evaluation continues with the next
argument until a non-blank value
and non-empty string is found.

Coalesce( Blank(), "", Blank(), "", Coalesce starts at the beginning of 3


3, 4 ) the argument list and evaluates
each argument in turn until a
non-blank value and non-empty
string is found. In this case, the first
four arguments all return blank or
an empty string, so evaluation
continues to the fifth argument. The
fifth argument is non-blank and
non-empty string, so evaluation
stops here. The value of the fifth
argument is returned, and the sixth
argument isn't evaluated.

Coalesce( "" ) Tests the first argument which is an blank


empty string. Because the first
argument is an empty string, and
there are no more arguments, the
function returns blank.

IsBlank
1. Create an app from scratch, add a text-input control, and name it FirstName.
2. Add a label, and set its Text property to this formula:

If( IsBlank( FirstName.Text ), "First Name is a required field." )

By default, the Text property of a text-input control is set to "Text input". Because the property
contains a value, it isn't blank, and the label doesn't display any message.
3. Remove all the characters from the text-input control, including any spaces.
Because the Text property no longer contains any characters, it's an empty string, and IsBlank(
FirstName.Text ) will be true. The required field message is displayed.
For information about how to perform validation by using other tools, see the Validate function and
working with data sources.
Other examples:

FORMULA DESCRIPTION RESULT

IsBlank( Blank() ) Tests the return value from the true


Blank function, which always
returns a blank value.

IsBlank( "" ) A string that contains no characters. true


FORMULA DESCRIPTION RESULT

IsBlank( "Hello" ) A string that contains one or more false


characters.

IsBlank( AnyCollection ) Because the collection exists, it isn't false


blank, even if it doesn't contain any
records. To check for an empty
collection, use IsEmpty instead.

IsBlank( Mid( "Hello", 17, 2 ) ) The starting character for Mid is true
beyond the end of the string. The
result is an empty string.

IsBlank( If( false, false ) ) An If function with no ElseResult. true


Because the condition is always
false, this If always returns blank.

IsEmpty
1. Create an app from scratch, and add a Button control.
2. Set the button's OnSelect property to this formula:
Collect( IceCream, { Flavor: "Strawberry", Quantity: 300 }, { Flavor: "Chocolate", Quantity:
100 } )
3. Preview your app, click or tap the button that you added, and then close Preview.
A collection named IceCream is created and contains this data:

This collection has two records and isn't empty. IsEmpty( IceCream ) returns false, and
CountRows( IceCream ) returns 2.
4. Add a second button, and set its OnSelect property to this formula:
Clear( IceCream )
5. Preview your app, click or tap the second button, and then close Preview.
The collection is now empty:

The Clear function removes all the records from a collection, resulting in an empty collection.
IsEmpty( IceCream ) returns true, and CountRows( IceCream ) returns 0.
You can also use IsEmpty to test whether a calculated table is empty, as these examples show:

FORMULA DESCRIPTION RESULT

IsEmpty( [ 1, 2, 3 ] ) The single-column table contains false


three records and, therefore, isn't
empty.
FORMULA DESCRIPTION RESULT

IsEmpty( [ ] ) The single-column table contains no true


records and is empty.

IsEmpty( Filter( [ 1, 2, 3 ], Value > The single-column table contains no true


5)) values that are greater than 5. The
result from the filter doesn't contain
any records and is empty.
IsMatch, Match, and MatchAll functions in Power Apps
2/8/2020 • 12 minutes to read • Edit Online

Tests for a match or extracts portions of a text string based on a pattern.

Description
The IsMatch function tests whether a text string matches a pattern that can comprise ordinary characters, predefined patterns, or a
regular expression. The Match and MatchAll functions return what was matched, including sub-matches.
Use IsMatch to validate what a user has typed in a Text input control. For example, you can confirm whether the user has entered a
valid email address before the result is saved to your data source. If the entry doesn't match your criteria, add other controls that prompt
the user to correct the entry.
Use Match to extract the first text string that matches a pattern and MatchAll to extract all text strings that match. You can also extract
sub-matches to parse complex strings.
Match returns a record of information for the first match found, and MatchAll returns a table of records for every match found. The
record or records contain:

COLUMN TYPE DESCRIPTION

named sub‑match or sub‑matches Text Each named sub-match will have its own
column. Create a named sub-match by using (?
<name>...) in the regular expression. If a named
sub-match has the same name as one of the
predefined columns (below), the sub-match
takes precedence, and a warning is generated.
To avoid this warning, rename the sub-match.

FullMatch Text All of the text string that was matched.

StartMatch Number The starting position of the match within the


input text string. The first character of the string
returns 1.

SubMatches Single-column table of Text (column Value) The table of named and unnamed sub-matches
in the order in which they appear in the regular
expression. Generally, named sub-matches are
easier to work with and are encouraged. Use the
ForAll function or Last( FirstN( ... ) ) functions
to work with an individual sub-match. If no sub-
matches are defined in the regular expression,
this table will be present but empty.

These functions support MatchOptions. By default:


These functions perform a case-sensitive match. Use IgnoreCase to perform case-insensitive matches.
IsMatch matches the entire text string (Complete MatchOption), while Match and MatchAll search for a match anywhere in the
text string (Contains MatchOption). Use Complete, Contains, BeginsWith, or EndsWith as appropriate for your scenario.
IsMatch returns true if the text string matches the pattern or false if it doesn't. Match returns blank if no match is found that can be
tested with the IsBlank function. MatchAll returns an empty table if no match is found that can be tested with the IsEmpty function.
If you're using MatchAll to split a text string, consider using the Split function, which is simpler to use and faster.

Patterns
The key to using these functions is in describing the pattern to match. You describe the pattern in a text string as a combination of:
Ordinary characters, such as "abc" or "123".
Predefined patterns, such as Letter, MultipleDigits, or Email. (The Match enum defines these patterns.)
Regular-expression codes, such as "\d+\s+\d+" or "[a-z]+".
Combine these elements by using the string-concatenation operator &. For example, "abc" & Digit & "\s+" is a valid pattern that
matches the characters "a", "b", and "c", followed by a digit from 0 to 9, followed by at least one whitespace character.
Ordinary characters
The simplest pattern is a sequence of ordinary characters to be matched exactly.
For example, when used with the IsMatch function, the string "Hello" matches the pattern "Hello" exactly. No more and no less. The
string "hello!" doesn't match the pattern because of the exclamation point on the end and because the case is wrong for the letter "h".
(See MatchOptions for ways to modify this behavior.)
In the pattern language, certain characters are reserved for special purposes. To use these characters, either prefix the character with a \
(backslash) to indicate that the character should be taken literally, or use one of the predefined patterns described later in this topic. This
table lists the special characters:

SPECIAL CHARACTER DESCRIPTION

. dot or period

? question mark

* asterisk

+ plus

() parentheses

[] square brackets

{} curly braces

^ caret

$ dollar sign

| vertical bar or pipe

\ backslash

For example, you can match "Hello?" by using the pattern "Hello\?" with a backslash before the question mark.
Predefined patterns
Predefined patterns provide a simple way to match either one of a set of characters or a sequence of multiple characters. Use the string-
concatenation operator & to combine your own text strings with members of the Match enum:

MATCH ENUM DESCRIPTION REGULAR EXPRESSION

Any Matches any character. .

Comma Matches a comma. ,

Digit Matches a single digit ("0" through "9"). \d

Email Matches an email address that contains an "at" .+\@.+\\.[^\\.]{2,}


symbol ("@") and a domain name that contains
a dot (".")

Hyphen Matches a hyphen. \-

LeftParen Matches a left parenthesis "(". \(

Letter Matches a letter. \p{L}

MultipleDigits Matches one or more digits. \d+


MATCH ENUM DESCRIPTION REGULAR EXPRESSION

MultipleLetters Matches one or more letters. \p{L}+

MultipleNonSpaces Matches one or more characters that don't add \S+


whitespace (not space, tab, or newline).

MultipleSpaces Matches one or more characters that add \s+


whitespace (space, tab, or newline).

NonSpace Matches a single character that doesn't add \S


whitespace.

OptionalDigits Matches zero, one, or more digits. \d*

OptionalLetters Matches zero, one, or more letters. \p{L}*

OptionalNonSpaces Matches zero, one, or more characters that \S*


don't add whitespace.

OptionalSpaces Matches zero, one, or more characters that add \s*


whitespace.

Period Matches a period or dot ("."). \.

RightParen Matches a right parenthesis ")". \)

Space Matches a character that adds whitespace. \s

For example, the pattern "A" & MultipleDigits will match the letter "A" followed by one or more digits.
Regular expressions
The pattern that these functions use is a regular expression. The ordinary characters and predefined patterns that are described earlier in
this topic help build regular expressions.
Regular expressions are very powerful, available in many programming languages, and used for a wide variety of purposes. They can
also often look like a random sequence of punctuation marks. This article doesn't describe all aspects of regular expressions, but a wealth
of information, tutorials, and tools are available on the web.
Regular expressions come in different dialects, and Power Apps uses a variant of the JavaScript dialect. See regular-expression syntax for
an introduction to the syntax. Named sub-matches (sometimes called named capture groups) are supported:
Named sub-matches: (?<name> ...)
Named backreferences: \k<name>
In the Match enum table earlier in this topic, each enum appears in the same row as its corresponding regular expression.

Match options
You can modify the behavior of these functions by specifying one or more options, which you can combine by using the string-
concatenation operator (& ).

MATCHOPTIONS ENUM DESCRIPTION IMPACT ON A REGULAR EXPRESSION

BeginsWith The pattern must match from the beginning of Adds a ^ to the start of the regular expression.
the text.

Complete Default for IsMatch. The pattern must match Adds a ^ to the start and a $ to the end of the
the entire string of text, from beginning to end. regular expression.

Contains Default for Match and MatchAll. The pattern Doesn't modify the regular expression.
must appear somewhere in the text but doesn't
need to begin or end it.
MATCHOPTIONS ENUM DESCRIPTION IMPACT ON A REGULAR EXPRESSION

EndsWith The pattern must match the end of the string of Adds a $ to the end of the regular expression.
text.

IgnoreCase Treats uppercase and lowercase letters as Doesn't modify the regular expression. This
identical. By default, matching is case sensitive. option is the equivalent of the standard "i"
modifier for regular expressions.

Multiline Matches across multiple lines. Doesn't modify the regular expression. This
option is the equivalent of the standard "m"
modifier for regular expressions.

Using MatchAll is equivalent to using the standard "g" modifier for regular expressions.

Syntax
IsMatch( Text, Pattern [, Options ] )
Text – Required. The text string to test.
Pattern – Required. The pattern to test as a text string. Concatenate predefined patterns that the Match enum defines, or provide a
regular expression. Pattern must be a constant formula without any variables, data sources, or other dynamic references that change
as the app runs.
Options – Optional. A text-string combination of MatchOptions enum values. By default, MatchOptions.Complete is used.
Match( Text, Pattern [, Options ] )
Text – Required. The text string to match.
Pattern – Required. The pattern to match as a text string. Concatenate predefined patterns that the Match enum defines, or provide a
regular expression. Pattern must be a constant formula without any variables, data sources, or other dynamic references that change
as the app runs.
Options – Optional. A text-string combination of MatchOptions enum values. By default, MatchOptions.Contains is used.
MatchAll( Text, Pattern [, Options ] )
Text – Required. The text string to match.
Pattern – Required. The pattern to match as a text string. Concatenate predefined patterns that the Match enum defines, or provide a
regular expression. Pattern must be a constant formula without any variables, data sources, or other dynamic references that change
as the app runs.
Options – Optional. A text-string combination of MatchOptions enum values. By default, MatchOptions.Contains is used.

IsMatch examples
Ordinary characters
Imagine that your app contains a Text input control named TextInput1. The user enters values into this control to be stored in a
database.
The user types Hello world into TextInput1.

FORMULA DESCRIPTION RESULT

IsMatch( TextInput1.Text, "Hello world" Tests whether the user's input matches, exactly, true
) the string "Hello world".

IsMatch( TextInput1.Text, "Good bye" ) Tests whether the user's input matches, exactly, false
the string "Good bye".

IsMatch( TextInput1.Text, "hello", Tests whether the user's input contains the word false
Contains ) "hello" (case sensitive).

IsMatch( TextInput1.Text, "hello", Tests whether the user's input contains the word true
Contains & IgnoreCase ) "hello" (case insensitive).

Predefined patterns
FORMULA DESCRIPTION RESULT

IsMatch( "123-45-7890", Digit & Digit & Matches a United States Social Security Number true
Digit & Hyphen & Digit & Digit & Hyphen
& Digit & Digit & Digit & Digit )

IsMatch( "joan@contoso.com", Email ) Matches an email address true

IsMatch( "123.456", MultipleDigits & Matches a sequence of digits, a period, and then true
Period & OptionalDigits ) zero or more digits.

IsMatch( "123", MultipleDigits & Period Matches a sequence of digits, a period, and then false
& OptionalDigits ) zero or more digits. A period doesn't appear in
the text to match, so this pattern isn't matched.

Regular expressions
FORMULA DESCRIPTION RESULT

IsMatch( "986", "\d+" ) Matches an integer greater than zero. true

IsMatch( "1.02", "\d+(\.\d\d)?" ) Matches a positive currency amount. If the true


input contains a decimal point, the input must
also contain two numeric characters after the
decimal point. For example, 3.00 is valid, but 3.1
isn't.

IsMatch( "-4.95", "(-)?\d+(\.\d\d)?" ) Matches a positive or negative currency true


amount. If the input contains a decimal point,
the input must also contain two numeric
characters after the decimal point.

IsMatch( "111-11-1111", "\d{3}-\d{2}- Matches a United States Social Security number. true
\d{4}" ) Validates the format, type, and length of the
supplied input field. The string to match must
consist of three numeric characters followed by
a dash, then two numeric characters followed by
a dash, and then four numeric characters.

IsMatch( "111-111-111", "\d{3}-\d{2}- Same as the previous example, but one of the false
\d{4}" ) hyphens is out of place in the input.

IsMatch( "AStrongPasswordNot", "(?!^[0- Validates a strong password, which must false


9]\*$)(?!^[a-zA-Z]\*$)([a-zA-Z0-9] contain eight, nine, or 10 characters, in addition
{8,10})" )
to at least one digit and at least one alphabetic
character. The string must not contain special
characters.

Match and MatchAll examples


FORMULA DESCRIPTION RESULT

Match( "Bob Jones Extracts only the email portion of the contact {
<bob.jones@contoso.com>", "<(?<email>" & information. email: "bob.jones@contoso.com",
Match.Email & ")>"
FullMatch: "<bob.jones@contoso.com>",
SubMatches: [ "bob.jones@contoso.com" ],
StartMatch: 11
}

Match( "Bob Jones Extracts only the email portion of the contact blank
<InvalidEmailAddress>", "<(?<email>" & information. No legal address is found (there is
Match.Email & ")>"
no @ sign), so the function returns blank.
FORMULA DESCRIPTION RESULT

Match( Language(), "(<language>\w{2}) Extracts the language, script, and region {


(?:-(?<script>\w{4}))?(?:-(? portions of the language tag that the language: "en",
<region>\w{2}))?" )
Language function returns. These results reflect script: blank,
the United States; see the Language function region: "US",
documentation for more examples. The (?: FullMatch: "en-US",
operator groups characters without creating SubMatches: [ "en", "", "US" ],
another sub-match. StartMatch: 1
}

Match( "PT2H1M39S", "PT(?:<hours>\d+)H)? Extracts the hours, minutes, and seconds from {
(?:(?<minutes>\d+)M)?(?:(? an ISO 8601 duration value. The extracted hours: "2",
<seconds>\d+)S)?" )
numbers are still in a text string; use the Value minutes: "1",
function to convert it to a number before seconds: "39",
mathematical operations are performed on it. FullMatch: "PT2H1M39S",
SubMatches: [ "2", "1", "39" ],
StartMatch: 1
}

Let's drill into that last example. If you wanted to convert this string to a date/time value using the Time function, you must pass in the
named sub-matches individually. To do this, you can use the With function operating on the record that Match returns:

With(
Match( "PT2H1M39S", "PT(?:(?<hours>\d+)H)?(?:(?<minutes>\d+)M)?(?:(?<seconds>\d+)S)?" ),
Time( Value( hours ), Value( minutes ), Value( seconds ) )
)

For these examples, add a Button control, set its OnSelect property to this formula, and then select the button:

Set( pangram, "The quick brown fox jumps over the lazy dog." )

FORMULA DESCRIPTION RESULT

Match( pangram, "THE", IgnoreCase ) Find all matches of "THE" in the text string that {
the pangram variable contains. The string FullMatch: "The",
contains two matches, but only the first is SubMatches: [ ],
returned because you're using Match and not StartMatch: 32
MatchAll. The SubMatches column is empty }
because no sub-matches were defined.

MatchAll( pangram, "the" ) Find all matches of "the" in the text string that
the pangram variable contains. The test is case
sensitive, so only the second instance of "the" is
found. The SubMatches column is empty
because no sub-matches were defined.

MatchAll( pangram, "the", IgnoreCase ) Find all matches of "the" in the text string that
the pangram variable contains. In this case, the
test is case insensitive, so both instances of the
word are found. The SubMatches column is
empty because no sub-matches were defined.

MatchAll( pangram, "\b\wo\w\b" ) Finds all three-letter words with an "o" in the
middle. Note that "brown" is excluded because
it's not a three-letter word and, therefore, fails
to match "\b" (word boundary).

Match( pangram, "\b\wo\w\b\s\*(? Matches all the characters between "fox" and {
<between>\w.+\w)\s\*\b\wo\w\b" ) "dog". between: "jumps over the lazy",
FullMatch: "fox jumps over the lazy dog",
SubMatches: [ "jumps over the lazy" ],
StartMatch: 17
}

To see the results of MatchAll in a gallery:


1. In an empty screen, insert a blank vertical Gallery control.
2. Set the gallery's Items property to MatchAll( pangram, "\w+" ) or MatchAll( pangram, MultipleLetters ).

3. Select "Add an item from the Insert tab" in the middle of the gallery control to select the template of the gallery.
4. Add a Label control to the gallery's template.
5. Set the label's Text property to ThisItem.FullMatch.
The gallery is filled with each word in our example text. Resize the gallery's template and the label control in order to see all the
words on one screen.
IsNumeric function in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Tests whether a value is numeric.

Description
The IsNumeric function tests whether a value is numeric. Other kinds of values include Boolean, string, table, and
record.
The return value is a Boolean true or false.

Syntax
IsNumeric( Value )
Value – Required. Value to test.
Now, Today, and IsToday functions in Power Apps
12/3/2019 • 3 minutes to read • Edit Online

Returns the current date and time, and tests whether a date/time value is today.

Description
The Now function returns the current date and time as a date/time value.
The Today function returns the current date as a date/time value. The time portion is midnight. Today has the
same value throughout a day, from midnight today to midnight tomorrow.
The IsToday function tests whether a date/time value is between midnight today and midnight tomorrow. This
function returns a Boolean (true or false) value.
All these functions work with the local time of the current user.
See working with dates and times for more information.

Volatile Functions
Now and Today are volatile functions. Each time one of these functions is evaluated it returns a different value.
When used in a data flow formula, a volatile function will only return a different value if the formula in which it
appears is reevaluated. If nothing else changes in the formula then it will have the same value throughout the
execution of your app.
For example, a label control with Label1.Text = Now() will not change while your app is active. Only closing and
reopening the app will result in a new value.
The function will be reevaluated if it is part of a formula in which something else has changed. For example, if we
change our example to involve a slider control with Label1.Text = DateAdd( Now(), Slider1.Value, Minutes )
then the current time is retrieved each time the Slider control's value changes and the label's text property is
reevaluated.
When used in a behavior formula, volatile functions will be evaluated each time the behavior formula is evaluated.
See below for an example.

Syntax
Now()
Today()
IsToday( DateTime )
DateTime - Required. The date/time value to test.

Examples
For the examples in this section, the current time is 3:59 AM on February 12, 2015, and the language is en-us.
FORMULA DESCRIPTION RESULT

Text( Now(), "mm/dd/yyyy Retrieves the current date and time, and "02/12/2015 03:59:00"
hh:mm:ss" ) displays it as a string.

Text( Today(), "mm/dd/yyyy Retrieves the current date only, leaving "02/12/2015 00:00:00"
hh:mm:ss" ) the time portion as midnight, and
displays it as a string.

IsToday( Now() ) Tests whether the current date and time true
is between midnight today and
midnight tomorrow.

IsToday( Today() ) Tests whether the current date is true


between midnight today and midnight
tomorrow.

Text( DateAdd( Now(), 12 ), Retrieves the current date and time, "02/24/2015 03:59:00"
"mm/dd/yyyy hh:mm:ss" ) adds 12 days to the result, and displays
it as a string.

Text( DateAdd( Today(), 12 ), Retrieves the current date, adds 12 days "02/24/2015 00:00:00"
"mm/dd/yyyy hh:mm:ss" ) to the result, and displays it as a string.

IsToday( DateAdd( Now(), 12 ) ) Tests whether the current date and false
time, plus 12 days, is between midnight
today and midnight tomorrow.

IsToday( DateAdd( Today(), 12 ) ) Tests whether the current date, plus 12 false
days, is between midnight today and
midnight tomorrow.

Display a clock that updates in real time


1. Add a Timer control, set its Duration property to 1000, and set its Repeat property to true.
The timer will run for one second, automatically start over, and continue that pattern.
2. Set the control's OnTimerEnd property to this formula:
Set( CurrentTime, Now() )
Whenever the timer starts over (after each second), this formula sets the CurrentTime global variable to the
current value of the Now function.

3. Add a Label control, and set its Text property to this formula:
Text( CurrentTime, LongTime24 )
Use the Text function to format the date and time however you want, or set this property to just
CurrentTime to show hours and minutes but not seconds.

4. Preview the app by pressing F5, and then start the timer by clicking or tapping it.
The label continually shows the current time, down to the second.

5. Set the timer's AutoStart property to true and its Visible property to false.
The timer is invisible and starts automatically.
6. Set the screen's OnStart property so that the CurrentTime variable has a valid value, as in this example:
Set(CurrentTime, Now())
The label appears as soon as the app starts (before the timer runs for a full second).
AsType and IsType functions in canvas apps
10/7/2019 • 4 minutes to read • Edit Online

Checks a record reference for a specific entity type (IsType) and treats the reference as a specific type (AsType).

Description
Read Understand record references and polymorphic lookups for a broader introduction and more details.
A lookup field usually refers to records in a particular entity. Because the entity type is well established, you can
access the fields of the lookup by using a simple dot notation. For example, First( Accounts ).'Primary
Contact'.'Full Name' walks from the Accounts entity to the Primary Contact record in the Contacts entity
and extracts the Full Name field.
Common Data Service also supports polymorphic lookup fields, which can refer to records from a set of entities,
as in these examples.

LOOKUP FIELD CAN REFER TO

Owner Users or Teams

Customer Accounts or Contacts

Regarding Accounts, Contacts, Knowledge Articles, etc.

In canvas-app formulas, you can use record references to work with polymorphic lookups. Because a record
reference can refer to different entities, you don't know which fields will be available when you write a formula.
The .Field notation isn't available. Those formulas must adapt to the records that the app encounters when it runs.
The IsType function tests whether a record reference refers to a specific entity type. The function returns a
Boolean TRUE or FALSE.
The AsType function treats a record reference as a specific entity type, sometimes referred to as casting. You can
use the result as if it were a record of the entity and, again, use the .Field notation to access all of the fields of that
record. An error occurs if the reference isn't of the specific type.
Use these functions together to first test the entity type of a record and then treat it as a record of that type so
that the fields are available:

If( IsType( First( Accounts ).Owner, Users ),


AsType( First( Accounts ).Owner, Users ).'Full Name',
AsType( First( Accounts ).Owner, Teams ).'Team Name'
)

You need these functions only if you're accessing the fields of a record reference. For example, you can use record
references in the Filter function without IsType or AsType:

Filter( Accounts, Owner = First( Users ) )

Similarly, you can use record references with the Patch function:
Patch( Accounts, First( Accounts ), { Owner: First( Teams ) } )

If used in a record context, such as within a Gallery or Edit form control, you might need to use the global
disambiguation operator to reference the entity type. For example, this formula would be effective for a gallery
that's displaying a list of contacts where Company Name is a Customer lookup:

If( IsType( ThisItem.'Company Name', [@Accounts] ),


AsType( ThisItem.'Company Name', [@Accounts] ).'Account Name',
AsType( ThisItem.'Company Name', [@Contacts] ).'Full Name'
)

For both functions, you specify the type through the name of the data source that's connected to the entity. For
the formula to work, you must also add a data source to the app for any types that you want to test or cast. For
example, you must add the Users entity as a data source if you want to use IsType and AsType with an Owner
lookup and records from that entity. You can add only the data sources that you actually use in your app; you
don't need to add all the entities that a lookup could reference.
If the record reference is blank, IsType returns FALSE, and AsType returns blank. All fields of a blank record will
be blank.

Syntax
AsType( RecordReference, EntityType )
RecordReference - Required. A record reference, often a lookup field that can refer to a record in any of
multiple entities.
EntityType - Required. The specific entity for which to test.
IsType( RecordReference, EntityType )
RecordReference - Required. A record reference, often a lookup field that can refer to a record in any of
multiple entities.
EntityType - Required. The specific entity to which the record should be cast.

Example
Understand record references and polymorphic lookups contains extensive examples.
1. Create a blank canvas app for tablets.
2. On the View tab, select Data sources, and then add the Contacts and Accounts entities as data sources.
3. Insert a Gallery control with a Blank vertical orientation.

4. On the Properties tab near the right side of the screen, set the gallery's Items property to Contacts.

5. Set the gallery's layout to Title and subtitle.


6. In the Data pane, open the Title1 list, and then select Full Name.

7. Select the Subtitle1 label control.


8. Set the Text property of Subtitle1 to this formula:

If( IsBlank( ThisItem.'Company Name' ), "--",


IsType( ThisItem.'Company Name', [@Accounts] ),
"Account: " & AsType( ThisItem.'Company Name', [@Accounts] ).'Account Name',
"Contact: " & AsType( ThisItem.'Company Name', [@Contacts] ).'Full Name'
)

The subtitle in the gallery shows these values:


"--" if the 'Company Name' is blank.
"Account: " and then the Account Name field from the Accounts entity if the Company Name field
refers to an account.
"Contact: " and then the Full Name field from the Contacts entity if the Company Name field refers
to a contact.
Your results might differ from those in this topic because it uses sample data that was modified to show
additional types of results.
JSON function in Power Apps
12/3/2019 • 5 minutes to read • Edit Online

Generates a JSON text string for a table, a record, or a value.

Description
The JSON function returns the JavaScript Object Notation (JSON ) representation of a data structure as text so
that it's suitable for storing or transmitting across a network. ECMA-404 and IETF RFC 8259 describe the format,
which is widely used by JavaScript and other programming languages.
Canvas apps support the data types that this table lists with details about their text representation:

DATA TYPE DESCRIPTION RESULT EXAMPLE

Boolean true or false. true

Color String that contains the 8-digit "#102030ff"


hexadecimal representation for the
color. This representation takes the
format #rrggbbaa, where rr is the red
component, gg is green, bb is blue, and
aa is the alpha channel. For the alpha
channel, 00 is fully transparent, and ff is
fully opaque. You can pass the string to
the ColorValue function.

Currency Number that uses the appropriate 1.345


decimal separator for the user's
language. Scientific notation is used if
needed.

Date String that contains the date in ISO "2019-03-31"


8601 yyyy-mm-dd format.

DateTime String that contains an ISO 8601 "2019-03-31T22:32:06.822Z"


date/time. Date/time values are in UTC,
as the ending "Z" indicates.

GUID String that contains the GUID value. "751b58ac-380e-4a04-a925-


Letters are lowercase. 9f375995cc40"

Image, Media If IncludeBinaryData is specified, "data:image/jpeg;base64,/9j/4AA..."


media files are encoded in a string. Web
references that use the http: or https:
URL scheme aren't modified. References
to in-memory binary data are encoded
with the "data:mimetype;base64,..."
format. In-memory data includes
images that users capture by using the
Camera control and any other
references with the appres: and blob:
URL schemes.
DATA TYPE DESCRIPTION RESULT EXAMPLE

Number Number that uses the appropriate 1.345


decimal separator for the user's
language. Scientific notation is used if
needed.

Option set Numeric value of the option set, not 1001


the label that's used for display. The
numeric value is used because it's
language independent.

Time String that contains an ISO 8601 "23:12:49.000"


hh:mm:ss.fff format.

Record Comma-delimited list, between { and }, { "First Name": "Fred", "Age": 21


of fields and their values. This notation }
resembles that for records in canvas
apps, but the name is always between
double quotation marks. This format
doesn't support records that are based
on many-to-one relationships.

Table Comma-delimited list, between [ and ], [ { "First Name": "Fred", "Age":


of records. This format doesn't support 21 }, { "First Name": "Jean",
"Age": 20 } ]
tables that are based on one-to-many
relationships.

Two option Boolean value of the two option, true false


or false, not the label that's used for
display. The Boolean value is used
because it's language independent.

Hyperlink, Text String between double quotation "This is a string."


marks. The function escapes embedded
double-quotation marks with a
backslash, replaces newlines with "\n",
and makes other standard JavaScript
replacements.

Specify the optional Format argument to control how readable the result is and how unsupported and binary data
types are handled. By default, the output is as compact as possible with no unnecessary spaces or newlines, and
unsupported data types and binary data aren't allowed. You can combine multiple formats if you specify the &
operator.

JSONFORMAT ENUM DESCRIPTION

Compact Default. The output is as compact as possible with no added


spaces or newlines.

IndentFour To improve readability, the output contains a newline for each


column and nesting level and uses four spaces for each
indentation level.

IncludeBinaryData The result includes image, video, and audio-clip columns. This
format can dramatically increase the result's size and degrade
your app's performance.
JSONFORMAT ENUM DESCRIPTION

IgnoreBinaryData The result doesn't include image, video, or audio-clip columns.


If you specify neither IncludeBinaryData nor
IgnoreBinaryData, the function produces an error if it
encounters binary data.

IgnoreUnsupportedTypes Unsupported data types are allowed, but the result won't
include them. By default, unsupported data types produce an
error.

Use the ShowColumns and DropColumns functions to control which data the result includes and to remove
unsupported data types.
Because JSON can be both memory and compute intensive, you can use this function only in behavior functions.
You can capture the result from JSON into a variable, which you can then use in data flow.
If a column has both a display name and a logical name, the result contains the logical name. Display names
reflect the language of the app user and are, therefore, inappropriate for data transfer to a common service.

Syntax
JSON ( DataStructure [, Format ] )
DataStructure – Required. The data structure to convert to JSON. Tables, records, and primitive values are
supported, arbitrarily nested.
Format - Optional. JSONFormat enum value. The default value is Compact, which doesn't add newlines or
spaces and blocks binary data and unsupported columns.

Examples
Hierarchical data
1. Insert a Button control, and set its OnSelect property to this formula.

ClearCollect( CityPopulations,
{ City: "London", Country: "United Kingdom", Population: 8615000 },
{ City: "Berlin", Country: "Germany", Population: 3562000 },
{ City: "Madrid", Country: "Spain", Population: 3165000 },
{ City: "Hamburg", Country: "Germany", Population: 1760000 },
{ City: "Barcelona", Country: "Spain", Population: 1602000 },
{ City: "Munich", Country: "Germany", Population: 1494000 }
);
ClearCollect( CitiesByCountry, GroupBy( CityPopulations, "Country", "Cities" ) )

2. Select the button while holding down the Alt key.


The CitiesByCountry collection is created with this data structure, which you can show by selecting
Collections on the File menu and then selecting the name of the collection.
You can also show this collection by selecting File > App settings > Advanced settings > Enable
formula bar result view, selecting the name of the collection in the formula bar, and then selecting the
down arrow next to the name of the collection under the formula bar.

3. Insert another button, and set its OnSelect property to this formula:

Set( CitiesByCountryJSON, JSON( CitiesByCountry ) )

This formula sets the global variable CitiesByCountryJSON to the JSON representation for
CitiesByCountry.
4. Select the button while holding down the Alt key.
5. Insert a Label control, and set its Text property to this variable.

CitiesByCountryJSON

The label shows this result, all on a single line with no spaces, suitable for transmission across a network:
[{"Cities":[{"City":"London","Population":8615000}],"Country":"United Kingdom"},{"Cities":
[{"City":"Berlin","Population":3562000},{"City":"Hamburg","Population":1760000},
{"City":"Munich","Population":1494000}],"Country":"Germany"},{"Cities":
[{"City":"Madrid","Population":3165000},{"City":"Barcelona","Population":1602000}],"Country":"Spain"}]

6. Change the second button's formula to make the output more readable.

Set( CitiesByCountryJSON, JSON(CitiesByCountry, JSONFormat.IndentFour ))

7. Select the second button while holding down the Alt key.
The label shows the more readable result.

[
{
"Cities": [
{
"City": "London",
"Population": 8615000
}
],
"Country": "United Kingdom"
},
{
"Cities": [
{
"City": "Berlin",
"Population": 3562000
},
{
"City": "Hamburg",
"Population": 1760000
},
{
"City": "Munich",
"Population": 1494000
}
],
"Country": "Germany"
},
{
"Cities": [
{
"City": "Madrid",
"Population": 3165000
},
{
"City": "Barcelona",
"Population": 1602000
}
],
"Country": "Spain"
}
]

Images and media in base64


1. Add an Image control.
This control brings SampleImage with it.
2. Add a Button control, and set its OnSelect property to this formula.
Set( ImageJSON, JSON( SampleImage, JSONFormat.IncludeBinaryData ) )

3. Select the button while holding down the Alt key.


4. Add a label, and set its Text property to this variable.

ImageJSON

5. Resize the control and reduce the font size as needed to show most of the result.
The label shows the text string that the JSON function captured.

"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxzdmcgdmVyc2lvbj0iMS4x
Ig0KCSB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3h
saW5rIiB4bWxuczphPSJodHRwOi8vbnMuYWRvYmUuY29tL0Fkb2JlU1ZHVmlld2VyRXh0ZW5zaW9ucy8zLjAvIg0KCSB4PSIwcHgiIH
k9IjBweCIgd2lkdGg9IjI3MHB4IiBoZWlnaHQ9IjI3MHB4IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAyNzAgMjcwIiB4bWw6c
3BhY2U9InByZXNlcnZlIj4NCgk8ZyBjbGFzcz0ic3QwIj4NCgkJPHJlY3QgeT0iMC43IiBmaWxsPSIjRTlFOUU5IiB3aWR0aD0iMjY5
IiBoZWlnaHQ9IjI2OS4zIi8+DQoJCTxwb2x5Z29uIGZpbGw9IiNDQkNCQ0EiIHBvaW50cz0iMjc3LjksMTg3LjEgMjQ1LDE0My40IDE
4OC42LDIwMi44IDc1LDgwLjUgLTQuMSwxNjUuMyAtNC4xLDI3MiAyNzcuOSwyNzIiLz4NCgkJPGVsbGlwc2UgZmlsbD0iI0NCQ0JDQS
IgY3g9IjIwMi40IiBjeT0iODQuMSIgcng9IjI0LjQiIHJ5PSIyNC4zIi8+DQoJPC9nPg0KPC9zdmc+"
Language function in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Returns the language tag of the current user.

Description
The Language function returns the language, script, and region of the current user as a language tag.
Use the language information to tailor your app across locales. For example, if you are creating an app that will
be used in Italy and France, you can use Language to automatically display Italian and French strings to your
users in those different locations.
Language tags
A language tag can be in one of three formats:

RETURN VALUE DESCRIPTION

"lg‑RE" lg is the two character abbreviation for the language and RE


is the two character abbreviation for the region. This is the
most common return type. For example, "en-GB" is returned
for Great Britain.

"lg" lg is the two character abbreviation for the language. This is


the format used when Power Apps has information about
the language, but does not have information for the specific
region.

"lg‑scrp‑RE" lg is the two character abbreviation for the language, scrp is


the four character abbreviation for the script, and RE is the
two character abbreviation for the region.

Power Apps uses the IETF BCP -47 language tag format.
To see the list of supported language tags, type Value( "1", ) in the formula bar or advanced view and scroll
through the list of locales suggested for the second argument.
The Text and Value functions also use language tags. Use these functions for translating to and from text
strings in a globally aware manner. When passing a language tag to these functions and the region would not
make a difference, you can use just the language portion of the tag.

Syntax
Language()

Examples
User's locale
It is assumed that the host operating system and/or browser are using the default locale for the location.
FORMULA LOCATION RETURN VALUE

Language() Lisbon, Portugal "pt-PT"

Language() Rio de Janeiro, Brazil "pt-BR"

Language() Atlanta, USA "en-US"

Language() Manchester, Great Britain "en-GB"

Language() Paris, France "fr-FR"

Language() Roseau, Dominica "en"

Language() Belgrade, Serbia "sr-cyrl-RS" or "sr-latn-RS", depending


on the user's system settings

Localization table
A simple approach to localization is to create an Excel spreadsheet mapping an author defined TextID to a
translated text for the user's language. Although you could use a collection or any other data source for this
table, we chose Excel because it is easy to edit and manage outside of the app by translators.
1. Create the following table in Excel:

The entry with blank for the Language column will be used as the default if there is no specific text
string found for a given language. This entry must appear after all other entries for a given TextID.
For our purposes, we only need to look at the language of the locale and not the region. If regional
considerations were important, we could have included the full language tag value in the table above.
2. Use the Insert ribbon, Table command, to make this into a proper Excel table. By default, it will be
named Table1 but you can name it whatever you like with the Table Tools/Design ribbon and the
Table Name: text box on the far left hand side.
3. Save the Excel file to your local file system.
4. In Power Apps, in the right-hand pane, click or tap the Data Sources tab, and then click or tap Add data
source.
5. Click or tap Add static data to your app, click or tap the Excel file that you saved, and then click or tap
Open.
6. Select the table that you created, and then click or tap Connect.
In your app, wherever you would have used the text "Hello" before, use this formula instead:
LookUp( Table1, TextID = "Hello" && (LanguageTag = Left( Language(), 2 ) || IsBlank(
LanguageTag ))).LocalizedText
This formula will lookup the appropriate LocalizedText value for the language of the user, and if that is not
found, will fall back on the default blank version.
Be aware that translated strings in other languages could be significantly longer than they are in your language.
In many cases, the labels and other elements that display the strings in your user interface will need to be wider
to accommodate.
Translation service
You can translate text on demand using a translation service, such as the Microsoft Translator service:
1. In Power Apps, in the right-hand pane, click or tap the Data Sources tab, and then click or tap Add data
source.
2. Click or tap Microsoft Translator.
In your app, wherever you would have used the text "Hello" before, use this formula instead:
MicrosoftTranslator.Translate( "Hello", Language() )
The Microsoft Translator service uses the same language tags that the Language function returns.
This approach comes with some drawbacks when compared to the previous example which utilized a pre-
translated table of text strings:
The translation will take time to complete, requiring a call to a service across the network. This will result in
a lag to see the translated text in your app.
The translation will be mechanical and may not be what you anticipate or be the best choice for the situation
within your app.
First, FirstN, Last, and LastN functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Returns a table's first or last set of records.

Description
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.
First and Last return a single record. FirstN and LastN return a table, even if you specify only a single record.
When used with a data source, these functions can't be delegated. Only the first portion of the data source will be
retrieved and then the function applied. The result may not represent the complete story. A warning will appear at
authoring time to remind you of this limitation and to suggest switching to delegable alternatives where possible.
For more information, see the delegation overview.

Syntax
First( Table )
Last( Table )
Table - Required. Table to operate on.
FirstN ( Table [, NumberOfRecords ] )
LastN ( Table [, NumberOfRecords ] )
Table - Required. Table to operate on.
NumberOfRecords - Optional. Number of records to return. If you don't specify this argument, the function
returns one record.

Examples
This formula returns the first record from a table named Employees:
First(Employees)
This formula returns the last 15 records from a table named Employees:
LastN (Employees, 15)
First, FirstN, Last, and LastN functions in Power
Apps
12/3/2019 • 2 minutes to read • Edit Online

Returns a table's first or last set of records.

Description
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.
First and Last return a single record. FirstN and LastN return a table, even if you specify only a single
record.
When used with a data source, these functions can't be delegated. Only the first portion of the data source
will be retrieved and then the function applied. The result may not represent the complete story. A warning
will appear at authoring time to remind you of this limitation and to suggest switching to delegable
alternatives where possible. For more information, see the delegation overview.

Syntax
First( Table )
Last( Table )
Table - Required. Table to operate on.
FirstN ( Table [, NumberOfRecords ] )
LastN ( Table [, NumberOfRecords ] )
Table - Required. Table to operate on.
NumberOfRecords - Optional. Number of records to return. If you don't specify this argument, the
function returns one record.

Examples
This formula returns the first record from a table named Employees:
First(Employees)
This formula returns the last 15 records from a table named Employees:
LastN (Employees, 15)
Download, Launch, and Param functions in canvas
apps
11/4/2019 • 2 minutes to read • Edit Online

Downloads or launches a webpage or an app with parameters.

Description
The Download function downloads a file from the web to the local device. The user is prompted for a location to
save the file. Download returns the location where the file was stored locally as a string.
The Launch function launches a webpage or an app. Optionally, this function can pass parameters to the app.
In Internet Explorer and Microsoft Edge, the Launch function opens a website or app only if its security settings are
the same or higher than those of the app that contains the function. If, for example, you add the Launch function to
an app that will run in the Trusted sites security zone, ensure that the website or app that you want the function to
open is in the Trusted sites or Local intranet zone (not in Restricted sites). More information: Change security
and privacy settings for Internet Explorer 11.
The Param function retrieves a parameter passed to the app when it was launched. If the named parameter wasn't
passed, Param returns blank.

Syntax
Download( Address )
Address - Required. The address of a web resource to download.
Launch( Address [, ParameterName1, ParameterValue1, ... ] )
Address - Required. The address of a webpage or the ID of an app to launch.
ParameterName(s) - Optional. Parameter name.
ParameterValue(s) - Optional. Corresponding parameter values to pass to the app or the webpage.
Param ( ParameterName )
ParameterName - Required. The name of the parameter passed to the app.
Left, Mid, and Right functions in Power Apps
2/11/2020 • 2 minutes to read • Edit Online

Extracts the left, middle, or right portion of a string of text.

Description
The Left, Mid, and Right functions return a portion of a string.
Left returns the beginning characters of a string.
Mid returns the middle characters of a string.
Right returns the ending characters of a string.
If you specify a single string as an argument, the function returns the portion that you requested of the string. If
you specify a single-column table that contains strings, the function returns a single-column table of the portions
that you requested of those strings. If you specify a multi-column table, you can shape it into a single-column table,
as working with tables describes.
If the starting position is negative or beyond the end of the string, Mid returns blank. You can check the length of a
string by using the Len function. If you request more characters than the string contains, the function returns as
many characters as possible.

Syntax
Left( String, NumberOfCharacters )
Mid( String, StartingPosition [, NumberOfCharacters ] )
Right( String, NumberOfCharacters )
String - Required. The string to from which to extract the result.
StartingPosition - Required (Mid only). The starting position. The first character of the string is position 1.
NumberOfCharacters - Required (Left and Right only). The number of characters to return. If omitted for the
Mid function, the function returns the portion from the starting position until the end of the string.
Left( SingleColumnTable, NumberOfCharacters )
Mid( SingleColumnTable, StartingPosition [, NumberOfCharacters ] )
Right( SingleColumnTable, NumberOfCharacters )
SingleColumnTable - Required. A single-column table of strings from which to extract the results.
StartingPosition - Required (Mid only). The starting position. The first character of the string is position 1.
NumberOfCharacters - Required (Left and Right only). The number of characters to return. If omitted for the
Mid function, the function returns the portion from the starting position until the end of the string.

Examples
Single string
The examples in this section use a text-input control as their data source. The control is named Author and
contains the string "E. E. Cummings".
FORMULA DESCRIPTION RESULT

Left( Author.Text, 5 ) Extracts up to five characters from the "E. E."


start of the string.

Mid( Author.Text, 7, 4 ) Extracts up to four characters, starting "Cumm"


with the seventh character, from the
string.

Mid( Author.Text, 7 ) Extracts all characters, starting with the "Cummings"


seventh character, from the string.

Right( Author.Text, 5 ) Extracts up to five characters from the "mings"


end of the string.

Single -column table


Each example in this section extracts strings from the Address column of this data source, named People, and
returns a single-column table that contains the results:

FORMULA DESCRIPTION RESULT

Left( Extracts the first eight characters of each


ShowColumns( People, "Address" ), string.
8)

Mid( Extracts the middle seven characters of


ShowColumns( People, "Address" ), each string, starting with the fifth
5, 7 ) character.

Right( Extracts the last seven characters of


ShowColumns( People, "Address" ), each string.
7)

Step-by-step example
1. Import or create a collection named Inventory, and show it in a gallery, as the first procedure in Show
images and text in a gallery describes.
2. Set the Text property of the lower label in the gallery to this function:
Right(ThisItem.ProductName, 3)
The label shows the last three characters of each product name.
Len function in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Returns the length of a string of text.

Description
If you specify a single string as the argument, the return value is the length as a number. If you specify a single-
column table that contains strings, the return value is a single-column table that contains the length of each
string. If you have a multi-column table, you can shape it into a single-column table, as working with tables
describes.
If you specify a blank string, Len returns 0.

Syntax
Len( String )
String - Required. The string to measure.
Len( SingleColumnTable )
SingleColumnTable - Required. A single-column table of strings to measure.

Examples
Single string
For the examples in this section, the data source is a text-input control that's named Author and that contains
the string "E. E. Cummings".

FORMULA DESCRIPTION RESULT

Len( Author.Text ) Measures the length of the string in 14


the Author control.

Len( "" ) Measures the length of an empty 0


string.

Single -column table


For the first example in this section, the data source is named People and contains this data:

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Len( In the Address column of the People


ShowColumns( People, "Address" ) table:
) Measures the length of each
string.
Returns a single-column table
that contains the length of each
string.

Len( [ "Hello", "to the", "World", "" In the Value column of the inline table:
]) Measures the length of each
string.
Returns a single-column table
that contains the length of each
string.
Abs, Exp, Ln, Power, and Sqrt functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Calculates absolute values, natural logarithms, square roots, and the results of raising e or any number to specified
powers.

Description
The Abs function returns the non-negative value of its argument. If a number is negative, Abs returns the positive
equivalent.
The Exp function returns e raised to the power of its argument. The transcendental number e begins 2.7182818...
The Ln function returns the natural logarithm (base e) of its argument.
The Power function returns a number raised to a power. It is equivalent to using the ^ operator.
The Sqrt function returns the number that, when multiplied by itself, equals its argument.
If you pass a single number, the return value is a single result based on the function called. If you pass a single-
column table that contains numbers, the return value is a single-column table of results, one result for each record
in the argument's table. If you have a multi-column table, you can shape it into a single-column table, as working
with tables describes.
If an argument would result in an undefined valued, the result is blank. This can happen, for example, with square
roots and logarithms of negative numbers.

Syntax
Abs( Number )
Exp( Number )
Ln( Number )
Sqrt( Number )
Number - Required. Number to operate on.
Power( Base, Exponent )
Base - Required. Base number to raise.
Exponent - Required. The exponent to which the base number is raised.
Abs( SingleColumnTable )
Exp( SingleColumnTable )
Ln( SingleColumnTable )
Sqrt( SingleColumnTable )
SingleColumnTable - Required. A single-column table of numbers to operate on.

Examples
Single number
FORMULA DESCRIPTION RESULT

Abs( -55 ) Returns the number without the 55


negative sign.

Exp( 2 ) Returns e raised to the power of 2, or e 7.389056...


* e.

Ln( 100 ) Returns the natural logarithm (base e) 4.605170...


of the number 100.

Power( 5, 3 ) Returns 5 raised to the power of 3, or 5 125


* 5 * 5.

Sqrt( 9 ) Returns the number that, when 3


multiplied by itself, results in 9.

Single -column table


The examples in this section use a data source that's named ValueTable and that contains this data:

FORMULA DESCRIPTION RESULT

Abs( ValueTable ) Returns the absolute value of each


number in the table.

Exp( ValueTable ) Returns e raised to the power of each


number in the table.

Ln( ValueTable ) Returns the natural logarithm of each


number in the table.

Sqrt( ValueTable ) Returns the square root of each number


in the table

Step-by-step example
1. Add a Text input control, and name it Source.
2. Add a Label control, and set its Text property to this formula:
Sqrt( Value( Source.Text ) )
3. Type a number into Source, and confirm that the Label control shows the square root of the number that you
typed.
SaveData and LoadData functions in Power Apps
3/24/2020 • 5 minutes to read • Edit Online

Saves and reloads a collection from a local device.

Description
The SaveData function stores a collection for later use under a name.
The LoadData function reloads a collection by name that was previously saved with SaveData. You can't use this
function to load a collection from another source.
Use these functions to improve app-startup performance by:
Caching data in the App.OnStart formula on a first run.
Reloading the local cache on next runs.
You can also use these functions to add simple offline capabilities to your app.
You can't use these functions inside a browser when:
Authoring the app in Power Apps Studio.
Running the app in the web player.
To test your app, run it in Power Apps Mobile on an iPhone or Android device.
These functions are limited by the amount of available app memory as they operate on an in-memory collection.
Available memory can vary depending on factors such as:
The device and operating system.
The memory that the Power Apps player uses.
Complexity of the app with screens and controls.
Test your app with expected scenarios on the type of devices you expect the app to run when storing large data.
Expect to have between 30 MB and 70 MB of available memory generally.
These functions depend on the collection being implicitly defined with Collect or ClearCollect. You don't need to
call Collect or ClearCollect to load data into the collection for defining it. It's a common case when using
LoadData after a previous SaveData. All that is needed is the presence of these functions in a formula to implicitly
define the structure of the collection. For more information, see creating and removing variables.
The loaded data will be appended to the collection. Use the Clear function before calling LoadData if you want to
start with an empty collection.
The device's built in app sandbox facilities are used to isolate saved data from other apps.
The device may also encrypt the data; or you can use a mobile device management tool such as Microsoft Intune.

Syntax
SaveData( Collection, Name )
LoadData( Collection, Name [, IgnoreNonexistentFile ])
Collection - Required. Collection to be stored or loaded.
Name - Required. Name of the storage. The name must be same to save and load same set of data. The name
space isn't shared with other apps or users.
IgnoreNonexistentFile - Optional. A Boolean value indicating what to do if the file doesn't already exist. Use false
(default) to return an error and true to suppress the error.

Examples
FORMULA DESCRIPTION RESULT

SaveData( LocalCache, "MyCache" ) Save the LocalCache collection to the Data is saved to the local device.
user's device under the name
"MyCache", suitable for LoadData to
retrieve later.

LoadData( LocalCache, "MyCache" ) Loads the LocalCache collection from Data is loaded from the local device.
the user's device under the name
"MyCache", previously stored with a call
to SaveData.

Simple offline example


Following simple example captures and stores the names and pictures of everyday items while offline. It stores the
information in the device's local storage for later use. This allows the app to be closed or the device to restart
without losing data.
You must have a device to work through this example as it uses the LoadData and SaveData functions that don't
operate when in a web browser.
1. Create a blank canvas app with a tablet layout. For more details, read creating an app from a template and
select Tablet layout under Blank app.
2. Add a Text input control and a Camera control and arrange them roughly as shown:

3. Add a Button control.


4. Double-click the button control to change the button text to Add Item (or modify the Text property).
5. Set the OnSelect property of the button control to this formula that will add an item to our collection:

Collect( MyItems, { Item: TextInput1.Text, Picture: Camera1.Photo } )


6. Add another Button control.
7. Double-click the button control to change the button text to Save Data (or modify the Text property).
8. Set the OnSelect property of the button control to this formula in order to save our collection to the local
device:

SaveData( MyItems, "LocalSavedItems" )

It's tempting to test the button as it doesn't affect anything. But you'll only see an error as you're authoring in
a web browser. Save the app first and open on a device before you follow the next steps to test this formula:
9. Add a third Button control.
10. Double-click the button control to change the button text to Load Data (or modify the Text property).
11. Set the OnSelect property of the button control to this formula in order to load our collection from the local
device:

LoadData( MyItems, "LocalSavedItems" )


12. Add a Gallery control with a Vertical layout that includes a picture and text areas:

13. When prompted, select the MyItems collection as the data source for this gallery. This will set the Items
property of the Gallery control:

The image control in the gallery template should default its Image property to ThisItem.Picture and the
label controls should both default their Text properties to ThisItem.Item. Check these formulas if after
adding items in the following steps you don't see anything in the gallery.
14. Position the control to the right of the other controls:

15. Save your app. If it's the first time it has been saved, there's no need to publish it. If it's not the first time,
publish the app after you save.
16. Open your app on a device such as a phone or tablet. SaveData and LoadData can't be used in Studio or in
a web browser. Refresh your app list if you don't see your app immediately, it can take a few seconds for the
app to appear on your device. Signing out and back in to your account can help too.

Once your app has been downloaded, you can disconnect from the network and run the app offline.
17. Enter the name and take a picture of an item.
18. Select the Add Item button. Repeat adding items a couple of times to load up your collection.
19. Select the Save Data button. This will save the data in your collection to your local device.
20. Close the app. Your collection in memory will be lost including all item names and pictures, but they'll still be
there in the device's storage.
21. Launch the app again. The collection in memory will again show as empty in the gallery.

22. Select the Load Data button. The collection will be repopulated from the stored data on your device and
your items will be back in the gallery. The collection was empty before this button calls the LoadData
function; there was no need to call Collect or ClearCollect before loading the data from storage.
23. Select the Load Data button again. The stored data will be appended to the end of the collection and a scroll
bar will appear on the gallery. If you would like to replace rather than append, use the Clear function first to
clear out the collection before calling the LoadData function.

More advanced offline example


For a detailed example, see the article on simple offline capabilities.
Acceleration, App, Compass, Connection, and
Location signals in Power Apps
2/11/2020 • 4 minutes to read • Edit Online

Returns information about the app's environment, such as where the user is located in the world and which
screen is displayed.

Description and syntax


Signals are values that can change at any time, independent of how the user may be interacting with the app.
Formulas that are based on signals automatically recalculate as these values change.
Signals typically return a record of information. You can use and store this information as a record, or you can
extract individual properties by using the . operator.

NOTE
The Acceleration and Compass functions return accurate values in a native player such as on iOS or Android, but
those functions return zero values as you create or modify an app in the browser.

Acceleration
The Acceleration signal returns the device's acceleration in three dimensions relative to the device's screen.
Acceleration is measured in g units of 9.81 m/second2 or 32.2 ft/second2 (the acceleration that the Earth
imparts to objects at its surface due to gravity).

PROPERTY DESCRIPTION

Acceleration.X Right and left. Right is a positive number.

Acceleration.Y Forward and back. Forward is a positive number.

Acceleration.Z Up and down. Up is a positive number.

App
Among other properties, the App object includes a signal that indicates which screen is showing.

PROPERTY DESCRIPTION

App.ActiveScreen Screen that's showing. Returns a screen object, which you


can use to reference properties of the screen or compare
to another screen to determine which screen is showing.
You can use the Back or Navigate function to change the
screen that's showing.

More information: App object documentation.


Compass
The Compass signal returns the compass heading of the top of the screen. The heading is based on magnetic
north.
PROPERTY DESCRIPTION

Compass.Heading Heading in degrees. Returns a number 0 to 360, and 0 is


north.

Connection
The Connection signal returns the information about the network connection. When on a metered
connection, you may want to limit how much data you send or receive over the network.

PROPERTY DESCRIPTION

Connection.Connected Returns a Boolean true or false value that indicates


whether the device is connected to a network.

Connection.Metered Returns a Boolean true or false value that indicates


whether the connection is metered.

Location
The Location signal returns the location of the device based on the Global Positioning System (GPS ) and
other device information, such as cell-tower communications and IP address.
When a user accesses the location information for the first time, the device may prompt that user to allow
access to this information.
As the location changes, dependencies on the location will continuously recalculate, which will consume
power from the device's battery. To conserve battery life, you can use the Enable and Disable functions to
turn location updates on and off. Location is automatically turned off if the displayed screen doesn't depend
on location information.

PROPERTY DESCRIPTION

Location.Altitude Returns a number that indicates the altitude, measured in


feet, above sea level.

Location.Latitude Returns a number, from –90 to 90, that indicates the


latitude, as measured in degrees from the equator. A
positive number indicates a location that's north of the
equator.

Location.Longitude Returns a number, from –180 to 180, that indicates the


longitude, as measured in degrees from Greenwich,
England. A positive number indicates a location that's east
of Greenwhich.

Examples
In a baseball field, a pitcher throws a phone from the pitcher's mound to a catcher at home plate. The phone
is lying flat with respect to the ground, the top of the screen is pointed at the catcher, and the pitcher adds no
spin. At this location, the phone has cellular network service that's metered but no WiFi. The PlayBall screen
is displayed.

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Location.Latitude Returns the latitude of the current 47.591


location. The field is located at map
coordinates 47.591 N, 122.333 W. The latitude will change continuously
as the ball moves between the pitcher
and the catcher.

Location.Longitude Returns the longitude of the current 122.333


location.
The longitude will change
continuously as the ball moves
between the pitcher and the catcher.

Location Returns the latitude and longitude of { Latitude: 47.591,


the current location, as a record. Longitude: 122.333 }

Compass.Heading Returns the compass heading of the 230.25


top of the screen. At this field, home
plate is roughly southwest from the
pitcher's mound.

Acceleration.X Returns the acceleration of the device 0


side to side. The pitcher is throwing
the phone straight ahead with respect
to the screen's top, so the device isn't
accelerating side to side.

Acceleration.Y Returns the acceleration of the device 8.2, while the pitcher throws the
front to back. The pitcher initially device.
gives the device a large acceleration
when throwing the device, going from 0, while the device is in the air.
0 to 90 miles per hour (132 feet per
second) in half a second. After the -8.2, as the catcher catches the
device is in the air, ignoring air device.
friction, the device doesn't accelerate
further. The device decelerates when
the catcher catches it, bringing it to a
stop.

Acceleration.Z Returns the acceleration of the device 0, before the pitcher throws the
top to bottom. While in the air, the device.
device experiences the effects of
gravity. 1, while the device is in the air.

0, after the catcher catches the device.

Acceleration Returns the acceleration as a record. { X: 0, Y: 264, Z: 0 } as the pitcher


throws the device.

Connection.Connected Returns a Boolean value that indicates true


whether the device is connected to a
network

Connection.Metered Returns a Boolean value that indicates true


whether the connection is metered

App.ActiveScreen = PlayBall Returns a Boolean value that indicates true


whether PlayBall is displayed.
FORMULA DESCRIPTION RESULT

App.ActiveScreen.Fill Returns the background color for the Color.Green


displayed screen.
Filter, Search, and LookUp functions in Power Apps
12/3/2019 • 8 minutes to read • Edit Online

Finds one or more records in a table.

Description
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 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.
For both, the formula is evaluated for each record of the table. Records that result in true are included in the result.
Besides the normal formula operators, you can use the in and exactin operators for substring matches.
Fields of the record currently being processed are available within the formula. You simply reference them by name
as you would any other value. You can also reference control properties and other values from throughout your
app. For more details, see the examples below and working with record scope.
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.
Filter and Search return a table that contains the same columns as the original table and the records that match
the criteria. LookUp returns only the first record found, after applying a formula to reduce the record to a single
value. If no records are found, Filter and Search return an empty table, and LookUp returns blank.
Tables are a value in Power Apps, just like a string or number. They can be passed to and returned from functions.
Filter, Search, and LookUp don't modify a table. Instead, they take a table as an argument and return a table, a
record, or a single value from it. See working with tables for more details.

Delegation
When possible, Power Apps will delegate filter and sort operations to the data source and page through the results
on demand. For example, when you start an app that shows a Gallery control filled with data, only the first set of
records will be initially brought to the device. As the user scrolls, additional data is brought down from the data
source. The result is a faster start time for the app and access to very large data sets.
However, delegation may not always be possible. Data sources vary on what functions and operators they support
with delegation. If complete delegation of a formula isn't possible, the authoring environment will flag the portion
that can't be delegated with a warning. When possible, consider changing the formula to avoid functions and
operators that can't be delegated. The delegation list details which data sources and operations can be delegated.
If delegation is not possible, Power Apps will pull down only a small set of records to work on locally. Filter and sort
functions will operate on a reduced set of records. What is available in the Gallery may not be the complete story,
which could be confusing to users.
See the delegation overview for more information.

Syntax
Filter( Table, Formula1 [, Formula2, ... ] )
Table - Required. Table to search.
Formula (s) - Required. The formula by which each record of the table is evaluated. The function returns all
records that result in true. You can reference columns within the table. If you supply more than one formula, the
results of all formulas are combined with the And function.
Search( Table, SearchString, Column1 [, Column2, ... ] )
Table - Required. Table to search.
SearchString - Required. The string to search for. If blank or an empty string, all records are returned.
Column(s) - Required. The names of columns within Table to search. Columns to search must contain text.
Column names must be strings and enclosed in double quotes. However, the column names must be static and
cannot be calculated with a formula. If SearchString is found within the data of any of these columns as a partial
match, the full record will be returned.

NOTE
For SharePoint and Excel data sources that contain column names with spaces, specify each space as "_x0020_". For example,
specify "Column Name" as "Column_x0020_Name".

LookUp( Table, Formula [, ReductionFormula ] )


Table - Required. Table to search. In the UI, the syntax is shown as source above the function box.
Formula - Required. The formula by which each record of the table is evaluated. The function returns the first
record that results in true. You can reference columns within the table. In the UI, the syntax is shown as
condition above the function box.
ReductionFormula - Optional. This formula is evaluated over the record that was found, and then reduces the
record to a single value. You can reference columns within the table. If you don't use this parameter, the function
returns the full record from the table. In the UI, the syntax is shown as result above the function box.

Examples
The following examples use the IceCream data source:

FORMULA DESCRIPTION RESULT

Filter( IceCream, OnOrder > 0 ) Returns records where OnOrder is


greater than zero.

Filter( IceCream, Quantity + Returns records where the sum of


OnOrder > 225 ) Quantity and OnOrder columns is
greater than 225.
FORMULA DESCRIPTION RESULT

Filter( IceCream, "chocolate" in Returns records where the word


Lower( Flavor ) ) "chocolate" appears in the Flavor name,
independent of uppercase or lowercase
letters.

Filter( IceCream, Quantity < 10 && Returns records where the Quantity is
OnOrder < 20 ) less than 10 and OnOrder is less than
20. No records match these criteria, so
an empty table is returned.

Search( IceCream, "choc", "Flavor" ) Returns records where the string "choc"
appears in the Flavor name,
independent of uppercase or lowercase
letters.

Search( IceCream, "", "Flavor" ) Because the search term is empty, all
records are returned.

LookUp( IceCream, Flavor = Searches for a record with Flavor equal 100
"Chocolate", Quantity ) to "Chocolate", of which there is one.
For the first record that's found, returns
the Quantity of that record.

LookUp( IceCream, Quantity > 150, Searches for a record with Quantity 250
Quantity + OnOrder ) greater than 100, of which there are
multiple. For the first record that's
found, which is "Vanilla" Flavor, returns
the sum of Quantity and OnOrder
columns.

LookUp( IceCream, Flavor = Searches for a record with Flavor equal blank
"Pistachio", OnOrder ) to "Pistachio", of which there are none.
Because none were found, Lookup
returns blank.

LookUp( IceCream, Flavor = Searches for a record with Flavor equal { Flavor: "Vanilla", Quantity: 200,
"Vanilla" ) to "Vanilla", of which there is one. Since OnOrder: 75 }
no reduction formula was supplied, the
entire record is returned.

Search user experience


In many apps, you can type one or more characters into a search box to filter a list of records in a large data set. As
you type, the list shows only those records that match the search criteria.
The examples in the rest of this topic show the results of searching a list, named Customers, that contains this data:
To create this data source as a collection, create a Button control and set its OnSelect property to this formula:
ClearCollect( Customers, Table( { Name: "Fred Garcia", Company: "Northwind Traders" }, { Name: "Cole
Miller", Company: "Contoso" }, { Name: "Glenda Johnson", Company: "Contoso" }, { Name: "Mike
Collins", Company: "Adventure Works" }, { Name: "Colleen Jones", Company: "Adventure Works" } ) )
As in this example, you can show a list of records in a Gallery control at the bottom of a screen. Near the top of
the screen, you can add a Text input control, named SearchInput, so that users can specify which records interest
them.

As the user types characters in SearchInput, the results in the gallery are automatically filtered. In this case, the
gallery is configured to show records for which the name of the customer (not the name of the company) starts
with the sequence of characters in SearchInput. If the user types co in the search box, the gallery shows these
results:
To filter based on the Name column, set the Items property of the gallery control to one of these formulas:

FORMULA DESCRIPTION RESULT

Filter( Customers, StartsWith( Name, Filters the Customers data source for
SearchInput.Text ) ) records in which the search string
appears at the start of the Name
column. The test is case insensitive. If
the user types co in the search box, the
gallery shows Colleen Jones and Cole
Miller. The gallery doesn't show Mike
Collins because the Name column for
that record doesn't start with the search
string.

Filter( Customers, SearchInput.Text Filters the Customers data source for


in Name ) records in which the search string
appears anywhere in the Name column.
The test is case insensitive. If the user
types co in the search box, the gallery
shows Colleen Jones, Cole Miller, and
Mike Collins because the search string
appears somewhere in the Name
column of all of those records.

Search( Customers, Similar to using the in operator, the


SearchInput.Text, "Name" ) Search function searches for a match
anywhere within the Name column of
each record. Note that you must
enclose the column name in double
quotation marks.

You can expand your search to include the Company column as well as the Name column:

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Filter( Customers, StartsWith( Name, Filters the Customers data source for
SearchInput.Text ) || StartsWith( records in which either the Name
Company, SearchInput.Text ) ) column or the Company column starts
with the search string (for example, co).
The || operator is true if either
StartsWith function is true.

Filter( Customers, SearchInput.Text Filters the Customers data source for


in Name || SearchInput.Text in records in which either the Name
Company ) column or the Company column
contains the search string (for example,
co) anywhere within it.

Search( Customers, Similar to using the in operator, the


SearchInput.Text, "Name", Search function searches the
"Company" ) Customers data source for records in
which either the Name column or the
Company column contains the search
string (for example, co) anywhere within
it. The Search function is easier to read
and write than Filter if you want to
specify multiple columns and multiple in
operators. Note that you must enclose
the names of the columns in double
quotation marks.
Lower, Upper, and Proper functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Converts letters in a string of text to all lowercase, all uppercase, or proper case.

Description
The Lower, Upper, and Proper functions convert the case of letters in strings.
Lower converts any uppercase letters to lowercase.
Upper converts any lowercase letters to uppercase.
Proper converts the first letter in each word to uppercase if it's lowercase and converts any other uppercase
letters to lowercase.
All three functions ignore characters that aren't letters.
If you pass a single string, the return value is the converted version of that string. If you pass a single-column table
that contains strings, the return value is a single-column table of converted strings. If you have a multi-column
table, you can shape it into a single-column table, as working with tables describes.

Syntax
Lower( String )
Upper( String )
Proper( String )
String - Required. The string to convert.
Lower( SingleColumnTable )
Upper( SingleColumnTable )
Proper( SingleColumnTable )
SingleColumnTable - Required. A single-column table of strings to convert.

Examples
Single string
The examples in this section use a text-input control, named Author, as their data source. The control contains the
string "E. E. CummINGS".

FORMULA DESCRIPTION RESULT

Lower( Author.Text ) Converts any uppercase letters in the "e. e. cummings"


string to lowercase.

Upper( Author.Text ) Converts any lowercase letters in the "E. E. CUMMINGS"


string to uppercase.

Proper( Author.Text ) Converts the first letter of each word to "E. E. Cummings"
uppercase if it's lowercase, and converts
any other uppercase letters to
lowercase.
Single -column table
The examples in this section convert strings from the Address column of the People data source, which contains
this data:

Each formula returns a single-column table that contains the converted strings.

FORMULA DESCRIPTION RESULT

Lower( Converts any letter that's lowercase to


ShowColumns( People, "Address" ) ) uppercase.

Upper( Converts any letter that's lowercase to


ShowColumns( People, "Address" ) ) uppercase.

Proper( Converts any first letter of a word that's


ShowColumns( People, "Address" ) ) lowercase to uppercase, and converts
any other letter that's uppercase to
lowercase.

Step-by-step example
1. Add a Text input control, and name it Source.
2. Add a label, and set its Text property to this function:
Proper(Source.Text)
3. Press F5, and then type WE ARE THE BEST! into the Source box.
The label shows We Are The Best!
IsMatch, Match, and MatchAll functions in Power Apps
2/8/2020 • 12 minutes to read • Edit Online

Tests for a match or extracts portions of a text string based on a pattern.

Description
The IsMatch function tests whether a text string matches a pattern that can comprise ordinary characters, predefined patterns, or a
regular expression. The Match and MatchAll functions return what was matched, including sub-matches.
Use IsMatch to validate what a user has typed in a Text input control. For example, you can confirm whether the user has entered a
valid email address before the result is saved to your data source. If the entry doesn't match your criteria, add other controls that prompt
the user to correct the entry.
Use Match to extract the first text string that matches a pattern and MatchAll to extract all text strings that match. You can also extract
sub-matches to parse complex strings.
Match returns a record of information for the first match found, and MatchAll returns a table of records for every match found. The
record or records contain:

COLUMN TYPE DESCRIPTION

named sub‑match or sub‑matches Text Each named sub-match will have its own
column. Create a named sub-match by using (?
<name>...) in the regular expression. If a named
sub-match has the same name as one of the
predefined columns (below), the sub-match
takes precedence, and a warning is generated.
To avoid this warning, rename the sub-match.

FullMatch Text All of the text string that was matched.

StartMatch Number The starting position of the match within the


input text string. The first character of the string
returns 1.

SubMatches Single-column table of Text (column Value) The table of named and unnamed sub-matches
in the order in which they appear in the regular
expression. Generally, named sub-matches are
easier to work with and are encouraged. Use the
ForAll function or Last( FirstN( ... ) ) functions
to work with an individual sub-match. If no sub-
matches are defined in the regular expression,
this table will be present but empty.

These functions support MatchOptions. By default:


These functions perform a case-sensitive match. Use IgnoreCase to perform case-insensitive matches.
IsMatch matches the entire text string (Complete MatchOption), while Match and MatchAll search for a match anywhere in the
text string (Contains MatchOption). Use Complete, Contains, BeginsWith, or EndsWith as appropriate for your scenario.
IsMatch returns true if the text string matches the pattern or false if it doesn't. Match returns blank if no match is found that can be
tested with the IsBlank function. MatchAll returns an empty table if no match is found that can be tested with the IsEmpty function.
If you're using MatchAll to split a text string, consider using the Split function, which is simpler to use and faster.

Patterns
The key to using these functions is in describing the pattern to match. You describe the pattern in a text string as a combination of:
Ordinary characters, such as "abc" or "123".
Predefined patterns, such as Letter, MultipleDigits, or Email. (The Match enum defines these patterns.)
Regular-expression codes, such as "\d+\s+\d+" or "[a-z]+".
Combine these elements by using the string-concatenation operator &. For example, "abc" & Digit & "\s+" is a valid pattern that
matches the characters "a", "b", and "c", followed by a digit from 0 to 9, followed by at least one whitespace character.
Ordinary characters
The simplest pattern is a sequence of ordinary characters to be matched exactly.
For example, when used with the IsMatch function, the string "Hello" matches the pattern "Hello" exactly. No more and no less. The
string "hello!" doesn't match the pattern because of the exclamation point on the end and because the case is wrong for the letter "h".
(See MatchOptions for ways to modify this behavior.)
In the pattern language, certain characters are reserved for special purposes. To use these characters, either prefix the character with a \
(backslash) to indicate that the character should be taken literally, or use one of the predefined patterns described later in this topic. This
table lists the special characters:

SPECIAL CHARACTER DESCRIPTION

. dot or period

? question mark

* asterisk

+ plus

() parentheses

[] square brackets

{} curly braces

^ caret

$ dollar sign

| vertical bar or pipe

\ backslash

For example, you can match "Hello?" by using the pattern "Hello\?" with a backslash before the question mark.
Predefined patterns
Predefined patterns provide a simple way to match either one of a set of characters or a sequence of multiple characters. Use the string-
concatenation operator & to combine your own text strings with members of the Match enum:

MATCH ENUM DESCRIPTION REGULAR EXPRESSION

Any Matches any character. .

Comma Matches a comma. ,

Digit Matches a single digit ("0" through "9"). \d

Email Matches an email address that contains an "at" .+\@.+\\.[^\\.]{2,}


symbol ("@") and a domain name that contains
a dot (".")

Hyphen Matches a hyphen. \-

LeftParen Matches a left parenthesis "(". \(

Letter Matches a letter. \p{L}

MultipleDigits Matches one or more digits. \d+


MATCH ENUM DESCRIPTION REGULAR EXPRESSION

MultipleLetters Matches one or more letters. \p{L}+

MultipleNonSpaces Matches one or more characters that don't add \S+


whitespace (not space, tab, or newline).

MultipleSpaces Matches one or more characters that add \s+


whitespace (space, tab, or newline).

NonSpace Matches a single character that doesn't add \S


whitespace.

OptionalDigits Matches zero, one, or more digits. \d*

OptionalLetters Matches zero, one, or more letters. \p{L}*

OptionalNonSpaces Matches zero, one, or more characters that \S*


don't add whitespace.

OptionalSpaces Matches zero, one, or more characters that add \s*


whitespace.

Period Matches a period or dot ("."). \.

RightParen Matches a right parenthesis ")". \)

Space Matches a character that adds whitespace. \s

For example, the pattern "A" & MultipleDigits will match the letter "A" followed by one or more digits.
Regular expressions
The pattern that these functions use is a regular expression. The ordinary characters and predefined patterns that are described earlier in
this topic help build regular expressions.
Regular expressions are very powerful, available in many programming languages, and used for a wide variety of purposes. They can
also often look like a random sequence of punctuation marks. This article doesn't describe all aspects of regular expressions, but a wealth
of information, tutorials, and tools are available on the web.
Regular expressions come in different dialects, and Power Apps uses a variant of the JavaScript dialect. See regular-expression syntax for
an introduction to the syntax. Named sub-matches (sometimes called named capture groups) are supported:
Named sub-matches: (?<name> ...)
Named backreferences: \k<name>
In the Match enum table earlier in this topic, each enum appears in the same row as its corresponding regular expression.

Match options
You can modify the behavior of these functions by specifying one or more options, which you can combine by using the string-
concatenation operator (& ).

MATCHOPTIONS ENUM DESCRIPTION IMPACT ON A REGULAR EXPRESSION

BeginsWith The pattern must match from the beginning of Adds a ^ to the start of the regular expression.
the text.

Complete Default for IsMatch. The pattern must match Adds a ^ to the start and a $ to the end of the
the entire string of text, from beginning to end. regular expression.

Contains Default for Match and MatchAll. The pattern Doesn't modify the regular expression.
must appear somewhere in the text but doesn't
need to begin or end it.
MATCHOPTIONS ENUM DESCRIPTION IMPACT ON A REGULAR EXPRESSION

EndsWith The pattern must match the end of the string of Adds a $ to the end of the regular expression.
text.

IgnoreCase Treats uppercase and lowercase letters as Doesn't modify the regular expression. This
identical. By default, matching is case sensitive. option is the equivalent of the standard "i"
modifier for regular expressions.

Multiline Matches across multiple lines. Doesn't modify the regular expression. This
option is the equivalent of the standard "m"
modifier for regular expressions.

Using MatchAll is equivalent to using the standard "g" modifier for regular expressions.

Syntax
IsMatch( Text, Pattern [, Options ] )
Text – Required. The text string to test.
Pattern – Required. The pattern to test as a text string. Concatenate predefined patterns that the Match enum defines, or provide a
regular expression. Pattern must be a constant formula without any variables, data sources, or other dynamic references that change
as the app runs.
Options – Optional. A text-string combination of MatchOptions enum values. By default, MatchOptions.Complete is used.
Match( Text, Pattern [, Options ] )
Text – Required. The text string to match.
Pattern – Required. The pattern to match as a text string. Concatenate predefined patterns that the Match enum defines, or provide a
regular expression. Pattern must be a constant formula without any variables, data sources, or other dynamic references that change
as the app runs.
Options – Optional. A text-string combination of MatchOptions enum values. By default, MatchOptions.Contains is used.
MatchAll( Text, Pattern [, Options ] )
Text – Required. The text string to match.
Pattern – Required. The pattern to match as a text string. Concatenate predefined patterns that the Match enum defines, or provide a
regular expression. Pattern must be a constant formula without any variables, data sources, or other dynamic references that change
as the app runs.
Options – Optional. A text-string combination of MatchOptions enum values. By default, MatchOptions.Contains is used.

IsMatch examples
Ordinary characters
Imagine that your app contains a Text input control named TextInput1. The user enters values into this control to be stored in a
database.
The user types Hello world into TextInput1.

FORMULA DESCRIPTION RESULT

IsMatch( TextInput1.Text, "Hello world" Tests whether the user's input matches, exactly, true
) the string "Hello world".

IsMatch( TextInput1.Text, "Good bye" ) Tests whether the user's input matches, exactly, false
the string "Good bye".

IsMatch( TextInput1.Text, "hello", Tests whether the user's input contains the word false
Contains ) "hello" (case sensitive).

IsMatch( TextInput1.Text, "hello", Tests whether the user's input contains the word true
Contains & IgnoreCase ) "hello" (case insensitive).

Predefined patterns
FORMULA DESCRIPTION RESULT

IsMatch( "123-45-7890", Digit & Digit & Matches a United States Social Security Number true
Digit & Hyphen & Digit & Digit & Hyphen
& Digit & Digit & Digit & Digit )

IsMatch( "joan@contoso.com", Email ) Matches an email address true

IsMatch( "123.456", MultipleDigits & Matches a sequence of digits, a period, and then true
Period & OptionalDigits ) zero or more digits.

IsMatch( "123", MultipleDigits & Period Matches a sequence of digits, a period, and then false
& OptionalDigits ) zero or more digits. A period doesn't appear in
the text to match, so this pattern isn't matched.

Regular expressions
FORMULA DESCRIPTION RESULT

IsMatch( "986", "\d+" ) Matches an integer greater than zero. true

IsMatch( "1.02", "\d+(\.\d\d)?" ) Matches a positive currency amount. If the true


input contains a decimal point, the input must
also contain two numeric characters after the
decimal point. For example, 3.00 is valid, but 3.1
isn't.

IsMatch( "-4.95", "(-)?\d+(\.\d\d)?" ) Matches a positive or negative currency true


amount. If the input contains a decimal point,
the input must also contain two numeric
characters after the decimal point.

IsMatch( "111-11-1111", "\d{3}-\d{2}- Matches a United States Social Security number. true
\d{4}" ) Validates the format, type, and length of the
supplied input field. The string to match must
consist of three numeric characters followed by
a dash, then two numeric characters followed by
a dash, and then four numeric characters.

IsMatch( "111-111-111", "\d{3}-\d{2}- Same as the previous example, but one of the false
\d{4}" ) hyphens is out of place in the input.

IsMatch( "AStrongPasswordNot", "(?!^[0- Validates a strong password, which must false


9]\*$)(?!^[a-zA-Z]\*$)([a-zA-Z0-9] contain eight, nine, or 10 characters, in addition
{8,10})" )
to at least one digit and at least one alphabetic
character. The string must not contain special
characters.

Match and MatchAll examples


FORMULA DESCRIPTION RESULT

Match( "Bob Jones Extracts only the email portion of the contact {
<bob.jones@contoso.com>", "<(?<email>" & information. email: "bob.jones@contoso.com",
Match.Email & ")>"
FullMatch: "<bob.jones@contoso.com>",
SubMatches: [ "bob.jones@contoso.com" ],
StartMatch: 11
}

Match( "Bob Jones Extracts only the email portion of the contact blank
<InvalidEmailAddress>", "<(?<email>" & information. No legal address is found (there is
Match.Email & ")>"
no @ sign), so the function returns blank.
FORMULA DESCRIPTION RESULT

Match( Language(), "(<language>\w{2}) Extracts the language, script, and region {


(?:-(?<script>\w{4}))?(?:-(? portions of the language tag that the language: "en",
<region>\w{2}))?" )
Language function returns. These results reflect script: blank,
the United States; see the Language function region: "US",
documentation for more examples. The (?: FullMatch: "en-US",
operator groups characters without creating SubMatches: [ "en", "", "US" ],
another sub-match. StartMatch: 1
}

Match( "PT2H1M39S", "PT(?:<hours>\d+)H)? Extracts the hours, minutes, and seconds from {
(?:(?<minutes>\d+)M)?(?:(? an ISO 8601 duration value. The extracted hours: "2",
<seconds>\d+)S)?" )
numbers are still in a text string; use the Value minutes: "1",
function to convert it to a number before seconds: "39",
mathematical operations are performed on it. FullMatch: "PT2H1M39S",
SubMatches: [ "2", "1", "39" ],
StartMatch: 1
}

Let's drill into that last example. If you wanted to convert this string to a date/time value using the Time function, you must pass in the
named sub-matches individually. To do this, you can use the With function operating on the record that Match returns:

With(
Match( "PT2H1M39S", "PT(?:(?<hours>\d+)H)?(?:(?<minutes>\d+)M)?(?:(?<seconds>\d+)S)?" ),
Time( Value( hours ), Value( minutes ), Value( seconds ) )
)

For these examples, add a Button control, set its OnSelect property to this formula, and then select the button:

Set( pangram, "The quick brown fox jumps over the lazy dog." )

FORMULA DESCRIPTION RESULT

Match( pangram, "THE", IgnoreCase ) Find all matches of "THE" in the text string that {
the pangram variable contains. The string FullMatch: "The",
contains two matches, but only the first is SubMatches: [ ],
returned because you're using Match and not StartMatch: 32
MatchAll. The SubMatches column is empty }
because no sub-matches were defined.

MatchAll( pangram, "the" ) Find all matches of "the" in the text string that
the pangram variable contains. The test is case
sensitive, so only the second instance of "the" is
found. The SubMatches column is empty
because no sub-matches were defined.

MatchAll( pangram, "the", IgnoreCase ) Find all matches of "the" in the text string that
the pangram variable contains. In this case, the
test is case insensitive, so both instances of the
word are found. The SubMatches column is
empty because no sub-matches were defined.

MatchAll( pangram, "\b\wo\w\b" ) Finds all three-letter words with an "o" in the
middle. Note that "brown" is excluded because
it's not a three-letter word and, therefore, fails
to match "\b" (word boundary).

Match( pangram, "\b\wo\w\b\s\*(? Matches all the characters between "fox" and {
<between>\w.+\w)\s\*\b\wo\w\b" ) "dog". between: "jumps over the lazy",
FullMatch: "fox jumps over the lazy dog",
SubMatches: [ "jumps over the lazy" ],
StartMatch: 17
}

To see the results of MatchAll in a gallery:


1. In an empty screen, insert a blank vertical Gallery control.
2. Set the gallery's Items property to MatchAll( pangram, "\w+" ) or MatchAll( pangram, MultipleLetters ).

3. Select "Add an item from the Insert tab" in the middle of the gallery control to select the template of the gallery.
4. Add a Label control to the gallery's template.
5. Set the label's Text property to ThisItem.FullMatch.
The gallery is filled with each word in our example text. Resize the gallery's template and the label control in order to see all the
words on one screen.
IsMatch, Match, and MatchAll functions in Power Apps
2/8/2020 • 12 minutes to read • Edit Online

Tests for a match or extracts portions of a text string based on a pattern.

Description
The IsMatch function tests whether a text string matches a pattern that can comprise ordinary characters, predefined patterns, or a
regular expression. The Match and MatchAll functions return what was matched, including sub-matches.
Use IsMatch to validate what a user has typed in a Text input control. For example, you can confirm whether the user has entered a
valid email address before the result is saved to your data source. If the entry doesn't match your criteria, add other controls that prompt
the user to correct the entry.
Use Match to extract the first text string that matches a pattern and MatchAll to extract all text strings that match. You can also extract
sub-matches to parse complex strings.
Match returns a record of information for the first match found, and MatchAll returns a table of records for every match found. The
record or records contain:

COLUMN TYPE DESCRIPTION

named sub‑match or sub‑matches Text Each named sub-match will have its own
column. Create a named sub-match by using (?
<name>...) in the regular expression. If a named
sub-match has the same name as one of the
predefined columns (below), the sub-match
takes precedence, and a warning is generated.
To avoid this warning, rename the sub-match.

FullMatch Text All of the text string that was matched.

StartMatch Number The starting position of the match within the


input text string. The first character of the string
returns 1.

SubMatches Single-column table of Text (column Value) The table of named and unnamed sub-matches
in the order in which they appear in the regular
expression. Generally, named sub-matches are
easier to work with and are encouraged. Use the
ForAll function or Last( FirstN( ... ) ) functions
to work with an individual sub-match. If no sub-
matches are defined in the regular expression,
this table will be present but empty.

These functions support MatchOptions. By default:


These functions perform a case-sensitive match. Use IgnoreCase to perform case-insensitive matches.
IsMatch matches the entire text string (Complete MatchOption), while Match and MatchAll search for a match anywhere in the
text string (Contains MatchOption). Use Complete, Contains, BeginsWith, or EndsWith as appropriate for your scenario.
IsMatch returns true if the text string matches the pattern or false if it doesn't. Match returns blank if no match is found that can be
tested with the IsBlank function. MatchAll returns an empty table if no match is found that can be tested with the IsEmpty function.
If you're using MatchAll to split a text string, consider using the Split function, which is simpler to use and faster.

Patterns
The key to using these functions is in describing the pattern to match. You describe the pattern in a text string as a combination of:
Ordinary characters, such as "abc" or "123".
Predefined patterns, such as Letter, MultipleDigits, or Email. (The Match enum defines these patterns.)
Regular-expression codes, such as "\d+\s+\d+" or "[a-z]+".
Combine these elements by using the string-concatenation operator &. For example, "abc" & Digit & "\s+" is a valid pattern that
matches the characters "a", "b", and "c", followed by a digit from 0 to 9, followed by at least one whitespace character.
Ordinary characters
The simplest pattern is a sequence of ordinary characters to be matched exactly.
For example, when used with the IsMatch function, the string "Hello" matches the pattern "Hello" exactly. No more and no less. The
string "hello!" doesn't match the pattern because of the exclamation point on the end and because the case is wrong for the letter "h".
(See MatchOptions for ways to modify this behavior.)
In the pattern language, certain characters are reserved for special purposes. To use these characters, either prefix the character with a \
(backslash) to indicate that the character should be taken literally, or use one of the predefined patterns described later in this topic. This
table lists the special characters:

SPECIAL CHARACTER DESCRIPTION

. dot or period

? question mark

* asterisk

+ plus

() parentheses

[] square brackets

{} curly braces

^ caret

$ dollar sign

| vertical bar or pipe

\ backslash

For example, you can match "Hello?" by using the pattern "Hello\?" with a backslash before the question mark.
Predefined patterns
Predefined patterns provide a simple way to match either one of a set of characters or a sequence of multiple characters. Use the string-
concatenation operator & to combine your own text strings with members of the Match enum:

MATCH ENUM DESCRIPTION REGULAR EXPRESSION

Any Matches any character. .

Comma Matches a comma. ,

Digit Matches a single digit ("0" through "9"). \d

Email Matches an email address that contains an "at" .+\@.+\\.[^\\.]{2,}


symbol ("@") and a domain name that contains
a dot (".")

Hyphen Matches a hyphen. \-

LeftParen Matches a left parenthesis "(". \(

Letter Matches a letter. \p{L}

MultipleDigits Matches one or more digits. \d+

MultipleLetters Matches one or more letters. \p{L}+


MATCH ENUM DESCRIPTION REGULAR EXPRESSION

MultipleNonSpaces Matches one or more characters that don't add \S+


whitespace (not space, tab, or newline).

MultipleSpaces Matches one or more characters that add \s+


whitespace (space, tab, or newline).

NonSpace Matches a single character that doesn't add \S


whitespace.

OptionalDigits Matches zero, one, or more digits. \d*

OptionalLetters Matches zero, one, or more letters. \p{L}*

OptionalNonSpaces Matches zero, one, or more characters that \S*


don't add whitespace.

OptionalSpaces Matches zero, one, or more characters that add \s*


whitespace.

Period Matches a period or dot ("."). \.

RightParen Matches a right parenthesis ")". \)

Space Matches a character that adds whitespace. \s

For example, the pattern "A" & MultipleDigits will match the letter "A" followed by one or more digits.
Regular expressions
The pattern that these functions use is a regular expression. The ordinary characters and predefined patterns that are described earlier in
this topic help build regular expressions.
Regular expressions are very powerful, available in many programming languages, and used for a wide variety of purposes. They can
also often look like a random sequence of punctuation marks. This article doesn't describe all aspects of regular expressions, but a wealth
of information, tutorials, and tools are available on the web.
Regular expressions come in different dialects, and Power Apps uses a variant of the JavaScript dialect. See regular-expression syntax for
an introduction to the syntax. Named sub-matches (sometimes called named capture groups) are supported:
Named sub-matches: (?<name> ...)
Named backreferences: \k<name>
In the Match enum table earlier in this topic, each enum appears in the same row as its corresponding regular expression.

Match options
You can modify the behavior of these functions by specifying one or more options, which you can combine by using the string-
concatenation operator (& ).

MATCHOPTIONS ENUM DESCRIPTION IMPACT ON A REGULAR EXPRESSION

BeginsWith The pattern must match from the beginning of Adds a ^ to the start of the regular expression.
the text.

Complete Default for IsMatch. The pattern must match Adds a ^ to the start and a $ to the end of the
the entire string of text, from beginning to end. regular expression.

Contains Default for Match and MatchAll. The pattern Doesn't modify the regular expression.
must appear somewhere in the text but doesn't
need to begin or end it.

EndsWith The pattern must match the end of the string of Adds a $ to the end of the regular expression.
text.
MATCHOPTIONS ENUM DESCRIPTION IMPACT ON A REGULAR EXPRESSION

IgnoreCase Treats uppercase and lowercase letters as Doesn't modify the regular expression. This
identical. By default, matching is case sensitive. option is the equivalent of the standard "i"
modifier for regular expressions.

Multiline Matches across multiple lines. Doesn't modify the regular expression. This
option is the equivalent of the standard "m"
modifier for regular expressions.

Using MatchAll is equivalent to using the standard "g" modifier for regular expressions.

Syntax
IsMatch( Text, Pattern [, Options ] )
Text – Required. The text string to test.
Pattern – Required. The pattern to test as a text string. Concatenate predefined patterns that the Match enum defines, or provide a
regular expression. Pattern must be a constant formula without any variables, data sources, or other dynamic references that change
as the app runs.
Options – Optional. A text-string combination of MatchOptions enum values. By default, MatchOptions.Complete is used.
Match( Text, Pattern [, Options ] )
Text – Required. The text string to match.
Pattern – Required. The pattern to match as a text string. Concatenate predefined patterns that the Match enum defines, or provide a
regular expression. Pattern must be a constant formula without any variables, data sources, or other dynamic references that change
as the app runs.
Options – Optional. A text-string combination of MatchOptions enum values. By default, MatchOptions.Contains is used.
MatchAll( Text, Pattern [, Options ] )
Text – Required. The text string to match.
Pattern – Required. The pattern to match as a text string. Concatenate predefined patterns that the Match enum defines, or provide a
regular expression. Pattern must be a constant formula without any variables, data sources, or other dynamic references that change
as the app runs.
Options – Optional. A text-string combination of MatchOptions enum values. By default, MatchOptions.Contains is used.

IsMatch examples
Ordinary characters
Imagine that your app contains a Text input control named TextInput1. The user enters values into this control to be stored in a
database.
The user types Hello world into TextInput1.

FORMULA DESCRIPTION RESULT

IsMatch( TextInput1.Text, "Hello world" Tests whether the user's input matches, exactly, true
) the string "Hello world".

IsMatch( TextInput1.Text, "Good bye" ) Tests whether the user's input matches, exactly, false
the string "Good bye".

IsMatch( TextInput1.Text, "hello", Tests whether the user's input contains the word false
Contains ) "hello" (case sensitive).

IsMatch( TextInput1.Text, "hello", Tests whether the user's input contains the word true
Contains & IgnoreCase ) "hello" (case insensitive).

Predefined patterns
FORMULA DESCRIPTION RESULT

IsMatch( "123-45-7890", Digit & Digit & Matches a United States Social Security Number true
Digit & Hyphen & Digit & Digit & Hyphen
& Digit & Digit & Digit & Digit )
FORMULA DESCRIPTION RESULT

IsMatch( "joan@contoso.com", Email ) Matches an email address true

IsMatch( "123.456", MultipleDigits & Matches a sequence of digits, a period, and then true
Period & OptionalDigits ) zero or more digits.

IsMatch( "123", MultipleDigits & Period Matches a sequence of digits, a period, and then false
& OptionalDigits ) zero or more digits. A period doesn't appear in
the text to match, so this pattern isn't matched.

Regular expressions
FORMULA DESCRIPTION RESULT

IsMatch( "986", "\d+" ) Matches an integer greater than zero. true

IsMatch( "1.02", "\d+(\.\d\d)?" ) Matches a positive currency amount. If the true


input contains a decimal point, the input must
also contain two numeric characters after the
decimal point. For example, 3.00 is valid, but 3.1
isn't.

IsMatch( "-4.95", "(-)?\d+(\.\d\d)?" ) Matches a positive or negative currency true


amount. If the input contains a decimal point,
the input must also contain two numeric
characters after the decimal point.

IsMatch( "111-11-1111", "\d{3}-\d{2}- Matches a United States Social Security number. true
\d{4}" ) Validates the format, type, and length of the
supplied input field. The string to match must
consist of three numeric characters followed by
a dash, then two numeric characters followed by
a dash, and then four numeric characters.

IsMatch( "111-111-111", "\d{3}-\d{2}- Same as the previous example, but one of the false
\d{4}" ) hyphens is out of place in the input.

IsMatch( "AStrongPasswordNot", "(?!^[0- Validates a strong password, which must false


9]\*$)(?!^[a-zA-Z]\*$)([a-zA-Z0-9] contain eight, nine, or 10 characters, in addition
{8,10})" )
to at least one digit and at least one alphabetic
character. The string must not contain special
characters.

Match and MatchAll examples


FORMULA DESCRIPTION RESULT

Match( "Bob Jones Extracts only the email portion of the contact {
<bob.jones@contoso.com>", "<(?<email>" & information. email: "bob.jones@contoso.com",
Match.Email & ")>"
FullMatch: "<bob.jones@contoso.com>",
SubMatches: [ "bob.jones@contoso.com" ],
StartMatch: 11
}

Match( "Bob Jones Extracts only the email portion of the contact blank
<InvalidEmailAddress>", "<(?<email>" & information. No legal address is found (there is
Match.Email & ")>"
no @ sign), so the function returns blank.

Match( Language(), "(<language>\w{2}) Extracts the language, script, and region {


(?:-(?<script>\w{4}))?(?:-(? portions of the language tag that the language: "en",
<region>\w{2}))?" )
Language function returns. These results reflect script: blank,
the United States; see the Language function region: "US",
documentation for more examples. The (?: FullMatch: "en-US",
operator groups characters without creating SubMatches: [ "en", "", "US" ],
another sub-match. StartMatch: 1
}
FORMULA DESCRIPTION RESULT

Match( "PT2H1M39S", "PT(?:<hours>\d+)H)? Extracts the hours, minutes, and seconds from {
(?:(?<minutes>\d+)M)?(?:(? an ISO 8601 duration value. The extracted hours: "2",
<seconds>\d+)S)?" )
numbers are still in a text string; use the Value minutes: "1",
function to convert it to a number before seconds: "39",
mathematical operations are performed on it. FullMatch: "PT2H1M39S",
SubMatches: [ "2", "1", "39" ],
StartMatch: 1
}

Let's drill into that last example. If you wanted to convert this string to a date/time value using the Time function, you must pass in the
named sub-matches individually. To do this, you can use the With function operating on the record that Match returns:

With(
Match( "PT2H1M39S", "PT(?:(?<hours>\d+)H)?(?:(?<minutes>\d+)M)?(?:(?<seconds>\d+)S)?" ),
Time( Value( hours ), Value( minutes ), Value( seconds ) )
)

For these examples, add a Button control, set its OnSelect property to this formula, and then select the button:

Set( pangram, "The quick brown fox jumps over the lazy dog." )

FORMULA DESCRIPTION RESULT

Match( pangram, "THE", IgnoreCase ) Find all matches of "THE" in the text string that {
the pangram variable contains. The string FullMatch: "The",
contains two matches, but only the first is SubMatches: [ ],
returned because you're using Match and not StartMatch: 32
MatchAll. The SubMatches column is empty }
because no sub-matches were defined.

MatchAll( pangram, "the" ) Find all matches of "the" in the text string that
the pangram variable contains. The test is case
sensitive, so only the second instance of "the" is
found. The SubMatches column is empty
because no sub-matches were defined.

MatchAll( pangram, "the", IgnoreCase ) Find all matches of "the" in the text string that
the pangram variable contains. In this case, the
test is case insensitive, so both instances of the
word are found. The SubMatches column is
empty because no sub-matches were defined.

MatchAll( pangram, "\b\wo\w\b" ) Finds all three-letter words with an "o" in the
middle. Note that "brown" is excluded because
it's not a three-letter word and, therefore, fails
to match "\b" (word boundary).

Match( pangram, "\b\wo\w\b\s\*(? Matches all the characters between "fox" and {
<between>\w.+\w)\s\*\b\wo\w\b" ) "dog". between: "jumps over the lazy",
FullMatch: "fox jumps over the lazy dog",
SubMatches: [ "jumps over the lazy" ],
StartMatch: 17
}

To see the results of MatchAll in a gallery:


1. In an empty screen, insert a blank vertical Gallery control.
2. Set the gallery's Items property to MatchAll( pangram, "\w+" ) or MatchAll( pangram, MultipleLetters ).
3. Select "Add an item from the Insert tab" in the middle of the gallery control to select the template of the gallery.
4. Add a Label control to the gallery's template.
5. Set the label's Text property to ThisItem.FullMatch.
The gallery is filled with each word in our example text. Resize the gallery's template and the label control in order to see all the
words on one screen.
Average, Max, Min, StdevP, Sum, and VarP functions
in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Aggregate functions that summarize a set of numbers.

Description
The Average function calculates the average, or arithmetic mean, of its arguments.
The Max function finds the maximum value.
The Min function finds the minimum value.
The Sum function calculates the sum of its arguments.
The StdevP function calculates the standard deviation of its arguments.
The VarP function calculates the variance of its arguments.
You can supply the values for these functions as:
Separate arguments. For example, Sum ( 1, 2, 3 ) returns 6.
A table and a formula to operate over that table. The aggregate will be calculated on the values of the formula
for each record.
Fields of the record currently being processed are available within the formula. You simply reference them by name
as you would any other value. You can also reference control properties and other values from throughout your
app. For more details, see the examples below and working with record scope.
These functions operate on numeric values only. Other types of values, such as strings or records, are ignored. Use
the Value function to convert a string into a number.
The Average, Max, Min, and Sum functions can be delegated when used with a data source that supports
delegation for these functions. However, StdevP and VarP can't be delegated for any data sources. If delegation is
not supported, only the first portion of the data will be retrieved and then the function applied locally. The result
may not represent the complete story. A delegation warning will appear at authoring time to remind you of this
limitation and to suggest switching to delegable alternatives where possible. For more information, see the
delegation overview.

Syntax
Average( NumericalFormula1, [ NumericalFormula2, ... ] )
Max( NumericalFormula1, [ NumericalFormula2, ... ] )
Min( NumericalFormula1, [ NumericalFormula2, ... ] )
Sum ( NumericalFormula1, [ NumericalFormula2, ... ] )
StdevP ( NumericalFormula1, [ NumericalFormula2, ... ] )
VarP ( NumericalFormula1, [ NumericalFormula2, ... ] )
NumericalFormula (s) - Required. Numeric values to operate on.
Average( Table, NumericalFormula )
Max( Table, NumericalFormula )
Min( Table, NumericalFormula )
Sum ( Table, NumericalFormula )
StdevP ( Table, NumericalFormula )
VarP ( Table, NumericalFormula )
Table - Required. Table to operate on.
NumericalFormula - Required. Formula to evaluate for each record. The result of this formula is used for the
aggregation. You can use columns of the table in the formula.

Examples
Step by step
Let's say that you had a data source named Sales that contained a CostPerUnit column and a UnitsSold column,
and you set the Text property of a label to this function:
Sum (Sales, CostPerUnit * UnitsSold)
The label would show total sales by multiplying the values in those columns for each record and then adding the
results from all records together:

As a different example, let's say that you had sliders that were named Slider1, Slider2, and Slider3 and a label
with its Text property set to this formula:
Sum (Slider1.Value, Slider2.Value, Slider3.Value)
The label would show the sum of all values to which the sliders were set.
Left, Mid, and Right functions in Power Apps
2/11/2020 • 2 minutes to read • Edit Online

Extracts the left, middle, or right portion of a string of text.

Description
The Left, Mid, and Right functions return a portion of a string.
Left returns the beginning characters of a string.
Mid returns the middle characters of a string.
Right returns the ending characters of a string.
If you specify a single string as an argument, the function returns the portion that you requested of the string. If
you specify a single-column table that contains strings, the function returns a single-column table of the portions
that you requested of those strings. If you specify a multi-column table, you can shape it into a single-column table,
as working with tables describes.
If the starting position is negative or beyond the end of the string, Mid returns blank. You can check the length of a
string by using the Len function. If you request more characters than the string contains, the function returns as
many characters as possible.

Syntax
Left( String, NumberOfCharacters )
Mid( String, StartingPosition [, NumberOfCharacters ] )
Right( String, NumberOfCharacters )
String - Required. The string to from which to extract the result.
StartingPosition - Required (Mid only). The starting position. The first character of the string is position 1.
NumberOfCharacters - Required (Left and Right only). The number of characters to return. If omitted for the
Mid function, the function returns the portion from the starting position until the end of the string.
Left( SingleColumnTable, NumberOfCharacters )
Mid( SingleColumnTable, StartingPosition [, NumberOfCharacters ] )
Right( SingleColumnTable, NumberOfCharacters )
SingleColumnTable - Required. A single-column table of strings from which to extract the results.
StartingPosition - Required (Mid only). The starting position. The first character of the string is position 1.
NumberOfCharacters - Required (Left and Right only). The number of characters to return. If omitted for the
Mid function, the function returns the portion from the starting position until the end of the string.

Examples
Single string
The examples in this section use a text-input control as their data source. The control is named Author and
contains the string "E. E. Cummings".
FORMULA DESCRIPTION RESULT

Left( Author.Text, 5 ) Extracts up to five characters from the "E. E."


start of the string.

Mid( Author.Text, 7, 4 ) Extracts up to four characters, starting "Cumm"


with the seventh character, from the
string.

Mid( Author.Text, 7 ) Extracts all characters, starting with the "Cummings"


seventh character, from the string.

Right( Author.Text, 5 ) Extracts up to five characters from the "mings"


end of the string.

Single -column table


Each example in this section extracts strings from the Address column of this data source, named People, and
returns a single-column table that contains the results:

FORMULA DESCRIPTION RESULT

Left( Extracts the first eight characters of each


ShowColumns( People, "Address" ), string.
8)

Mid( Extracts the middle seven characters of


ShowColumns( People, "Address" ), each string, starting with the fifth
5, 7 ) character.

Right( Extracts the last seven characters of


ShowColumns( People, "Address" ), each string.
7)

Step-by-step example
1. Import or create a collection named Inventory, and show it in a gallery, as the first procedure in Show
images and text in a gallery describes.
2. Set the Text property of the lower label in the gallery to this function:
Right(ThisItem.ProductName, 3)
The label shows the last three characters of each product name.
Average, Max, Min, StdevP, Sum, and VarP functions
in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Aggregate functions that summarize a set of numbers.

Description
The Average function calculates the average, or arithmetic mean, of its arguments.
The Max function finds the maximum value.
The Min function finds the minimum value.
The Sum function calculates the sum of its arguments.
The StdevP function calculates the standard deviation of its arguments.
The VarP function calculates the variance of its arguments.
You can supply the values for these functions as:
Separate arguments. For example, Sum ( 1, 2, 3 ) returns 6.
A table and a formula to operate over that table. The aggregate will be calculated on the values of the formula
for each record.
Fields of the record currently being processed are available within the formula. You simply reference them by name
as you would any other value. You can also reference control properties and other values from throughout your
app. For more details, see the examples below and working with record scope.
These functions operate on numeric values only. Other types of values, such as strings or records, are ignored. Use
the Value function to convert a string into a number.
The Average, Max, Min, and Sum functions can be delegated when used with a data source that supports
delegation for these functions. However, StdevP and VarP can't be delegated for any data sources. If delegation is
not supported, only the first portion of the data will be retrieved and then the function applied locally. The result
may not represent the complete story. A delegation warning will appear at authoring time to remind you of this
limitation and to suggest switching to delegable alternatives where possible. For more information, see the
delegation overview.

Syntax
Average( NumericalFormula1, [ NumericalFormula2, ... ] )
Max( NumericalFormula1, [ NumericalFormula2, ... ] )
Min( NumericalFormula1, [ NumericalFormula2, ... ] )
Sum ( NumericalFormula1, [ NumericalFormula2, ... ] )
StdevP ( NumericalFormula1, [ NumericalFormula2, ... ] )
VarP ( NumericalFormula1, [ NumericalFormula2, ... ] )
NumericalFormula (s) - Required. Numeric values to operate on.
Average( Table, NumericalFormula )
Max( Table, NumericalFormula )
Min( Table, NumericalFormula )
Sum ( Table, NumericalFormula )
StdevP ( Table, NumericalFormula )
VarP ( Table, NumericalFormula )
Table - Required. Table to operate on.
NumericalFormula - Required. Formula to evaluate for each record. The result of this formula is used for the
aggregation. You can use columns of the table in the formula.

Examples
Step by step
Let's say that you had a data source named Sales that contained a CostPerUnit column and a UnitsSold column,
and you set the Text property of a label to this function:
Sum (Sales, CostPerUnit * UnitsSold)
The label would show total sales by multiplying the values in those columns for each record and then adding the
results from all records together:

As a different example, let's say that you had sliders that were named Slider1, Slider2, and Slider3 and a label
with its Text property set to this formula:
Sum (Slider1.Value, Slider2.Value, Slider3.Value)
The label would show the sum of all values to which the sliders were set.
Day, Month, Year, Hour, Minute, Second, and
Weekday functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Returns individual components of a Date/Time value.

Description
The Day function returns the day component of a Date/Time value, ranging from 1 to 31.
The Month function returns the month component of a Date/Time value, ranging from 1 to 12.
The Year function returns the year component of a Date/Time value, starting with 1900.
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 Second function returns the second component of a Date/Time value, ranging from 0 to 59.
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:

EXCEL CODE STARTOFWEEK ENUMERATION DESCRIPTION

1, 17 StartOfWeek.Sunday Numbers 1 (Sunday) through 7


(Saturday). Default.

2, 11 StartOfWeek.Monday Numbers 1 (Monday) through 7


(Sunday).

3 StartOfWeek.MondayZero Numbers 0 (Monday) through 6


(Sunday).

12 StartOfWeek.Tuesday Numbers 1 (Tuesday) through 7


(Monday).

13 StartOfWeek.Wednesday Numbers 1 (Wednesday) through 7


(Tuesday).

14 StartOfWeek.Thursday Numbers 1 (Thursday) through 7


(Wednesday).

15 StartOfWeek.Friday Numbers 1 (Friday) through 7


(Thursday).

16 StartOfWeek.Saturday Numbers 1 (Saturday) through 7


(Friday).

All functions return a number.


See working with dates and times for more information.
Syntax
Day( DateTime )
Month( DateTime )
Year( DateTime )
Hour( DateTime )
Minute( DateTime )
Second( DateTime )
DateTime - Required. Date/Time value to operate on.
Weekday( DateTime [, WeekdayFirst ] )
DateTime - Required. Date/Time value to operate on.
WeekdayFirst - Optional. Excel code specifying which day starts the week. If not supplied, 1 (Sunday first) is
used.

Examples
For the following example, the current time is 3:59:37 PM on Thursday, April 9, 2015.

FORMULA DESCRIPTION RESULT

Year( Now() ) Returns the year component of the 2015


current time and date.

Month( Now() ) Returns the month component of the 4


current time and date.

Day( Now() ) Returns the day component of the 9


current time and date.

Hour( Now() ) Returns the hour component of the 15


current time and date.

Minute( Now() ) Returns the minute component of the 59


current time and date.

Second( Now() ) Returns the minute component of the 37


current time and date.

Weekday( Now() ) Returns the weekday component of the 5


current time and date, using the default
start of the week as Sunday.

Weekday( Now(), 14 ) Returns the weekday component of the 1


current time and date, using an Excel
code to specify the start of the week as
Thursday.

Weekday( Now(), StartOfWeek.Wed Returns the weekday component of the 2


nesday ) current time and date, using a
StartOfWeek enumeration to specify
the start of the week as Wednesday.
Mod function in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Returns the remainder of a division.

Description
The Mod function returns the remainder after a number is divided by a divisor.
The result has the same sign as the divisor.

Syntax
Mod( Number, Divisor )
Number - Required. Number to divide.
Divisor - Required. Number to divide by.
Day, Month, Year, Hour, Minute, Second, and
Weekday functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Returns individual components of a Date/Time value.

Description
The Day function returns the day component of a Date/Time value, ranging from 1 to 31.
The Month function returns the month component of a Date/Time value, ranging from 1 to 12.
The Year function returns the year component of a Date/Time value, starting with 1900.
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 Second function returns the second component of a Date/Time value, ranging from 0 to 59.
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:

EXCEL CODE STARTOFWEEK ENUMERATION DESCRIPTION

1, 17 StartOfWeek.Sunday Numbers 1 (Sunday) through 7


(Saturday). Default.

2, 11 StartOfWeek.Monday Numbers 1 (Monday) through 7


(Sunday).

3 StartOfWeek.MondayZero Numbers 0 (Monday) through 6


(Sunday).

12 StartOfWeek.Tuesday Numbers 1 (Tuesday) through 7


(Monday).

13 StartOfWeek.Wednesday Numbers 1 (Wednesday) through 7


(Tuesday).

14 StartOfWeek.Thursday Numbers 1 (Thursday) through 7


(Wednesday).

15 StartOfWeek.Friday Numbers 1 (Friday) through 7


(Thursday).

16 StartOfWeek.Saturday Numbers 1 (Saturday) through 7


(Friday).

All functions return a number.


See working with dates and times for more information.
Syntax
Day( DateTime )
Month( DateTime )
Year( DateTime )
Hour( DateTime )
Minute( DateTime )
Second( DateTime )
DateTime - Required. Date/Time value to operate on.
Weekday( DateTime [, WeekdayFirst ] )
DateTime - Required. Date/Time value to operate on.
WeekdayFirst - Optional. Excel code specifying which day starts the week. If not supplied, 1 (Sunday first) is
used.

Examples
For the following example, the current time is 3:59:37 PM on Thursday, April 9, 2015.

FORMULA DESCRIPTION RESULT

Year( Now() ) Returns the year component of the 2015


current time and date.

Month( Now() ) Returns the month component of the 4


current time and date.

Day( Now() ) Returns the day component of the 9


current time and date.

Hour( Now() ) Returns the hour component of the 15


current time and date.

Minute( Now() ) Returns the minute component of the 59


current time and date.

Second( Now() ) Returns the minute component of the 37


current time and date.

Weekday( Now() ) Returns the weekday component of the 5


current time and date, using the default
start of the week as Sunday.

Weekday( Now(), 14 ) Returns the weekday component of the 1


current time and date, using an Excel
code to specify the start of the week as
Thursday.

Weekday( Now(), StartOfWeek.Wed Returns the weekday component of the 2


nesday ) current time and date, using a
StartOfWeek enumeration to specify
the start of the week as Wednesday.
Back and Navigate functions in Power Apps
12/3/2019 • 5 minutes to read • Edit Online

Changes which screen is displayed.

Overview
Most apps contain multiple screens. Use the Back and Navigate function to change which screen is
displayed. For example, set the OnSelect property of a button to a formula that includes a Navigate
function if you want to show a different screen when a user selects that button. In that formula, you can
specify a visual transition, such as Fade, to control how one screen changes to another.
Back and Navigate change only which screen is displayed. Screens that aren't currently displayed
continue to operate behind the scenes. You can build formulas that refer to properties of controls on
other screens. For example, a user can change the value of a slider on one screen, navigate to a
different screen that uses that value in a formula, and ascertain how it affects what happens in the new
screen. The user can then navigate back to the original screen and confirm that the slider has retained
its value.
Context variables are also preserved when a user navigates between screens. You can use Navigate to
set one or more context variables for the screen that the formula will display, which is the only way to
set a context variable from outside the screen. You can use this approach to pass parameters to a
screen. If you've used another programming tool, this approach is similar to passing parameters to
procedures.
You can use either function only within a behavior formula.

Navigate
In the first argument, specify the name of the screen to display.
In the second argument, specify how the old screen changes to the new screen:

TRANSITION ARGUMENT DESCRIPTION DEMONSTRATION

ScreenTransition.Cover The new screen slides into view,


moving right to left, to cover the
current screen.

ScreenTransition.CoverRight The new screen slides into view,


moving left to right, to cover the
current screen.
TRANSITION ARGUMENT DESCRIPTION DEMONSTRATION

ScreenTransition.Fade The current screen fades away to


reveal the new screen.

ScreenTransition.None (Default) The new screen quickly replaces the


current screen.

ScreenTransition.UnCover The current screen slides out of


view, moving right to left, to
uncover the new screen.

ScreenTransition.UnCoverRight The current screen slides out of


view, moving left to right, to
uncover the new screen.

You can use Navigate to create or update context variables of the new screen. As an optional third
argument, pass a record that contains the context-variable name as a column name and the new value
for the context variable. This record is the same as the record that you use with the UpdateContext
function.
Set the OnHidden property of the old screen, the OnVisible property of the new screen, or both to
make additional changes during the transition. The App.ActiveScreen property will be updated to
reflect the change.
Navigate normally returns true but will return false if an error is encountered.

Back
The Back function returns to the screen that was most recently displayed.
For each Navigate call, the app tracks the screen that appeared and the transition. You can use
successive Back calls to return all the way to the screen that appeared when the user started the app.
When the Back function runs, the inverse transition is used by default. For example, if a screen
appeared through the CoverRight transition, Back uses UnCover (which is to the left) to return. Fade
and None are their own inverses. Pass an optional argument to Back to force a specific transition.
Back normally returns true but returns false if the user hasn't navigated to another screen since
starting the app.
Syntax
Back( [ Transition ] )
Transition - Optional. The visual transition to use between the current screen and the previous
screen. Refer to the list of valid values for this argument earlier in this topic. By default, the transition
through which a screen returns is the inverse of the transition through which it appeared.
Navigate( Screen [, Transition [, UpdateContextRecord ] ] )
Screen - Required. The screen to display.
Transition - Optional. The visual transition to use between the current screen and the next screen.
See the list of valid values for this argument earlier in this topic. The default value is None.
UpdateContextRecord - Optional. A record that contains the name of at least one column and a
value for each column. This record updates the context variables of the new screen as if passed to
the UpdateContext function.

Examples
FORMULA DESCRIPTION RESULT

Navigate( Details ) Displays the Details screen with no The Details screen appears quickly.
transition or change in value for a
context variable.

Navigate( Details, Displays the Details screen with a The current screen fades away to
ScreenTransition.Fade ) Fade transition. No value of a show the Details screen.
context variable is changed.

Navigate( Details, Displays the Details screen with a The current screen fades away to
ScreenTransition.Fade, { ID: 12 } Fade transition, and updates the show the Details screen, and the
) value of the ID context variable to context variable ID on that screen is
12. set to 12.

Navigate( Details, Displays the Details screen with a The current screen fades away to
ScreenTransition.Fade, Fade transition. Updates the value show the Details screen. The
{ ID: 12 , Shade: Color.Red } ) of the ID context variable to 12, context variable ID on the Details
and updates the value of the screen is set to 12, and the context
Shade context variable to variable Shade is set to Color.Red.
Color.Red. If you set the Fill property of a
control on the Details screen to
Shade, that control would display
as red.

Back() Displays the previous screen with Displays the previous screen
the default return transition. through the inverse transition of
the transition through which the
current screen appeared.

Back( ScreenTransition.Cover ) Displays the previous screen with Displays the previous screen
the Cover transition. through the Cover transition,
regardless of the transition through
which the current screen appeared.

Step-by-step
1. Create a blank app.
2. Add a second screen to it.
The app contains two blank screens: Screen1 and Screen2.
3. Set the Fill property of Screen2 to the value Gray .
4. On Screen2, add a button, and set its OnSelect property to this formula:

Navigate( Screen1, ScreenTransition.Cover )

5. While holding down the Alt key, select the button.


Screen1 appears with a white background through a transition that covers to the left.
6. On Screen1, add a button, and set its OnSelect property to this formula:

Back()

7. While holding down the Alt key, select the button.


The second screen appears with a gray background through a transition that uncovers to the
right (the inverse of Cover).
8. Select the button on each screen repeatedly to bounce back and forth.
Another example
EditForm, NewForm, SubmitForm, ResetForm, and
ViewForm functions in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

View, edit, or create an item, save the contents, and reset the controls in an Edit form control.

Overview
These functions change the state of the Edit form control. The form control can be in one of these modes:

MODE DESCRIPTION

FormMode.Edit The form is populated with an existing record and the user can
modify the values of the fields. Once complete, the user can
save the changes to the record.

FormMode.New The form is populates with default values and the user can
modify the values of the fields. Once complete, the user can
add the record to the data source.

FormMode.View The form is populated with an existing record but the user
cannot modify the values of the fields.

Description
These functions are often invoked from the OnSelect formula of a Button or Image control so that the user can
save edits, abandon edits, or create a record. You can use controls and these functions together to create a complete
solution.
These functions return no values.
SubmitForm
Use the SubmitForm function in the OnSelect property of a Button control to save any changes in a Form control
to the data source.
Before submitting any changes, this function checks for validation issues with any field that's marked as required or
that has one or more constraints on its value. This behavior matches that of the Validate function.
SubmitForm also checks the Valid property of the Form, which is an aggregation of all the Valid properties of the
Card controls that the Form control contains. If a problem occurs, the data isn't submitted, and the Error and
ErrorKind properties of the Form control are set accordingly.
If validation passes, SubmitForm submits the change to the data source.
If successful, the Form's OnSuccess behavior runs, and the Error and ErrorKind properties are cleared. If the
form was in FormMode.New mode, it is returned to FormMode.Edit mode.
If unsuccessful, the Form's OnFailure behavior runs, and the Error and ErrorKind properties are set
accordingly. The mode of the form is unchanged.
EditForm
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.
NewForm
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.
ResetForm
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.
ViewForm
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.
DisplayMode Property
The current mode can be read through the Mode property. The mode also determines the value of the
DisplayMode property which can be used by data cards and controls within the form control. Often, the data
card's DisplayMode property will be set to Parent.DisplayMode (referencing the form) as will the control's
DisplayMode property (referencing the data card):

MODE DISPLAYMODE DESCRIPTION

FormMode.Edit DisplayMode.Edit Data cards and controls are editable,


ready to accept changes to a record.

FormMode.New DisplayMode.Edit Data cards and controls are editable,


ready to accept a new record.

FormMode.View DisplayMode.View Data cards and controls are not editable


and optimized for viewing.

Syntax
SubmitForm ( FormName )
FormName - Required. Form control to submit to the data source.
EditForm ( FormName )
FormName - Required. Form control to switch to FormMode.Edit mode.
NewForm ( FormName )
FormName - Required. Form control to switch to FormMode.New mode.
ResetForm ( FormName )
FormName - Required. Form control to reset to initial values. Also switches the form from FormMode.New
mode to FormMode.Edit mode.
ViewForm ( FormName )
FormName - Required. Form control to switch to FormMode.View mode.
Examples
See Understand data forms for complete examples.
1. Add a Button control, set its Text property to show Save, and set its OnSelect property to this formula:
SubmitForm ( EditForm )
2. Set the OnFailure property of a Form control to blank and its OnSuccess property to this formula:
Back()
3. Name a Label control ErrorText, and set its Text property to this formula:
EditForm.Error
When the user selects the Save button, any changes in the Form control are submitted to the underlying
data source.
If the submission succeeds, any changes are saved or, if the Form control is in New mode, a record is
created. ErrorText is blank and the previous screen reappears.
If the submission fails, ErrorText shows a user-friendly error message, and the current screen remains
visible so that the user can correct the problem and try again.
4. Add a Button control, set its Text property to show Cancel, and set its OnSelect property to this formula:
ResetForm ( EditForm ); Back()
When the user selects the Cancel button, the values in the Form control are reset to what they were before
the user started to edit it, the previous screen reappears, and the Form control is returned to Edit mode if it
was in New mode.
5. Add a Button control, set its Text property to show New, and set its OnSelect property to this formula:
NewForm ( EditForm ); Navigate( EditScreen, None )
When the user selects the New button, the Form control switches to New mode, the default values for the
Form control's data source populate that control, and the screen that contains the Form control appears.
When the SubmitForm function runs, a record is created instead of updated.
And, Or, and Not functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Boolean logic functions, commonly used to manipulate the results of comparisons and tests.

Description
The And function returns true if all of its arguments are true.
The Or function returns true if any of its arguments are true.
The Not function returns true if its argument is false; it returns false if its argument is true.
These functions work the same way as they do in Excel. You can also use operators to perform these same
operations, using either Visual Basic or JavaScript syntax:

FUNCTION NOTATION VISUAL BASIC OPERATOR NOTATION JAVASCRIPT OPERATOR NOTATION

And( x, y ) x And y x && y

Or( x, y ) x Or y x || y

Not( x ) Not x !x

These functions work with logical values. You can't pass them a number or a string directly; instead, you must make
a comparison or a test. For example, this logical formula x > 1 evaluates to the Boolean value true if x is greater
than 1. If x is less than 1, the formula evaluates to false.

Syntax
And( LogicalFormula1, LogicalFormula2 [, LogicalFormula3, ... ] )
Or( LogicalFormula1, LogicalFormula2 [, LogicalFormula3, ... ] )
Not( LogicalFormula )
LogicalFormula (s) - Required. Logical formulas to evaluate and operate on.

Examples
The examples in this section use these global variables:
a = false
b = true
x = 10
y = 100
s = "Hello World"
To create these global variables in an app, insert a Button control, and set its OnSelect property to this formula:

Set( a, false ); Set( b, true ); Set( x, 10 ); Set( y, 100 ); Set( s, "Hello World" )

Select the button (by clicking it while you hold down the Alt key), and then set the Text property of a Label control
to a formula in the first column of the next table.

FORMULA DESCRIPTION RESULT

And( a, b ) Tests the values of a and b. One of the false


arguments is false, so the function
returns false.

a And b Same as the previous example, using false


Visual Basic notation.

a && b Same as the previous example, using false


JavaScript notation.

Or( a, b ) Tests the values of a and b. One of the true


arguments is true, so the function
returns true.

a Or b Same as the previous example, using true


Visual Basic notation.

a || b Same as the previous example, using true


JavaScript notation.

Not( a ) Tests the value of a. The argument is true


false, so the function returns the
opposite result.

Not a Same as the previous example, using true


Visual Basic notation.

!a Same as the previous example, using true


JavaScript notation.

Len( s ) < 20 And Not IsBlank( s ) Tests whether the length of s is less true
than 20 and whether it isn't a blank
value. The length is less than 20, and
the value isn't blank. Therefore, the
result is true.

Or( Len( s ) < 10, x < 100, y < 100 ) Tests whether the length of s is less true
than 10, whether x is less than 100, and
whether y is less than 100. The first and
third arguments are false, but the
second one is true. Therefore, the
function returns true.

Not IsBlank( s ) Tests whether s is blank, which returns true


false. Not returns the opposite of this
result, which is true.
Notify function in Power Apps
3/4/2020 • 2 minutes to read • Edit Online

Displays a banner message to the user.

Description
The Notify function displays a banner message to the user at the top of the screen, overlaying what is currently
displayed. The notification will remain until the user dismisses it, another notification replaces it, or the timeout
expires which defaults to 10 seconds.
An appropriate color and icon are used depending on the type of the message. The type is specified by the second
argument to the function:

NOTIFICATIONTYPE ARGUMENT DESCRIPTION

NotificationType.Error Displays the message as an error.

NotificationType.Information (Default) Displays the message as informational.

NotificationType.Success Displays the message as success.

NotificationType.Warning Displays the message as a warning.

Messages are shown both when authoring your app and when end users are using your app.
Notify can only be used in behavior formulas.
Notify can be paired with the IfError function to detect and report errors with a custom error message.
Power Apps can also send push notifications using an entirely different mechanism from Notify. For more
information see Send a notification in Power Apps.
Notify always returns true.
Note: This function was previously named ShowError when it could only display error messages.

Syntax
Notify( Message [, NotificationType [ , Timeout ] ] )
Message – Required. Message to display to the user.
NotificationType – Optional. Type of the message to display from the table above. The default is
NotificationType.Information.
Timeout – Optional. Number of milliseconds to wait before automatically dismissing the notification. The
default is 10 seconds (or 10,000 milliseconds). The notification will be displayed indefinitely with a Timeout of 0.

Examples
Step by step
1. Add a Button control to your screen.
2. Set the OnSelect property of the Button to the formula:

Notify( "Hello, World" )

3. Click or press the button.


Each time the button is clicked, the message Hello, World is displayed to the user as informational. It will
dismiss automatically in 10 seconds (default timeout) if the user does not dismiss it or press the button
again.

4. Change the type of message to indicate an error. Add a second argument to our formula:

Notify( "Hello, World", NotificationType.Error )

5. Click or press the button.


Now each time the button is clicked, the message Hello, World is displayed to the user as an error. It will
dismiss automatically in 10 seconds (default timeout) if the user does not dismiss it or press the button
again.

6. Change the type of message to indicate a warning. Change the second argument in our formula:

Notify( "Hello, World", NotificationType.Warning, 4000 )

7. Click or press the button.


Now each time the button is clicked, the message Hello, World is displayed to the user as a warning. It will
dismiss automatically in 4 seconds (4,000 milliseconds) if the user does not dismiss it or press the button
again.
8. Change the type of message to indicate success. Change the second argument in our formula:

Notify( "Hello, World", NotificationType.Success, 0 )

9. Click or press the button.


Now each time the button is clicked, the message Hello, World is displayed to the user as success. With a 0
timeout, the notification will only be dismissed by the user or by pressing the button again.
Now, Today, and IsToday functions in Power Apps
12/3/2019 • 3 minutes to read • Edit Online

Returns the current date and time, and tests whether a date/time value is today.

Description
The Now function returns the current date and time as a date/time value.
The Today function returns the current date as a date/time value. The time portion is midnight. Today has the
same value throughout a day, from midnight today to midnight tomorrow.
The IsToday function tests whether a date/time value is between midnight today and midnight tomorrow. This
function returns a Boolean (true or false) value.
All these functions work with the local time of the current user.
See working with dates and times for more information.

Volatile Functions
Now and Today are volatile functions. Each time one of these functions is evaluated it returns a different value.
When used in a data flow formula, a volatile function will only return a different value if the formula in which it
appears is reevaluated. If nothing else changes in the formula then it will have the same value throughout the
execution of your app.
For example, a label control with Label1.Text = Now() will not change while your app is active. Only closing and
reopening the app will result in a new value.
The function will be reevaluated if it is part of a formula in which something else has changed. For example, if we
change our example to involve a slider control with Label1.Text = DateAdd( Now(), Slider1.Value, Minutes )
then the current time is retrieved each time the Slider control's value changes and the label's text property is
reevaluated.
When used in a behavior formula, volatile functions will be evaluated each time the behavior formula is evaluated.
See below for an example.

Syntax
Now()
Today()
IsToday( DateTime )
DateTime - Required. The date/time value to test.

Examples
For the examples in this section, the current time is 3:59 AM on February 12, 2015, and the language is en-us.
FORMULA DESCRIPTION RESULT

Text( Now(), "mm/dd/yyyy Retrieves the current date and time, and "02/12/2015 03:59:00"
hh:mm:ss" ) displays it as a string.

Text( Today(), "mm/dd/yyyy Retrieves the current date only, leaving "02/12/2015 00:00:00"
hh:mm:ss" ) the time portion as midnight, and
displays it as a string.

IsToday( Now() ) Tests whether the current date and time true
is between midnight today and
midnight tomorrow.

IsToday( Today() ) Tests whether the current date is true


between midnight today and midnight
tomorrow.

Text( DateAdd( Now(), 12 ), Retrieves the current date and time, "02/24/2015 03:59:00"
"mm/dd/yyyy hh:mm:ss" ) adds 12 days to the result, and displays
it as a string.

Text( DateAdd( Today(), 12 ), Retrieves the current date, adds 12 days "02/24/2015 00:00:00"
"mm/dd/yyyy hh:mm:ss" ) to the result, and displays it as a string.

IsToday( DateAdd( Now(), 12 ) ) Tests whether the current date and false
time, plus 12 days, is between midnight
today and midnight tomorrow.

IsToday( DateAdd( Today(), 12 ) ) Tests whether the current date, plus 12 false
days, is between midnight today and
midnight tomorrow.

Display a clock that updates in real time


1. Add a Timer control, set its Duration property to 1000, and set its Repeat property to true.
The timer will run for one second, automatically start over, and continue that pattern.
2. Set the control's OnTimerEnd property to this formula:
Set( CurrentTime, Now() )
Whenever the timer starts over (after each second), this formula sets the CurrentTime global variable to the
current value of the Now function.

3. Add a Label control, and set its Text property to this formula:
Text( CurrentTime, LongTime24 )
Use the Text function to format the date and time however you want, or set this property to just
CurrentTime to show hours and minutes but not seconds.

4. Preview the app by pressing F5, and then start the timer by clicking or tapping it.
The label continually shows the current time, down to the second.

5. Set the timer's AutoStart property to true and its Visible property to false.
The timer is invisible and starts automatically.
6. Set the screen's OnStart property so that the CurrentTime variable has a valid value, as in this example:
Set(CurrentTime, Now())
The label appears as soon as the app starts (before the timer runs for a full second).
Operators and Identifiers in Power Apps
3/4/2020 • 8 minutes to read • Edit Online

Some of these operators are dependent on the language of the author. See Global apps for more
information.

SYMBOL TYPE SYNTAX DESCRIPTION

. Property Selector Slider1.Value Extracts a property from


Color.Red a table, control, signal, or
Acceleration.X enumeration. For
backwards compatibility,
! may also be used.

. Decimal separator 1.23 Separator between


[language dependent] whole and fractional
parts of a number. The
character depends on
the language.

() Parentheses Filter(T, A < 10) Enforces precedence


order, and groups sub-
(1 + 2) * 3 expressions in a larger
expression

+ Arithmetic operators 1+2 Addition

- 2-1 Subtraction and sign

* 2*3 Multiplication

/ 2/3 Division (also see the


Mod function)

^ 2^3 Exponentiation,
equivalent to the Power
function

% 20% Percentage (equivalent


to "* 1/100")

= Comparison operators Price = 100 Equal to

> Price > 100 Greater than

>= Price >= 100 Greater than or equal to

< Price < 100 Less than

<= Price <= 100 Less than or equal to

<> Price <> 100 Not equal to


SYMBOL TYPE SYNTAX DESCRIPTION

& String concatenation "hello" & " " & Makes multiple strings
operator "world" appear continuous

&& or And Logical operators Price < 100 && Logical conjunction,
Slider1.Value = 20 equivalent to the And
or Price < 100 And function
Slider1.Value = 20

|| or Or Price < 100 || Logical disjunction,


Slider1.Value = 20 or equivalent to the Or
Price < 100 Or function
Slider1.Value = 20

! or Not !(Price < 100) or Not Logical negation,


(Price < 100) equivalent to the Not
function

exactin Membership operators Gallery1.Selected Belonging to a collection


exactin SavedItems or a table

exactin "Windows" exactin Substring test (case-


“To display windows sensitive)
in the Windows
operating system...”

in Gallery1.Selected in Belonging to a collection


SavedItems or a table

in "The" in "The Substring test (case-


keyboard and the insensitive)
monitor..."

@ Disambiguation operator MyTable[@fieldname] Field disambiguation

@ [@MyVariable] Global disambiguation

, List separator If( X < 10, "Low", Separates:


[language dependent] "Good" ) arguments in
{ X: 12, Y: 32 } function calls
[ 1, 2, 3 ] fields in a record
records in a table
This character depends
on the language.

; Formula chaining Collect(T, A); Separate invocations of


[language dependent] Navigate(S1, "") functions in behavior
properties. The chaining
operator depends on the
language.

Parent Parent operator Parent.Fill Access to properties of a


control container
SYMBOL TYPE SYNTAX DESCRIPTION

ThisItem ThisItem operator ThisItem.FirstName Access to fields of a


Gallery or form control

in and exactin operators


You can use the in and exactin operators to find a string in a data source, such as a collection or an
imported table. The in operator identifies matches regardless of case, and the exactin operator
identifies matches only if they're capitalized the same way. Here's an example:
1. Create or import a collection named Inventory, and show it in a gallery, as the first
procedure in Show images and text in a gallery describes.
2. Set the Items property of the gallery to this formula:
Filter(Inventory, "E" in ProductName)
The gallery shows all products except Callisto because the name of that product is the only
one that doesn't contain the letter you specified.
3. Change the Items property of the gallery to this formula:
Filter(Inventory, "E" exactin ProductName)
The gallery shows only Europa because only its name contains the letter that you specified in
the case that you specified.

ThisItem operator
You can show data in Gallery, Edit form, or Display form controls by binding it to a table or a
collection. These controls are a container for other cards and controls. Each card or control within the
container can access the bound data through the ThisItem operator.
Use the ThisItem operator to specify the column of data to be displayed in each card or control
within the outer control. For example, that operator in the product gallery for Show images and text
in a gallery specified that the image control showed the product design, the upper label showed the
product name, and the lower label showed the number of units in stock.
For nested galleries, ThisItem refers to the innermost gallery's items. Assuming the row fields in the
inner and outer galleries don't conflict, you can also use the unqualified field (column) names directly.
This approach enables rules in an inner gallery to refer to an outer gallery's items.

Parent operator
Some controls host other controls. For example, Screen, Gallery, Card, Edit form, and Display
form controls are all containers for controls. We call the hosting control the "parent" of the controls
within.
Any control in Power Apps can be referenced by name from anywhere within the app. Screen1 may
be the name of a screen in your app. To retrieve the background color of this screen, you can use
Screen1.Fill.
Controls on this screen have another option. They can use a relative reference: Parent.Fill. The
Parent operator refers to the control that hosts this control, making available all of its properties.
Using Parent is helpful because it doesn't depend on the name of the control. You can copy and
paste a container control without needing to adjust any references within the container. This operator
also makes the relationship between child and parent controls clearer when reading formulas.
Identifier names
The names of variables, data sources, columns, and other objects can contain any Unicode.
Use single quotes around a name that contains a space or other special character. Use two single
quotes together to represent one single quote in the name. Names that do not contain special
characters do not require single quotes.
Here are some example column names you might encounter in a table, and how they are
represented in a formula:

COLUMN NAME IN A DATABASE COLUMN REFERENCE IN A FORMULA

SimpleName SimpleName

NameWith123Numbers NameWith123Numbers

Name with spaces 'Name with spaces'

Name with "double" quotes 'Name with "double" quotes'

Name with 'single' quotes 'Name with ''single'' quotes'

Name with an @ at sign 'Name with an @ at sign'

Double quotes are used to designate text strings.

Display names and logical names


Some data sources such as SharePoint and Common Data Service have two different names to refer
to the same table or column of data:
Logical name - A name that is guaranteed to be unique, does not change after being created,
usually does not allow spaces or other special characters, and is not localized into different
languages. As a result the name can be somewhat cryptic. These names are used by
professional developers. For example cra3a_customfield. This name may also be referred to
as schema name or just name.
Display name - A name that is user friendly and intended to be seen by end users. This name
may not be unique, may change over time, may contain spaces and any Unicode character,
and may be localized into different languages. Corresponding to the example above, the
display name may be Custom Field with a space inbetween the words.
Since display names are easier to understand, Canvas apps will suggest them as choices and not
suggest logical names. Although logical names are not suggested, they can still be used if typed in
directly.
For example, imagine you have added a Custom Field to an entity in Common Data Service. A
logical name will be assigned for you by the system which you can modify only when creating the
field. The result would look similar to:
When authoring a reference to a field of Accounts, the suggestion will be made to use 'Custom
Field' since this is the display name. Note that the single quotes must be used because this name
has a space in it:

After selecting the suggestion, 'Custom Field' is shown in the formula bar and the data is retrieved:

Although it is not suggested, we could also use the logical name for this field. This will result in the
same data being retrieved. Note that no single quotes are required since this name does not contain
spaces or special characters:
Behind the scenes, a mapping is maintained between the display names seen in formulas and the
underlying logical names. Since logical names must be used to interact with the data source, this
mapping is used to convert from the current display name to the logical name automatically and that
is what is seen in the network traffic. This mapping is also used to convert back to logical names in
order to switch into new display names, for example if a display name changes or a maker in a
different language edits the app.

NOTE
Logical names are not translated when moving an app between environments. For Common Data Service
system entity and field names this should not be a problem as logical names are consistent across
environments. But any custom fields, such as cra3a_customfield in this example above, may have a different
environment prefix (cra3a in this case). Display names are preferred as they can be matched against display
names in the new environment.

Name disambiguation
Since display names are not unique, the same display name may appear more than once in the same
entity. When this happens, the logical name will be added to the end of the display name in
parenthesis for one of more of the conflicting names. Building on the example above, if there was a
second field with the same display name of Custom Field with a logical name of
cra3a_customfieldalt then the suggestions would show:

Name disambiguation strings are added in other situations where name conflicts occur, such as the
names of entities, option sets, and other Common Data Service items.
Disambiguation operator
Some functions create record scopes for accessing the fields of table while processing each record,
such as Filter, AddColumns, and Sum. Field names added with the record scope override the same
names from elsewhere in the app. When this happens, you can still access values from outside the
record scope with the @ disambiguation operator:
To access values from nested record scopes, use the @ operator with the name of the table being
operated upon using this pattern:
Table[@FieldName]
To access global values, such as data sources, collections, and context variables, use the pattern
[@ObjectName] (without a table designation).

For more information and examples, see record scopes.


And, Or, and Not functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Boolean logic functions, commonly used to manipulate the results of comparisons and tests.

Description
The And function returns true if all of its arguments are true.
The Or function returns true if any of its arguments are true.
The Not function returns true if its argument is false; it returns false if its argument is true.
These functions work the same way as they do in Excel. You can also use operators to perform these same
operations, using either Visual Basic or JavaScript syntax:

FUNCTION NOTATION VISUAL BASIC OPERATOR NOTATION JAVASCRIPT OPERATOR NOTATION

And( x, y ) x And y x && y

Or( x, y ) x Or y x || y

Not( x ) Not x !x

These functions work with logical values. You can't pass them a number or a string directly; instead, you must
make a comparison or a test. For example, this logical formula x > 1 evaluates to the Boolean value true if x is
greater than 1. If x is less than 1, the formula evaluates to false.

Syntax
And( LogicalFormula1, LogicalFormula2 [, LogicalFormula3, ... ] )
Or( LogicalFormula1, LogicalFormula2 [, LogicalFormula3, ... ] )
Not( LogicalFormula )
LogicalFormula (s) - Required. Logical formulas to evaluate and operate on.

Examples
The examples in this section use these global variables:
a = false
b = true
x = 10
y = 100
s = "Hello World"
To create these global variables in an app, insert a Button control, and set its OnSelect property to this
formula:

Set( a, false ); Set( b, true ); Set( x, 10 ); Set( y, 100 ); Set( s, "Hello World" )
Select the button (by clicking it while you hold down the Alt key), and then set the Text property of a Label
control to a formula in the first column of the next table.

FORMULA DESCRIPTION RESULT

And( a, b ) Tests the values of a and b. One of false


the arguments is false, so the function
returns false.

a And b Same as the previous example, using false


Visual Basic notation.

a && b Same as the previous example, using false


JavaScript notation.

Or( a, b ) Tests the values of a and b. One of true


the arguments is true, so the function
returns true.

a Or b Same as the previous example, using true


Visual Basic notation.

a || b Same as the previous example, using true


JavaScript notation.

Not( a ) Tests the value of a. The argument is true


false, so the function returns the
opposite result.

Not a Same as the previous example, using true


Visual Basic notation.

!a Same as the previous example, using true


JavaScript notation.

Len( s ) < 20 And Not IsBlank( s ) Tests whether the length of s is less true
than 20 and whether it isn't a blank
value. The length is less than 20, and
the value isn't blank. Therefore, the
result is true.

Or( Len( s ) < 10, x < 100, y < 100 ) Tests whether the length of s is less true
than 10, whether x is less than 100,
and whether y is less than 100. The
first and third arguments are false, but
the second one is true. Therefore, the
function returns true.

Not IsBlank( s ) Tests whether s is blank, which returns true


false. Not returns the opposite of this
result, which is true.
Download, Launch, and Param functions in canvas
apps
11/4/2019 • 2 minutes to read • Edit Online

Downloads or launches a webpage or an app with parameters.

Description
The Download function downloads a file from the web to the local device. The user is prompted for a location to
save the file. Download returns the location where the file was stored locally as a string.
The Launch function launches a webpage or an app. Optionally, this function can pass parameters to the app.
In Internet Explorer and Microsoft Edge, the Launch function opens a website or app only if its security settings
are the same or higher than those of the app that contains the function. If, for example, you add the Launch
function to an app that will run in the Trusted sites security zone, ensure that the website or app that you want
the function to open is in the Trusted sites or Local intranet zone (not in Restricted sites). More information:
Change security and privacy settings for Internet Explorer 11.
The Param function retrieves a parameter passed to the app when it was launched. If the named parameter
wasn't passed, Param returns blank.

Syntax
Download( Address )
Address - Required. The address of a web resource to download.
Launch( Address [, ParameterName1, ParameterValue1, ... ] )
Address - Required. The address of a webpage or the ID of an app to launch.
ParameterName(s) - Optional. Parameter name.
ParameterValue(s) - Optional. Corresponding parameter values to pass to the app or the webpage.
Param ( ParameterName )
ParameterName - Required. The name of the parameter passed to the app.
Patch function in Power Apps
3/17/2020 • 6 minutes to read • Edit Online

Modifies or creates one or more records in a data source, or merges records outside of a data source.
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.
To update records in a data source more easily for simple changes, use the Edit form control instead.
When you add an Edit form control, you provide users with a form to fill in and then save the changes
to a data source. For more information, see Understand data forms.

Overview
Use the Patch function to modify one or more records of a data source. The values of specific fields
are modified without affecting other properties. For example, this formula changes the phone number
for a customer named Contoso:
Patch( Customers, First( Filter( Customers, Name = "Contoso" ) ), { Phone: "1-212-555-1234" } )

Use Patch with the Defaults function to create records. Use this behavior to build a single screen for
both creating and editing records. For example, this formula creates a record for a customer named
Contoso:
Patch( Customers, Defaults( Customers ), { Name: "Contoso" } )

Even if you're not working with a data source, you can use Patch to merge two or more records. For
example, this formula merges two records into one that identifies both the phone number and the
location for Contoso:
Patch( { Name: "Contoso", Phone: "1-212-555-1234" }, { Name: "Contoso", Location: "Midtown" } )

Description
Modify or create a record in a data source
To use this function with a data source, specify the data source, and then specify a base record:
To modify a record, the base record needs to have come from a data source. The base record may
have come through a gallery's Items property, been placed in a context variable, or come through
some other path. But, you can trace the base record back to the data source. This is important as the
record will include additional information to help find the record again for modification.
To create a record, use the Defaults function to create a base record with default values.
Then specify one or more change records, each of which contains new property values that override
property values in the base record. Change records are processed in order from the beginning of the
argument list to the end, with later property values overriding earlier ones.
The return value of Patch is the record that you modified or created. If you created a record, the return
value may include properties that the data source generated automatically. However, the return value
doesn't provide a value for fields of a related entity.
For example, you use
Set(MyAccount, Patch(Accounts, First(Account), 'Account Name': "Example name"); and then
MyAccount.'Primary Contact'.'Full Name' . You can't yield a full name in this case. Instead, to access the
fields of a related entity, use a separate lookup such as:

LookUp(Accounts, Account = MyAccount.Account).'Primary Contact'.'Full Name'

When you update a data source, one or more issues may arise. Use the Errors function to identify and
examine issues, as Working with Data Sources describes.
Related functions include the Update function to replace an entire record, and the Collect function to
create a record. Use the UpdateIf function to modify specific properties of multiple records based on
a condition.
Modify or create a set of records in a data source
Patch can also be used to create or modify multiple records with a single call.
Instead of passing a single base record, a table of base records can be provided in the second
argument. Change records are provided in a table as well, corresponding one-for-one with the base
records. The number of records in each change table must be the same as the number of records in the
base table.
When using Patch in this manner, the return value is also a table with each record corresponding one-
for-one with the base and change records.
Merge records outside of a data source
Specify two or more records that you want to merge. Records are processed in the order from the
beginning of the argument list to the end, with later property values overriding earlier ones.
Patch returns the merged record and doesn't modify its arguments or records in any data sources.

Syntax
Modify or create a record in a data source
Patch( DataSource, BaseRecord, ChangeRecord1 [, ChangeRecord2, … ])
DataSource – Required. The data source that contains the record that you want to modify or will
contain the record that you want to create.
BaseRecord – Required. The record to modify or create. If the record came from a data source, the
record is found and modified. If the result of Defaults is used, a record is created.
ChangeRecord (s) – Required. One or more records that contain properties to modify in the
BaseRecord. Change records are processed in order from the beginning of the argument list to the
end, with later property values overriding earlier ones.
Modify or create a set of records in a data source
Patch( DataSource, BaseRecordsTable, ChangeRecordTable1 [, ChangeRecordTable2, … ] )
DataSource – Required. The data source that contains the records that you want to modify or will
contain the records that you want to create.
BaseRecordTable – Required. A table of records to modify or create. If the record came from a data
source, the record is found and modified. If the result of Defaults is used, a record is created.
ChangeRecordTable(s) – Required. One or more tables of records that contain properties to modify
for each record of the BaseRecordTable. Change records are processed in order from the beginning
of the argument list to the end, with later property values overriding earlier ones.
Merge records
Patch( Record1, Record2 [, …] )
Record (s) - Required. At least two records that you want to merge. Records are processed in order
from the beginning of the argument list to the end, with later property values overriding earlier
ones.

Examples
Modify or create a record (in a data source)
In these examples, you'll modify or create a record in a data source, named IceCream, that contains
the data in this table and automatically generates the values in the ID column:

FORMULA DESCRIPTION RESULT

Patch( IceCream, Modifies a record in the IceCream { ID: 1, Flavor: "Chocolate",


First( Filter( IceCream, Flavor = data source: Quantity: 400 }
"Chocolate" ) ), { Quantity: 400 } The ID column of the record
) to modify contains the The Chocolate entry in the
value of 1. (The Chocolate IceCream data source has been
record has that ID.) modified.
The value in the Quantity
column changes to 400.

Patch( IceCream, Creates a record in the IceCream { ID: 3, Flavor: "Strawberry",


Defaults( IceCream ), data source: Quantity: 0 }
{ Flavor: "Strawberry" } ) The ID column contains the
value 3, which the data The Strawberry entry in the
source generates IceCream data source has been
automatically. created.
The Quantity column
contains 0, which is the
default value for that
column in the IceCream
data source, as the
Defaults function specifies.
The Flavor column contains
the value of Strawberry.

After the previous formulas have been evaluated, the data source ends with these values:

Merge records (outside of a data source)

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Patch( { Name: "James", Score: Merges two records outside of a { Name: "Jim", Score: 90,
90 }, data source: Passed: true }
{ Name: "Jim", Passed: true } ) The values in the Name
column of each record don't
match. The result contains
the value (Jim) in the
record that's closer to the
end of the argument list
instead of the value
(James) in the record that's
closer to the start.
The first record contains a
column (Score) that doesn't
exist in the second record.
The result contains that
column with its value (90).
The second record contains
a column (Passed) that
doesn't exist in the first
record. The result contains
that column with its value
(true).
Acos, Acot, Asin, Atan, Atan2, Cos, Cot, Degrees, Pi,
Radians, Sin, and Tan functions in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Calculates trigonometric values.

Description
Primary functions
The Cos function returns the cosine of its argument, an angle specified in radians.
The Cot function returns the cotangent of its argument, an angle specified in radians.
The Sin function returns the sine of its argument, an angle specified in radians.
The Tan function returns the tangent of its argument, an angle specified in radians.
Inverse functions
The Acos function returns the arccosine, or inverse cosine, of its argument. The arccosine is the angle whose cosine
is the argument. The returned angle is given in radians in the range 0 (zero) to π.
The Acot function returns the principal value of the arccotangent, or inverse cotangent, of its argument. The
returned angle is given in radians in the range 0 (zero) to π.
The Asin function returns the arcsine, or inverse sine, of its argument. The arcsine is the angle whose sine is the
argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan function returns the arctangent, or inverse tangent, of its argument. The arctangent is the angle whose
tangent is the argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan2 function returns the arctangent, or inverse tangent, of the specified x and y coordinates as arguments.
The arctangent is the angle from the x-axis to a line that contains the origin (0, 0) and a point with coordinates (x, y).
The angle is given in radians between -π and π, excluding -π. A positive result represents a counterclockwise angle
from the x-axis; a negative result represents a clockwise angle. Atan2( a, b ) equals Atan( b/a ), except that a can
equal 0 (zero) with the Atan2 function.
Helper functions
The Degrees function converts radians to degrees. π radians equals 180 degrees.
The Pi function returns the transcendental number π, which begins 3.141592...
The Radians function converts degrees to radians.
Notes
If you pass a single number to these functions, the return value is a single result. If you pass a single-column table
that contains numbers, the return value is a single-column table of results, one result for each record in the
argument's table. If you have a multi-column table, you can shape it into a single-column table, as working with
tables describes.
If an argument would result in an undefined value, the result is blank. This can happen, for example, when using
inverse functions with arguments that are out of range.
Syntax
Primary Functions
Cos( Radians )
Cot( Radians )
Sin( Radians )
Tan( Radians )
Radians - Required. Angle to operate on.
Cos( SingleColumnTable )
Cot( SingleColumnTable )
Sin( SingleColumnTable )
Tan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of angles to operate on.
Inverse Functions
Acos( Number )
Acot( Number )
Asin( Number )
Atan( Number )
Number - Required. Number to operate on.
Acos( SingleColumnTable )
Acot( SingleColumnTable )
Asin( SingleColumnTable )
Atan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of numbers to operate on.
Atan2( X, Y )
X - Required. X-axis coordinate.
Y - Required. Y -axis coordinate.
Helper Functions
Degrees( Radians )
Radians - Required. Angle in radians to convert to degrees.
Pi()
Radians( Degrees )
Degrees - Required. Angle in degrees to convert to radians.

Examples
Single number
FORMULA DESCRIPTION RESULT

Cos( 1.047197 ) Returns the cosine of 1.047197 radians 0.5


or 60 degrees.
FORMULA DESCRIPTION RESULT

Cot( Pi()/4 ) Returns the cotangent of 0.785398... 1


radians or 45 degrees.

Sin( Pi()/2 ) Returns the sine of 1.570796... radians 1


or 90 degrees.

Tan( Radians(60) ) Returns the tangent of 1.047197... 1.732050...


radians or 60 degrees.

Acos( 0.5 ) Returns the arccosine of 0.5, in radians. 1.047197...

Acot( 1 ) Returns the arccotangent of 1, in 0.785398...


radians.

Asin( 1 ) Returns the arcsine of 1, in radians. 1.570796...

Atan( 1.732050 ) Returns the arctangent of 1.732050, in 1.047197...


radians.

Atan2( 5, 3 ) Returns the arctangent of the angle 0.540419...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (5,3),
which is approximately 31 degrees.

Atan2( 4, 4 ) Returns the arctangent of the angle 0.785398...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (4,4),
which is exactly π/4 radians or 45
degrees.

Degrees( 1.047197 ) Returns the equivalent number of 60


degrees for 1.047197 radians.

Pi() Returns the transcendental number π. 3.141592...

Radians( 15 ) Returns the equivalent number of 0.261799...


radians for 15 degrees.

Single -column table


The examples in this section use a data source that's named ValueTable and that contains the following data. The
last record in the table is π/2 radians or 90 degrees.

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Cos( ValueTable ) Returns the cosine of each number in


the table.

Cot( ValueTable ) Returns the cotangent of each number


in the table.

Sin( ValueTable ) Returns the sine of each number in the


table.

Tan( ValueTable ) Returns the tangent of each number in


the table.

Acos( ValueTable ) Returns the arccosine of each number in


the table.

Acot( ValueTable ) Returns the arccotangent of each


number in the table.

Asin( ValueTable ) Returns the arcsine of each number in


the table.

Atan( ValueTable ) Returns the arctangent of each number


in the table.
FORMULA DESCRIPTION RESULT

Degrees( ValueTable ) Returns the equivalent number of


degrees for each number in the table,
assumed to be angles in radians.

Radians( ValueTable ) Returns the equivalent number of


radians for each number in the table,
assumed to be angles in degrees.
EncodeUrl and PlainText functions in Power Apps
2/8/2020 • 2 minutes to read • Edit Online

Encodes and decodes strings.

Description
The EncodeUrl function encodes a URL string, replacing certain non-alphanumeric characters with % and a
hexadecimal number.
The PlainText function removes HTML and XML tags, converting certain tags such as these to an appropriate
symbol:
&nbsp;
&quot;
The return value from these functions is the encoded or decoded string. This function doesn't remove all HTML
and XML tags.

Syntax
EncodeUrl( String )
String - Required. URL to be encoded.
PlainText( String )
String - Required. String from which HTML and XML tags will be stripped.

Examples
If you show an RSS feed in a text gallery and then set the Text property of a label in that gallery to
ThisItem.description, the label might show raw HTML or XML code as in this example:

<p>We have done an unusually&nbsp;&quot;deep&quot; globalization and localization.</p>

If you set the Text property of the label to PlainText(ThisItem.description), the text appears as in this example:

We have done an unusually "deep" globalization and localization.


Abs, Exp, Ln, Power, and Sqrt functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Calculates absolute values, natural logarithms, square roots, and the results of raising e or any number to specified
powers.

Description
The Abs function returns the non-negative value of its argument. If a number is negative, Abs returns the positive
equivalent.
The Exp function returns e raised to the power of its argument. The transcendental number e begins 2.7182818...
The Ln function returns the natural logarithm (base e) of its argument.
The Power function returns a number raised to a power. It is equivalent to using the ^ operator.
The Sqrt function returns the number that, when multiplied by itself, equals its argument.
If you pass a single number, the return value is a single result based on the function called. If you pass a single-
column table that contains numbers, the return value is a single-column table of results, one result for each record
in the argument's table. If you have a multi-column table, you can shape it into a single-column table, as working
with tables describes.
If an argument would result in an undefined valued, the result is blank. This can happen, for example, with square
roots and logarithms of negative numbers.

Syntax
Abs( Number )
Exp( Number )
Ln( Number )
Sqrt( Number )
Number - Required. Number to operate on.
Power( Base, Exponent )
Base - Required. Base number to raise.
Exponent - Required. The exponent to which the base number is raised.
Abs( SingleColumnTable )
Exp( SingleColumnTable )
Ln( SingleColumnTable )
Sqrt( SingleColumnTable )
SingleColumnTable - Required. A single-column table of numbers to operate on.

Examples
Single number
FORMULA DESCRIPTION RESULT

Abs( -55 ) Returns the number without the 55


negative sign.

Exp( 2 ) Returns e raised to the power of 2, or e 7.389056...


* e.

Ln( 100 ) Returns the natural logarithm (base e) 4.605170...


of the number 100.

Power( 5, 3 ) Returns 5 raised to the power of 3, or 5 125


* 5 * 5.

Sqrt( 9 ) Returns the number that, when 3


multiplied by itself, results in 9.

Single -column table


The examples in this section use a data source that's named ValueTable and that contains this data:

FORMULA DESCRIPTION RESULT

Abs( ValueTable ) Returns the absolute value of each


number in the table.

Exp( ValueTable ) Returns e raised to the power of each


number in the table.

Ln( ValueTable ) Returns the natural logarithm of each


number in the table.

Sqrt( ValueTable ) Returns the square root of each number


in the table

Step-by-step example
1. Add a Text input control, and name it Source.
2. Add a Label control, and set its Text property to this formula:
Sqrt( Value( Source.Text ) )
3. Type a number into Source, and confirm that the Label control shows the square root of the number that you
typed.
Lower, Upper, and Proper functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Converts letters in a string of text to all lowercase, all uppercase, or proper case.

Description
The Lower, Upper, and Proper functions convert the case of letters in strings.
Lower converts any uppercase letters to lowercase.
Upper converts any lowercase letters to uppercase.
Proper converts the first letter in each word to uppercase if it's lowercase and converts any other uppercase
letters to lowercase.
All three functions ignore characters that aren't letters.
If you pass a single string, the return value is the converted version of that string. If you pass a single-column table
that contains strings, the return value is a single-column table of converted strings. If you have a multi-column
table, you can shape it into a single-column table, as working with tables describes.

Syntax
Lower( String )
Upper( String )
Proper( String )
String - Required. The string to convert.
Lower( SingleColumnTable )
Upper( SingleColumnTable )
Proper( SingleColumnTable )
SingleColumnTable - Required. A single-column table of strings to convert.

Examples
Single string
The examples in this section use a text-input control, named Author, as their data source. The control contains the
string "E. E. CummINGS".

FORMULA DESCRIPTION RESULT

Lower( Author.Text ) Converts any uppercase letters in the "e. e. cummings"


string to lowercase.

Upper( Author.Text ) Converts any lowercase letters in the "E. E. CUMMINGS"


string to uppercase.

Proper( Author.Text ) Converts the first letter of each word to "E. E. Cummings"
uppercase if it's lowercase, and converts
any other uppercase letters to
lowercase.
Single -column table
The examples in this section convert strings from the Address column of the People data source, which contains
this data:

Each formula returns a single-column table that contains the converted strings.

FORMULA DESCRIPTION RESULT

Lower( Converts any letter that's lowercase to


ShowColumns( People, "Address" ) ) uppercase.

Upper( Converts any letter that's lowercase to


ShowColumns( People, "Address" ) ) uppercase.

Proper( Converts any first letter of a word that's


ShowColumns( People, "Address" ) ) lowercase to uppercase, and converts
any other letter that's uppercase to
lowercase.

Step-by-step example
1. Add a Text input control, and name it Source.
2. Add a label, and set its Text property to this function:
Proper(Source.Text)
3. Press F5, and then type WE ARE THE BEST! into the Source box.
The label shows We Are The Best!
Acos, Acot, Asin, Atan, Atan2, Cos, Cot, Degrees, Pi,
Radians, Sin, and Tan functions in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Calculates trigonometric values.

Description
Primary functions
The Cos function returns the cosine of its argument, an angle specified in radians.
The Cot function returns the cotangent of its argument, an angle specified in radians.
The Sin function returns the sine of its argument, an angle specified in radians.
The Tan function returns the tangent of its argument, an angle specified in radians.
Inverse functions
The Acos function returns the arccosine, or inverse cosine, of its argument. The arccosine is the angle whose cosine
is the argument. The returned angle is given in radians in the range 0 (zero) to π.
The Acot function returns the principal value of the arccotangent, or inverse cotangent, of its argument. The
returned angle is given in radians in the range 0 (zero) to π.
The Asin function returns the arcsine, or inverse sine, of its argument. The arcsine is the angle whose sine is the
argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan function returns the arctangent, or inverse tangent, of its argument. The arctangent is the angle whose
tangent is the argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan2 function returns the arctangent, or inverse tangent, of the specified x and y coordinates as arguments.
The arctangent is the angle from the x-axis to a line that contains the origin (0, 0) and a point with coordinates (x, y).
The angle is given in radians between -π and π, excluding -π. A positive result represents a counterclockwise angle
from the x-axis; a negative result represents a clockwise angle. Atan2( a, b ) equals Atan( b/a ), except that a can
equal 0 (zero) with the Atan2 function.
Helper functions
The Degrees function converts radians to degrees. π radians equals 180 degrees.
The Pi function returns the transcendental number π, which begins 3.141592...
The Radians function converts degrees to radians.
Notes
If you pass a single number to these functions, the return value is a single result. If you pass a single-column table
that contains numbers, the return value is a single-column table of results, one result for each record in the
argument's table. If you have a multi-column table, you can shape it into a single-column table, as working with
tables describes.
If an argument would result in an undefined value, the result is blank. This can happen, for example, when using
inverse functions with arguments that are out of range.
Syntax
Primary Functions
Cos( Radians )
Cot( Radians )
Sin( Radians )
Tan( Radians )
Radians - Required. Angle to operate on.
Cos( SingleColumnTable )
Cot( SingleColumnTable )
Sin( SingleColumnTable )
Tan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of angles to operate on.
Inverse Functions
Acos( Number )
Acot( Number )
Asin( Number )
Atan( Number )
Number - Required. Number to operate on.
Acos( SingleColumnTable )
Acot( SingleColumnTable )
Asin( SingleColumnTable )
Atan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of numbers to operate on.
Atan2( X, Y )
X - Required. X-axis coordinate.
Y - Required. Y -axis coordinate.
Helper Functions
Degrees( Radians )
Radians - Required. Angle in radians to convert to degrees.
Pi()
Radians( Degrees )
Degrees - Required. Angle in degrees to convert to radians.

Examples
Single number
FORMULA DESCRIPTION RESULT

Cos( 1.047197 ) Returns the cosine of 1.047197 radians 0.5


or 60 degrees.
FORMULA DESCRIPTION RESULT

Cot( Pi()/4 ) Returns the cotangent of 0.785398... 1


radians or 45 degrees.

Sin( Pi()/2 ) Returns the sine of 1.570796... radians 1


or 90 degrees.

Tan( Radians(60) ) Returns the tangent of 1.047197... 1.732050...


radians or 60 degrees.

Acos( 0.5 ) Returns the arccosine of 0.5, in radians. 1.047197...

Acot( 1 ) Returns the arccotangent of 1, in 0.785398...


radians.

Asin( 1 ) Returns the arcsine of 1, in radians. 1.570796...

Atan( 1.732050 ) Returns the arctangent of 1.732050, in 1.047197...


radians.

Atan2( 5, 3 ) Returns the arctangent of the angle 0.540419...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (5,3),
which is approximately 31 degrees.

Atan2( 4, 4 ) Returns the arctangent of the angle 0.785398...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (4,4),
which is exactly π/4 radians or 45
degrees.

Degrees( 1.047197 ) Returns the equivalent number of 60


degrees for 1.047197 radians.

Pi() Returns the transcendental number π. 3.141592...

Radians( 15 ) Returns the equivalent number of 0.261799...


radians for 15 degrees.

Single -column table


The examples in this section use a data source that's named ValueTable and that contains the following data. The
last record in the table is π/2 radians or 90 degrees.

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Cos( ValueTable ) Returns the cosine of each number in


the table.

Cot( ValueTable ) Returns the cotangent of each number


in the table.

Sin( ValueTable ) Returns the sine of each number in the


table.

Tan( ValueTable ) Returns the tangent of each number in


the table.

Acos( ValueTable ) Returns the arccosine of each number in


the table.

Acot( ValueTable ) Returns the arccotangent of each


number in the table.

Asin( ValueTable ) Returns the arcsine of each number in


the table.

Atan( ValueTable ) Returns the arctangent of each number


in the table.
FORMULA DESCRIPTION RESULT

Degrees( ValueTable ) Returns the equivalent number of


degrees for each number in the table,
assumed to be angles in radians.

Radians( ValueTable ) Returns the equivalent number of


radians for each number in the table,
assumed to be angles in degrees.
Rand function in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Returns a pseudo-random number.

Description
The Rand function returns a pseudo-random number that's greater than or equal to 0 and less than 1.

Volatile Functions
Rand is a volatile function. Each time the function is evaluated it returns a different value.
When used in a data flow formula, a volatile function will only return a different value if the formula in which it
appears is reevaluated. If nothing else changes in the formula then it will have the same value throughout the
execution of your app.
For example, a label control with Label1.Text = Rand() will not change while your app is active. Only closing and
reopening the app will result in a new value.
The function will be reevaluated if it is part of a formula in which something else has changed. For example, if we
change our example to involve a slider control with Label1.Text = Slider1.Value + Rand() then a new random
number is generated each time the Slider control's value changes and the label's text property is reevaluated. See
below for this example.
When used in a behavior formula, Rand will be evaluated each time the behavior formula is evaluated. See below
for an example.

Syntax
Rand()

Examples
Display a different random number as user input changes
1. Add a Slider control, and rename it Slider1 if it has a different name.
2. Add a Label control, and set its Text property to this formula:
Slider1.Value + Rand()
The label shows 50 (the default value for the slider) plus a random decimal:
3. While holding down the Alt key, change the value of the slider.
Every time you change the value of the slider, the decimal portion of the label shows a different random
number:

Create a table of random numbers


1. Add a Button control, and set its OnSelect property to this formula:
ClearCollect( RandomNumbers, ForAll( [ 1, 2, 3, 4, 5 ], Rand() ))
This formula creates a single-column table that's used to iterate five times, resulting in five random
numbers.
2. Add a Data table, set its Items property to RandomNumbers, and show the Value field.

3. While holding down the Alt key, select the button by clicking or tapping it.
The data table shows five random decimal numbers:
4. Select the button again to show a different list of random numbers:

To generate a single random number instead of a table, use Set( RandomNumber, Rand() ).
Refresh function in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Refreshes the records of a data source.

Description
The Refresh function retrieves a fresh copy of a data source. You'll see changes that other users made.
Refresh has no return value, and you can use it only in behavior formulas.

Syntax
Refresh( DataSource )
DataSource – Required. The data source that you want to refresh.

Example
In this example, you'll refresh the data source named IceCream, which starts with this data:

A user on another device changes the Quantity in the Strawberry record to 400. You won't see this change
until this formula executes:
Refresh( IceCream )
After that formula executes, galleries that are bound to the IceCream data source will show the updated value
for Strawberry:
Relate and Unrelate functions in Power Apps
12/3/2019 • 9 minutes to read • Edit Online

Relate and unrelate records of two entities through a one-to-many or many-to-many relationship.

Description
The Relate function links two records through a one-to-many or many-to-many relationship in Common Data
Service. The Unrelate function reverses the process and removes the link.
For one-to-many relationships, the Many entity has a foreign-key field that points to a record of the One entity.
Relate sets this field to point to a specific record of the One entity, while Unrelate sets this field to blank. If the
field is already set when Relate is called, the existing link is lost in favor of the new link. You can also set this field
by using the Patch function or an Edit form control; you need not use the Relate function.
For many-to-many relationships, the system that links the records maintains a hidden join table. You can't access
this join table directly; it can be read only through a one-to-many projection and set through the Relate and
Unrelate functions. Neither related entity has a foreign key.
The data for the entity that you specify in the first argument will be refreshed to reflect the change, but the data for
the entity that you specify in the second argument won't. That data must be manually refreshed with the Refresh
function to show the result of the operation.
These functions never create or delete a record. They only relate or unrelate two records that already exist.
You can use these functions only in behavior formulas.

NOTE
These functions are part of a preview feature, and their behavior is available only when the Relational data, option sets,
and other new features for CDS feature is enabled. This is an app-level setting that's enabled by default for new apps. To
find this feature switch, open the File menu, select App settings, and then select Advanced settings. Your feedback is very
valuable to us - please let us know what you think in the Power Apps community forums.

Syntax
Relate( Entity1RelatedTable, Entity2Record )
Entity1RelatedTable - Required. For a record of Entity1, the table of Entity2 records related through a one-to-
many or many-to-many relationship.
Entity2Record - Required. The Entity2 record to add to the relationship.
Unrelate( Entity1RelatedTable, Entity2Record )
Entity1RelatedTable - Required. For a record of Entity1, the table of Entity2 records related through a one-to-
many or many-to-many relationship.
Entity2Record - Required. The Entity2 record to remove from the relationship.

Examples
Consider a Products entity with the following relationships as seen in the Power Apps portal's entity viewer:
RELATIONSHIP DISPLAY NAME RELATED ENTITY RELATIONSHIP TYPE

Product Reservation Reservation One-to-many

Product ↔ Contact Contact Many-to-many

Products and Reservations are related through a One-to-Many relationship. To relate the first record of the
Reservations entity with the first record of the Products entity:
Relate( First( Products ).Reservations, First( Reservations ) )

To remove the relationship between these records:


Unrelate( First( Products ).Reservations, First( Reservations ) )

At no time did we create or remove or a record, only the relationship between records was modified.
Products and Contacts are related through a Many-to-Many relationship. To relate the first record of the
Contacts entity with the first record of the Products entity:
Relate( First( Products ).Contacts, First( Contacts ) )

As Many-to-Many relationships are symmetric, we could also have done this in the opposite direction:
Relate( First( Contacts ).Products, First( Products ) )

To remove the relationship between these records:


Unrelate( First( Products ).Contacts, First( Contacts ) )

or:
Unrelate( First( Contacts ).Products, First( Products ) )

The walk through that follows does exactly these operations on these entities using an app with Gallery and
Combo box controls for selecting the records involved.
These examples depend on the sample data being installed in your environment. Either create a trial environment
including sample data or add sample data to an existing environment.
One -to -many
Relate function
You'll first create a simple app to view and reassign the reservations that are associated with a product.
1. Create a tablet app from blank.
2. On the View tab, select Data sources.
3. In the Data pane, select Add data source > Common Data Service > Products > Connect.
The Products entity is part of the sample data loaded above.
4. On the Insert tab, add a blank vertical Gallery control.
5. Ensure that the control that you just added is named Gallery1, and then move and resize it to fill the left-
hand side of the screen.
6. On the Properties tab, set Gallery1's Items property to Products and its Layout to Image and title.

7. In Gallery1, ensure that the Label control is named Title1, and then set its Text property to
ThisItem.Name.

8. Select the screen to avoid inserting the next item into Gallery1. Add a second blank vertical Gallery control,
and ensure that it's named Gallery2.
Gallery2 will show the reservations for whatever product the user selects in Gallery1.
9. Move and resize Gallery2 to fill the upper-right quadrant of the screen.
10. (optional) Add the blue Label control above Gallery2, as the next graphic shows.
11. In the formula bar, set the Items property of Gallery2 to Gallery1.Selected.Reservations.
12. In the properties pane, set Gallery2's Layout to Title.

13. In Gallery2, add a Combo box control, ensure that it's named ComboBox1, and then move and resize it to
avoid blocking the other controls in Gallery2.
14. On the Properties tab, set ComboBox1's Items property to Products.

15. Scroll down in the Properties tab and set ComboBox1's Allow multiple selection property to Off.
16. In the formula bar, set ComboBox1's DefaultSelectedItems property to ThisItem.'Product
Reservation'.

17. In Gallery2, set NextArrow2's OnSelect property to this formula:

Relate( ComboBox1.Selected.Reservations, ThisItem )

When the user selects this icon, the current reservation changes to the product that the user selected in
ComboBox1.

18. Press F5 to test the app in Preview mode.


With this app, the user can move a reservation from one product to another. For a reservation on one product, the
user can select a different product in ComboBox1 and then select NextArrow2 to change that reservation.

Unrelate function
At this point, you can move the relationship from one record to another, but you can't remove the relationship
altogether. You can use the Unrelate function to disconnect a reservation record from any product.
1. On the View tab, select Data sources.
2. In the Data pane, select Add data source > Common Data Service > Reservations > Connect.
3. In Gallery2, set the OnSelect formula for NextArrow2 to this formula:

If( IsBlank( ComboBox1.Selected ),


Unrelate( Gallery1.Selected.Reservations, ThisItem ),
Relate( ComboBox1.Selected.Reservations, ThisItem )
);
Refresh( Reservations )

4. Copy Gallery2 to the Clipboard by selecting it and then pressing Ctrl-C.


5. Paste a duplicate of Gallery2 to the same screen by pressing Ctrl-V, and then move it to the lower-right
quadrant of the screen.
6. (optional) If you added a label above Gallery2, repeat the previous two steps for that label.
7. Ensure that the duplicate of Gallery2 is named Gallery2_1, and then set its Items property to this formula:

Filter( Reservations, IsBlank( 'Product Reservation' ) )

A delegation warning appears, but it won't matter with the small amount of data in this example.

With these changes, users can clear the selection in ComboBox1 for a contact if that person hasn't reserved a
product. Contacts who haven't reserved a product appear in Gallery2_1 where users can assign each contact to a
product.

Many-to -many
Create a many-to-many relationship
The sample data doesn't include a many-to-many relationship, but you'll create one between the Products entity
and the Contacts entity. Users can relate each product to more than one contact and each contact to more than one
product.
1. From this page, select Data in the left navigation bar, and then select Entities.

2. Change the entity filter to include all entities.


By default, sample entities don't appear.

3. Scroll down, open the Product entity, and select Relationships.


4. Select Add relationship > Many-to-many.

5. Select the Contact entity for the relationship.

6. Select Done > Save entity.

Relate and unrelate contacts with one or more products


You'll create another app that resembles the one you created earlier in this topic, but the new app will offer a many-
to-many relationship. Each contact will be able to reserve multiple products instead of only one.
1. In a blank app for tablets, create Gallery1 as the first procedure in this topic describes.
2. Add another blank vertical Gallery control, ensure that it's named Gallery2, and then move it into the
upper-right corner of the screen.
Later in this topic, you'll add a Combo box control under Gallery2.
3. In the formula bar, set Gallery2's Items property to Gallery1.Selected.Contacts.

4. On the Properties tab, set Layout to Image and title.

5. In Gallery2, ensure that the Label control is named Title2, and then set its Text property to ThisItem.'Full
Name'.
No text will appear in that control until you finish this procedure and assign a contact to a product.
6. Delete NextArrow2, insert a Cancel icon, and ensure that it's named icon1.
7. Set the Cancel icon's OnSelect property to this formula:

Unrelate( Gallery1.Selected.Contacts, ThisItem )

8. On the View tab, select Data sources.


9. In the Data pane, select Add data source > Common Data Service > Contacts > Connect.
10. Under Gallery2, add a Combo box control, ensure that it's named ComboBox1, and then set its Items
property to Contacts.
11. On the Properties tab, set Allow multiple selection to Off.

12. Insert an Add icon, and set its OnSelect property to this formula:

Relate( Gallery1.Selected.Contacts, ComboBox1.Selected )

With this app, users can now freely relate and unrelate a set of contacts to each product.
To add a contact to a product, select the contact in the combo box at the bottom of the screen, and then select
the Add icon.
To remove a contact from a product, select the Cancel icon for that contact.
Unlike one-to-many, a many-to-many relationship allows users to associate the same contact with multiple
products.

In reverse: relate and unrelate products with multiple contacts


Many-to-many relationships are symmetric. You can extend the example to add products to a contact and then flip
between the two screens to show how the relationship appears from either direction.
1. Set the OnVisible property of Screen1 to Refresh( Products ).
When you update a one-to-many or many-to-many relationship, only the data of the first argument entity of
the Relate or Unrelate call is refreshed. The second must be refreshed manually if you want to flip between
the screens of this app.

2. Duplicate Screen1.
The duplicate will be named Screen1_1 and form the basis for looking at the relationships from the contacts
side.
3. To create the reverse view, change these formulas on the controls of Screen1_1:
Screen1_1.OnVisible = Refresh( Contacts )
Gallery1_1.Items = Contacts
Title1_1.Text = ThisItem.'Full Name'
Label1_1.Text = "Selected Contact Products"
Gallery2_1.Items = Gallery1_1.Selected.Products
Title2_1.Text = ThisItem.Name
Icon1_1.OnSelect = Unrelate( Gallery1_1.Selected.Products, ThisItem )
ComboBox1_1.Items = Products
Icon2_1.OnSelect = Relate( Gallery1_1.Selected.Products, ComboBox1_1.Selected )
The result will look very similar to the previous screen but comes at the relationship from the Contacts side.

4. Insert an Arrows up down icon and set its OnSelect property to Navigate( Screen1, None ). Do the
same thing on Screen1 with the formula Navigate( Screen1_1, None ).
With this new screen, users can add a contact to a product and then flip to a view of contacts and see the associated
product. The relationships are symmetric and shared between the two screens.
Remove and RemoveIf functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Removes records from a data source.

Description
Remove function
Use the Remove function to remove a specific record or records from a data source.
For collections, the entire record must match. You can use the All argument to remove all copies of a record;
otherwise, only one copy of the record is removed.
RemoveIf function
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.
Remove and RemoveIf return the modified data source as a table. You can use both functions only in behavior
formulas.
You can also use the Clear function to remove all of the records in a data source.
Delegation
When used with a data source, these functions can't be delegated. Only the first portion of the data source will be
retrieved and then the function applied. The result may not represent the complete story. A warning will appear at
authoring time to remind you of this limitation and to suggest switching to delegable alternatives where possible.
For more information, see the delegation overview.

Syntax
Remove( DataSource, Record1 [, Record2, ... ] [, All ] )
DataSource – Required. The data source that contains the record or records that you want to remove.
Record (s) – Required. The record or records to remove.
All – Optional. In a collection, the same record may appear more than once. You can add the All argument to
remove all copies of the record.
Remove( DataSource, Table [, All ] )
DataSource – Required. The data source that contains the records that you want to remove.
Table – Required. A table of records to remove.
All – Optional. In a collection, the same record may appear more than once. You can add the All argument to
remove all copies of the record.
RemoveIf( DataSource, Condition [, ... ] )
DataSource – Required. The data source that contains the record or records that you want to remove.
Condition(s) – Required. A formula that evaluates to true for the record or records to remove. You can use
column names from the DataSource in the formula. If you specify multiple Conditions, all must evaluate to true
for the record or records to be removed.
Examples
In these examples, you'll remove a record or records in a data source that's named IceCream and that starts with
the data in this table:

FORMULA DESCRIPTION RESULT

Remove( IceCream, Removes the Chocolate record from


First( Filter( IceCream, Flavor="Choc the data source.
olate" ) ) )

The IceCream data source has been


modified.

Remove( IceCream, Removes two records from the data


First( Filter( IceCream, Flavor="Choc source.
olate" ) )
First( Filter( IceCream, Flavor="Stra
wberry" ) ) ) The IceCream data source has been
modified.

RemoveIf( IceCream, Quantity > 150 Removes records that have a Quantity
) that's greater than 150.

The IceCream data source has been


modified.

RemoveIf( IceCream, Removes records that have a Quantity


Quantity > 150, Left( Flavor, 1 ) = that's greater than 150 and Flavor
"S" ) starts with an S.

The IceCream data source has been


modified.

RemoveIf( IceCream, true ) Removes all records from the data


source.
The IceCream data source has been
modified.

Step by step
1. Import or create a collection named Inventory, and show it in a gallery as Show data in a gallery describes.
2. In the gallery, set the OnSelect property of the image to this expression:
Remove(Inventory, ThisItem )
3. Press F5, and then select an image in the gallery.
The item is removed from the gallery and the collection.
Remove and RemoveIf functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Removes records from a data source.

Description
Remove function
Use the Remove function to remove a specific record or records from a data source.
For collections, the entire record must match. You can use the All argument to remove all copies of a record;
otherwise, only one copy of the record is removed.
RemoveIf function
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.
Remove and RemoveIf return the modified data source as a table. You can use both functions only in
behavior formulas.
You can also use the Clear function to remove all of the records in a data source.
Delegation
When used with a data source, these functions can't be delegated. Only the first portion of the data source will
be retrieved and then the function applied. The result may not represent the complete story. A warning will
appear at authoring time to remind you of this limitation and to suggest switching to delegable alternatives
where possible. For more information, see the delegation overview.

Syntax
Remove( DataSource, Record1 [, Record2, ... ] [, All ] )
DataSource – Required. The data source that contains the record or records that you want to remove.
Record (s) – Required. The record or records to remove.
All – Optional. In a collection, the same record may appear more than once. You can add the All argument
to remove all copies of the record.
Remove( DataSource, Table [, All ] )
DataSource – Required. The data source that contains the records that you want to remove.
Table – Required. A table of records to remove.
All – Optional. In a collection, the same record may appear more than once. You can add the All argument
to remove all copies of the record.
RemoveIf( DataSource, Condition [, ... ] )
DataSource – Required. The data source that contains the record or records that you want to remove.
Condition(s) – Required. A formula that evaluates to true for the record or records to remove. You can use
column names from the DataSource in the formula. If you specify multiple Conditions, all must evaluate to
true for the record or records to be removed.
Examples
In these examples, you'll remove a record or records in a data source that's named IceCream and that starts
with the data in this table:

FORMULA DESCRIPTION RESULT

Remove( IceCream, Removes the Chocolate record from


First( Filter( IceCream, Flavor="Ch the data source.
ocolate" ) ) )

The IceCream data source has been


modified.

Remove( IceCream, Removes two records from the data


First( Filter( IceCream, Flavor="Ch source.
ocolate" ) )
First( Filter( IceCream, Flavor="Str
awberry" ) ) ) The IceCream data source has been
modified.

RemoveIf( IceCream, Removes records that have a


Quantity > 150 ) Quantity that's greater than 150.

The IceCream data source has been


modified.

RemoveIf( IceCream, Removes records that have a


Quantity > 150, Left( Flavor, 1 ) = Quantity that's greater than 150 and
"S" ) Flavor starts with an S.

The IceCream data source has been


modified.

RemoveIf( IceCream, true ) Removes all records from the data


source.
The IceCream data source has been
modified.

Step by step
1. Import or create a collection named Inventory, and show it in a gallery as Show data in a gallery
describes.
2. In the gallery, set the OnSelect property of the image to this expression:
Remove(Inventory, ThisItem )
3. Press F5, and then select an image in the gallery.
The item is removed from the gallery and the collection.
AddColumns, DropColumns, RenameColumns, and
ShowColumns functions in Power Apps
12/3/2019 • 6 minutes to read • Edit Online

Shapes a table by adding, dropping, renaming, and selecting its columns.

Overview
These functions shape a table by adjusting its columns:
Reduce a table that contains multiple columns down to a single column for use with single-column functions, such as Lower or Abs.
Add a calculated column to a table (for example, a Total Price column that shows the results of multiplying Quantity by Unit Price).
Rename a column to something more meaningful, for display to users or for use in formulas.
A table is a value in Power Apps, just like a string or a number. You can specify a table as an argument in a formula, and functions can
return a table as a result.

NOTE
The functions that this topic describes don't modify the original table. Instead, they take that table as an argument and return a new table with a
transform applied. See working with tables for more details.

You can't modify the columns of a data source by using these functions. You must modify the data at its source. You can add columns to
a collection with the Collect function. See working with data sources for more details.

Description
The AddColumns function adds a column to a table, and a formula defines the values in that column. Existing columns remain
unmodified.
The formula is evaluated for each record of the table.
Fields of the record currently being processed are available within the formula. You simply reference them by name as you would any
other value. You can also reference control properties and other values from throughout your app. For more details, see the examples
below and working with record scope.
The DropColumns function excludes columns from a table. All other columns remain unmodified. DropColumns excludes columns,
and ShowColumns includes columns.
Use the RenameColumns function to rename one or more columns of a table by providing at least one argument pair that specifies the
name of a column that the table contains (the old name, which you want to replace) and the name of a column that the table doesn't
contain (the new name, which you want to use). The old name must already exist in the table, and the new name must not exist. Each
column name may appear only once in the argument list as either an old column name or a new column name. To rename a column to
an existing column name, first drop the existing column with DropColumns, or rename the existing column out of the way by nesting
one RenameColumns function within another.
The ShowColumns function includes columns of a table and drops all other columns. You can use ShowColumns to create a single-
column table from a multi-column table. ShowColumns includes columns, and DropColumns excludes columns.
For all these functions, the result is a new table with the transform applied. The original table isn't modified. You can't modify an existing
table with a formula. SharePoint, Common Data Service, SQL Server, and other data sources provide tools for modifying the columns of
lists, entities, and tables, which are often referred to as the schema. The functions in this topic only transform an input table, without
modifying the original, into an output table for further use.
The arguments to these functions support delegation. For example, a Filter function used as an argument to pull in related records
searches through all listings, even if the '[dbo].[AllListings]' data source contains a million rows:

AddColumns( RealEstateAgents,
"Listings",
Filter( '[dbo].[AllListings]', ListingAgentName = AgentName )
)
However, the output of these functions is subject to the non-delegation record limit. In this example, only 500 records are returned even
if the RealEstateAgents data source has 501 or more records.
If you use AddColumns in this manner, Filter must make separate calls to the data source for each of those first records in
RealEstateAgents, which causes a lot of network chatter. If [dbo].[AllListings] is small enough and doesn't change often, you could
call the Collect function in OnStart to cache the data source in your app when it starts. As an alternative, you could restructure your app
so that you pull in the related records only when the user asks for them.

Syntax
AddColumns( Table, ColumnName1, Formula1 [, ColumnName2, Formula2, ... ] )
Table - Required. Table to operate on.
ColumnName(s) - Required. Name(s) of the column(s) to add. You must specify a string (for example, "Name" with double quotes
included) for this argument.
Formula (s) - Required. Formula(s) to evaluate for each record. The result is added as the value of the corresponding new column. You
can reference other columns of the table in this formula.
DropColumns( Table, ColumnName1 [, ColumnName2, ... ] )
Table - Required. Table to operate on.
ColumnName(s) - Required. Name(s) of the column(s) to drop. You must specify a string (for example, "Name" with double quotes
included) for this argument.
RenameColumns( Table, OldColumnName1, NewColumnName1 [, OldColumnName2, NewColumnName2, ... ] )
Table - Required. Table to operate on.
OldColumnName - Required. Name of a column to rename from the original table. This element appears first in the argument pair
(or first in each argument pair if the formula includes more than one pair). This name must be a string (for example "Name" with
double quotation marks included).
NewColumnName - Required. Replacement name. This element appears last in the argument pair (or last in each argument pair if
the formula includes more than one pair). You must specify a string (for example, "Customer Name" with double quotation marks
included) for this argument.
ShowColumns( Table, ColumnName1 [, ColumnName2, ... ] )
Table - Required. Table to operate on.
ColumnName(s) - Required. Name(s) of the column(s) to include. You must specify a string (for example, "Name" with double
quotes included) for this argument.

Examples
The examples in this section use the IceCreamSales data source, which contains the data in this table:

None of these examples modify the IceCreamSales data source. Each function transforms the value of the data source as a table and
returns that value as the result.

FORMULA DESCRIPTION RESULT

AddColumns( IceCreamSales, "Revenue", Adds a Revenue column to the result. For each
UnitPrice * QuantitySold ) record, UnitPrice * QuantitySold is evaluated,
and the result is placed in the new column.

DropColumns( IceCreamSales, "UnitPrice" ) Excludes the UnitPrice column from the result.
Use this function to exclude columns, and use
ShowColumns to include them.
FORMULA DESCRIPTION RESULT

ShowColumns( IceCreamSales, "Flavor" ) Includes only the Flavor column in the result.
Use this function include columns, and use
DropColumns to exclude them.

RenameColumns( IceCreamSales, Renames the UnitPrice column in the result.


"UnitPrice", "Price")

RenameColumns( IceCreamSales, Renames the UnitPrice and QuantitySold


"UnitPrice", "Price", "QuantitySold", columns in the result.
"Number")

DropColumns( Performs the following table transforms in


RenameColumns( order, starting from the inside of the formula:
AddColumns( IceCreamSales, "Revenue", 1. Adds a Revenue column based on the
UnitPrice * QuantitySold ), per-record calculation of UnitPrice *
"UnitPrice", "Price" ), Quantity.
"Quantity" ) 2. Renames UnitPrice to Price.
3. Excludes the Quantity column.
Note that order is important. For example, we
can't calculate with UnitPrice after it has been
renamed.

Step by step
Let's try some of the examples from earlier in this topic.
1. Create a collection by adding a Button control and setting its OnSelect property to this formula:

ClearCollect( IceCreamSales,
Table(
{ Flavor: "Strawberry", UnitPrice: 1.99, QuantitySold: 20 },
{ Flavor: "Chocolate", UnitPrice: 2.99, QuantitySold: 45 },
{ Flavor: "Vanilla", UnitPrice: 1.50, QuantitySold: 35 }
)
)

2. Run the formula by selecting the button while holding down the Alt key.
3. Add a second Button control, set its OnSelect property to this formula, and then run it:

ClearCollect( FirstExample,
AddColumns( IceCreamSales, "Revenue", UnitPrice * QuantitySold )
)

4. On the File menu, select Collections, and then select IceCreamSales to show that collection.
As this graphic shows, the second formula didn't modify this collection. The AddColumns function used IceCreamSales as a
read-only argument; the function didn't modify the table to which that argument refers.
5. Select FirstExample.
As this graphic shows, the second formula returned a new table with the added column. The ClearCollect function captured the
new table in the FirstExample collection, adding something to the original table as it flowed through the function without
modifying the source:
Replace and Substitute functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Replace a portion of a string of text with another string.

Description
The Replace function identifies the text to replace by starting position and length.
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.
If you pass a single string, the return value is the modified string. If you pass a single-column table that contains
strings, the return value is a single-column table of modified strings. If you have a multi-column table, you can
shape it into a single-column table, as working with tables describes.

Syntax
Replace( String, StartingPosition, NumberOfCharacters, NewString )
String - Required. The string to operate on.
StartingPosition - Required. Character position to start the replacement. The first character of String is at
position 1.
NumberOfCharacters - Required. The number of characters to replace in String.
NewString - Required. The replacement string. The number of characters in this argument can differ from the
NumberOfCharacters argument.
Substitute( String, OldString, NewString [, InstanceNumber ] )
String - Required. The string to operate on.
OldString - Required. The string to replace.
NewString - Required. The replacement string. OldString and NewString can have different lengths.
InstanceNumber - Optional. Use this argument to specify which instance of OldString to replace if String
contains more than one instance. If you don't specify this argument, all instances will be replaced.
Replace( SingleColumnTable, StartingPosition, NumberOfCharacters, NewString )
SingleColumnTable - Required. A single-column table of strings to operate on.
StartingPosition - Required. Character position to start the replacement. The first character of each string in the
table is at position 1.
NumberOfCharacters - Required. The number of characters to replace in each string.
NewString - Required. The replacement string. The number of characters in this argument can differ from the
NumberOfCharacters argument.
Substitute( SingleColumnTable, OldString, NewString [, InstanceNumber ] )
SingleColumnTable - Required. A single-column table of strings to operate on.
OldString - Required. The string to replace.
NewString - Required. The replacement string. OldString and NewString can have different lengths.
InstanceNumber - Optional. Use this argument to specify which instance of OldString to replace if String
contains more than one instance. If you don't specify this argument, all instances will be replaced.
Examples
FORMULA DESCRIPTION RESULT

Replace( "abcdefghijk", 6, 5, "*" ) Replaces five characters in "abcdefghijk" "abcde*k"


with a single "*" character, starting with
the sixth character ("f").

Replace( "2019", 3, 2, "20" ) Replaces the last two characters of "2020"


"2019" with "20".

Replace( "123456", 1, 3, "_" ) Replaces the first three characters of "_456"


"123456" with a single "_" character.

Substitute( "Sales Data", "Sales", "C Substitutes the string "Cost" for "Sales". "Cost Data"
ost" )

Substitute( "Quarter 1, 2018", "1", Substitutes only the first instance of "1" "Quarter 2, 2018"
"2", 1 ) with "2" because the fourth argument
(InstanceNumber) is provided with a 1.

Substitute( "Quarter 1, 2011", "1", Substitutes only the third instance of "1" "Quarter 1, 2012"
"2", 3 ) with "2" because the fourth argument
(InstanceNumber) is provided with a 3.

Substitute( "Quarter 1, 2011", "1", Substitutes all instances of "1" with "2" "Quarter 2, 2022"
"2" ) because the fourth argument
(InstanceNumber) isn't provided.

Replace( Replaces the ninth character in each [ "Quarter 3, 2018",


[ "Quarter 1, 2018", record of the single-column table with "Quarter 3, 2011",
"Quarter 2, 2011", "3". "Quarter 3, 2019" ]
"Quarter 4, 2019" ],
9, 1, "3" )

Substitute( Because the fourth argument [ "Qtr 3, 2018",


[ "Qtr 1, 2018", (InstanceNumber) is provided with a "Quarter 3, 2011",
"Quarter 1, 2011", value of 1, substitutes only the first "Q3, 2019" ]
"Q1, 2019" ], instance of "1" in each record of the
"1", "3", 1 ) single-column table with "3".

Substitute( Because the fourth argument [ "Qtr 3, 2038",


[ "Qtr 1, 2018", (InstanceNumber) isn't provided, "Quarter 3, 2033",
"Quarter 1, 2011", substitutes all instances of "1" in each "Q3, 2039" ]
"Q1, 2019" ], record of the single-column table with
"1", "3" ) "3".
Reset function in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Resets a control to its default value, discarding any user changes.

Description
The Reset function resets a control to its Default property value. Any user changes are discarded.
You cannot reset controls that are within a Gallery or Edit form control from outside those controls. You can
reset controls from formulas on controls within the same gallery or form. You can also reset all the controls
within a form with the ResetForm function.
Using the Reset function is an alternative to toggling the Reset property of input controls and is generally
preferred. The Reset property may be a better choice if many controls need to be reset together from multiple
formulas. Toggling the Reset property can be done from a Button control with the formula Reset =
Button.Pressed or from a variable with Reset = MyVar and toggling MyVar with the formula
Button.OnSelect = Set( MyVar, true ); Set( MyVar, false ).
Input controls are also reset when their Default property changes.
Reset has no return value, and you can use it only in behavior formulas.

Syntax
Reset( Control )
Control – Required. The control to reset.

Example
1. Insert a Text input control on a screen. By default, it's name will be TextInput1 and its Default property will
be set to "Text input".
2. Type a new value in the text box.
3. Insert a Button control on the screen.
4. Set the button's OnSelect property to Reset( TextInput1 ).
5. Select the button. This can be done even when authoring by selecting toward the ends of the control.
6. The contents of the text box will return to the value of the Default property.
EditForm, NewForm, SubmitForm, ResetForm, and
ViewForm functions in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

View, edit, or create an item, save the contents, and reset the controls in an Edit form control.

Overview
These functions change the state of the Edit form control. The form control can be in one of these modes:

MODE DESCRIPTION

FormMode.Edit The form is populated with an existing record and the user can
modify the values of the fields. Once complete, the user can
save the changes to the record.

FormMode.New The form is populates with default values and the user can
modify the values of the fields. Once complete, the user can
add the record to the data source.

FormMode.View The form is populated with an existing record but the user
cannot modify the values of the fields.

Description
These functions are often invoked from the OnSelect formula of a Button or Image control so that the user can
save edits, abandon edits, or create a record. You can use controls and these functions together to create a complete
solution.
These functions return no values.
SubmitForm
Use the SubmitForm function in the OnSelect property of a Button control to save any changes in a Form control
to the data source.
Before submitting any changes, this function checks for validation issues with any field that's marked as required or
that has one or more constraints on its value. This behavior matches that of the Validate function.
SubmitForm also checks the Valid property of the Form, which is an aggregation of all the Valid properties of the
Card controls that the Form control contains. If a problem occurs, the data isn't submitted, and the Error and
ErrorKind properties of the Form control are set accordingly.
If validation passes, SubmitForm submits the change to the data source.
If successful, the Form's OnSuccess behavior runs, and the Error and ErrorKind properties are cleared. If the
form was in FormMode.New mode, it is returned to FormMode.Edit mode.
If unsuccessful, the Form's OnFailure behavior runs, and the Error and ErrorKind properties are set
accordingly. The mode of the form is unchanged.
EditForm
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.
NewForm
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.
ResetForm
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.
ViewForm
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.
DisplayMode Property
The current mode can be read through the Mode property. The mode also determines the value of the
DisplayMode property which can be used by data cards and controls within the form control. Often, the data
card's DisplayMode property will be set to Parent.DisplayMode (referencing the form) as will the control's
DisplayMode property (referencing the data card):

MODE DISPLAYMODE DESCRIPTION

FormMode.Edit DisplayMode.Edit Data cards and controls are editable,


ready to accept changes to a record.

FormMode.New DisplayMode.Edit Data cards and controls are editable,


ready to accept a new record.

FormMode.View DisplayMode.View Data cards and controls are not editable


and optimized for viewing.

Syntax
SubmitForm ( FormName )
FormName - Required. Form control to submit to the data source.
EditForm ( FormName )
FormName - Required. Form control to switch to FormMode.Edit mode.
NewForm ( FormName )
FormName - Required. Form control to switch to FormMode.New mode.
ResetForm ( FormName )
FormName - Required. Form control to reset to initial values. Also switches the form from FormMode.New
mode to FormMode.Edit mode.
ViewForm ( FormName )
FormName - Required. Form control to switch to FormMode.View mode.
Examples
See Understand data forms for complete examples.
1. Add a Button control, set its Text property to show Save, and set its OnSelect property to this formula:
SubmitForm ( EditForm )
2. Set the OnFailure property of a Form control to blank and its OnSuccess property to this formula:
Back()
3. Name a Label control ErrorText, and set its Text property to this formula:
EditForm.Error
When the user selects the Save button, any changes in the Form control are submitted to the underlying
data source.
If the submission succeeds, any changes are saved or, if the Form control is in New mode, a record is
created. ErrorText is blank and the previous screen reappears.
If the submission fails, ErrorText shows a user-friendly error message, and the current screen remains
visible so that the user can correct the problem and try again.
4. Add a Button control, set its Text property to show Cancel, and set its OnSelect property to this formula:
ResetForm ( EditForm ); Back()
When the user selects the Cancel button, the values in the Form control are reset to what they were before
the user started to edit it, the previous screen reappears, and the Form control is returned to Edit mode if it
was in New mode.
5. Add a Button control, set its Text property to show New, and set its OnSelect property to this formula:
NewForm ( EditForm ); Navigate( EditScreen, None )
When the user selects the New button, the Form control switches to New mode, the default values for the
Form control's data source populate that control, and the screen that contains the Form control appears.
When the SubmitForm function runs, a record is created instead of updated.
Revert function in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Refreshes and clears errors for the records of a data source.

Description
The Revert function refreshes an entire data source or a single record in that data source. You'll see changes that
other users made.
For the records reverted, Revert also clears any errors from the table that the Errors function returned.
If the Errors function reports a conflict after a Patch or other data operation, Revert the record to start with the
conflicting version and reapply the change.
Revert has no return value. You can use it only in a behavior formula.

Syntax
Revert( DataSource [, Record ] )
DataSource – Required. The data source that you want to revert.
Record - Optional. The record that you want to revert. If you don't specify a record, the entire data source is
reverted.

Example
In this example, you'll revert the data source named IceCream, which starts with the data in this table:

A user on another device changes the Quantity property of the Strawberry record to 400. At about the same
time, you change the same property of the same record to 500, not knowing about the other change.
You use the Patch function to update the record:
Patch( IceCream, First( Filter( IceCream, Flavor = "Strawberry" ) ), { Quantity: 500 } )
You check the Errors table and find an error:

RECORD COLUMN MESSAGE ERROR

{ ID: 1, Flavor: blank "The record you are ErrorKind.Conflict


"Strawberry", Quantity: trying to modify has been
300 } modified by another user.
Please revert the record
and try again."

Based on the Error column, you have a Reload button for which the OnSelect property to set to this formula:
Revert( IceCream, First( Filter( IceCream, Flavor = "Strawberry" ) ) )
After you select the Reload button, the Errors table is empty, and the new value for Strawberry has been loaded:

You reapply your change on top of the previous change, and your change succeed because the conflict has been
resolved.
Color enumeration and ColorFade, ColorValue,
and RGBA functions in Power Apps
12/3/2019 • 7 minutes to read • Edit Online

Use built-in color values, define custom colors, and use the alpha channel.

Description
By using the Color enumeration, you can easily access the colors that are defined by HTML's Cascading
Style Sheets (CSS ). For example, Color.Red returns pure red. You can find a list of these colors at the end of
this topic.
The ColorValue function returns a color based on a color string in a CSS. The string can take any of these
forms:
CSS color name: "RoxyBrown" and "OliveDrab" are examples. These names don't include spaces. The
list of supported colors appears later in this topic.
6-digit hex value: As an example "#ffd700" is the same as "Gold". The string is in the format
"#rrggbb" where rr is the red portion in two hexadecimal digits, gg is the green, and bb is the blue.
8-digit hex value: As an example, "#ff7f5080" is the same as "Coral" with a 50% alpha channel. The
string is in the format "#rrggbbaa" where rr, gg, and bb are identical to the 6-digit form. The alpha
channel is represented by aa: 00 represents fully transparent, and ff represents fully opaque.
The RGBA function returns a color based on red, green, and blue components. The function also includes an
alpha channel for mixing colors of controls that are layered in front of one another. An alpha channel varies
from 0 or 0% (which is fully transparent and invisible) to 1 or 100% (which is fully opaque and completely
blocks out any layers behind a control).
The ColorFade function returns a brighter or darker version of a color. The amount of fade varies from -1
(which fully darkens a color to black) to 0 (which doesn't affect the color) to 1 (which fully brightens a color to
white).

Alpha channel
In a canvas app, you can layer controls in front of one another and specify the transparency of a control to
any controls that are behind it. As a result, colors will blend through the layers. For example, this diagram
shows how the three primary colors mix with an alpha setting of 50%:
You can also blend images in file formats that support alpha channels. For example, you can't blend .jpeg
files, but you can blend .png files. The next graphic shows the same red, green, and blue colors from the
previous example, but the red color appears as a squiggle (instead of a circle) in a .png file with a 50% alpha
channel:

If you specify a Color enumeration value or you build a ColorValue formula with a color name or a 6-digit
hexadecimal value, the alpha setting is 100%, which is fully opaque.

Syntax
Color.ColorName
ColorName - Required. A Cascading Style Sheet (CSS ) color name. The list of possible enumeration
values appears at the end of this topic.
ColorValue( CSSColor )
CSSColor - Required. A Cascading Style Sheet (CSS ) color definition. You can specify either a name, such
as OliveDrab, or a hex value, such as #6b8e23 or #7fffd420. Hex values can take the form of either
#rrggbb or #rrggbbaa.
RGBA ( Red, Green, Blue, Alpha )
Red, Green, Blue - Required. Color-component values, which range from 0 (no saturation) to 255 (full
saturation).
Alpha - Required. Alpha component, which ranges from 0 (fully transparent) to 1 (fully opaque). You can
also use a percentage, 0% to 100%.
ColorFade( Color, FadeAmount )
Color - Required. A color value such as Color.Red or the output from ColorValue or RGBA.
FadeAmount - Required. A number between -1 and 1. -1 fully darkens a color to black, 0 doesn't affect
the color, and 1 fully brightens a color to white. You can also use a percentage from -100% to 100%.

Built-in colors
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.AliceBlue ColorValue( "#f0f8ff" ) RGBA( 240, 248, 255, 1 )


ColorValue( "aliceblue" )

Color.AntiqueWhite ColorValue( "#faebd7" ) RGBA( 250, 235, 215, 1 )


ColorValue(
"AntiqueWhite" )

Color.Aqua ColorValue( "#00ffff" ) RGBA( 0, 255, 255, 1 )


ColorValue( "AQUA" )

Color.Aquamarine ColorValue( "#7fffd4" ) RGBA( 127, 255, 212, 1 )


ColorValue(
"Aquamarine" )

Color.Azure ColorValue( "#f0ffff" ) RGBA( 240, 255, 255, 1 )


ColorValue( "azure" )

Color.Beige ColorValue( "#f5f5dc" ) RGBA( 245, 245, 220, 1 )


ColorValue( "Beige" )

Color.Bisque ColorValue( "#ffe4c4" ) RGBA( 255, 228, 196, 1 )


ColorValue( "BISQUE" )

Color.Black ColorValue( "#000000" ) RGBA( 0, 0, 0, 1 )


ColorValue( "Black" )

Color.BlanchedAlmond ColorValue( "#ffebcd" ) RGBA( 255, 235, 205, 1 )


ColorValue(
"blanchedalmond" )

Color.Blue ColorValue( "#0000ff" ) RGBA( 0, 0, 255, 1 )


ColorValue( "Blue" )

Color.BlueViolet ColorValue( "#8a2be2" ) RGBA( 138, 43, 226, 1 )


ColorValue(
"BLUEVIOLET" )

Color.Brown ColorValue( "#a52a2a" ) RGBA( 165, 42, 42, 1 )


ColorValue( "Brown" )

Color.Burlywood ColorValue( "#deb887" ) RGBA( 222, 184, 135, 1 )


ColorValue(
"burlywood" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.CadetBlue ColorValue( "#5f9ea0" ) RGBA( 95, 158, 160, 1 )


ColorValue(
"CadetBlue" )

Color.Chartreuse ColorValue( "#7fff00" ) RGBA( 127, 255, 0, 1 )


ColorValue(
"CHARTREUSE" )

Color.Chocolate ColorValue( "#d2691e" ) RGBA( 210, 105, 30, 1 )


ColorValue(
"Chocolate" )

Color.Coral ColorValue( "#ff7f50" ) RGBA( 255, 127, 80, 1 )


ColorValue( "coral" )

Color.CornflowerBlue ColorValue( "#6495ed" ) RGBA( 100, 149, 237, 1 )


ColorValue(
"CornflowerBlue" )

Color.Cornsilk ColorValue( "#fff8dc" ) RGBA( 255, 248, 220, 1 )


ColorValue(
"CORNSILK" )

Color.Crimson ColorValue( "#dc143c" ) RGBA( 220, 20, 60, 1 )


ColorValue( "Crimson" )

Color.Cyan ColorValue( "#00ffff" ) RGBA( 0, 255, 255, 1 )


ColorValue( "cyan" )

Color.DarkBlue ColorValue( "#00008b" ) RGBA( 0, 0, 139, 1 )


ColorValue( "DarkBlue" )

Color.DarkCyan ColorValue( "#008b8b" ) RGBA( 0, 139, 139, 1 )


ColorValue(
"DARKCYAN" )

Color.DarkGoldenRod ColorValue( "#b8860b" ) RGBA( 184, 134, 11, 1 )


ColorValue(
"DarkGoldenRod" )

Color.DarkGray ColorValue( "#a9a9a9" ) RGBA( 169, 169, 169, 1 )


ColorValue( "darkgray" )

Color.DarkGreen ColorValue( "#006400" ) RGBA( 0, 100, 0, 1 )


ColorValue(
"DarkGreen" )

Color.DarkGrey ColorValue( "#a9a9a9" ) RGBA( 169, 169, 169, 1 )


ColorValue(
"DARKGREY" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.DarkKhaki ColorValue( "#bdb76b" ) RGBA( 189, 183, 107, 1 )


ColorValue(
"DarkKhaki" )

Color.DarkMagenta ColorValue( "#8b008b" ) RGBA( 139, 0, 139, 1 )


ColorValue(
"darkmagenta" )

Color.DarkOliveGreen ColorValue( "#556b2f" ) RGBA( 85, 107, 47, 1 )


ColorValue(
"DarkOliveGreen" )

Color.DarkOrange ColorValue( "#ff8c00" ) RGBA( 255, 140, 0, 1 )


ColorValue(
"DARKORANGE" )

Color.DarkOrchid ColorValue( "#9932cc" ) RGBA( 153, 50, 204, 1 )


ColorValue(
"DarkOrchid" )

Color.DarkRed ColorValue( "#8b0000" ) RGBA( 139, 0, 0, 1 )


ColorValue( "darkred" )

Color.DarkSalmon ColorValue( "#e9967a" ) RGBA( 233, 150, 122, 1 )


ColorValue(
"DarkSalmon" )

Color.DarkSeaGreen ColorValue( "#8fbc8f" ) RGBA( 143, 188, 143, 1 )


ColorValue(
"DARKSEAGREEN" )

Color.DarkSlateBlue ColorValue( "#483d8b" ) RGBA( 72, 61, 139, 1 )


ColorValue(
"DarkSlateBlue" )

Color.DarkSlateGray ColorValue( "#2f4f4f" ) RGBA( 47, 79, 79, 1 )


ColorValue(
"darkslategray" )

Color.DarkSlateGrey ColorValue( "#2f4f4f" ) RGBA( 47, 79, 79, 1 )


ColorValue(
"DarkSlateGrey" )

Color.DarkTurquoise ColorValue( "#00ced1" ) RGBA( 0, 206, 209, 1 )


ColorValue(
"DARKTURQUOISE" )

Color.DarkViolet ColorValue( "#9400d3" ) RGBA( 148, 0, 211, 1 )


ColorValue(
"DarkViolet" )

Color.DeepPink ColorValue( "#ff1493" ) RGBA( 255, 20, 147, 1 )


ColorValue(
"deeppink" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.DeepSkyBlue ColorValue( "#00bfff" ) RGBA( 0, 191, 255, 1 )


ColorValue(
"DeepSkyBlue" )

Color.DimGray ColorValue( "#696969" ) RGBA( 105, 105, 105, 1 )


ColorValue(
"DIMGRAY" )

Color.DimGrey ColorValue( "#696969" ) RGBA( 105, 105, 105, 1 )


ColorValue( "DimGrey" )

Color.DodgerBlue ColorValue( "#1e90ff" ) RGBA( 30, 144, 255, 1 )


ColorValue(
"dodgerblue" )

Color.FireBrick ColorValue( "#b22222" ) RGBA( 178, 34, 34, 1 )


ColorValue( "FireBrick" )

Color.FloralWhite ColorValue( "#fffaf0" ) RGBA( 255, 250, 240, 1 )


ColorValue(
"FLORALWHITE" )

Color.ForestGreen ColorValue( "#228b22" ) RGBA( 34, 139, 34, 1 )


ColorValue(
"ForestGreen" )

Color.Fuchsia ColorValue( "#ff00ff" ) RGBA( 255, 0, 255, 1 )


ColorValue( "fuchsia" )

Color.Gainsboro ColorValue( "#dcdcdc" ) RGBA( 220, 220, 220, 1 )


ColorValue(
"Gainsboro" )

Color.GhostWhite ColorValue( "#f8f8ff" ) RGBA( 248, 248, 255, 1 )


ColorValue(
"GHOSTWHITE" )

Color.Gold ColorValue( "#ffd700" ) RGBA( 255, 215, 0, 1 )


ColorValue( "Gold" )

Color.GoldenRod ColorValue( "#daa520" ) RGBA( 218, 165, 32, 1 )


ColorValue(
"goldenrod" )

Color.Gray ColorValue( "#808080" ) RGBA( 128, 128, 128, 1 )


ColorValue( "Gray" )

Color.Green ColorValue( "#008000" ) RGBA( 0, 128, 0, 1 )


ColorValue( "GREEN" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.GreenYellow ColorValue( "#adff2f" ) RGBA( 173, 255, 47, 1 )


ColorValue(
"GreenYellow" )

Color.Grey ColorValue( "#808080" ) RGBA( 128, 128, 128, 1 )


ColorValue( "grey" )

Color.Honeydew ColorValue( "#f0fff0" ) RGBA( 240, 255, 240, 1 )


ColorValue(
"Honeydew" )

Color.HotPink ColorValue( "#ff69b4" ) RGBA( 255, 105, 180, 1 )


ColorValue(
"HOTPINK" )

Color.IndianRed ColorValue( "#cd5c5c" ) RGBA( 205, 92, 92, 1 )


ColorValue(
"IndianRed" )

Color.Indigo ColorValue( "#4b0082" ) RGBA( 75, 0, 130, 1 )


ColorValue( "indigo" )

Color.Ivory ColorValue( "#fffff0" ) RGBA( 255, 255, 240, 1 )


ColorValue( "Ivory" )

Color.Khaki ColorValue( "#f0e68c" ) RGBA( 240, 230, 140, 1 )


ColorValue( "KHAKI" )

Color.Lavender ColorValue( "#e6e6fa" ) RGBA( 230, 230, 250, 1 )


ColorValue( "Lavender" )

Color.LavenderBlush ColorValue( "#fff0f5" ) RGBA( 255, 240, 245, 1 )


ColorValue(
"lavenderblush" )

Color.LawnGreen ColorValue( "#7cfc00" ) RGBA( 124, 252, 0, 1 )


ColorValue(
"LawnGreen" )

Color.LemonChiffon ColorValue( "#fffacd" ) RGBA( 255, 250, 205, 1 )


ColorValue(
"LEMONCHIFFON" )

Color.LightBlue ColorValue( "#add8e6" ) RGBA( 173, 216, 230, 1 )


ColorValue( "LightBlue" )

Color.LightCoral ColorValue( "#f08080" ) RGBA( 240, 128, 128, 1 )


ColorValue(
"lightcoral" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.LightCyan ColorValue( "#e0ffff" ) RGBA( 224, 255, 255, 1 )


ColorValue(
"LightCyan" )

Color.LightGoldenRodYe ColorValue( "#fafad2" ) RGBA( 250, 250, 210, 1 )


llow ColorValue(
"lightgoldenrodyellow"
)

Color.LightGray ColorValue( "#d3d3d3" ) RGBA( 211, 211, 211, 1 )


ColorValue(
"LightGray" )

Color.LightGreen ColorValue( "#90ee90" ) RGBA( 144, 238, 144, 1 )


ColorValue(
"lightgreen" )

Color.LightGrey ColorValue( "#d3d3d3" ) RGBA( 211, 211, 211, 1 )


ColorValue(
"LightGrey" )

Color.LightPink ColorValue( "#ffb6c1" ) RGBA( 255, 182, 193, 1 )


ColorValue(
"LIGHTPINK" )

Color.LightSalmon ColorValue( "#ffa07a" ) RGBA( 255, 160, 122, 1 )


ColorValue(
"LightSalmon" )

Color.LightSeaGreen ColorValue( "#20b2aa" ) RGBA( 32, 178, 170, 1 )


ColorValue(
"lightseagreen" )

Color.LightSkyBlue ColorValue( "#87cefa" ) RGBA( 135, 206, 250, 1 )


ColorValue(
"LightSkyBlue" )

Color.LightSlateGray ColorValue( "#778899" ) RGBA( 119, 136, 153, 1 )


ColorValue(
"LIGHTSLATEGRAY" )

Color.LightSlateGrey ColorValue( "#778899" ) RGBA( 119, 136, 153, 1 )


ColorValue(
"LightSlateGrey" )

Color.LightSteelBlue ColorValue( "#b0c4de" ) RGBA( 176, 196, 222, 1 )


ColorValue(
"lightsteelblue" )

Color.LightYellow ColorValue( "#ffffe0" ) RGBA( 255, 255, 224, 1 )


ColorValue(
"LightYellow" )

Color.Lime ColorValue( "#00ff00" ) RGBA( 0, 255, 0, 1 )


ColorValue( "LIME" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.LimeGreen ColorValue( "#32cd32" ) RGBA( 50, 205, 50, 1 )


ColorValue(
"LimeGreen" )

Color.Linen ColorValue( "#faf0e6" ) RGBA( 250, 240, 230, 1 )


ColorValue( "linen" )

Color.Magenta ColorValue( "#ff00ff" ) RGBA( 255, 0, 255, 1 )


ColorValue( "Magenta" )

Color.Maroon ColorValue( "#800000" ) RGBA( 128, 0, 0, 1 )


ColorValue(
"MAROON" )

Color.MediumAquamari ColorValue( "#66cdaa" ) RGBA( 102, 205, 170, 1 )


ne ColorValue(
"MediumAquamarine" )

Color.MediumBlue ColorValue( "#0000cd" ) RGBA( 0, 0, 205, 1 )


ColorValue(
"mediumblue" )

Color.MediumOrchid ColorValue( "#ba55d3" ) RGBA( 186, 85, 211, 1 )


ColorValue(
"MediumOrchid" )

Color.MediumPurple ColorValue( "#9370db" ) RGBA( 147, 112, 219, 1 )


ColorValue(
"MEDIUMPURPLE" )

Color.MediumSeaGreen ColorValue( "#3cb371" ) RGBA( 60, 179, 113, 1 )


ColorValue(
"MediumSeaGreen" )

Color.MediumSlateBlue ColorValue( "#7b68ee" ) RGBA( 123, 104, 238, 1 )


ColorValue(
"mediumslateblue" )

Color.MediumSpringGre ColorValue( "#00fa9a" ) RGBA( 0, 250, 154, 1 )


en ColorValue(
"MediumSpringGreen" )

Color.MediumTurquoise ColorValue( "#48d1cc" ) RGBA( 72, 209, 204, 1 )


ColorValue(
"MEDIUMTURQUOISE" )

Color.MediumVioletRed ColorValue( "#c71585" ) RGBA( 199, 21, 133, 1 )


ColorValue(
"MediumVioletRed" )

Color.MidnightBlue ColorValue( "#191970" ) RGBA( 25, 25, 112, 1 )


ColorValue(
"midnightblue" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.MintCream ColorValue( "#f5fffa" ) RGBA( 245, 255, 250, 1 )


ColorValue(
"MintCream" )

Color.MistyRose ColorValue( "#ffe4e1" ) RGBA( 255, 228, 225, 1 )


ColorValue(
"MISTYROSE" )

Color.Moccasin ColorValue( "#ffe4b5" ) RGBA( 255, 228, 181, 1 )


ColorValue( "Moccasin" )

Color.NavajoWhite ColorValue( "#ffdead" ) RGBA( 255, 222, 173, 1 )


ColorValue(
"navajowhite" )

Color.Navy ColorValue( "#000080" ) RGBA( 0, 0, 128, 1 )


ColorValue( "Navy" )

Color.OldLace ColorValue( "#fdf5e6" ) RGBA( 253, 245, 230, 1 )


ColorValue( "OLDLACE" )

Color.Olive ColorValue( "#808000" ) RGBA( 128, 128, 0, 1 )


ColorValue( "Olive" )

Color.OliveDrab ColorValue( "#6b8e23" ) RGBA( 107, 142, 35, 1 )


ColorValue(
"olivedrab" )

Color.Orange ColorValue( "#ffa500" ) RGBA( 255, 165, 0, 1 )


ColorValue( "Orange" )

Color.OrangeRed ColorValue( "#ff4500" ) RGBA( 255, 69, 0, 1 )


ColorValue(
"ORANGERED" )

Color.Orchid ColorValue( "#da70d6" ) RGBA( 218, 112, 214, 1 )


ColorValue( "Orchid" )

Color.PaleGoldenRod ColorValue( "#eee8aa" ) RGBA( 238, 232, 170, 1 )


ColorValue(
"palegoldenrod" )

Color.PaleGreen ColorValue( "#98fb98" ) RGBA( 152, 251, 152, 1 )


ColorValue(
"PaleGreen" )

Color.PaleTurquoise ColorValue( "#afeeee" ) RGBA( 175, 238, 238, 1 )


ColorValue(
"PALETURQUOISE" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.PaleVioletRed ColorValue( "#db7093" ) RGBA( 219, 112, 147, 1 )


ColorValue(
"PaleVioletRed" )

Color.PapayaWhip ColorValue( "#ffefd5" ) RGBA( 255, 239, 213, 1 )


ColorValue(
"papayawhip" )

Color.PeachPuff ColorValue( "#ffdab9" ) RGBA( 255, 218, 185, 1 )


ColorValue(
"PeachPuff" )

Color.Peru ColorValue( "#cd853f" ) RGBA( 205, 133, 63, 1 )


ColorValue( "PERU" )

Color.Pink ColorValue( "#ffc0cb" ) RGBA( 255, 192, 203, 1 )


ColorValue( "Pink" )

Color.Plum ColorValue( "#dda0dd" ) RGBA( 221, 160, 221, 1 )


ColorValue( "plum" )

Color.PowderBlue ColorValue( "#b0e0e6" ) RGBA( 176, 224, 230, 1 )


ColorValue(
"PowderBlue" )

Color.Purple ColorValue( "#800080" ) RGBA( 128, 0, 128, 1 )


ColorValue( "PURPLE" )

Color.Red ColorValue( "#ff0000" ) RGBA( 255, 0, 0, 1 )


ColorValue( "Red" )

Color.RosyBrown ColorValue( "#bc8f8f" ) RGBA( 188, 143, 143, 1 )


ColorValue(
"rosybrown" )

Color.RoyalBlue ColorValue( "#4169e1" ) RGBA( 65, 105, 225, 1 )


ColorValue(
"RoyalBlue" )

Color.SaddleBrown ColorValue( "#8b4513" ) RGBA( 139, 69, 19, 1 )


ColorValue(
"SADDLEBROWN" )

Color.Salmon ColorValue( "#fa8072" ) RGBA( 250, 128, 114, 1 )


ColorValue( "Salmon" )

Color.SandyBrown ColorValue( "#f4a460" ) RGBA( 244, 164, 96, 1 )


ColorValue(
"sandybrown" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.SeaGreen ColorValue( "#2e8b57" ) RGBA( 46, 139, 87, 1 )


ColorValue(
"SeaGreen" )

Color.SeaShell ColorValue( "#fff5ee" ) RGBA( 255, 245, 238, 1 )


ColorValue(
"SEASHELL" )

Color.Sienna ColorValue( "#a0522d" ) RGBA( 160, 82, 45, 1 )


ColorValue( "Sienna" )

Color.Silver ColorValue( "#c0c0c0" ) RGBA( 192, 192, 192, 1 )


ColorValue( "silver" )

Color.SkyBlue ColorValue( "#87ceeb" ) RGBA( 135, 206, 235, 1 )


ColorValue( "SkyBlue" )

Color.SlateBlue ColorValue( "#6a5acd" ) RGBA( 106, 90, 205, 1 )


ColorValue(
"SLATEBLUE" )

Color.SlateGray ColorValue( "#708090" ) RGBA( 112, 128, 144, 1 )


ColorValue(
"SlateGray" )

Color.SlateGrey ColorValue( "#708090" ) RGBA( 112, 128, 144, 1 )


ColorValue( "slategrey" )

Color.Snow ColorValue( "#fffafa" ) RGBA( 255, 250, 250, 1 )


ColorValue( "Snow" )

Color.SpringGreen ColorValue( "#00ff7f" ) RGBA( 0, 255, 127, 1 )


ColorValue(
"SPRINGGREEN" )

Color.SteelBlue ColorValue( "#4682b4" ) RGBA( 70, 130, 180, 1 )


ColorValue( "SteelBlue" )

Color.Tan ColorValue( "#d2b48c" ) RGBA( 210, 180, 140, 1 )


ColorValue( "tan" )

Color.Teal ColorValue( "#008080" ) RGBA( 0, 128, 128, 1 )


ColorValue( "Teal" )

Color.Thistle ColorValue( "#d8bfd8" ) RGBA( 216, 191, 216, 1 )


ColorValue( "THISTLE" )
COLOR ENUMERATION COLORVALUE RGBA COLOR SWATCH

Color.Tomato ColorValue( "#ff6347" ) RGBA( 255, 99, 71, 1 )


ColorValue( "Tomato" )

Color.Transparent ColorValue( RGBA( 0, 0, 0, 0 )


"#00000000" )
ColorValue(
"Transparent" )

Color.Turquoise ColorValue( "#40e0d0" ) RGBA( 64, 224, 208, 1 )


ColorValue( "turquoise" )

Color.Violet ColorValue( "#ee82ee" ) RGBA( 238, 130, 238, 1 )


ColorValue( "Violet" )

Color.Wheat ColorValue( "#f5deb3" ) RGBA( 245, 222, 179, 1 )


ColorValue( "WHEAT" )

Color.White ColorValue( "#ffffff" ) RGBA( 255, 255, 255, 1 )


ColorValue( "White" )

Color.WhiteSmoke ColorValue( "#f5f5f5" ) RGBA( 245, 245, 245, 1 )


ColorValue(
"whitesmoke" )

Color.Yellow ColorValue( "#ffff00" ) RGBA( 255, 255, 0, 1 )


ColorValue( "Yellow" )

Color.YellowGreen ColorValue( "#9acd32" ) RGBA( 154, 205, 50, 1 )


ColorValue(
"YELLOWGREEN" )
Left, Mid, and Right functions in Power Apps
2/11/2020 • 2 minutes to read • Edit Online

Extracts the left, middle, or right portion of a string of text.

Description
The Left, Mid, and Right functions return a portion of a string.
Left returns the beginning characters of a string.
Mid returns the middle characters of a string.
Right returns the ending characters of a string.
If you specify a single string as an argument, the function returns the portion that you requested of the string.
If you specify a single-column table that contains strings, the function returns a single-column table of the
portions that you requested of those strings. If you specify a multi-column table, you can shape it into a single-
column table, as working with tables describes.
If the starting position is negative or beyond the end of the string, Mid returns blank. You can check the length
of a string by using the Len function. If you request more characters than the string contains, the function
returns as many characters as possible.

Syntax
Left( String, NumberOfCharacters )
Mid( String, StartingPosition [, NumberOfCharacters ] )
Right( String, NumberOfCharacters )
String - Required. The string to from which to extract the result.
StartingPosition - Required (Mid only). The starting position. The first character of the string is position 1.
NumberOfCharacters - Required (Left and Right only). The number of characters to return. If omitted for
the Mid function, the function returns the portion from the starting position until the end of the string.
Left( SingleColumnTable, NumberOfCharacters )
Mid( SingleColumnTable, StartingPosition [, NumberOfCharacters ] )
Right( SingleColumnTable, NumberOfCharacters )
SingleColumnTable - Required. A single-column table of strings from which to extract the results.
StartingPosition - Required (Mid only). The starting position. The first character of the string is position 1.
NumberOfCharacters - Required (Left and Right only). The number of characters to return. If omitted for
the Mid function, the function returns the portion from the starting position until the end of the string.

Examples
Single string
The examples in this section use a text-input control as their data source. The control is named Author and
contains the string "E. E. Cummings".
FORMULA DESCRIPTION RESULT

Left( Author.Text, 5 ) Extracts up to five characters from the "E. E."


start of the string.

Mid( Author.Text, 7, 4 ) Extracts up to four characters, starting "Cumm"


with the seventh character, from the
string.

Mid( Author.Text, 7 ) Extracts all characters, starting with "Cummings"


the seventh character, from the string.

Right( Author.Text, 5 ) Extracts up to five characters from the "mings"


end of the string.

Single -column table


Each example in this section extracts strings from the Address column of this data source, named People, and
returns a single-column table that contains the results:

FORMULA DESCRIPTION RESULT

Left( Extracts the first eight characters of


ShowColumns( People, "Address" ) each string.
,8)

Mid( Extracts the middle seven characters


ShowColumns( People, "Address" ) of each string, starting with the fifth
, 5, 7 ) character.

Right( Extracts the last seven characters of


ShowColumns( People, "Address" ) each string.
,7)

Step-by-step example
1. Import or create a collection named Inventory, and show it in a gallery, as the first procedure in Show
images and text in a gallery describes.
2. Set the Text property of the lower label in the gallery to this function:
Right(ThisItem.ProductName, 3)
The label shows the last three characters of each product name.
Round, RoundDown, and RoundUp functions in
Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Rounds a number.

Description
The Round, RoundDown, and RoundUp functions round a number to the specified number of decimal places:
Round rounds up if the next digit is a 5 or higher. Otherwise, this function rounds down.
RoundDown always rounds down to the previous lower number.
RoundUp always rounds up to the next higher number.
If you pass a single number, the return value is the rounded version of that number. If you pass a single-column
table that contains numbers, the return value is a single-column table of rounded numbers. If you have a multi-
column table, you can shape it into a single-column table, as working with tables describes.

Syntax
Round( Number, DecimalPlaces )
RoundDown( Number, DecimalPlaces )
RoundUp( Number, DecimalPlaces )
Number - Required. The number to round.
DecimalPlaces - Required. The number of places to the right of the decimal point to round to. Use 0 to round to
a whole number.
Round, RoundDown, and RoundUp functions in
Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Rounds a number.

Description
The Round, RoundDown, and RoundUp functions round a number to the specified number of decimal places:
Round rounds up if the next digit is a 5 or higher. Otherwise, this function rounds down.
RoundDown always rounds down to the previous lower number.
RoundUp always rounds up to the next higher number.
If you pass a single number, the return value is the rounded version of that number. If you pass a single-column
table that contains numbers, the return value is a single-column table of rounded numbers. If you have a multi-
column table, you can shape it into a single-column table, as working with tables describes.

Syntax
Round( Number, DecimalPlaces )
RoundDown( Number, DecimalPlaces )
RoundUp( Number, DecimalPlaces )
Number - Required. The number to round.
DecimalPlaces - Required. The number of places to the right of the decimal point to round to. Use 0 to round to
a whole number.
Round, RoundDown, and RoundUp functions in
Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Rounds a number.

Description
The Round, RoundDown, and RoundUp functions round a number to the specified number of decimal places:
Round rounds up if the next digit is a 5 or higher. Otherwise, this function rounds down.
RoundDown always rounds down to the previous lower number.
RoundUp always rounds up to the next higher number.
If you pass a single number, the return value is the rounded version of that number. If you pass a single-column
table that contains numbers, the return value is a single-column table of rounded numbers. If you have a multi-
column table, you can shape it into a single-column table, as working with tables describes.

Syntax
Round( Number, DecimalPlaces )
RoundDown( Number, DecimalPlaces )
RoundUp( Number, DecimalPlaces )
Number - Required. The number to round.
DecimalPlaces - Required. The number of places to the right of the decimal point to round to. Use 0 to round
to a whole number.
SaveData and LoadData functions in Power Apps
3/24/2020 • 5 minutes to read • Edit Online

Saves and reloads a collection from a local device.

Description
The SaveData function stores a collection for later use under a name.
The LoadData function reloads a collection by name that was previously saved with SaveData. You can't use
this function to load a collection from another source.
Use these functions to improve app-startup performance by:
Caching data in the App.OnStart formula on a first run.
Reloading the local cache on next runs.
You can also use these functions to add simple offline capabilities to your app.
You can't use these functions inside a browser when:
Authoring the app in Power Apps Studio.
Running the app in the web player.
To test your app, run it in Power Apps Mobile on an iPhone or Android device.
These functions are limited by the amount of available app memory as they operate on an in-memory
collection. Available memory can vary depending on factors such as:
The device and operating system.
The memory that the Power Apps player uses.
Complexity of the app with screens and controls.
Test your app with expected scenarios on the type of devices you expect the app to run when storing large data.
Expect to have between 30 MB and 70 MB of available memory generally.
These functions depend on the collection being implicitly defined with Collect or ClearCollect. You don't need
to call Collect or ClearCollect to load data into the collection for defining it. It's a common case when using
LoadData after a previous SaveData. All that is needed is the presence of these functions in a formula to
implicitly define the structure of the collection. For more information, see creating and removing variables.
The loaded data will be appended to the collection. Use the Clear function before calling LoadData if you
want to start with an empty collection.
The device's built in app sandbox facilities are used to isolate saved data from other apps.
The device may also encrypt the data; or you can use a mobile device management tool such as Microsoft
Intune.

Syntax
SaveData( Collection, Name )
LoadData( Collection, Name [, IgnoreNonexistentFile ])
Collection - Required. Collection to be stored or loaded.
Name - Required. Name of the storage. The name must be same to save and load same set of data. The
name space isn't shared with other apps or users.
IgnoreNonexistentFile - Optional. A Boolean value indicating what to do if the file doesn't already exist. Use
false (default) to return an error and true to suppress the error.

Examples
FORMULA DESCRIPTION RESULT

SaveData( LocalCache, "MyCache" Save the LocalCache collection to the Data is saved to the local device.
) user's device under the name
"MyCache", suitable for LoadData to
retrieve later.

LoadData( LocalCache, "MyCache" Loads the LocalCache collection from Data is loaded from the local device.
) the user's device under the name
"MyCache", previously stored with a
call to SaveData.

Simple offline example


Following simple example captures and stores the names and pictures of everyday items while offline. It stores
the information in the device's local storage for later use. This allows the app to be closed or the device to
restart without losing data.
You must have a device to work through this example as it uses the LoadData and SaveData functions that
don't operate when in a web browser.
1. Create a blank canvas app with a tablet layout. For more details, read creating an app from a template
and select Tablet layout under Blank app.
2. Add a Text input control and a Camera control and arrange them roughly as shown:

3. Add a Button control.


4. Double-click the button control to change the button text to Add Item (or modify the Text property).
5. Set the OnSelect property of the button control to this formula that will add an item to our collection:

Collect( MyItems, { Item: TextInput1.Text, Picture: Camera1.Photo } )


6. Add another Button control.
7. Double-click the button control to change the button text to Save Data (or modify the Text property).
8. Set the OnSelect property of the button control to this formula in order to save our collection to the
local device:

SaveData( MyItems, "LocalSavedItems" )

It's tempting to test the button as it doesn't affect anything. But you'll only see an error as you're
authoring in a web browser. Save the app first and open on a device before you follow the next steps to
test this formula:
9. Add a third Button control.
10. Double-click the button control to change the button text to Load Data (or modify the Text property).
11. Set the OnSelect property of the button control to this formula in order to load our collection from the
local device:

LoadData( MyItems, "LocalSavedItems" )


12. Add a Gallery control with a Vertical layout that includes a picture and text areas:

13. When prompted, select the MyItems collection as the data source for this gallery. This will set the
Items property of the Gallery control:

The image control in the gallery template should default its Image property to ThisItem.Picture and
the label controls should both default their Text properties to ThisItem.Item. Check these formulas if
after adding items in the following steps you don't see anything in the gallery.
14. Position the control to the right of the other controls:

15. Save your app. If it's the first time it has been saved, there's no need to publish it. If it's not the first time,
publish the app after you save.
16. Open your app on a device such as a phone or tablet. SaveData and LoadData can't be used in Studio
or in a web browser. Refresh your app list if you don't see your app immediately, it can take a few
seconds for the app to appear on your device. Signing out and back in to your account can help too.

Once your app has been downloaded, you can disconnect from the network and run the app offline.
17. Enter the name and take a picture of an item.
18. Select the Add Item button. Repeat adding items a couple of times to load up your collection.
19. Select the Save Data button. This will save the data in your collection to your local device.
20. Close the app. Your collection in memory will be lost including all item names and pictures, but they'll
still be there in the device's storage.
21. Launch the app again. The collection in memory will again show as empty in the gallery.

22. Select the Load Data button. The collection will be repopulated from the stored data on your device
and your items will be back in the gallery. The collection was empty before this button calls the
LoadData function; there was no need to call Collect or ClearCollect before loading the data from
storage.
23. Select the Load Data button again. The stored data will be appended to the end of the collection and a
scroll bar will appear on the gallery. If you would like to replace rather than append, use the Clear
function first to clear out the collection before calling the LoadData function.

More advanced offline example


For a detailed example, see the article on simple offline capabilities.
Filter, Search, and LookUp functions in Power
Apps
12/3/2019 • 8 minutes to read • Edit Online

Finds one or more records in a table.

Description
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 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.
For both, the formula is evaluated for each record of the table. Records that result in true are included in the
result. Besides the normal formula operators, you can use the in and exactin operators for substring
matches.
Fields of the record currently being processed are available within the formula. You simply reference them
by name as you would any other value. You can also reference control properties and other values from
throughout your app. For more details, see the examples below and working with record scope.
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.
Filter and Search return a table that contains the same columns as the original table and the records that
match the criteria. LookUp returns only the first record found, after applying a formula to reduce the record
to a single value. If no records are found, Filter and Search return an empty table, and LookUp returns
blank.
Tables are a value in Power Apps, just like a string or number. They can be passed to and returned from
functions. Filter, Search, and LookUp don't modify a table. Instead, they take a table as an argument and
return a table, a record, or a single value from it. See working with tables for more details.

Delegation
When possible, Power Apps will delegate filter and sort operations to the data source and page through the
results on demand. For example, when you start an app that shows a Gallery control filled with data, only
the first set of records will be initially brought to the device. As the user scrolls, additional data is brought
down from the data source. The result is a faster start time for the app and access to very large data sets.
However, delegation may not always be possible. Data sources vary on what functions and operators they
support with delegation. If complete delegation of a formula isn't possible, the authoring environment will
flag the portion that can't be delegated with a warning. When possible, consider changing the formula to
avoid functions and operators that can't be delegated. The delegation list details which data sources and
operations can be delegated.
If delegation is not possible, Power Apps will pull down only a small set of records to work on locally. Filter
and sort functions will operate on a reduced set of records. What is available in the Gallery may not be the
complete story, which could be confusing to users.
See the delegation overview for more information.

Syntax
Filter( Table, Formula1 [, Formula2, ... ] )
Table - Required. Table to search.
Formula (s) - Required. The formula by which each record of the table is evaluated. The function returns
all records that result in true. You can reference columns within the table. If you supply more than one
formula, the results of all formulas are combined with the And function.
Search( Table, SearchString, Column1 [, Column2, ... ] )
Table - Required. Table to search.
SearchString - Required. The string to search for. If blank or an empty string, all records are returned.
Column(s) - Required. The names of columns within Table to search. Columns to search must contain
text. Column names must be strings and enclosed in double quotes. However, the column names must
be static and cannot be calculated with a formula. If SearchString is found within the data of any of these
columns as a partial match, the full record will be returned.

NOTE
For SharePoint and Excel data sources that contain column names with spaces, specify each space as "_x0020_". For
example, specify "Column Name" as "Column_x0020_Name".

LookUp( Table, Formula [, ReductionFormula ] )


Table - Required. Table to search. In the UI, the syntax is shown as source above the function box.
Formula - Required. The formula by which each record of the table is evaluated. The function returns the
first record that results in true. You can reference columns within the table. In the UI, the syntax is shown
as condition above the function box.
ReductionFormula - Optional. This formula is evaluated over the record that was found, and then reduces
the record to a single value. You can reference columns within the table. If you don't use this parameter,
the function returns the full record from the table. In the UI, the syntax is shown as result above the
function box.

Examples
The following examples use the IceCream data source:

FORMULA DESCRIPTION RESULT

Filter( IceCream, OnOrder > 0 ) Returns records where OnOrder is


greater than zero.
FORMULA DESCRIPTION RESULT

Filter( IceCream, Quantity + Returns records where the sum of


OnOrder > 225 ) Quantity and OnOrder columns is
greater than 225.

Filter( IceCream, "chocolate" in Returns records where the word


Lower( Flavor ) ) "chocolate" appears in the Flavor
name, independent of uppercase or
lowercase letters.

Filter( IceCream, Quantity < 10 Returns records where the Quantity


&& OnOrder < 20 ) is less than 10 and OnOrder is less
than 20. No records match these
criteria, so an empty table is
returned.

Search( IceCream, "choc", Returns records where the string


"Flavor" ) "choc" appears in the Flavor name,
independent of uppercase or
lowercase letters.

Search( IceCream, "", "Flavor" ) Because the search term is empty, all
records are returned.

LookUp( IceCream, Flavor = Searches for a record with Flavor 100


"Chocolate", Quantity ) equal to "Chocolate", of which there
is one. For the first record that's
found, returns the Quantity of that
record.

LookUp( IceCream, Quantity > Searches for a record with Quantity 250
150, Quantity + OnOrder ) greater than 100, of which there are
multiple. For the first record that's
found, which is "Vanilla" Flavor,
returns the sum of Quantity and
OnOrder columns.

LookUp( IceCream, Flavor = Searches for a record with Flavor blank


"Pistachio", OnOrder ) equal to "Pistachio", of which there
are none. Because none were found,
Lookup returns blank.

LookUp( IceCream, Flavor = Searches for a record with Flavor { Flavor: "Vanilla", Quantity: 200,
"Vanilla" ) equal to "Vanilla", of which there is OnOrder: 75 }
one. Since no reduction formula was
supplied, the entire record is
returned.

Search user experience


In many apps, you can type one or more characters into a search box to filter a list of records in a large data
set. As you type, the list shows only those records that match the search criteria.
The examples in the rest of this topic show the results of searching a list, named Customers, that contains
this data:

To create this data source as a collection, create a Button control and set its OnSelect property to this
formula:
ClearCollect( Customers, Table( { Name: "Fred Garcia", Company: "Northwind Traders" }, { Name:
"Cole Miller", Company: "Contoso" }, { Name: "Glenda Johnson", Company: "Contoso" }, { Name:
"Mike Collins", Company: "Adventure Works" }, { Name: "Colleen Jones", Company: "Adventure
Works" } ) )
As in this example, you can show a list of records in a Gallery control at the bottom of a screen. Near the
top of the screen, you can add a Text input control, named SearchInput, so that users can specify which
records interest them.

As the user types characters in SearchInput, the results in the gallery are automatically filtered. In this case,
the gallery is configured to show records for which the name of the customer (not the name of the
company) starts with the sequence of characters in SearchInput. If the user types co in the search box, the
gallery shows these results:
To filter based on the Name column, set the Items property of the gallery control to one of these formulas:

FORMULA DESCRIPTION RESULT

Filter( Customers, StartsWith( Filters the Customers data source for


Name, SearchInput.Text ) ) records in which the search string
appears at the start of the Name
column. The test is case insensitive. If
the user types co in the search box,
the gallery shows Colleen Jones and
Cole Miller. The gallery doesn't
show Mike Collins because the
Name column for that record doesn't
start with the search string.

Filter( Customers, Filters the Customers data source for


SearchInput.Text in Name ) records in which the search string
appears anywhere in the Name
column. The test is case insensitive. If
the user types co in the search box,
the gallery shows Colleen Jones,
Cole Miller, and Mike Collins
because the search string appears
somewhere in the Name column of
all of those records.

Search( Customers, Similar to using the in operator, the


SearchInput.Text, "Name" ) Search function searches for a match
anywhere within the Name column
of each record. Note that you must
enclose the column name in double
quotation marks.

You can expand your search to include the Company column as well as the Name column:

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Filter( Customers, StartsWith( Filters the Customers data source for


Name, SearchInput.Text ) || records in which either the Name
StartsWith( Company, column or the Company column
SearchInput.Text ) ) starts with the search string (for
example, co). The || operator is true if
either StartsWith function is true.

Filter( Customers, Filters the Customers data source for


SearchInput.Text in Name || records in which either the Name
SearchInput.Text in Company ) column or the Company column
contains the search string (for
example, co) anywhere within it.

Search( Customers, Similar to using the in operator, the


SearchInput.Text, "Name", Search function searches the
"Company" ) Customers data source for records in
which either the Name column or
the Company column contains the
search string (for example, co)
anywhere within it. The Search
function is easier to read and write
than Filter if you want to specify
multiple columns and multiple in
operators. Note that you must
enclose the names of the columns in
double quotation marks.
Day, Month, Year, Hour, Minute, Second, and
Weekday functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Returns individual components of a Date/Time value.

Description
The Day function returns the day component of a Date/Time value, ranging from 1 to 31.
The Month function returns the month component of a Date/Time value, ranging from 1 to 12.
The Year function returns the year component of a Date/Time value, starting with 1900.
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 Second function returns the second component of a Date/Time value, ranging from 0 to 59.
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:

EXCEL CODE STARTOFWEEK ENUMERATION DESCRIPTION

1, 17 StartOfWeek.Sunday Numbers 1 (Sunday) through 7


(Saturday). Default.

2, 11 StartOfWeek.Monday Numbers 1 (Monday) through 7


(Sunday).

3 StartOfWeek.MondayZero Numbers 0 (Monday) through 6


(Sunday).

12 StartOfWeek.Tuesday Numbers 1 (Tuesday) through 7


(Monday).

13 StartOfWeek.Wednesday Numbers 1 (Wednesday) through 7


(Tuesday).

14 StartOfWeek.Thursday Numbers 1 (Thursday) through 7


(Wednesday).

15 StartOfWeek.Friday Numbers 1 (Friday) through 7


(Thursday).

16 StartOfWeek.Saturday Numbers 1 (Saturday) through 7


(Friday).

All functions return a number.


See working with dates and times for more information.
Syntax
Day( DateTime )
Month( DateTime )
Year( DateTime )
Hour( DateTime )
Minute( DateTime )
Second( DateTime )
DateTime - Required. Date/Time value to operate on.
Weekday( DateTime [, WeekdayFirst ] )
DateTime - Required. Date/Time value to operate on.
WeekdayFirst - Optional. Excel code specifying which day starts the week. If not supplied, 1 (Sunday first) is
used.

Examples
For the following example, the current time is 3:59:37 PM on Thursday, April 9, 2015.

FORMULA DESCRIPTION RESULT

Year( Now() ) Returns the year component of the 2015


current time and date.

Month( Now() ) Returns the month component of the 4


current time and date.

Day( Now() ) Returns the day component of the 9


current time and date.

Hour( Now() ) Returns the hour component of the 15


current time and date.

Minute( Now() ) Returns the minute component of the 59


current time and date.

Second( Now() ) Returns the minute component of the 37


current time and date.

Weekday( Now() ) Returns the weekday component of the 5


current time and date, using the default
start of the week as Sunday.

Weekday( Now(), 14 ) Returns the weekday component of the 1


current time and date, using an Excel
code to specify the start of the week as
Thursday.

Weekday( Now(), StartOfWeek.Wed Returns the weekday component of the 2


nesday ) current time and date, using a
StartOfWeek enumeration to specify
the start of the week as Wednesday.
Select function in Power Apps
1/21/2020 • 3 minutes to read • Edit Online

Simulates a select action on a control, causing the OnSelect formula to be evaluated.

Description
The Select function simulates a select action on a control as if the user had clicked or tapped the control. As a
result, the OnSelect formula on the target control is evaluated.
Use Select to propagate a select action to a parent control. This type of propagation is the default behavior in, for
example, galleries. By default, the OnSelect property of any control in a Gallery control is set to Select( Parent ).
That way, you can set the value of the OnSelect property of the gallery control itself, and that formula will be
evaluated regardless of where in the gallery a user might click or tap.
If you want one or more controls in the gallery to perform different actions from the gallery itself, set the
OnSelect property for those controls to something other than the default value. You can leave the default values
for the OnSelect properties of most controls in the gallery if you want them to perform the same action as the
gallery itself.
Select queues the target OnSelect for later processing, which may happen after the current formula has finished
being evaluated. Select doesn't cause the target OnSelect to evaluate immediately, nor does Select wait for
OnSelect to finish being evaluated.
You can't use Select across screens.
You can use Select only with controls that have an OnSelect property.
You can use Select only in behavior formulas.
A control can't Select itself directly or indirectly through other controls.
The select function can also be used with a gallery. For example, it can be used to specify the row or column to
select in a gallery and the control to select within that row or column of the gallery. When you select a row or
column, the gallery selection changes and the OnSelect formula on the gallery control is evaluated. If a control
within the row or column is provided, the OnSelect formula for the child control will be evaluated.

Syntax
Select( Control )
Control – Required. The control to select on behalf of the user.
Select( Control, Row or column, Child Control )
Control – Required. The control to select on behalf of the user.
Row or column – Not required. The number of row or column (starting with 1) in a gallery control to select on
behalf of the user.
Child Control - Not required. The child control of the control identified in the 'control' parameter to select.

Examples
Button
Select(button1)

Gallery
Select(Gallery1, 1)

Simulates a user selecting row 1 or column 1 in Gallery1.


Gallery
Select(Gallery1, 1, ChildControl1)

Simulates a user selecting ChildConttrol1 in row 1 or column 1 of Gallery1.


Basic usage
1. Add a Button control, and rename it Button1 if it has a different name.
2. Set the OnSelect property of Button1 to this formula:
Notify( "Hello World" )
3. On the same screen, add a second Button control, and set its OnSelect property to this formula:
Select( Button1 )
4. While holding down the Alt key, select the second button.
A notification appears across the top of your app. The OnSelect property of Button1 generated this
notification.

Gallery control
1. Add a vertical Gallery control that contains other controls.
2. Set the OnSelect property of the gallery to this formula:
Notify( "Gallery Selected" )
3. While holding down the Alt key, click or tap the background of the gallery or any control in the gallery.
All actions will show the Gallery Selected notification at the top of the app.
Use the gallery's OnSelect property to specify the default action to take when the user clicks or taps an
item in the gallery.
4. Set the OnSelect property of the image control to this formula:
Notify( "Image Selected", Success )
5. While holding down the Alt key, click or tap the various elements of the gallery.
When you click or tap any control in the gallery except the image, Gallery Selected appears as before.
When you click or tap the image, Image Selected appears.
Use individual controls in the gallery to take actions that differ from the gallery's default action.
6. On the same screen, add a Button control, and set its OnSelect property to this formula:
Select( Gallery1,2,Image1 )
7. While holding down the Alt key, select the button.
A Image Selected notification appears across the top of your app. The button click simulated selecting the
image in row 2 of the gallery.
Set function in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Sets the value of a global variable.

Overview
Use the Set function to set the value of a global variable, which temporarily holds a piece of information, such as
the number of times the user has selected a button or the result of a data operation.
Global variables are available throughout your app on all screens. These are the simplest kind of variables and fill
the needs of most situations. There are also context variables which are scoped to a single screen and collections
that allow row level modifications to tables. For more information about these other options, review Understand
variables.
Power Apps are based on formulas that automatically recalculate as the user interacts with an app. Any formulas
that depend on a variable will automatically update when it changes. However, the variable won't be
automatically updated if the value of the formula used in the Set function changes. This requires the app maker
to manually update the variable, which can be error prone and harder for others to understand. Before you use a
variable, review Understand variables.

Description
Global variables are implicitly created by using the Set function. No explicit declaration is required. If you
remove all the Set functions for a global variable, that global variable will cease to exist. To clear a variable, set its
value to the result of the Blank function.
You can see your variables' values, definitions, and uses with the Variables view under the File menu in Power
Apps Studio.
As the examples later in this topic show, global variables can hold several kinds of information, including these:
a single value
a record
a table
an object reference
any result from a formula
A global variable holds its value until the app is closed. Once closed, the global variable's value will be lost and
must be recreated when the app is loaded again.
Global variables cannot use the same name as an existing collection or control. It can use the same name as a
context variable. To disambiguate between the two, use the disambiguation operator.
Set has no return value, and you can use it only within a behavior formula.

Syntax
Set( VariableName, Value )
VariableName - Required. The name of a global variable to create or update.
Value - Required. The value to assign to the context variable.
Examples
FORMULA DESCRIPTION RESULT

Set( Counter, 1 ) Creates or modifies the global variable Counter has the value 1. You can
Counter, setting its value to 1. reference that variable by using the
name Counter in a formula on any
screen.

Set( Counter, 2 ) Sets the value of the Counter global Counter has the value 2.
variable from the previous example to
2.

Set( Counter, Counter + 1 ) Increments the value of the Counter Counter has the value 3.
global variable from the previous
example to 3.

Set( Name, "Lily" ) Creates or modifies the global variable Name has the value Lily.
Name setting its value to Lily.

Set( Person, { Name: "Milton", Creates or modifies the global variable Person has the value of record
Address: "1 Main St" } ) Person, setting its value to a record. { Name: "Milton",
The record contains two columns, Address: "1 Main St" }.
named Name and Address. The value
of the Name column is Milton, and Reference this record as a whole with
the value of the Address column is 1 the name Person, or reference an
Main St. individual column of this record with
Person.Name or Person.Address.

Set( Person, Works with the Patch function to Person now has the value of record
Patch( Person, {Address: "2 Main St update the Person global variable by { Name: "Milton",
"})) setting the value of the Address Address: "2 Main St" }.
column to 2 Main St.
SetFocus function in Power Apps
12/3/2019 • 6 minutes to read • Edit Online

Moves input focus to a specific control.

Description
The SetFocus function gives a control the input focus. The user's keystrokes are then received by that control,
allowing them to type into a text input control or use the Enter key to select a button. The user can also use the Tab
key, touch, mouse, or other gesture to move the input focus themselves. Tab key behavior is governed by the
TabIndex property.
Use the SetFocus function to set the focus when (each with an example below ):
a newly exposed or enabled input control, to guide the user in what comes next and for faster data entry.
a form is validated, to focus and display the offending input control for quick resolution.
a screen is displayed, to focus the first input control with the OnVisible property of the Screen.
The control with focus may be visually different based on the FocusedBorderColor and
FocusedBorderThickness properties.

Limitations
SetFocus can only be used with:
Button control
Icon control
Image control
Label control
TextInput control
You cannot set the focus to controls that are within a Gallery control, Edit form control, or Component. SetFocus
can be used with a control in a scrollbale screen.
You can only set the focus to controls on the same screen as the formula containing the SetFocus call.
Attempting to set the focus to a control that has its DisplayMode property set to Disabled has no effect. Focus
will remain where it was previously.
On Apple iOS, the soft keyboard will only be displayed automatically if SetFocus was initiated by a direct user
action. For example, invoking from a button's OnSelect property will display the soft keyboard while invoking
from a screen's OnVisible will not.
You can use SetFocus only in behavior formulas.

Syntax
SetFocus( Control )
Control – Required. The control to give the input focus.

Examples
Focus on a newly exposed or enabled input control
Many shopping carts allow the customer to use the shipping address as the billing address, alleviating the need to
enter the same information twice. If a different billing address is desired, the billing address text input boxes are
enabled, and it is helpful to guide the customer to the these newly enabled controls for faster data entry.

There are many formulas in play here, but the one that moves the focus is on the OnUncheck property of the
Check box control:

SetFocus( BillingName )

The Tab key can also be used to move focus quickly from one field to another. To better illustrate, the Tab key was
not used in the animation.
To create this example:
1. Create a new app.
2. Add Label controls with the text "Shipping address", "Name:", "Address:", "Billing Address", "Name:", and
"Address:" and position them as shown in the animation.
3. Add a Text Input control and rename it ShippingName.
4. Add a Text Input control and rename it ShippingAddress.
5. Add a Check box control and rename it SyncAddresses.
6. Set the Text property of this control to the formula "Use Shipping address as Billing address" .
7. Add a Text Input control and rename it BillingName.
8. Set the Default property on this control to the formula ShippingName .
9. Set the DisplayMode property on this control to the formula
If( SyncAddresses.Value, DisplayMode.View, DisplayMode.Edit ) . This will automatically enable or disable this
control based on the state of the check box control.
10. Add a Text Input control and rename it BillingAddress.
11. Set the Default property on this control to the formula ShippingAddress .
12. Set the DisplayMode property on this control to the formula
If( SyncAddresses.Value, DisplayMode.View, DisplayMode.Edit ) . This will automatically enable or disable this
control based on the state of the check box control.
13. Set the Default property of the check box to the formula true . This will default the Billing address to use the
same value as the Shipping address.
14. Set the OnCheck property of the check box to the formula Reset( BillingName ); Reset( BillingAddress ) . If
the user chooses to sync Shipping and Billing addresses, this will clear any user input in the Billing address
fields allowing the Default properties on each to pull the values from the corresponding Shipping address
fields.
15. Set the OnUncheck property of the check box to the formula SetFocus( BillingName ) . If the user chooses to
have a different billing address, this will move the focus to the first control in the Billing address. The controls
will have already been enabled due to their DisplayMode properties.
Focus on validation issues

NOTE
Although this example appears to be an Edit form control, unfortunately SetFocus is not yet supported by that control.
Instead, this example uses a scrollable screen to host the input controls.

When validating a form, it can be helpful to not only display a message if there is a problem but to also take the
user to the field that is offending. It can be particularly helpful if the field in question is scrolled off the screen and
not visible.

In this animation, the validation button is repeatedly pressed until all the fields have been filled in properly. Note
that the mouse pointer doesn't move down from the top of the screen. Instead the SetFocus function hsa moved
the input focus to the control that requires attention with this formula:
If( IsBlank( Name ),
Notify( "Name requires a value", Error ); SetFocus( Name ),
IsBlank( Street1 ),
Notify( "Street Address 1 requires a value", Error ); SetFocus( Street1 ),
IsBlank( Street2 ),
Notify( "Street Address 2 requires a value", Error ); SetFocus( Street2 ),
IsBlank( City ),
Notify( "City requires a value", Error ); SetFocus( City ),
IsBlank( County ),
Notify( "County requires a value", Error ); SetFocus( County ),
IsBlank( StateProvince ),
Notify( "State or Province requires a value", Error ); SetFocus( StateProvince ),
IsBlank( PostalCode ),
Notify( "Postal Code requires a value", Error ); SetFocus( PostalCode ),
IsBlank( Phone ),
Notify( "Contact Phone requires a value", Error ); SetFocus( Phone ),
Notify( "Form is Complete", Success )
)

To create this example:


1. Create a new, blank phone app.
2. From the Insert menu, select New screen, and then select Scrollable.
3. In the center section of the screen, add Text input controls and name them Name, Street1, Street2, City,
County, StateProvince, PostalCode, and Phone. Add Label controls above each one to identify the fields.
You may need to resize the section if it is not long enough to fit all the controls.
4. Add a checkmark Icon control at the top of the screen, above the scrollable section.
5. Set the OnSelect property of the icon control to the formula If( IsBlank( ... given above.
Focus when displaying a screen

NOTE
Although this example appears to be an Edit form control, unforutnatley SetFocus is not yet supported by that control.
Instead, this example uses a scrollable screen to host the input controls.

Similar to exposing an input control, when displaying a data entry screen it is helpful to focus the first input control
for faster data entry.
In this animation, the data entry screen on the left is not using SetFocus. Upon display no input control has focus,
requiring the user to tab, touch, mouse, or use another means to focus the Name field before a value can be typed
into it.
On the right we have exactly the same app with the OnVisible property of the data entry screen set to this
formula:

SetFocus( Name )

This sets the focus to the Name field automatically. The user can begin typing and tabbing between fields
immediately with no prior action required.
To create this example:
1. Create the "Focus on validation issues" app above.
2. On this screen, set the OnVisible property to the formula SetFocus( Name ) .
3. Add a second screen.
4. Add a Button control.
5. Set the OnSelect property of this control to the formula Navigate( Screen1 ) .
6. Preview the app from this screen. Press the button. The OnVisible formula will be evaluated and the Name
field will automatically be in focus.
SetProperty function in Power Apps Test Studio
1/21/2020 • 2 minutes to read • Edit Online

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.

Syntax
SetProperty (Control Property, value)
Control Property – Required. The control property to set on behalf of the user.
Value – Required. The value of the property to set on behalf of the user.

Examples
CONTROL PROPERTY EXAMPLE EXPRESSION

TextInput Text SetProperty(TextInput1.Text,


"Sample text")

RichTextEditor HtmlText SetProperty(RichTextEditor1.HtmlText,


"<p>Sample text</p>")

Toggle Value SetProperty(Toggle1.Value, false)

Checkbox Value SetProperty(Checkbox1.Value,


false)

Slider Value SetProperty(Slider1.Value, 10)

Rating Value SetProperty(Rating1.Value, 5)

DatePicker SelectedDate SetProperty(DatePicker1.SelectedDate,


Date(2020,3,10))

Radio Selected SetProperty(Radio1.Selected,


"Yes")

Radio SelectedText SetProperty(Radio1.SelectedText,


"Yes")

Dropdown Selected SetProperty(Dropdown1.Selected,


{Value:"Sample value"})

Dropdown SelectedText SetProperty(Dropdown1.SelectedText,


{Value:"Sample value"})

Combobox Selected SetProperty(Dropdown1.Selected,


{Value:"Sample value"})
CONTROL PROPERTY EXAMPLE EXPRESSION

Combobox SelectedItems SetProperty(ComboBox1.SelectedItems,


Table({Value:"Sample value"},
({Value:"Sample value"}))

ListBox Selected SetProperty(Listbox1.Selected,


{'Value':"Sample value"})

ListBox SelectedItems SetProperty(Listbox1.SelectedItems,


Table({Value:"Sample value"},
({Value:"Sample value"}))

See Also
Test Studio Overview
Working with Test Studio
AddColumns, DropColumns, RenameColumns, and
ShowColumns functions in Power Apps
12/3/2019 • 6 minutes to read • Edit Online

Shapes a table by adding, dropping, renaming, and selecting its columns.

Overview
These functions shape a table by adjusting its columns:
Reduce a table that contains multiple columns down to a single column for use with single-column functions, such as Lower or Abs.
Add a calculated column to a table (for example, a Total Price column that shows the results of multiplying Quantity by Unit
Price).
Rename a column to something more meaningful, for display to users or for use in formulas.
A table is a value in Power Apps, just like a string or a number. You can specify a table as an argument in a formula, and functions can
return a table as a result.

NOTE
The functions that this topic describes don't modify the original table. Instead, they take that table as an argument and return a new table with a
transform applied. See working with tables for more details.

You can't modify the columns of a data source by using these functions. You must modify the data at its source. You can add columns to
a collection with the Collect function. See working with data sources for more details.

Description
The AddColumns function adds a column to a table, and a formula defines the values in that column. Existing columns remain
unmodified.
The formula is evaluated for each record of the table.
Fields of the record currently being processed are available within the formula. You simply reference them by name as you would any
other value. You can also reference control properties and other values from throughout your app. For more details, see the examples
below and working with record scope.
The DropColumns function excludes columns from a table. All other columns remain unmodified. DropColumns excludes columns,
and ShowColumns includes columns.
Use the RenameColumns function to rename one or more columns of a table by providing at least one argument pair that specifies the
name of a column that the table contains (the old name, which you want to replace) and the name of a column that the table doesn't
contain (the new name, which you want to use). The old name must already exist in the table, and the new name must not exist. Each
column name may appear only once in the argument list as either an old column name or a new column name. To rename a column to
an existing column name, first drop the existing column with DropColumns, or rename the existing column out of the way by nesting
one RenameColumns function within another.
The ShowColumns function includes columns of a table and drops all other columns. You can use ShowColumns to create a single-
column table from a multi-column table. ShowColumns includes columns, and DropColumns excludes columns.
For all these functions, the result is a new table with the transform applied. The original table isn't modified. You can't modify an existing
table with a formula. SharePoint, Common Data Service, SQL Server, and other data sources provide tools for modifying the columns of
lists, entities, and tables, which are often referred to as the schema. The functions in this topic only transform an input table, without
modifying the original, into an output table for further use.
The arguments to these functions support delegation. For example, a Filter function used as an argument to pull in related records
searches through all listings, even if the '[dbo].[AllListings]' data source contains a million rows:

AddColumns( RealEstateAgents,
"Listings",
Filter( '[dbo].[AllListings]', ListingAgentName = AgentName )
)

However, the output of these functions is subject to the non-delegation record limit. In this example, only 500 records are returned even
if the RealEstateAgents data source has 501 or more records.
If you use AddColumns in this manner, Filter must make separate calls to the data source for each of those first records in
RealEstateAgents, which causes a lot of network chatter. If [dbo].[AllListings] is small enough and doesn't change often, you could
call the Collect function in OnStart to cache the data source in your app when it starts. As an alternative, you could restructure your
app so that you pull in the related records only when the user asks for them.

Syntax
AddColumns( Table, ColumnName1, Formula1 [, ColumnName2, Formula2, ... ] )
Table - Required. Table to operate on.
ColumnName(s) - Required. Name(s) of the column(s) to add. You must specify a string (for example, "Name" with double quotes
included) for this argument.
Formula (s) - Required. Formula(s) to evaluate for each record. The result is added as the value of the corresponding new column. You
can reference other columns of the table in this formula.
DropColumns( Table, ColumnName1 [, ColumnName2, ... ] )
Table - Required. Table to operate on.
ColumnName(s) - Required. Name(s) of the column(s) to drop. You must specify a string (for example, "Name" with double quotes
included) for this argument.
RenameColumns( Table, OldColumnName1, NewColumnName1 [, OldColumnName2, NewColumnName2, ... ] )
Table - Required. Table to operate on.
OldColumnName - Required. Name of a column to rename from the original table. This element appears first in the argument pair
(or first in each argument pair if the formula includes more than one pair). This name must be a string (for example "Name" with
double quotation marks included).
NewColumnName - Required. Replacement name. This element appears last in the argument pair (or last in each argument pair if
the formula includes more than one pair). You must specify a string (for example, "Customer Name" with double quotation marks
included) for this argument.
ShowColumns( Table, ColumnName1 [, ColumnName2, ... ] )
Table - Required. Table to operate on.
ColumnName(s) - Required. Name(s) of the column(s) to include. You must specify a string (for example, "Name" with double
quotes included) for this argument.

Examples
The examples in this section use the IceCreamSales data source, which contains the data in this table:

None of these examples modify the IceCreamSales data source. Each function transforms the value of the data source as a table and
returns that value as the result.

FORMULA DESCRIPTION RESULT

AddColumns( IceCreamSales, "Revenue", Adds a Revenue column to the result. For each
UnitPrice * QuantitySold ) record, UnitPrice * QuantitySold is evaluated,
and the result is placed in the new column.

DropColumns( IceCreamSales, "UnitPrice" ) Excludes the UnitPrice column from the result.
Use this function to exclude columns, and use
ShowColumns to include them.

ShowColumns( IceCreamSales, "Flavor" ) Includes only the Flavor column in the result.
Use this function include columns, and use
DropColumns to exclude them.
FORMULA DESCRIPTION RESULT

RenameColumns( IceCreamSales, Renames the UnitPrice column in the result.


"UnitPrice", "Price")

RenameColumns( IceCreamSales, Renames the UnitPrice and QuantitySold


"UnitPrice", "Price", "QuantitySold", columns in the result.
"Number")

DropColumns( Performs the following table transforms in


RenameColumns( order, starting from the inside of the formula:
AddColumns( IceCreamSales, "Revenue", 1. Adds a Revenue column based on the
UnitPrice * QuantitySold ), per-record calculation of UnitPrice *
"UnitPrice", "Price" ), Quantity.
"Quantity" ) 2. Renames UnitPrice to Price.
3. Excludes the Quantity column.
Note that order is important. For example, we
can't calculate with UnitPrice after it has been
renamed.

Step by step
Let's try some of the examples from earlier in this topic.
1. Create a collection by adding a Button control and setting its OnSelect property to this formula:

ClearCollect( IceCreamSales,
Table(
{ Flavor: "Strawberry", UnitPrice: 1.99, QuantitySold: 20 },
{ Flavor: "Chocolate", UnitPrice: 2.99, QuantitySold: 45 },
{ Flavor: "Vanilla", UnitPrice: 1.50, QuantitySold: 35 }
)
)

2. Run the formula by selecting the button while holding down the Alt key.
3. Add a second Button control, set its OnSelect property to this formula, and then run it:

ClearCollect( FirstExample,
AddColumns( IceCreamSales, "Revenue", UnitPrice * QuantitySold )
)

4. On the File menu, select Collections, and then select IceCreamSales to show that collection.
As this graphic shows, the second formula didn't modify this collection. The AddColumns function used IceCreamSales as a
read-only argument; the function didn't modify the table to which that argument refers.
5. Select FirstExample.
As this graphic shows, the second formula returned a new table with the added column. The ClearCollect function captured the
new table in the FirstExample collection, adding something to the original table as it flowed through the function without
modifying the source:
Shuffle function in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Randomly reorders the records of a table.

Description
The Shuffle function reorders the records of a table.
Shuffle returns a table that has the same columns and number of rows as the argument.

Syntax
Shuffle( Table )
Table - Required. Table to shuffle.

Example
If you stored details about playing cards in a collection named Deck, this formula would return a copy of that
collection that has been randomly shuffled.
Shuffle(Deck)
Acos, Acot, Asin, Atan, Atan2, Cos, Cot, Degrees, Pi,
Radians, Sin, and Tan functions in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Calculates trigonometric values.

Description
Primary functions
The Cos function returns the cosine of its argument, an angle specified in radians.
The Cot function returns the cotangent of its argument, an angle specified in radians.
The Sin function returns the sine of its argument, an angle specified in radians.
The Tan function returns the tangent of its argument, an angle specified in radians.
Inverse functions
The Acos function returns the arccosine, or inverse cosine, of its argument. The arccosine is the angle whose cosine
is the argument. The returned angle is given in radians in the range 0 (zero) to π.
The Acot function returns the principal value of the arccotangent, or inverse cotangent, of its argument. The
returned angle is given in radians in the range 0 (zero) to π.
The Asin function returns the arcsine, or inverse sine, of its argument. The arcsine is the angle whose sine is the
argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan function returns the arctangent, or inverse tangent, of its argument. The arctangent is the angle whose
tangent is the argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan2 function returns the arctangent, or inverse tangent, of the specified x and y coordinates as arguments.
The arctangent is the angle from the x-axis to a line that contains the origin (0, 0) and a point with coordinates (x, y).
The angle is given in radians between -π and π, excluding -π. A positive result represents a counterclockwise angle
from the x-axis; a negative result represents a clockwise angle. Atan2( a, b ) equals Atan( b/a ), except that a can
equal 0 (zero) with the Atan2 function.
Helper functions
The Degrees function converts radians to degrees. π radians equals 180 degrees.
The Pi function returns the transcendental number π, which begins 3.141592...
The Radians function converts degrees to radians.
Notes
If you pass a single number to these functions, the return value is a single result. If you pass a single-column table
that contains numbers, the return value is a single-column table of results, one result for each record in the
argument's table. If you have a multi-column table, you can shape it into a single-column table, as working with
tables describes.
If an argument would result in an undefined value, the result is blank. This can happen, for example, when using
inverse functions with arguments that are out of range.
Syntax
Primary Functions
Cos( Radians )
Cot( Radians )
Sin( Radians )
Tan( Radians )
Radians - Required. Angle to operate on.
Cos( SingleColumnTable )
Cot( SingleColumnTable )
Sin( SingleColumnTable )
Tan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of angles to operate on.
Inverse Functions
Acos( Number )
Acot( Number )
Asin( Number )
Atan( Number )
Number - Required. Number to operate on.
Acos( SingleColumnTable )
Acot( SingleColumnTable )
Asin( SingleColumnTable )
Atan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of numbers to operate on.
Atan2( X, Y )
X - Required. X-axis coordinate.
Y - Required. Y -axis coordinate.
Helper Functions
Degrees( Radians )
Radians - Required. Angle in radians to convert to degrees.
Pi()
Radians( Degrees )
Degrees - Required. Angle in degrees to convert to radians.

Examples
Single number
FORMULA DESCRIPTION RESULT

Cos( 1.047197 ) Returns the cosine of 1.047197 radians 0.5


or 60 degrees.
FORMULA DESCRIPTION RESULT

Cot( Pi()/4 ) Returns the cotangent of 0.785398... 1


radians or 45 degrees.

Sin( Pi()/2 ) Returns the sine of 1.570796... radians 1


or 90 degrees.

Tan( Radians(60) ) Returns the tangent of 1.047197... 1.732050...


radians or 60 degrees.

Acos( 0.5 ) Returns the arccosine of 0.5, in radians. 1.047197...

Acot( 1 ) Returns the arccotangent of 1, in 0.785398...


radians.

Asin( 1 ) Returns the arcsine of 1, in radians. 1.570796...

Atan( 1.732050 ) Returns the arctangent of 1.732050, in 1.047197...


radians.

Atan2( 5, 3 ) Returns the arctangent of the angle 0.540419...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (5,3),
which is approximately 31 degrees.

Atan2( 4, 4 ) Returns the arctangent of the angle 0.785398...


from the x-axis of the line that contains
the origin (0,0) and the coordinate (4,4),
which is exactly π/4 radians or 45
degrees.

Degrees( 1.047197 ) Returns the equivalent number of 60


degrees for 1.047197 radians.

Pi() Returns the transcendental number π. 3.141592...

Radians( 15 ) Returns the equivalent number of 0.261799...


radians for 15 degrees.

Single -column table


The examples in this section use a data source that's named ValueTable and that contains the following data. The
last record in the table is π/2 radians or 90 degrees.

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Cos( ValueTable ) Returns the cosine of each number in


the table.

Cot( ValueTable ) Returns the cotangent of each number


in the table.

Sin( ValueTable ) Returns the sine of each number in the


table.

Tan( ValueTable ) Returns the tangent of each number in


the table.

Acos( ValueTable ) Returns the arccosine of each number in


the table.

Acot( ValueTable ) Returns the arccotangent of each


number in the table.

Asin( ValueTable ) Returns the arcsine of each number in


the table.

Atan( ValueTable ) Returns the arctangent of each number


in the table.
FORMULA DESCRIPTION RESULT

Degrees( ValueTable ) Returns the equivalent number of


degrees for each number in the table,
assumed to be angles in radians.

Radians( ValueTable ) Returns the equivalent number of


radians for each number in the table,
assumed to be angles in degrees.
Sort and SortByColumns functions in Power Apps
12/3/2019 • 7 minutes to read • Edit Online

Sorts a table.

Description
The Sort function sorts a table based on a formula.
The formula is evaluated for each record of the table, and the results are used to sort the table. The formula must
result in a number, a string, or a Boolean value; it can't result in a table or a record.
Fields of the record currently being processed are available within the formula. You simply reference them by name
as you would any other value. You can also reference control properties and other values from throughout your
app. For more details, see the examples below and working with record scope.
To sort first by one column and then by another, you embed a Sort formula within another. For example, you can
use this formula to sort a Contacts table first by a LastName column and then by a FirstName column: Sort(
Sort( Contacts, LastName ), FirstName )
The SortByColumns function can also be used to sort a table based on one or more columns.
The parameter list for SortByColumns provides the names of the columns to sort by and the sort direction per
column. Sorting is performed in the order of the parameters (sorted first by the first column, then the second, and
so on). Column names are specified as strings, requiring double quotes if directly included in the parameter list. For
example, SortByColumns( CustomerTable, "LastName" ).
You can combine SortByColumns with a Drop down or List box control to enable users to select which column
to sort by.
In addition to sorting ascending or descending, SortByColumns can sort based on a single column table of values.
For example, you can sort record based on the name of a day of the week by supplying [ "Monday", "Tuesday",
"Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ] as the sort order. All records which have
Monday" will come first, followed by Tuesday, and so on. Records found that do not appear in the sort table are
put at the end of the list.
Tables are a value in Power Apps, just like a string or number. They can be passed to and returned from functions.
Sort and SortByColumn don't modify a table; instead they take a table as an argument and return a new table that
has been sorted. See working with tables for more details.

Delegation
When possible, Power Apps will delegate filter and sort operations to the data source and page through the results
on demand. For example, when you start an app that shows a Gallery control filled with data, only the first set of
records will be initially brought to the device. As the user scrolls, additional data is brought down from the data
source. The result is a faster start time for the app and access to very large data sets.
However, delegation may not always be possible. Data sources vary on what functions and operators they support
with delegation. If complete delegation of a formula isn't possible, the authoring environment will flag the portion
that can't be delegated with a warning. When possible, consider changing the formula to avoid functions and
operators that can't be delegated. The delegation list details which data sources and operations can be delegated.
If delegation is not possible, Power Apps will pull down only a small set of records to work on locally. Filter and sort
functions will operate on a reduced set of records. What is available in the Gallery may not be the complete story,
which could be confusing to users.
See the delegation overview for more information.

Syntax
Sort( Table, Formula [, SortOrder ] )
Table - Required. Table to sort.
Formula - Required. This formula is evaluated for each record of the table, and the results are used to sort the
table. You can reference columns within the table.
SortOrder - Optional. Specify SortOrder.Descending to sort the table in descending order.
SortOrder.Ascending is the default value.
SortByColumns( Table, ColumnName1 [, SortOrder1, ColumnName2, SortOrder2, ... ] )
Table - Required. Table to sort.
ColumnName(s) - Required. The column names to sort on, as strings.
SortOrder (s) - Optional. SortOrder.Ascending or SortOrder.Descending. SortOrder.Ascending is the
default. If multiple ColumnNames are supplied, all but the last column must include a SortOrder.

NOTE
For SharePoint and Excel data sources that contain column names with spaces, specify each space as "_x0020_". For
example, specify "Column Name" as "Column_x0020_Name".

SortByColumns( Table, ColumnName, SortOrderTable )


Table - Required. Table to sort.
ColumnName - Required. The column name to sort on, as strings.
SortOrderTable - Required. Single column table of values to sort by.

NOTE
For SharePoint and Excel data sources that contain column names with spaces, specify each space as "_x0020_". For
example, specify "Column Name" as "Column_x0020_Name".

Examples
For the following examples, we'll use the IceCream data source, which contains the data in this table:
FORMULA DESCRIPTION RESULT

Sort( IceCream, Flavor ) Sorts IceCream by its Flavor column.


The Flavor column contains strings, so
SortByColumns( IceCream, "Flavor" the table is sorted alphabetically. By
) default, the sort order is ascending.

Sort( IceCream, Quantity ) Sorts IceCream by its Quantity


column. The Quantity column contains
SortByColumns( IceCream, numbers, so the table is sorted
"Quantity" ) numerically. By default, the sort order is
ascending.

Sort( IceCream, Quantity, Sorts IceCream by its Quantity


SortOrder.Descending ) column. The Quantity column contains
numbers, so the sort is done
SortByColumns( IceCream, numerically. The sort order has been
"Quantity", SortOrder.Descending ) specified as descending.

Sort( IceCream, Quantity + OnOrder Sorts IceCream by the sum of its


) Quantity and OnOrder columns for
each record individually. The sum is a
number, so the table is sorted
numerically. By default, the sort order is
ascending. Since we are sorting by a
formula and not by raw column values,
there is no equivalent using
SortByColumns.

Sort( Sort( IceCream, OnOrder ), Sorts IceCream first by its OnOrder


Quantity ) column, and then by its Quantity
column. Note that "Pistachio" rose
SortByColumns( IceCream, above "Vanilla" in the first sort based on
"OnOrder", Ascending, "Quantity", OnOrder, and then together they
Ascending ) moved to their appropriate place based
on Quantity.

SortByColumns( IceCream, "Flavor", Sorts IceCream by it's Flavor column


[ "Pistachio", "Strawberry" ] ) based on the single column table
containing "Pistachio" and "Strawberry".
Records which have a Flavor of
"Pistachio" will appear first in the result,
followed by records that contain
"Strawberry". For values in the Flavor
column that are not matched, such as
"Vanilla", they will appear after the items
that were matched.

Step by step
To run these examples yourself, create the IceCream data source as a collection:
1. Add a button, and set its OnSelect property to this formula:
ClearCollect( IceCream, { Flavor: "Chocolate", Quantity: 100, OnOrder: 150 }, { Flavor: "Vanilla",
Quantity: 200, OnOrder: 20 }, { Flavor: "Strawberry", Quantity: 300, OnOrder: 0 }, { Flavor: "Mint
Chocolate", Quantity: 60, OnOrder: 100 }, { Flavor: "Pistachio", Quantity: 200, OnOrder: 10 } )
2. Preview the app, select the button, and then press Esc to return to the default workspace.
3. Select Collections on the File menu to display the collection that you just created, and then press Esc to return
to the default workspace.
Sort
1. Add another button, and set its OnSelect property to this formula:
ClearCollect( SortByFlavor, Sort( IceCream, Flavor ) )
The previous formula creates a second collection, named SortByFlavor, that contains the same data as Ice
Cream. However, the new collection contains the data sorted alphabetically by the Flavor column in
ascending order.
2. Press F5, select the new button, and then press Esc.
3. Select Collections on the File menu to display both collections, and then press Esc to return to the default
workspace.
4. Repeat the last three steps, but change the name of the collection that you want to create, and replace the
Sort formula with a different formula from the table of examples earlier in this section that uses Sort.
SortByColumns
1. Add another button, and set its OnSelect property to this formula:
ClearCollect( SortByQuantity, SortByColumns( IceCream, "Quantity", Ascending, "Flavor",
Descending ) )
The previous formula creates a third collection, named SortByQuantity, that contains the same data as Ice
Cream. However, the new collection contains the data sorted numerically by the Quantity column in
ascending order, and then by the Flavor column in descending order.
2. Press F5, select the new button, and then press Esc.
3. Select Collections on the File menu to display all three collections, and then press Esc to return to the
default workspace.
4. Repeat the last three steps, but change the name of the collection that you want to create, and replace the
SortByColumns formula with a different formula from the table of examples earlier in this section that uses
SortByColumns.
Sort and SortByColumns functions in Power Apps
12/3/2019 • 7 minutes to read • Edit Online

Sorts a table.

Description
The Sort function sorts a table based on a formula.
The formula is evaluated for each record of the table, and the results are used to sort the table. The formula
must result in a number, a string, or a Boolean value; it can't result in a table or a record.
Fields of the record currently being processed are available within the formula. You simply reference them by
name as you would any other value. You can also reference control properties and other values from
throughout your app. For more details, see the examples below and working with record scope.
To sort first by one column and then by another, you embed a Sort formula within another. For example, you
can use this formula to sort a Contacts table first by a LastName column and then by a FirstName column:
Sort( Sort( Contacts, LastName ), FirstName )
The SortByColumns function can also be used to sort a table based on one or more columns.
The parameter list for SortByColumns provides the names of the columns to sort by and the sort direction per
column. Sorting is performed in the order of the parameters (sorted first by the first column, then the second,
and so on). Column names are specified as strings, requiring double quotes if directly included in the parameter
list. For example, SortByColumns( CustomerTable, "LastName" ).
You can combine SortByColumns with a Drop down or List box control to enable users to select which
column to sort by.
In addition to sorting ascending or descending, SortByColumns can sort based on a single column table of
values. For example, you can sort record based on the name of a day of the week by supplying [ "Monday",
"Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ] as the sort order. All records
which have Monday" will come first, followed by Tuesday, and so on. Records found that do not appear in the
sort table are put at the end of the list.
Tables are a value in Power Apps, just like a string or number. They can be passed to and returned from
functions. Sort and SortByColumn don't modify a table; instead they take a table as an argument and return a
new table that has been sorted. See working with tables for more details.

Delegation
When possible, Power Apps will delegate filter and sort operations to the data source and page through the
results on demand. For example, when you start an app that shows a Gallery control filled with data, only the
first set of records will be initially brought to the device. As the user scrolls, additional data is brought down
from the data source. The result is a faster start time for the app and access to very large data sets.
However, delegation may not always be possible. Data sources vary on what functions and operators they
support with delegation. If complete delegation of a formula isn't possible, the authoring environment will flag
the portion that can't be delegated with a warning. When possible, consider changing the formula to avoid
functions and operators that can't be delegated. The delegation list details which data sources and operations
can be delegated.
If delegation is not possible, Power Apps will pull down only a small set of records to work on locally. Filter and
sort functions will operate on a reduced set of records. What is available in the Gallery may not be the
complete story, which could be confusing to users.
See the delegation overview for more information.

Syntax
Sort( Table, Formula [, SortOrder ] )
Table - Required. Table to sort.
Formula - Required. This formula is evaluated for each record of the table, and the results are used to sort
the table. You can reference columns within the table.
SortOrder - Optional. Specify SortOrder.Descending to sort the table in descending order.
SortOrder.Ascending is the default value.
SortByColumns( Table, ColumnName1 [, SortOrder1, ColumnName2, SortOrder2, ... ] )
Table - Required. Table to sort.
ColumnName(s) - Required. The column names to sort on, as strings.
SortOrder (s) - Optional. SortOrder.Ascending or SortOrder.Descending. SortOrder.Ascending is
the default. If multiple ColumnNames are supplied, all but the last column must include a SortOrder.

NOTE
For SharePoint and Excel data sources that contain column names with spaces, specify each space as "_x0020_".
For example, specify "Column Name" as "Column_x0020_Name".

SortByColumns( Table, ColumnName, SortOrderTable )


Table - Required. Table to sort.
ColumnName - Required. The column name to sort on, as strings.
SortOrderTable - Required. Single column table of values to sort by.

NOTE
For SharePoint and Excel data sources that contain column names with spaces, specify each space as "_x0020_".
For example, specify "Column Name" as "Column_x0020_Name".

Examples
For the following examples, we'll use the IceCream data source, which contains the data in this table:
FORMULA DESCRIPTION RESULT

Sort( IceCream, Flavor ) Sorts IceCream by its Flavor column.


The Flavor column contains strings, so
SortByColumns( IceCream, the table is sorted alphabetically. By
"Flavor" ) default, the sort order is ascending.

Sort( IceCream, Quantity ) Sorts IceCream by its Quantity


column. The Quantity column
SortByColumns( IceCream, contains numbers, so the table is
"Quantity" ) sorted numerically. By default, the sort
order is ascending.

Sort( IceCream, Quantity, Sorts IceCream by its Quantity


SortOrder.Descending ) column. The Quantity column
contains numbers, so the sort is done
SortByColumns( IceCream, numerically. The sort order has been
"Quantity", SortOrder.Descending ) specified as descending.

Sort( IceCream, Quantity + Sorts IceCream by the sum of its


OnOrder ) Quantity and OnOrder columns for
each record individually. The sum is a
number, so the table is sorted
numerically. By default, the sort order
is ascending. Since we are sorting by a
formula and not by raw column values,
there is no equivalent using
SortByColumns.

Sort( Sort( IceCream, OnOrder ), Sorts IceCream first by its OnOrder


Quantity ) column, and then by its Quantity
column. Note that "Pistachio" rose
SortByColumns( IceCream, above "Vanilla" in the first sort based
"OnOrder", Ascending, "Quantity", on OnOrder, and then together they
Ascending ) moved to their appropriate place
based on Quantity.

SortByColumns( IceCream, Sorts IceCream by it's Flavor column


"Flavor", based on the single column table
[ "Pistachio", "Strawberry" ] ) containing "Pistachio" and
"Strawberry". Records which have a
Flavor of "Pistachio" will appear first in
the result, followed by records that
contain "Strawberry". For values in the
Flavor column that are not matched,
such as "Vanilla", they will appear after
the items that were matched.

Step by step
To run these examples yourself, create the IceCream data source as a collection:
1. Add a button, and set its OnSelect property to this formula:
ClearCollect( IceCream, { Flavor: "Chocolate", Quantity: 100, OnOrder: 150 }, { Flavor: "Vanilla",
Quantity: 200, OnOrder: 20 }, { Flavor: "Strawberry", Quantity: 300, OnOrder: 0 }, { Flavor: "Mint
Chocolate", Quantity: 60, OnOrder: 100 }, { Flavor: "Pistachio", Quantity: 200, OnOrder: 10 } )
2. Preview the app, select the button, and then press Esc to return to the default workspace.
3. Select Collections on the File menu to display the collection that you just created, and then press Esc to
return to the default workspace.
Sort
1. Add another button, and set its OnSelect property to this formula:
ClearCollect( SortByFlavor, Sort( IceCream, Flavor ) )
The previous formula creates a second collection, named SortByFlavor, that contains the same data as
Ice Cream. However, the new collection contains the data sorted alphabetically by the Flavor column in
ascending order.
2. Press F5, select the new button, and then press Esc.
3. Select Collections on the File menu to display both collections, and then press Esc to return to the
default workspace.
4. Repeat the last three steps, but change the name of the collection that you want to create, and replace the
Sort formula with a different formula from the table of examples earlier in this section that uses Sort.
SortByColumns
1. Add another button, and set its OnSelect property to this formula:
ClearCollect( SortByQuantity, SortByColumns( IceCream, "Quantity", Ascending, "Flavor",
Descending ) )
The previous formula creates a third collection, named SortByQuantity, that contains the same data as
Ice Cream. However, the new collection contains the data sorted numerically by the Quantity column
in ascending order, and then by the Flavor column in descending order.
2. Press F5, select the new button, and then press Esc.
3. Select Collections on the File menu to display all three collections, and then press Esc to return to the
default workspace.
4. Repeat the last three steps, but change the name of the collection that you want to create, and replace the
SortByColumns formula with a different formula from the table of examples earlier in this section that
uses SortByColumns.
Split function in Power Apps
12/3/2019 • 3 minutes to read • Edit Online

Splits a text string into a table of substrings.

Description
The Split function breaks a text string into a table of substrings. Use Split to break up comma delimited lists,
dates that use a slash between date parts, and in other situations where a well defined delimiter is used.
A separator string is used to break the text string apart. The separator can be zero, one, or more characters that
are matched as a whole in the text string. Using a zero length or blank string results in each character being
broken out individually. The matched separator characters are not returned in the result. If no separator match is
found then the entire text string is returned as a single result.
Use the Concat function to recombine the string without the separators.
Use the MatchAll function to split a string using a regular expression.
The examples show how Split can be used with the First and Last functions to extract a single delimited
substring. The Match function is often a more concise and powerful choice for those familiar with regular
expressions.

Syntax
Split( Text, Separator )
Text - Required. Text to split.
Separator - Required. Separator to use in splitting the string. Can be zero, one, or more characters.

Examples
Basic usage
FORMULA DESCRIPTION RESULT

Split( "Apples, Oranges, Splits the different fruits apart, based


Bananas", "," ) on the comma separator. The split is
performed based on only the comma
and not the space after it, resulting in a
space at the front of " Oranges" and
" Bananas".

TrimEnds( Split( "Apples, Same as the previous example, but in


Oranges, Bananas", "," ) ) this case the space is removed by the
TrimEnds function, operating on the
single column table that is produced by
Split. We could have also used the
separator ", " which includes the space
after the comma, but that would not
have worked properly if there is no
space or there are two spaces.
FORMULA DESCRIPTION RESULT

Split( "08/28/17", "/" ) Splits the date apart, using a forward


slash as the separator.

Different delimiters
FORMULA DESCRIPTION RESULT

Split( "Hello, World", "," ) Splits the words apart, using a comma
as the separator. The second result
starts with a space since this was the
character immediately following the
comma.

Split( "Hello, World", "o" ) Splits the string apart, using the
character "o" as the separator.

Split( "Hello, World", "l" ) Splits the string apart, using the single
character "l" as the separator. Since
there were no characters between the
two l's in Hello, a blank value was
returned.

Split( "Hello, World", "ll" ) Splits the string apart, using the double
character "ll" as the separator.

Split( "Hello, World", "%" ) Splits the string apart, using the
percent sign as the separator. Since this
separator does not appear in the
string, the entire string is returned as
one result.
FORMULA DESCRIPTION RESULT

Split( "Hello, World", "" ) Splits the string apart, using an empty
string as the separator (zero
characters). This will break the string on
each character.

Substring extraction
FORMULA DESCRIPTION RESULT

First( Split( Last( Split( "Bob Splits the string apart based on an "bob.jones@contoso.com"
Jones <bob.jones@contoso.com>", opening delimiter (<) and extracts the
"<" ) ).Result, ">" ) ).Result
string to the right of the delimiter with
Last. The formula then splits that result
based on the closing delimiter (>) and
extracts the string the left of the
delimiter with Right.

Match( "Bob Jones Performs the same delimiter based "bob.jones@contoso.com"


<bob.jones@contoso.com>", "<(? extraction as the last example but uses
<email>.+)>" ).email
the Match function and a regular
expression instead.
Abs, Exp, Ln, Power, and Sqrt functions in Power
Apps
12/3/2019 • 2 minutes to read • Edit Online

Calculates absolute values, natural logarithms, square roots, and the results of raising e or any number to
specified powers.

Description
The Abs function returns the non-negative value of its argument. If a number is negative, Abs returns the
positive equivalent.
The Exp function returns e raised to the power of its argument. The transcendental number e begins
2.7182818...
The Ln function returns the natural logarithm (base e) of its argument.
The Power function returns a number raised to a power. It is equivalent to using the ^ operator.
The Sqrt function returns the number that, when multiplied by itself, equals its argument.
If you pass a single number, the return value is a single result based on the function called. If you pass a single-
column table that contains numbers, the return value is a single-column table of results, one result for each
record in the argument's table. If you have a multi-column table, you can shape it into a single-column table, as
working with tables describes.
If an argument would result in an undefined valued, the result is blank. This can happen, for example, with
square roots and logarithms of negative numbers.

Syntax
Abs( Number )
Exp( Number )
Ln( Number )
Sqrt( Number )
Number - Required. Number to operate on.
Power( Base, Exponent )
Base - Required. Base number to raise.
Exponent - Required. The exponent to which the base number is raised.
Abs( SingleColumnTable )
Exp( SingleColumnTable )
Ln( SingleColumnTable )
Sqrt( SingleColumnTable )
SingleColumnTable - Required. A single-column table of numbers to operate on.

Examples
Single number
FORMULA DESCRIPTION RESULT

Abs( -55 ) Returns the number without the 55


negative sign.

Exp( 2 ) Returns e raised to the power of 2, or 7.389056...


e * e.

Ln( 100 ) Returns the natural logarithm (base e) 4.605170...


of the number 100.

Power( 5, 3 ) Returns 5 raised to the power of 3, or 125


5 * 5 * 5.

Sqrt( 9 ) Returns the number that, when 3


multiplied by itself, results in 9.

Single -column table


The examples in this section use a data source that's named ValueTable and that contains this data:

FORMULA DESCRIPTION RESULT

Abs( ValueTable ) Returns the absolute value of each


number in the table.

Exp( ValueTable ) Returns e raised to the power of each


number in the table.

Ln( ValueTable ) Returns the natural logarithm of each


number in the table.

Sqrt( ValueTable ) Returns the square root of each


number in the table

Step-by-step example
1. Add a Text input control, and name it Source.
2. Add a Label control, and set its Text property to this formula:
Sqrt( Value( Source.Text ) )
3. Type a number into Source, and confirm that the Label control shows the square root of the number that
you typed.
EndsWith and StartsWith functions in Power Apps
12/3/2019 • 5 minutes to read • Edit Online

Tests whether a text string begins or ends another text string.

Description
The EndsWith function tests whether one text string ends with another.
The StartsWith function tests whether one text string begins with another.
For both functions, the tests are case insensitive. The return value of both is a Boolean true or false.
Use EndsWith and StartsWith with the Filter function to search the data within your app. You can also use the
in operator or the Search function to look anywhere within text strings, not just at the beginning or end. Your
choice of functions will depend on the needs of your app and which function can be delegated for your particular
data source. If one of these functions can't be delegated, a delegation warning will appear at authoring time to
warn you of this limitation.

Syntax
EndsWith( Text, EndText )
Text – Required. The text to test.
EndText – Required. The text to search for at the end of Text. If EndText is an empty string, EndsWith returns
true.
StartsWith( Text, StartText )
Text – Required. The text to test.
StartText – Required. The text to search for at the beginning of Text. If StartText is an empty string, StartsWith
returns true.

Examples
FORMULA DESCRIPTION RESULT

EndsWith( "Hello World", "world" ) Tests whether "Hello World" ends true
with "world". The test is case
insensitive.

EndsWith( "Good bye", "good" ) Tests whether "Good bye" ends with false
"good". The EndText argument
("good") appears in the text but not at
the end.

EndsWith( "Always say hello", Tests whether "Always say hello" true
"hello" ) ends with "hello".
FORMULA DESCRIPTION RESULT

EndsWith( "Bye bye", "" ) Tests whether "Bye bye" ends with an true
empty text string (Len returns 0).
Easing its use in Filter expressions,
EndsWith is defined to return true in
this case.

FORMULA DESCRIPTION RESULT

StartsWith( "Hello World", "hello" ) Tests whether "Hello World" begins true
with "hello". The test is case
insensitive.

StartsWith( "Good bye", "hello" ) Tests whether "Good bye" begins with false
"hello".

StartsWith( "Always say hello", Tests whether "Always say hello" false
"hello" ) begins with "hello". Although "hello"
appears in the text, it doesn't appear at
the beginning.

StartsWith( "Bye bye", "" ) Tests whether "Bye bye" starts with an true
empty text string (Len returns 0).
Easing its use in Filter expressions,
StartsWith is defined to return true in
this case.

Search user experience


In many apps, you can type one or more characters into a search box to filter a list of records in a large data set.
As you type, the list shows only those records that match the search criteria.
The examples in the rest of this topic show the results of searching a Customers list that contains this data:

To create this data source as a collection, create a Button control and set its OnSelect property to this formula:
ClearCollect( Customers, Table( { Name: "Fred Garcia", Company: "Northwind Traders" }, { Name: "Cole
Miller", Company: "Contoso" }, { Name: "Glenda Johnson", Company: "Contoso" }, { Name: "Mike
Collins", Company: "Adventure Works" }, { Name: "Colleen Jones", Company: "Adventure Works" } ) )
As in this example, you can show a list of records in a Gallery control at the bottom of a screen. Near the top of
the screen, you can add a Text input control, named SearchInput, so that users can specify which records
interest them.
As the user types characters in SearchInput, the results in the gallery are automatically filtered. In this case, the
gallery is configured to show records for which the name of the customer (not the name of the company) starts
with the sequence of characters in SearchInput.If the user types co in the search box, the gallery shows these
results:

To filter based on the Name column, set the Items property of the gallery control to one of these formulas:

FORMULA DESCRIPTION RESULT

Filter( Customers, StartsWith( Filters the Customers data source for


Name, SearchInput.Text ) ) records in which the search string
appears at the start of the Name
column. The test is case insensitive. If
the user types co in the search box, the
gallery shows Colleen Jones and Cole
Miller. The gallery doesn't show Mike
Collins because the Name column for
that record doesn't start with the
search string.
FORMULA DESCRIPTION RESULT

Filter( Customers, SearchInput.Text Filters the Customers data source for


in Name ) records in which the search string
appears anywhere in the Name
column. The test is case insensitive. If
the user types co in the search box, the
gallery shows Colleen Jones, Cole
Miller, and Mike Collins because the
search string appears somewhere in the
Name column of all of those records.

Search( Customers, Similar to using the in operator, the


SearchInput.Text, "Name" ) Search function searches for a match
anywhere within the Name column of
each record. Note that you must
enclose the column name in double
quotation marks.

You can expand your search to include the Company column as well as the Name column:

FORMULA DESCRIPTION RESULT

Filter( Customers, StartsWith( Filters the Customers data source for


Name, SearchInput.Text ) || records in which either the Name
StartsWith( Company, column or the Company column starts
SearchInput.Text ) ) with the search string (for example, co).
The || operator is true if either
StartsWith function is true.

Filter( Customers, SearchInput.Text Filters the Customers data source for


in Name || SearchInput.Text in records in which either the Name
Company ) column or the Company column
contains the search string (for example,
co) anywhere within it.

Search( Customers, Similar to using the in operator, the


SearchInput.Text, "Name", Search function searches the
"Company" ) Customers data source for records in
which either the Name column or the
Company column contains the search
string (for example, co) anywhere
within it. The Search function is easier
to read and write than Filter if you
want to specify multiple columns and
multiple in operators. Note that you
must enclose the names of the columns
in double quotation marks.
Average, Max, Min, StdevP, Sum, and VarP functions
in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Aggregate functions that summarize a set of numbers.

Description
The Average function calculates the average, or arithmetic mean, of its arguments.
The Max function finds the maximum value.
The Min function finds the minimum value.
The Sum function calculates the sum of its arguments.
The StdevP function calculates the standard deviation of its arguments.
The VarP function calculates the variance of its arguments.
You can supply the values for these functions as:
Separate arguments. For example, Sum ( 1, 2, 3 ) returns 6.
A table and a formula to operate over that table. The aggregate will be calculated on the values of the formula
for each record.
Fields of the record currently being processed are available within the formula. You simply reference them by name
as you would any other value. You can also reference control properties and other values from throughout your
app. For more details, see the examples below and working with record scope.
These functions operate on numeric values only. Other types of values, such as strings or records, are ignored. Use
the Value function to convert a string into a number.
The Average, Max, Min, and Sum functions can be delegated when used with a data source that supports
delegation for these functions. However, StdevP and VarP can't be delegated for any data sources. If delegation is
not supported, only the first portion of the data will be retrieved and then the function applied locally. The result
may not represent the complete story. A delegation warning will appear at authoring time to remind you of this
limitation and to suggest switching to delegable alternatives where possible. For more information, see the
delegation overview.

Syntax
Average( NumericalFormula1, [ NumericalFormula2, ... ] )
Max( NumericalFormula1, [ NumericalFormula2, ... ] )
Min( NumericalFormula1, [ NumericalFormula2, ... ] )
Sum ( NumericalFormula1, [ NumericalFormula2, ... ] )
StdevP ( NumericalFormula1, [ NumericalFormula2, ... ] )
VarP ( NumericalFormula1, [ NumericalFormula2, ... ] )
NumericalFormula (s) - Required. Numeric values to operate on.
Average( Table, NumericalFormula )
Max( Table, NumericalFormula )
Min( Table, NumericalFormula )
Sum ( Table, NumericalFormula )
StdevP ( Table, NumericalFormula )
VarP ( Table, NumericalFormula )
Table - Required. Table to operate on.
NumericalFormula - Required. Formula to evaluate for each record. The result of this formula is used for the
aggregation. You can use columns of the table in the formula.

Examples
Step by step
Let's say that you had a data source named Sales that contained a CostPerUnit column and a UnitsSold column,
and you set the Text property of a label to this function:
Sum (Sales, CostPerUnit * UnitsSold)
The label would show total sales by multiplying the values in those columns for each record and then adding the
results from all records together:

As a different example, let's say that you had sliders that were named Slider1, Slider2, and Slider3 and a label
with its Text property set to this formula:
Sum (Slider1.Value, Slider2.Value, Slider3.Value)
The label would show the sum of all values to which the sliders were set.
Replace and Substitute functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Replace a portion of a string of text with another string.

Description
The Replace function identifies the text to replace by starting position and length.
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.
If you pass a single string, the return value is the modified string. If you pass a single-column table that contains
strings, the return value is a single-column table of modified strings. If you have a multi-column table, you can
shape it into a single-column table, as working with tables describes.

Syntax
Replace( String, StartingPosition, NumberOfCharacters, NewString )
String - Required. The string to operate on.
StartingPosition - Required. Character position to start the replacement. The first character of String is at
position 1.
NumberOfCharacters - Required. The number of characters to replace in String.
NewString - Required. The replacement string. The number of characters in this argument can differ from the
NumberOfCharacters argument.
Substitute( String, OldString, NewString [, InstanceNumber ] )
String - Required. The string to operate on.
OldString - Required. The string to replace.
NewString - Required. The replacement string. OldString and NewString can have different lengths.
InstanceNumber - Optional. Use this argument to specify which instance of OldString to replace if String
contains more than one instance. If you don't specify this argument, all instances will be replaced.
Replace( SingleColumnTable, StartingPosition, NumberOfCharacters, NewString )
SingleColumnTable - Required. A single-column table of strings to operate on.
StartingPosition - Required. Character position to start the replacement. The first character of each string in
the table is at position 1.
NumberOfCharacters - Required. The number of characters to replace in each string.
NewString - Required. The replacement string. The number of characters in this argument can differ from the
NumberOfCharacters argument.
Substitute( SingleColumnTable, OldString, NewString [, InstanceNumber ] )
SingleColumnTable - Required. A single-column table of strings to operate on.
OldString - Required. The string to replace.
NewString - Required. The replacement string. OldString and NewString can have different lengths.
InstanceNumber - Optional. Use this argument to specify which instance of OldString to replace if String
contains more than one instance. If you don't specify this argument, all instances will be replaced.
Examples
FORMULA DESCRIPTION RESULT

Replace( "abcdefghijk", 6, 5, "*" ) Replaces five characters in "abcdefghijk" "abcde*k"


with a single "*" character, starting with
the sixth character ("f").

Replace( "2019", 3, 2, "20" ) Replaces the last two characters of "2020"


"2019" with "20".

Replace( "123456", 1, 3, "_" ) Replaces the first three characters of "_456"


"123456" with a single "_" character.

Substitute( "Sales Data", "Sales", "C Substitutes the string "Cost" for "Sales". "Cost Data"
ost" )

Substitute( "Quarter 1, 2018", "1", Substitutes only the first instance of "1" "Quarter 2, 2018"
"2", 1 ) with "2" because the fourth argument
(InstanceNumber) is provided with a 1.

Substitute( "Quarter 1, 2011", "1", Substitutes only the third instance of "Quarter 1, 2012"
"2", 3 ) "1" with "2" because the fourth
argument (InstanceNumber) is
provided with a 3.

Substitute( "Quarter 1, 2011", "1", Substitutes all instances of "1" with "2" "Quarter 2, 2022"
"2" ) because the fourth argument
(InstanceNumber) isn't provided.

Replace( Replaces the ninth character in each [ "Quarter 3, 2018",


[ "Quarter 1, 2018", record of the single-column table with "Quarter 3, 2011",
"Quarter 2, 2011", "3". "Quarter 3, 2019" ]
"Quarter 4, 2019" ],
9, 1, "3" )

Substitute( Because the fourth argument [ "Qtr 3, 2018",


[ "Qtr 1, 2018", (InstanceNumber) is provided with a "Quarter 3, 2011",
"Quarter 1, 2011", value of 1, substitutes only the first "Q3, 2019" ]
"Q1, 2019" ], instance of "1" in each record of the
"1", "3", 1 ) single-column table with "3".

Substitute( Because the fourth argument [ "Qtr 3, 2038",


[ "Qtr 1, 2018", (InstanceNumber) isn't provided, "Quarter 3, 2033",
"Quarter 1, 2011", substitutes all instances of "1" in each "Q3, 2039" ]
"Q1, 2019" ], record of the single-column table with
"1", "3" ) "3".
EditForm, NewForm, SubmitForm, ResetForm, and
ViewForm functions in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

View, edit, or create an item, save the contents, and reset the controls in an Edit form control.

Overview
These functions change the state of the Edit form control. The form control can be in one of these modes:

MODE DESCRIPTION

FormMode.Edit The form is populated with an existing record and the user can
modify the values of the fields. Once complete, the user can
save the changes to the record.

FormMode.New The form is populates with default values and the user can
modify the values of the fields. Once complete, the user can
add the record to the data source.

FormMode.View The form is populated with an existing record but the user
cannot modify the values of the fields.

Description
These functions are often invoked from the OnSelect formula of a Button or Image control so that the user can
save edits, abandon edits, or create a record. You can use controls and these functions together to create a complete
solution.
These functions return no values.
SubmitForm
Use the SubmitForm function in the OnSelect property of a Button control to save any changes in a Form control
to the data source.
Before submitting any changes, this function checks for validation issues with any field that's marked as required or
that has one or more constraints on its value. This behavior matches that of the Validate function.
SubmitForm also checks the Valid property of the Form, which is an aggregation of all the Valid properties of the
Card controls that the Form control contains. If a problem occurs, the data isn't submitted, and the Error and
ErrorKind properties of the Form control are set accordingly.
If validation passes, SubmitForm submits the change to the data source.
If successful, the Form's OnSuccess behavior runs, and the Error and ErrorKind properties are cleared. If the
form was in FormMode.New mode, it is returned to FormMode.Edit mode.
If unsuccessful, the Form's OnFailure behavior runs, and the Error and ErrorKind properties are set
accordingly. The mode of the form is unchanged.
EditForm
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.
NewForm
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.
ResetForm
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.
ViewForm
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.
DisplayMode Property
The current mode can be read through the Mode property. The mode also determines the value of the
DisplayMode property which can be used by data cards and controls within the form control. Often, the data
card's DisplayMode property will be set to Parent.DisplayMode (referencing the form) as will the control's
DisplayMode property (referencing the data card):

MODE DISPLAYMODE DESCRIPTION

FormMode.Edit DisplayMode.Edit Data cards and controls are editable,


ready to accept changes to a record.

FormMode.New DisplayMode.Edit Data cards and controls are editable,


ready to accept a new record.

FormMode.View DisplayMode.View Data cards and controls are not editable


and optimized for viewing.

Syntax
SubmitForm ( FormName )
FormName - Required. Form control to submit to the data source.
EditForm ( FormName )
FormName - Required. Form control to switch to FormMode.Edit mode.
NewForm ( FormName )
FormName - Required. Form control to switch to FormMode.New mode.
ResetForm ( FormName )
FormName - Required. Form control to reset to initial values. Also switches the form from FormMode.New
mode to FormMode.Edit mode.
ViewForm ( FormName )
FormName - Required. Form control to switch to FormMode.View mode.
Examples
See Understand data forms for complete examples.
1. Add a Button control, set its Text property to show Save, and set its OnSelect property to this formula:
SubmitForm ( EditForm )
2. Set the OnFailure property of a Form control to blank and its OnSuccess property to this formula:
Back()
3. Name a Label control ErrorText, and set its Text property to this formula:
EditForm.Error
When the user selects the Save button, any changes in the Form control are submitted to the underlying
data source.
If the submission succeeds, any changes are saved or, if the Form control is in New mode, a record is
created. ErrorText is blank and the previous screen reappears.
If the submission fails, ErrorText shows a user-friendly error message, and the current screen remains
visible so that the user can correct the problem and try again.
4. Add a Button control, set its Text property to show Cancel, and set its OnSelect property to this formula:
ResetForm ( EditForm ); Back()
When the user selects the Cancel button, the values in the Form control are reset to what they were before
the user started to edit it, the previous screen reappears, and the Form control is returned to Edit mode if it
was in New mode.
5. Add a Button control, set its Text property to show New, and set its OnSelect property to this formula:
NewForm ( EditForm ); Navigate( EditScreen, None )
When the user selects the New button, the Form control switches to New mode, the default values for the
Form control's data source populate that control, and the screen that contains the Form control appears.
When the SubmitForm function runs, a record is created instead of updated.
Average, Max, Min, StdevP, Sum, and VarP functions
in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Aggregate functions that summarize a set of numbers.

Description
The Average function calculates the average, or arithmetic mean, of its arguments.
The Max function finds the maximum value.
The Min function finds the minimum value.
The Sum function calculates the sum of its arguments.
The StdevP function calculates the standard deviation of its arguments.
The VarP function calculates the variance of its arguments.
You can supply the values for these functions as:
Separate arguments. For example, Sum ( 1, 2, 3 ) returns 6.
A table and a formula to operate over that table. The aggregate will be calculated on the values of the formula
for each record.
Fields of the record currently being processed are available within the formula. You simply reference them by name
as you would any other value. You can also reference control properties and other values from throughout your
app. For more details, see the examples below and working with record scope.
These functions operate on numeric values only. Other types of values, such as strings or records, are ignored. Use
the Value function to convert a string into a number.
The Average, Max, Min, and Sum functions can be delegated when used with a data source that supports
delegation for these functions. However, StdevP and VarP can't be delegated for any data sources. If delegation is
not supported, only the first portion of the data will be retrieved and then the function applied locally. The result
may not represent the complete story. A delegation warning will appear at authoring time to remind you of this
limitation and to suggest switching to delegable alternatives where possible. For more information, see the
delegation overview.

Syntax
Average( NumericalFormula1, [ NumericalFormula2, ... ] )
Max( NumericalFormula1, [ NumericalFormula2, ... ] )
Min( NumericalFormula1, [ NumericalFormula2, ... ] )
Sum ( NumericalFormula1, [ NumericalFormula2, ... ] )
StdevP ( NumericalFormula1, [ NumericalFormula2, ... ] )
VarP ( NumericalFormula1, [ NumericalFormula2, ... ] )
NumericalFormula (s) - Required. Numeric values to operate on.
Average( Table, NumericalFormula )
Max( Table, NumericalFormula )
Min( Table, NumericalFormula )
Sum ( Table, NumericalFormula )
StdevP ( Table, NumericalFormula )
VarP ( Table, NumericalFormula )
Table - Required. Table to operate on.
NumericalFormula - Required. Formula to evaluate for each record. The result of this formula is used for the
aggregation. You can use columns of the table in the formula.

Examples
Step by step
Let's say that you had a data source named Sales that contained a CostPerUnit column and a UnitsSold column,
and you set the Text property of a label to this function:
Sum (Sales, CostPerUnit * UnitsSold)
The label would show total sales by multiplying the values in those columns for each record and then adding the
results from all records together:

As a different example, let's say that you had sliders that were named Slider1, Slider2, and Slider3 and a label
with its Text property set to this formula:
Sum (Slider1.Value, Slider2.Value, Slider3.Value)
The label would show the sum of all values to which the sliders were set.
If and Switch functions in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Determines whether any condition in a set is true (If) or the result of a formula matches any value in a set
(Switch) and then returns a result or executes an action.

Description
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 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.
If and Switch are very similar, but you should use the best function for your situation:
Use If to evaluate a single condition. The most common syntax for this function is If( Condition,
ThenResult, DefaultResult ), which provides the common “if … then … else …” pattern seen in other
programming tools.
Use If to evaluate multiple unrelated conditions. In Power Apps (unlike Microsoft Excel), you can specify
multiple conditions without having to nest If formulas.
Use Switch to evaluate a single condition against multiple possible matches. You can also use If in this
case, but you'd need to repeat the formula for each possible match.
You can use both of these functions in behavior formulas to branch between two or more actions. Only one
branch will trigger an action. Conditions and matches are evaluated in order, and they stop if a condition is
true or a match is found.
Blank is returned if no conditions are true, no matches are found, and you don't specify a default result.

Syntax
If( Condition, ThenResult [, DefaultResult ] )
If( Condition1, ThenResult1 [, Condition2, ThenResult2, ... [ , DefaultResult ] ] )
Condition(s) - Required. Formula(s) to test for true. Such formulas commonly contain comparison
operators (such as <, >, and =) and test functions such as IsBlank and IsEmpty.
ThenResult(s) - Required. The corresponding value to return for a condition that evaluates to true.
DefaultResult - Optional. The value to return if no condition evaluates to true. If you don't specify this
argument, blank is returned.
Switch( Formula, Match1, Result1 [, Match2, Result2, ... [, DefaultResult ] ] )
Formula - Required. Formula to evaluate for matches. This formula is evaluated only once.
Match(s) - Required. Values to compare with the result from Formula. If an exact match is found, the
corresponding Result is returned.
Result(s) - Required. The corresponding value to return when an exact match is found.
DefaultResult - Optional. If an exact match isn't found, this value is returned. If you don't specify this
argument, blank is returned.

Examples
Values in formulas
In the following examples, a Slider control (named Slider1) has a value of 25.

FORMULA DESCRIPTION RESULT

If( Slider1.Value = 25, "Result1" ) The condition is true, and the "Result1"
corresponding result is returned.

If( Slider1.Value = 25, "Result1", The condition is true, and the "Result1"
"Result2" ) corresponding result is returned.

If( Slider1.Value > 1000, "Result1" The condition is false, and no blank
) DefaultResult was provided.

If( Slider1.Value > 1000, "Result1", The condition is false, a "Result2"


"Result2" ) DefaultResult was provided, and it's
returned.

If( Slider1.Value = 25, "Result1", The first condition is true, and the "Result1"
Slider1.Value > 0, "Result2" ) corresponding result is returned. The
second condition is also true, but it
isn't evaluated because it appears
later in the argument list than a
condition that evaluates to true.

If( IsBlank( Slider1.Value ), The first condition is false because "Result2"


"Result1", the slider isn't blank. The second
IsNumeric( Slider1.Value ), condition is true because the slider's
"Result2" ) value is a number, and the
corresponding result is returned.

If( Slider1.Value > 1000, "Result1", Both the first and second conditions "Result3"
Slider1.Value > 50, "Result2", are false, a DefaultResult was
"Result3") provided, and it's returned.

Switch( Slider1.Value, 25, The slider's value matches the first "Result1"
"Result1" ) value to be checked, and the
corresponding result is returned.

Switch( Slider1.Value, 20, The slider's value matches the second "Result2"
"Result1", 25, "Result2", 30, value to be checked, and the
"Result3" ) corresponding result is returned.

Switch( Slider1.Value, 20, The slider's value doesn't match any "DefaultResult"
"Result1", 10, "Result2", 0, value to be checked. A DefaultResult
"Result3", "DefaultResult" ) was provided, so it's returned.

Branching in behavior formulas


In these examples, a Text input control named FirstName has the value "John" typed into it.
FORMULA DESCRIPTION RESULT

If( ! IsBlank( FirstName.Text ), The condition is true, so the true


Navigate( Screen1, Navigate function runs. You can use
ScreenTransition.None ) ) the IsBlank function to test whether The display is changed to Screen1.
a required form field has been filled
in. If FirstName were blank, this
formula would have no effect.

If( IsBlank( FirstName.Text ), Without the ! operator, the condition true


Navigate( Screen1, is false, so the Navigate function
ScreenTransition.None ), Back() ) doesn't run. The Back function was The display goes back to the screen
provided as a DefaultResult, so it that was previously shown.
runs.

Switch( FirstName.Text, "Carlos", The value of FirstName.Text is true


Navigate( Screen1, compared against "Carlos", "Kirstin",
ScreenTransition.None ), "Kirstin", and "John" in that order. A match is The display is changed to Screen3.
Navigate( Screen2, found with "John", so the app
ScreenTransition.None ), "John", navigates to Screen3.
Navigate( Screen3,
ScreenTransition.None ) )

Step by step
1. Add a Text input control, and name it Text1 if it doesn't have that name by default.
2. In Text1, type 30.
3. Add a Label control, and set its Text property to this formula:
If( Value(Text1.Text) < 20, "Order MANY more!", Value(Text1.Text) < 40, "Order more!",
Text1.Text )
The Label control shows Order more! because the value of Text1 is more than 20 but less than 40.
4. In Text1, type 15.
The Label control shows Order MANY more! because the value of Text1 is less than 20.
5. In Text1, type 50.
The Label control shows the value that you typed because it's more than 40.
Table function in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Creates a temporary table.

Description
The Table function creates a table from an argument list of records.
The table's columns will be the union of all the properties from all the argument records. A blank value is added to
any column for which a record doesn't include a value.
A table is a value in Power Apps, just like a string or a number. You can specify a table as an argument for a
function, and functions can return a table as a result. Table doesn't create a permanent table. Instead it returns a
temporary table made of its arguments. You can specify this temporary table as an argument for another function,
visualize it in a gallery, or embed it in another table. See working with tables for more details.
You can also create a single-column table with the [ value1, value2, ... ] syntax.

Syntax
Table( Record1 [, Record2, ... ] )
Record (s) - Required. The records to add to the table.

Examples
Set the Items property of a listbox to this formula:
Table({Color:"red"}, {Color:"green"}, {Color:"blue"})
The listbox shows each color as an option.
Add a text gallery, and set its Items property to this function:
Table({Item:"Violin123", Location:"France", Owner:"Fabrikam"}, {Item:"Violin456",
Location:"Chile"})
The gallery shows two records, both of which contain the name and location of an item. Only one record
contains the name of the owner.
Acos, Acot, Asin, Atan, Atan2, Cos, Cot, Degrees,
Pi, Radians, Sin, and Tan functions in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Calculates trigonometric values.

Description
Primary functions
The Cos function returns the cosine of its argument, an angle specified in radians.
The Cot function returns the cotangent of its argument, an angle specified in radians.
The Sin function returns the sine of its argument, an angle specified in radians.
The Tan function returns the tangent of its argument, an angle specified in radians.
Inverse functions
The Acos function returns the arccosine, or inverse cosine, of its argument. The arccosine is the angle whose
cosine is the argument. The returned angle is given in radians in the range 0 (zero) to π.
The Acot function returns the principal value of the arccotangent, or inverse cotangent, of its argument. The
returned angle is given in radians in the range 0 (zero) to π.
The Asin function returns the arcsine, or inverse sine, of its argument. The arcsine is the angle whose sine is
the argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan function returns the arctangent, or inverse tangent, of its argument. The arctangent is the angle
whose tangent is the argument. The returned angle is given in radians in the range -π/2 to π/2.
The Atan2 function returns the arctangent, or inverse tangent, of the specified x and y coordinates as
arguments. The arctangent is the angle from the x-axis to a line that contains the origin (0, 0) and a point with
coordinates (x, y). The angle is given in radians between -π and π, excluding -π. A positive result represents a
counterclockwise angle from the x-axis; a negative result represents a clockwise angle. Atan2( a, b ) equals
Atan( b/a ), except that a can equal 0 (zero) with the Atan2 function.
Helper functions
The Degrees function converts radians to degrees. π radians equals 180 degrees.
The Pi function returns the transcendental number π, which begins 3.141592...
The Radians function converts degrees to radians.
Notes
If you pass a single number to these functions, the return value is a single result. If you pass a single-column
table that contains numbers, the return value is a single-column table of results, one result for each record in
the argument's table. If you have a multi-column table, you can shape it into a single-column table, as
working with tables describes.
If an argument would result in an undefined value, the result is blank. This can happen, for example, when
using inverse functions with arguments that are out of range.
Syntax
Primary Functions
Cos( Radians )
Cot( Radians )
Sin( Radians )
Tan( Radians )
Radians - Required. Angle to operate on.
Cos( SingleColumnTable )
Cot( SingleColumnTable )
Sin( SingleColumnTable )
Tan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of angles to operate on.
Inverse Functions
Acos( Number )
Acot( Number )
Asin( Number )
Atan( Number )
Number - Required. Number to operate on.
Acos( SingleColumnTable )
Acot( SingleColumnTable )
Asin( SingleColumnTable )
Atan( SingleColumnTable )
SingleColumnTable - Required. A single-column table of numbers to operate on.
Atan2( X, Y )
X - Required. X-axis coordinate.
Y - Required. Y -axis coordinate.
Helper Functions
Degrees( Radians )
Radians - Required. Angle in radians to convert to degrees.
Pi()
Radians( Degrees )
Degrees - Required. Angle in degrees to convert to radians.

Examples
Single number
FORMULA DESCRIPTION RESULT

Cos( 1.047197 ) Returns the cosine of 1.047197 0.5


radians or 60 degrees.
FORMULA DESCRIPTION RESULT

Cot( Pi()/4 ) Returns the cotangent of 0.785398... 1


radians or 45 degrees.

Sin( Pi()/2 ) Returns the sine of 1.570796... 1


radians or 90 degrees.

Tan( Radians(60) ) Returns the tangent of 1.047197... 1.732050...


radians or 60 degrees.

Acos( 0.5 ) Returns the arccosine of 0.5, in 1.047197...


radians.

Acot( 1 ) Returns the arccotangent of 1, in 0.785398...


radians.

Asin( 1 ) Returns the arcsine of 1, in radians. 1.570796...

Atan( 1.732050 ) Returns the arctangent of 1.732050, 1.047197...


in radians.

Atan2( 5, 3 ) Returns the arctangent of the angle 0.540419...


from the x-axis of the line that
contains the origin (0,0) and the
coordinate (5,3), which is
approximately 31 degrees.

Atan2( 4, 4 ) Returns the arctangent of the angle 0.785398...


from the x-axis of the line that
contains the origin (0,0) and the
coordinate (4,4), which is exactly π/4
radians or 45 degrees.

Degrees( 1.047197 ) Returns the equivalent number of 60


degrees for 1.047197 radians.

Pi() Returns the transcendental number 3.141592...


π.

Radians( 15 ) Returns the equivalent number of 0.261799...


radians for 15 degrees.

Single -column table


The examples in this section use a data source that's named ValueTable and that contains the following data.
The last record in the table is π/2 radians or 90 degrees.

FORMULA DESCRIPTION RESULT


FORMULA DESCRIPTION RESULT

Cos( ValueTable ) Returns the cosine of each number in


the table.

Cot( ValueTable ) Returns the cotangent of each


number in the table.

Sin( ValueTable ) Returns the sine of each number in


the table.

Tan( ValueTable ) Returns the tangent of each number


in the table.

Acos( ValueTable ) Returns the arccosine of each number


in the table.

Acot( ValueTable ) Returns the arccotangent of each


number in the table.

Asin( ValueTable ) Returns the arcsine of each number in


the table.

Atan( ValueTable ) Returns the arctangent of each


number in the table.
FORMULA DESCRIPTION RESULT

Degrees( ValueTable ) Returns the equivalent number of


degrees for each number in the table,
assumed to be angles in radians.

Radians( ValueTable ) Returns the equivalent number of


radians for each number in the table,
assumed to be angles in degrees.
Text function in Power Apps
12/3/2019 • 10 minutes to read • Edit Online

Converts any value and formats a number or date/time value to a string of text.

Description
The Text function formats a number or a date/time value based on one of these types of arguments:
A predefined date/time format, which you specify by using the DateTimeFormat enumeration. For dates
and times, this approach is preferred as it automatically adjusts to each user's language and region.
A custom format, which comprises a string of placeholders that define, for example, whether numbers show a
decimal separator and dates show the full name of the month, the month as an abbreviation, or the month as
a number. Power Apps supports a subset of the placeholders that Microsoft Excel does. In this string, the
language placeholder specifies the language in which to interpret the other placeholders. If the custom
format includes a period, for example, the language-format placeholder specifies whether the period is a
decimal separator (ja-JP ) or a thousands separator (es-ES ).
See working with dates and times for more information.
The Text function can also convert any data type to a text representation using a default format. Use this to pass
non-text values to text-based functions such as Len, Right, and IsMatch.
Predefined date/time formats
PREDEFINED FORMAT DESCRIPTION

DateTimeFormat.LongDate Full year, month, day of the month, and day of the week. The
names of the month and the day of the week aren't
abbreviated.

DateTimeFormat.LongDateTime Full year, month, day of the month, and day of the week,
plus hour (12-hour clock), minutes, seconds, and AM/PM
designation. The names of the month and the day of the
week aren't abbreviated.

DateTimeFormat.LongDateTime24 Full year, month, day of the month, and day of the week,
plus hour (24-hour clock), minutes, and seconds. The names
of the month and the day of the week aren't abbreviated.

DateTimeFormat.LongTime Hour (12-hour clock), minutes, seconds, and AM/PM


designation. Same as ShortTime.

DateTimeFormat.LongTime24 Hour (24-hour clock), minutes, seconds. Same as


ShortTime24.

DateTimeFormat.ShortDate Four-digit year with two-digit month and day of the month.

DateTimeFormat.ShortDateTime Four-digit year with two-digit month and day of the month,
plus hour (12-hour clock), minutes, seconds, and AM/PM
designation.
PREDEFINED FORMAT DESCRIPTION

DateTimeFormat.ShortDateTime24 Four-digit year with two-digit month and day of the month,
plus hour (24-hour clock), minutes, and seconds.

DateTimeFormat.ShortTime Hour (12-hour clock), minutes, seconds, and AM/PM


designation. Same as LongTime.

DateTimeFormat.ShortTime24 Hour (24-hour clock), minutes, and seconds. Same as


LongTime24.

DateTimeFormat.UTC The date/time value is converted to UTC based on the


current user's time zone and formatted according to the ISO
8601 standard.

Number placeholders
PLACEHOLDER DESCRIPTION

0 (zero) Displays insignificant zeros if a number has fewer digits than


there are zeros in the format. For example, use the format
#.00 if you want to display 8.9 as 8.90.

# Follows the same rules as the 0 (zero). However, Text doesn't


return extra zeros when the number has fewer digits on
either side of the decimal than there are # symbols in the
format. For example, 8.9 is displayed if the custom format is
#.## and the number to format is 8.9.

. (period) Displays the decimal point in a number. Depends on the


language of the custom format; see global apps for more
details.

, (comma) Displays the grouping separator in a number, often used for


thousands. Text separates groups by commas if the format
contains a comma that's enclosed by number signs (#) or by
zeros. Depends on the language of the custom format; see
global apps for more details.

If a number has more digits to the right of the decimal point than there are placeholders in the format, the
number rounds to as many decimal places as there are placeholders. If there are more digits to the left of the
decimal point than there are placeholders, the extra digits are displayed. If the format contains only number
signs (#) to the left of the decimal point, numbers less than 1 start with a decimal point (for example, .47).
Date and time placeholders
PLACEHOLDER DESCRIPTION

m Displays the month as a number without a leading zero.

mm Displays the month as a number with a leading zero when


appropriate.

mmm Displays the month as an abbreviation (Jan to Dec).

mmmm Displays the month as a full name (January to December).


PLACEHOLDER DESCRIPTION

d Displays the day as a number without a leading zero.

dd Displays the day as a number with a leading zero when


appropriate.

ddd Displays the day as an abbreviation (Sun to Sat).

dddd Displays the day as a full name (Sunday to Saturday).

yy Displays the year as a two-digit number.

yyyy Displays the year as a four-digit number.

h Displays the hour as a number without a leading zero.

hh Displays the hour as a number with a leading zero when


appropriate. If the format contains AM or PM, the hour is
shown based on the 12-hour clock. Otherwise, the hour is
shown based on the 24-hour clock.

m Displays the minute as a number without a leading zero.

This placeholder must appear immediately after the h or hh


code or immediately before the ss code; otherwise, Text
returns the month instead of minutes.

mm Displays the minute as a number with a leading zero when


appropriate.

This placeholder must appear immediately after the h or hh


placeholder or immediately before the ss placeholder.
Otherwise, Text returns the month instead of minutes.

s Displays the second as a number without a leading zero.

ss Displays the second as a number with a leading zero when


appropriate.

f Displays the fractions of seconds.

AM/PM, a/p Displays the hour based on a 12-hour clock. Text returns
"AM" or "a" for times from midnight until noon and "PM" or
"p" for times from noon until midnight

Literal placeholders
You can include any of these characters in your format string. They will appear in the result of Text as is.
Additional characters are reserved for future placeholders, so you shouldn't use them.

CHARACTER DESCRIPTION

Any currency symbol Dollar sign, cents sign, euro sign, etc.

+ Plus sign
CHARACTER DESCRIPTION

( Left parenthesis

: Colon

^ Circumflex accent (caret)

' Apostrophe

{ Left curly bracket

< Less-than sign

= Equal sign

- Minus sign

/ Slash mark

) Right parenthesis

& Ampersand

~ Tilde

} Right curly bracket

> Greater-than sign

Space character

Global apps
The Text function is globally aware. For a wide array of languages, it knows how to properly write out dates,
times, currencies, and numbers. To do its job, it needs two pieces of information:
The language of the custom format: For makers, how should a custom format be interpreted? The
separator characters (. and ,) have different meanings in different languages. If you specify a custom format,
you can include a language placeholder or take the default value, which reflects the language to which your
device is set. Even easier, you can use one of the predefined date/time formats, which are language agnostic.
The language of the result: For users, in what language should the function result appear? Names of
months and weekdays must be in the appropriate language for the user of the app, which you can specify by
adding a third, optional argument to the Text function.
For both, you specify the language by using a language tag. To see the list of supported languages, type Text(
1234, "", ) in the formula bar or the Advanced tab of the right-hand pane, and then scroll through the list of
locales suggested for the third argument.
Language placeholder
To specify the language of the custom format, use:
PLACEHOLDER DESCRIPTION

[$-LanguageTag] LanguageTag is a language tag as returned from the


Language function. It can specify just the language (such as
[$-en] for English), or it can also specify the region (such as
[$-en-GB] to further specify Great Britain).

The language placeholder can appear anywhere in the custom format but only once.
If you specify a custom format without a language placeholder and the format is ambiguous from a global
standpoint, the language tag for your current language is inserted automatically.
[$-en-US ] is assumed if this placeholder isn't present when your app is run.

NOTE
In a future version, the syntax of this placeholder may change to avoid confusion with a similar, but different, placeholder
that Excel supports.

Result language tag


The result of Text includes translated strings for months, weekdays, and AM/PM designations, as well as the
appropriate group and decimal separators.
By default, Text uses the language of the user running the app. The Language function returns the language
tag for the current user. You can override this default value by supplying a language tag for the third argument
to Text.

Syntax
Text( NumberOrDateTime, DateTimeFormatEnum [, ResultLanguageTag ] )
NumberOrDateTime - Required. The number or the date/time value to format.
DateTimeFormat - Required. A member of the DateTimeFormat enumeration.
ResultLanguageTag - Optional. The language tag to use for the result text. By default, the language of the
current user is used.
Text( NumberOrDateTime, CustomFormat [, ResultLanguageTag ] )
Number - Required. The number or the date/time value to format.
CustomFormat - Required. One or more placeholders enclosed in double quotation marks.
ResultLanguageTag - Optional. The language tag to use for the result text. By default, the language of the
current user is used.
Text( AnyValue )
AnyValue - Required. Value to convert to a text representation. A default format is used.

Examples
Unless otherwise specified, the user running these formulas is located in the United States and has selected
English as their language. The Language function is returning "en-US".
Number
FORMULA DESCRIPTION RESULT

Text( 1234.59, "####.#" ) Formats the number with one decimal "1234.6"
place.

Text( 8.9, "#.000" ) Pads the decimal portion of the "8.900"


number with trailing zeros, if needed.

Text( 0.631, "0.#" ) Pads the whole portion of the number "0.6"
with leading zeros, if needed.

Text( 12, "#.0#" ) Pads the decimal portion of the "12.0"


Text( 1234.568, "#.0#" ) number with zeros for one decimal "1234.57"
place, and includes a second decimal
place if supplied.

Text( 12000, "$ #,###" ) Places a thousands separator every "$ 12,000"
Text( 1200000, "$ #,###" ) three digits, and includes a currency "$ 1,200,000"
symbol.

Date/Time
At 2:37:47 PM on Monday, November 23, 2015
United States Pacific Time Zone (UTC -8)

FORMULA DESCRIPTION RESULT

Text( Now(), Formats as a long date string, in the "Monday, November 23, 2015"
DateTimeFormat.LongDate ) language and locale of the current user.

Text( Now(), Formats as a long date and time string, "Monday, November 23, 2015 2:37:47
DateTimeFormat.LongDateTime ) in the language and locale of the PM"
current user, using a 12-hour clock.

Text( Now(), Formats as a long time string, using a "14:37:47"


DateTimeFormat.LongTime24 ) 24-hour clock.

Text( Now(), Formats as a short date string, in the "11/23/2015"


DateTimeFormat.ShortDate ) language and locale of the current user.

Text( Now(), "d-mmm-yy" ) Formats using placeholder characters: "23-Nov-15"


d for a single-digit or double-
digit day of the month
- as a literal character copied to
the result
mmm for a three-letter
abbreviation of the month
- as another literal character
copied to the result
yy for a two-digit abbreviation
of the year

Text(1448318857*1000, "mmm. dd, Shows a Unix date-time value in "Nov. 23, 2015 (02:47:37 PM)"
yyyy (hh:mm:ss AM/PM)") human-readable format if you multiply
the source value by 1,000.

Global apps
FORMULA DESCRIPTION RESULT

Text(1234567.89, "[$-fr-FR]# ###,## Shows a space as a grouping separator, "1 234 567,89 €"
€", "fr-FR") the comma as a decimal separator, and
€ as the currency symbol.

Text(1234567,89; "[$-fr-FR]# ###,## If the source data follows the French "1 234 567,89 €"
€") custom of using a comma as the
decimal separator, you must change
your locale to French and separate the
arguments with a semi-colon instead
of a comma to get the same result as
above.

Text( Date(2016,1,31), "dddd Returns the weekday, month, and day "Saturday January 31"
mmmm d" ) of the month in the language of the
current user. Because none of the
placeholders are language dependent,
there is no need for a format text
language tag.

Text( Date(2016,1,31), "dddd Returns the weekday, month, and day "domingo enero 31"
mmmm d", "es-ES" ) of the month in the "es-ES" language.

Converting values to text


FORMULA DESCRIPTION RESULT

Text( 1234567.89 ) Converts a number to a string. There "1234567.89"


are no thousands separators or control
over the number of digits before or
after the decimal separator; for more
control, supply number placeholders as
the second argument.

Text( DateTimeValue( "01/04/2003" Converts a date/time value to a string "1/4/2003 12:00 AM"
)) of text. To control the conversion,
provide either a member of the
DateTimeFormat enumeration or a
custom-format string.

Text( true ) Converts a Boolean value to a string. "true"

Text( GUID() ) Converts a generated GUID value to a "f8b10550-0f12-4f08-9aa3-


string. bb10958bc3ff"

Left( Text( GUID() ), 4 ) Returns the first four characters of a "2d9c"


generated GUID.
Date and Time functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Converts date and time components to a date/time value.

Description
The Date function converts individual Year, Month, and Day values to a Date/Time value. The time portion is
midnight.
If Year is between 0 and 1899 (inclusive), the function adds that value to 1900 to calculate the year. 70
becomes 1970.
If Month is less than 1 or more than 12, the result subtracts or adds that many months from the beginning
of the specified year.
If Day is greater than the number of days in the specified month, the function adds that many days to the
first day of the month and returns the corresponding date from a subsequent month. If Day is less than 1,
the function subtracts that many days, plus 1, from the first day of the specified month.
The Time function converts individual Hour, Minute, and Second values to a Date/Time value. The result has
no date associated with it.
See the DateValue, TimeValue, and DateTimeValue functions for information about how to convert a string
to a value.
Also see working with dates and times for more information.

Syntax
Date( Year, Month, Day )
Year - Required. Numbers greater than 1899 are interpreted as absolute (1980 is interpreted as 1980);
numbers that range from 0 to 1899 are interpreted as relative to 1900. (For example, 80 is interpreted as
1980.)
Month - Required. A number that ranges from 1 to 12.
Day - Required. A number that ranges from 1 to 31.
Time( Hour, Minute, Second )
Hour - Required. A number that ranges from 0 (12:00 AM ) to 23 (11:00 PM ).
Minute - Required. A number that ranges from 0 to 59.
Second - Required. A number that ranges from 0 to 59.

Examples
Date
If a user typed 1979 in a text-input control named HireYear, 3 in a text-input control named HireMonth, and
17 in a text-input control named HireDay, this function would return 3/17/1979:
Date(Value(HireYear.Text), Value(HireMonth.Text), Value(HireDay.Text))
Time
If a user typed 14 in a text-input control named BirthHour, 50 in a text-input control named BirthMinute, and
24 in a text-input control named BirthSecond, this function would return 02:50:24 p.
Text(Time(Value(BirthHour.Text), Value(BirthMinute.Text), Value(BirthSecond.Text)), "hh:mm:ss
a/p")
DateValue, TimeValue, and DateTimeValue
functions in Power Apps
3/17/2020 • 3 minutes to read • Edit Online

Converts date, time, or both in a string to a date/time value.

Description
DateValue function converts a date string (for example, "10/01/2014") to a date/time value.
TimeValue function converts a time string (for example, "12:15 PM") to a date/time value.
DateTimeValue function converts a date and time string (for example, "January 10, 2013 12:13 AM")
to a date/time value.
DateValue function ignores any time information in the date string, and the TimeValue function ignores any
date information in the time string.

NOTE
The DateValue, TimeValue, and DateTimeValue functions by default use the language from the current user's settings.
You can override it to ensure that strings are interpreted properly. For example, "10/1/1920" is interpreted as October
1st in "en" and as January 10th in "fr".

Dates must be in one of these formats:


MM/DD/YYYY
DD/MM/YYYY
DD Mon YYYY
Month DD, YYYY
To convert from numeric date, month and year components, read Date.
To convert from numeric hour, minute and second components, read Time.
For more information, read:
Working with date and time.
Date/time and data types.

Syntax
DateValue( String [, Language ])
DateTimeValue( String [, Language ])
TimeValue( String [, Language ])
String - Required. A text string that contains a date, time, or combination date and time value.
Language - Optional. A language string, such as would be returned by the first two characters from the
Language function. If not provided, the language of the current user's settings is used.

Examples
DateValue
If you type 10/11/2014 into a text-input control named Startdate, and then set the Text property of a label to
these formulas:
Convert a date from a string in the user's locale and show the result as a long date.

Text( DateValue( Startdate.Text ), DateTimeFormat.LongDate )

Device set to en locale shows the label as Saturday, October 11, 2014.

NOTE
You can use several options with DateTimeFormat compared to LongDateTime. To display a list of options,
type the parameter followed by an exclamation sign (!) in the formula bar.

Convert date from a string in the French locale and show the result as a long date. In this example, the
months and day of the month are interpreted differently from English.

Text( DateValue( Startdate.Text, "fr" ), DateTimeFormat.LongDate )

Device set to en locale shows the label as Monday, November 10, 2014.
If you typed October 20, 2014 instead:
Convert a date from a string in the user's locale and calculate the difference between two days, in days

DateDiff( DateValue( Startdate.Text ), Today() )

Device set to en locale shows the label as 9, indicating the number of days between October 11 and
October 20. The DateDiff function can also show the difference in months, quarters, or years.
DateTimeValue
If you typed 10/11/2014 1:50:24.765 PM into a text-input control named Start, and then set the Text
property of a label to the following formula:
Convert both a date and time string in the current locale.

Text( DateTimeValue( Start.Text ), DateTimeFormat.LongDateTime )

Device set to en locale shows the label as Saturday, October 11, 2014 1:50:24 PM.

NOTE
You can use several options with DateTimeFormat compared to LongDateTime. To display a list of options,
type the parameter followed by an exclamation sign (!) in the formula bar.

Convert both a date and time string in the French locale. Month and day of the month are interpreted
differently.

Text( DateTimeValue( Start.Text, "fr"), DateTimeFormat.LongDateTime )

Device set to en locale shows the label as Monday, November 10, 2014 1:50:24 PM.
Convert both a date and time string in the user's locale, and display the result with a fractional second.

Text( DateTimeValue( Start.Text ), "dddd, mmmm dd, yyyy hh:mm:ss.fff AM/PM" )

Device set to en locale shows the label as Saturday, October 11, 2014 01:50:24.765 PM.
As an alternative, you can specify hh:mm:ss.f or hh:mm:ss.ff to round the time to the nearest 10th or
100th of a second.
TimeValue
Name a text-input control FinishedAt, and set the Text property of a label to this formula:

If( TimeValue( FinishedAt.Text ) < TimeValue( "5:00:00.000 PM" ),


"You made it!",
"Too late!"
)

If you type 4:59:59.999 PM in the FinishedAt control, the label shows "You made it!"
If you type 5:00:00.000 PM in the FinishedAt control, the label shows "Too late!"
DateAdd, DateDiff, and TimeZoneOffset functions
in Power Apps
1/24/2020 • 3 minutes to read • Edit Online

Adds to or finds the difference in date/time values and converts between local time and UTC.

Description
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 number of units.
For both functions, units can be Milliseconds, Seconds, Minutes, Hours, Days, Months, Quarters, or Years.
By default, both functions use Days as units.
The TimeZoneOffset function returns the number of minutes between the user's local time and UTC
(Coordinated Universal Time).
You can use DateAdd with the TimeZoneOffset to convert between the user's local time and UTC
(Coordinated Universal Time). Adding TimeZoneOffset will convert a local time to UTC, and subtracting it
(adding the negative) will convert from UTC to local time.
Also see Date, Time, and DateTime data types and working with dates and times for more information.

Syntax
DateAdd( DateTime, Addition [, Units ] )
DateTime - Required. Date/time value to operate on.
Addition - Required. Number, in Units, to add to the DateTime.
Units - Optional. The type of Units to add: Milliseconds, Seconds, Minutes, Hours, Days, Months,
Quarters, or Years. If not specified, Days are used.
DateDiff( StartDateTime, EndDateTime [, Units ] )
StartDateTime - Required. Starting date/time value.
EndDateTime - Required. Ending date/time value.
Units - Optional. The type of Units to add: Milliseconds, Seconds, Minutes, Hours, Days, Months,
Quarters, or Years. If not specified, Days are used.
TimeZoneOffset( [ DateTime ] )
DateTime - Optional. Date/time value for which to return the offset. By default, the current date/time is used.

Examples
In all of these examples, assume that the current date and time is July 15, 2013, 1:02 PM.
Simple DateAdd
FORMULA DESCRIPTION RESULT

Text( DateAdd( Now(), 3 ), Adds three days (default units) to the "18-07-2013 13:02"
"dd-mm-yyyy hh:mm" ) current date and time.

Text( DateAdd( Now(), 4, Hours ), Add four hours to the current date "15-07-2013 17:02"
"dd-mm-yyyy hh:mm" ) and time.

Text( DateAdd( Today(), 1, Months Adds one month to the current date, "15-08-2013 00:00"
), without time as Today doesn't return
"dd-mm-yyyy hh:mm" ) a time component.

Text( DateAdd( Now(), ‑30, Minutes Subtracts 30 minutes from the current "15-07-2013 12:32"
), date and time.
"dd-mm-yyyy hh:mm" )

Simple DateDiff
FORMULA DESCRIPTION RESULT

DateDiff( Now(), Returns the difference between the 170


DateValue("1/1/2014") ) two units in the default units of Days

DateDiff( Now(), Returns the difference between the 6


DateValue("1/1/2014"), Months ) two values in Months

DateDiff( Now(), Today(), Minutes ) Returns the difference between the -782
current date/time and the current date
only (no time) in minutes. Since the
Now is later than Today the result will
be negative.

Converting to UTC
To convert to UTC (Coordinated Universal Time), add the TimeZoneOffset for the given time.
For example, imagine the current date and time is July 15, 2013, 1:02 PM in Pacific Daylight Time (PDT, UTC -
7). To determine the current time in UTC, use:
DateAdd( Now(), TimeZoneOffset(), Minutes )
TimeZoneOffset defaults to the current time, so you don't need to pass it an argument.
To see the result, use the Text function with the format dd -mm -yyyy hh:mm, which will return 15-07-2013
20:02.
Converting from UTC
To convert from UTC, subtract the TimeZoneOffset (by adding the negative) for the given time.
For example, imagine the UTC date and time July 15, 2013, 8:02 PM is stored in a variable named StartTime.
To adjust the time for the user's time zone, use:
DateAdd( StartTime, −TimeZoneOffset( StartTime ), Minutes )
Note the negative sign before TimeZoneOffset to subtract the offset rather than add it.
To see the result, use the Text function with the format dd -mm -yyyy hh:mm, which will result in 15-07-2013
13:02 if you're in Pacific Daylight Time.
Now, Today, and IsToday functions in Power Apps
12/3/2019 • 3 minutes to read • Edit Online

Returns the current date and time, and tests whether a date/time value is today.

Description
The Now function returns the current date and time as a date/time value.
The Today function returns the current date as a date/time value. The time portion is midnight. Today has the
same value throughout a day, from midnight today to midnight tomorrow.
The IsToday function tests whether a date/time value is between midnight today and midnight tomorrow. This
function returns a Boolean (true or false) value.
All these functions work with the local time of the current user.
See working with dates and times for more information.

Volatile Functions
Now and Today are volatile functions. Each time one of these functions is evaluated it returns a different value.
When used in a data flow formula, a volatile function will only return a different value if the formula in which it
appears is reevaluated. If nothing else changes in the formula then it will have the same value throughout the
execution of your app.
For example, a label control with Label1.Text = Now() will not change while your app is active. Only closing and
reopening the app will result in a new value.
The function will be reevaluated if it is part of a formula in which something else has changed. For example, if we
change our example to involve a slider control with Label1.Text = DateAdd( Now(), Slider1.Value, Minutes )
then the current time is retrieved each time the Slider control's value changes and the label's text property is
reevaluated.
When used in a behavior formula, volatile functions will be evaluated each time the behavior formula is
evaluated. See below for an example.

Syntax
Now()
Today()
IsToday( DateTime )
DateTime - Required. The date/time value to test.

Examples
For the examples in this section, the current time is 3:59 AM on February 12, 2015, and the language is en-us.
FORMULA DESCRIPTION RESULT

Text( Now(), "mm/dd/yyyy Retrieves the current date and time, "02/12/2015 03:59:00"
hh:mm:ss" ) and displays it as a string.

Text( Today(), "mm/dd/yyyy Retrieves the current date only, leaving "02/12/2015 00:00:00"
hh:mm:ss" ) the time portion as midnight, and
displays it as a string.

IsToday( Now() ) Tests whether the current date and true


time is between midnight today and
midnight tomorrow.

IsToday( Today() ) Tests whether the current date is true


between midnight today and midnight
tomorrow.

Text( DateAdd( Now(), 12 ), Retrieves the current date and time, "02/24/2015 03:59:00"
"mm/dd/yyyy hh:mm:ss" ) adds 12 days to the result, and displays
it as a string.

Text( DateAdd( Today(), 12 ), Retrieves the current date, adds 12 "02/24/2015 00:00:00"
"mm/dd/yyyy hh:mm:ss" ) days to the result, and displays it as a
string.

IsToday( DateAdd( Now(), 12 ) ) Tests whether the current date and false
time, plus 12 days, is between midnight
today and midnight tomorrow.

IsToday( DateAdd( Today(), 12 ) ) Tests whether the current date, plus 12 false
days, is between midnight today and
midnight tomorrow.

Display a clock that updates in real time


1. Add a Timer control, set its Duration property to 1000, and set its Repeat property to true.
The timer will run for one second, automatically start over, and continue that pattern.
2. Set the control's OnTimerEnd property to this formula:
Set( CurrentTime, Now() )
Whenever the timer starts over (after each second), this formula sets the CurrentTime global variable to
the current value of the Now function.

3. Add a Label control, and set its Text property to this formula:
Text( CurrentTime, LongTime24 )
Use the Text function to format the date and time however you want, or set this property to just
CurrentTime to show hours and minutes but not seconds.

4. Preview the app by pressing F5, and then start the timer by clicking or tapping it.
The label continually shows the current time, down to the second.

5. Set the timer's AutoStart property to true and its Visible property to false.
The timer is invisible and starts automatically.
6. Set the screen's OnStart property so that the CurrentTime variable has a valid value, as in this example:
Set(CurrentTime, Now())
The label appears as soon as the app starts (before the timer runs for a full second).
Trace function
3/12/2020 • 2 minutes to read • Edit Online

When used with Test Studio, Trace is an optional expression that can be used to provide additional information in
your test results from the OnTestCaseComplete event. Trace event messages, as well as any messages for both
passed and failed assertions, are contained in a Traces table in the TestCaseResult record. The Traces table has two
properties, Message and Timestamp.
Trace messages can also be defined in your app. These can be viewed in the Power Apps Monitor tool along with
other app activities, to help in debugging or identifying issues with real-time diagnostic information for your app.
If you have allowed your app to send telemetry data to Azure Application Insights, the Trace function can also be
used to send custom event or diagnostic information to your Application Insights resource. You can inspect this
data in Application Insights to help diagnose problems or understand usage of your apps and features. Trace
information used in Tests will also be recorded in Application Insights. Test trace information will not be available
in the Monitor tool as the Monitor is connected to the app when it is played from the Canvas studio.

Syntax
Trace(message, trace_severity, custom_record )
Message – Required. The information to be traced. In tests, this creates a record in the Traces table in the
TestCaseResult record.
Trace_severity - Optional. The severity level of the Trace recorded in Application Insights. Options are
TraceSeverity.Information, TraceSeverity.Warning or TraceSeverity.Error.
custom_record - Optional. A record containing custom data that will be recorded in Application Insights.
See Also
Test Studio Overview
Working with Test Studio
Trim and TrimEnds functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Removes extra spaces from a string of text.

Description
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.
If you specify a single string of text, the return value for either function is the string with any extra spaces removed.
If you specify a single-column table that contains strings, the return value is a single-column table of trimmed
strings. If you have a multi-column table, you can shape it into a single-column table, as working with tables
describes.
By trimming spaces between words, Trim is consistent with the function of the same name in Microsoft Excel.
However, TrimEnds is consistent with programming tools that trim spaces only from the start and end of each
string.

Syntax
Trim ( String )
TrimEnds( String )
String - Required. The string of text to remove spaces from.
Trim ( SingleColumnTable )
TrimEnds( SingleColumnTable )
SingleColumnTable - Required. A single-column table of strings to remove spaces from.

Example
FORMULA DESCRIPTION RESULT

Trim( " Hello World " ) Removes all spaces from the start and "Hello World"
end of a string and extra spaces from
within the string.

TrimEnds( " Hello World " ) Removes all spaces from the start and "Hello World"
end of a string.

The following examples use a single-column collection, named Spaces, that contains these strings:
To create this collection, set the OnSelect property of a Button control to this formula, open Preview mode, and
then click or tap the button:
ClearCollect( Spaces, [ " Jane Doe ", " Jack and Jill", "Already trimmed",
" Venus, Earth, Mars ", "Oil and Water " ] )

FORMULA DESCRIPTION RESULT

Trim( Spaces ) Trims all spaces from the start and end
of each string and extra spaces from
within each string in the Spaces
collection.

TrimEnds( Spaces ) Trims all spaces from the start and end
of each string in the Spaces collection.

NOTE
Extra spaces don't appear if you display a collection by clicking or tapping Collections on the File menu. To verify string
length, use the Len function.
Trim and TrimEnds functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Removes extra spaces from a string of text.

Description
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.
If you specify a single string of text, the return value for either function is the string with any extra spaces
removed. If you specify a single-column table that contains strings, the return value is a single-column table of
trimmed strings. If you have a multi-column table, you can shape it into a single-column table, as working with
tables describes.
By trimming spaces between words, Trim is consistent with the function of the same name in Microsoft Excel.
However, TrimEnds is consistent with programming tools that trim spaces only from the start and end of each
string.

Syntax
Trim ( String )
TrimEnds( String )
String - Required. The string of text to remove spaces from.
Trim ( SingleColumnTable )
TrimEnds( SingleColumnTable )
SingleColumnTable - Required. A single-column table of strings to remove spaces from.

Example
FORMULA DESCRIPTION RESULT

Trim( " Hello World " ) Removes all spaces from the start and "Hello World"
end of a string and extra spaces from
within the string.

TrimEnds( " Hello World " ) Removes all spaces from the start and "Hello World"
end of a string.

The following examples use a single-column collection, named Spaces, that contains these strings:
To create this collection, set the OnSelect property of a Button control to this formula, open Preview mode, and
then click or tap the button:
ClearCollect( Spaces, [ " Jane Doe ", " Jack and Jill", "Already trimmed",
" Venus, Earth, Mars ", "Oil and Water " ] )

FORMULA DESCRIPTION RESULT

Trim( Spaces ) Trims all spaces from the start and end
of each string and extra spaces from
within each string in the Spaces
collection.

TrimEnds( Spaces ) Trims all spaces from the start and end
of each string in the Spaces collection.

NOTE
Extra spaces don't appear if you display a collection by clicking or tapping Collections on the File menu. To verify string
length, use the Len function.
GroupBy and Ungroup functions in Power Apps
12/3/2019 • 4 minutes to read • Edit Online

Groups and ungroups records of a table.

Description
The GroupBy function returns a table with records grouped together based on the values in one or more
columns. Records in the same group are placed into a single record, with a column added that holds a nested
table of the remaining columns.
The Ungroup function reverses the GroupBy process. This function returns a table, breaking into separate
records any records that were grouped together.
You can group records by using GroupBy, modify the table that it returns, and then ungroup records in the
modified table by using Ungroup. For example, you can remove a group of records by following this approach:
Use the GroupBy function.
Use the Filter function to remove the entire group of records.
Use the Ungroup function.
You can also aggregate results based on a grouping:
Use the GroupBy function.
Use the AddColumns function with Sum, Average, and other aggregate functions to add a new column
which is an aggregate of the group tables.
Use the DropColumns function to drop the group table.
Ungroup tries to preserve the original order of the records that were fed to GroupBy. This isn't always possible
(for example, if the original table contains blank records).
A table is a value in Power Apps, just like a string or a number. You can specify a table as an argument for a
function, and a function can return a table. GroupBy and Ungroup don't modify a table; instead they take a table
as an argument and return a different table. See working with tables for more details.

Syntax
GroupBy( Table, ColumnName1 [, ColumnName2, ... ], GroupColumnName )
Table - Required. Table to be grouped.
ColumnName(s) - Required. The column names in Table by which to group records. These columns
become columns in the resulting table.
GroupColumnName - Required. The column name for the storage of record data not in the
ColumnName(s).

NOTE
For SharePoint and Excel data sources that contain column names with spaces, specify each space as "_x0020_". For
example, specify "Column Name" as "Column_x0020_Name".
Ungroup( Table, GroupColumnName )
Table - Required. Table to be ungrouped.
GroupColumnName - Required. The column that contains the record data setup with the GroupBy
function.

NOTE
For SharePoint and Excel data sources that contain column names with spaces, specify each space as "_x0020_". For
example, specify "Column Name" as "Column_x0020_Name".

Examples
Create a collection
1. Add a button, and set its Text property so that the button shows Original.
2. Set the OnSelect property of the Original button to this formula:

ClearCollect( CityPopulations,
{ City: "London", Country: "United Kingdom", Population: 8615000},
{ City: "Berlin", Country: "Germany", Population: 3562000},
{ City: "Madrid", Country: "Spain", Population: 3165000},
{ City: "Rome", Country: "Italy", Population: 2874000},
{ City: "Paris", Country: "France", Population: 2273000},
{ City: "Hamburg", Country: "Germany", Population: 1760000},
{ City: "Barcelona", Country: "Spain", Population: 1602000},
{ City: "Munich", Country: "Germany", Population: 1494000},
{ City: "Milan", Country: "Italy", Population: 1344000}
)

3. While holding down the Alt key, select the Original button.
You just created a collection, named CityPopulations, that contains this data:

4. To display this collection, select Collections on the File menu and then select the CityPopulations
collection. The first five records in the collection appear:
Group records
1. Add another button, and set its Text property to "Group".
2. Set the OnSelect property of this button to this formula:
ClearCollect( CitiesByCountry, GroupBy( CityPopulations, "Country", "Cities" ) )
3. While holding down the Alt key, select the Group button.
You just created a collection, named CitiesByCountry, in which the records of the previous collection are
grouped by the Country column.

4. To display the first five records in this collection, select Collections on the File menu.
5. To display the populations of cities in a country, select the table icon in the Cities column for that country
(for example, Germany):

Filter and ungroup records


1. Add another button, and set its Text property so that the button shows "Filter".
2. Set the OnSelect property of this button to this formula:
ClearCollect( CitiesByCountryFiltered, Filter( CitiesByCountry, "e" in Country ) )
3. While holding down the Alt key, select the button that you added.
You just created a third collection, named CitiesByCountryFiltered, that includes only those countries
that have an "e" in their names (that is, not Spain or Italy).
4. Add one more button, and set its Text property so that the button shows "Ungroup".
5. Set the OnSelect property of this button to this formula:
ClearCollect( CityPopulationsUngrouped, Ungroup( CitiesByCountryFiltered, "Cities" ) )
Which results in:

Aggregate results
Something else we can do with a grouped table is to aggregate the results. In this example, we will sum the
population of the major cities in each country.
1. Add another button, and set its Text property so that the button shows "Sum".
2. Set the OnSelect property of the "Sum" button to this formula:
ClearCollect( CityPopulationsSum, AddColumns( CitiesByCountry, "Sum of City Populations",
Sum ( Cities, Population ) ) )
Which results in:
AddColumns starts with the base CitiesByCountry collection and adds a new column Sum of City
Populations. This column's values are calculated row -by-row, based on the formula Sum ( Cities,
Population ). AddColumns provides the value of the Cities column (a table) for each row, and Sum adds
up the Population for each row of this sub table.
Now that we have the sum that we want, we can use DropColumns to remove the sub tables.
3. Add another button, and set its Text property so that the button shows "SumOnly".
4. Set the OnSelect property of the "SumOnly" button to this formula:
ClearCollect( CityPopulationsSumOnly, DropColumns( CityPopulationsSum, "Cities" ) )
Which results in:

Note that we didn't need to ungroup this table.


Relate and Unrelate functions in Power Apps
12/3/2019 • 9 minutes to read • Edit Online

Relate and unrelate records of two entities through a one-to-many or many-to-many relationship.

Description
The Relate function links two records through a one-to-many or many-to-many relationship in Common Data
Service. The Unrelate function reverses the process and removes the link.
For one-to-many relationships, the Many entity has a foreign-key field that points to a record of the One entity.
Relate sets this field to point to a specific record of the One entity, while Unrelate sets this field to blank. If the
field is already set when Relate is called, the existing link is lost in favor of the new link. You can also set this field
by using the Patch function or an Edit form control; you need not use the Relate function.
For many-to-many relationships, the system that links the records maintains a hidden join table. You can't access
this join table directly; it can be read only through a one-to-many projection and set through the Relate and
Unrelate functions. Neither related entity has a foreign key.
The data for the entity that you specify in the first argument will be refreshed to reflect the change, but the data
for the entity that you specify in the second argument won't. That data must be manually refreshed with the
Refresh function to show the result of the operation.
These functions never create or delete a record. They only relate or unrelate two records that already exist.
You can use these functions only in behavior formulas.

NOTE
These functions are part of a preview feature, and their behavior is available only when the Relational data, option sets,
and other new features for CDS feature is enabled. This is an app-level setting that's enabled by default for new apps. To
find this feature switch, open the File menu, select App settings, and then select Advanced settings. Your feedback is very
valuable to us - please let us know what you think in the Power Apps community forums.

Syntax
Relate( Entity1RelatedTable, Entity2Record )
Entity1RelatedTable - Required. For a record of Entity1, the table of Entity2 records related through a one-to-
many or many-to-many relationship.
Entity2Record - Required. The Entity2 record to add to the relationship.
Unrelate( Entity1RelatedTable, Entity2Record )
Entity1RelatedTable - Required. For a record of Entity1, the table of Entity2 records related through a one-to-
many or many-to-many relationship.
Entity2Record - Required. The Entity2 record to remove from the relationship.

Examples
Consider a Products entity with the following relationships as seen in the Power Apps portal's entity viewer:
RELATIONSHIP DISPLAY NAME RELATED ENTITY RELATIONSHIP TYPE

Product Reservation Reservation One-to-many

Product ↔ Contact Contact Many-to-many

Products and Reservations are related through a One-to-Many relationship. To relate the first record of the
Reservations entity with the first record of the Products entity:
Relate( First( Products ).Reservations, First( Reservations ) )

To remove the relationship between these records:


Unrelate( First( Products ).Reservations, First( Reservations ) )

At no time did we create or remove or a record, only the relationship between records was modified.
Products and Contacts are related through a Many-to-Many relationship. To relate the first record of the
Contacts entity with the first record of the Products entity:
Relate( First( Products ).Contacts, First( Contacts ) )

As Many-to-Many relationships are symmetric, we could also have done this in the opposite direction:
Relate( First( Contacts ).Products, First( Products ) )

To remove the relationship between these records:


Unrelate( First( Products ).Contacts, First( Contacts ) )

or:
Unrelate( First( Contacts ).Products, First( Products ) )

The walk through that follows does exactly these operations on these entities using an app with Gallery and
Combo box controls for selecting the records involved.
These examples depend on the sample data being installed in your environment. Either create a trial environment
including sample data or add sample data to an existing environment.
One -to -many
Relate function
You'll first create a simple app to view and reassign the reservations that are associated with a product.
1. Create a tablet app from blank.
2. On the View tab, select Data sources.
3. In the Data pane, select Add data source > Common Data Service > Products > Connect.
The Products entity is part of the sample data loaded above.
4. On the Insert tab, add a blank vertical Gallery control.
5. Ensure that the control that you just added is named Gallery1, and then move and resize it to fill the left-
hand side of the screen.
6. On the Properties tab, set Gallery1's Items property to Products and its Layout to Image and title.

7. In Gallery1, ensure that the Label control is named Title1, and then set its Text property to
ThisItem.Name.

8. Select the screen to avoid inserting the next item into Gallery1. Add a second blank vertical Gallery
control, and ensure that it's named Gallery2.
Gallery2 will show the reservations for whatever product the user selects in Gallery1.
9. Move and resize Gallery2 to fill the upper-right quadrant of the screen.
10. (optional) Add the blue Label control above Gallery2, as the next graphic shows.
11. In the formula bar, set the Items property of Gallery2 to Gallery1.Selected.Reservations.
12. In the properties pane, set Gallery2's Layout to Title.

13. In Gallery2, add a Combo box control, ensure that it's named ComboBox1, and then move and resize it
to avoid blocking the other controls in Gallery2.
14. On the Properties tab, set ComboBox1's Items property to Products.

15. Scroll down in the Properties tab and set ComboBox1's Allow multiple selection property to Off.
16. In the formula bar, set ComboBox1's DefaultSelectedItems property to ThisItem.'Product
Reservation'.

17. In Gallery2, set NextArrow2's OnSelect property to this formula:

Relate( ComboBox1.Selected.Reservations, ThisItem )

When the user selects this icon, the current reservation changes to the product that the user selected in
ComboBox1.

18. Press F5 to test the app in Preview mode.


With this app, the user can move a reservation from one product to another. For a reservation on one product, the
user can select a different product in ComboBox1 and then select NextArrow2 to change that reservation.

Unrelate function
At this point, you can move the relationship from one record to another, but you can't remove the relationship
altogether. You can use the Unrelate function to disconnect a reservation record from any product.
1. On the View tab, select Data sources.
2. In the Data pane, select Add data source > Common Data Service > Reservations > Connect.
3. In Gallery2, set the OnSelect formula for NextArrow2 to this formula:

If( IsBlank( ComboBox1.Selected ),


Unrelate( Gallery1.Selected.Reservations, ThisItem ),
Relate( ComboBox1.Selected.Reservations, ThisItem )
);
Refresh( Reservations )

4. Copy Gallery2 to the Clipboard by selecting it and then pressing Ctrl-C.


5. Paste a duplicate of Gallery2 to the same screen by pressing Ctrl-V, and then move it to the lower-right
quadrant of the screen.
6. (optional) If you added a label above Gallery2, repeat the previous two steps for that label.
7. Ensure that the duplicate of Gallery2 is named Gallery2_1, and then set its Items property to this
formula:

Filter( Reservations, IsBlank( 'Product Reservation' ) )

A delegation warning appears, but it won't matter with the small amount of data in this example.

With these changes, users can clear the selection in ComboBox1 for a contact if that person hasn't reserved a
product. Contacts who haven't reserved a product appear in Gallery2_1 where users can assign each contact to a
product.

Many-to -many
Create a many-to-many relationship
The sample data doesn't include a many-to-many relationship, but you'll create one between the Products entity
and the Contacts entity. Users can relate each product to more than one contact and each contact to more than
one product.
1. From this page, select Data in the left navigation bar, and then select Entities.

2. Change the entity filter to include all entities.


By default, sample entities don't appear.

3. Scroll down, open the Product entity, and select Relationships.


4. Select Add relationship > Many-to-many.

5. Select the Contact entity for the relationship.

6. Select Done > Save entity.

Relate and unrelate contacts with one or more products


You'll create another app that resembles the one you created earlier in this topic, but the new app will offer a
many-to-many relationship. Each contact will be able to reserve multiple products instead of only one.
1. In a blank app for tablets, create Gallery1 as the first procedure in this topic describes.
2. Add another blank vertical Gallery control, ensure that it's named Gallery2, and then move it into the
upper-right corner of the screen.
Later in this topic, you'll add a Combo box control under Gallery2.
3. In the formula bar, set Gallery2's Items property to Gallery1.Selected.Contacts.

4. On the Properties tab, set Layout to Image and title.

5. In Gallery2, ensure that the Label control is named Title2, and then set its Text property to
ThisItem.'Full Name'.
No text will appear in that control until you finish this procedure and assign a contact to a product.
6. Delete NextArrow2, insert a Cancel icon, and ensure that it's named icon1.
7. Set the Cancel icon's OnSelect property to this formula:

Unrelate( Gallery1.Selected.Contacts, ThisItem )

8. On the View tab, select Data sources.


9. In the Data pane, select Add data source > Common Data Service > Contacts > Connect.
10. Under Gallery2, add a Combo box control, ensure that it's named ComboBox1, and then set its Items
property to Contacts.
11. On the Properties tab, set Allow multiple selection to Off.

12. Insert an Add icon, and set its OnSelect property to this formula:

Relate( Gallery1.Selected.Contacts, ComboBox1.Selected )

With this app, users can now freely relate and unrelate a set of contacts to each product.
To add a contact to a product, select the contact in the combo box at the bottom of the screen, and then
select the Add icon.
To remove a contact from a product, select the Cancel icon for that contact.
Unlike one-to-many, a many-to-many relationship allows users to associate the same contact with multiple
products.

In reverse: relate and unrelate products with multiple contacts


Many-to-many relationships are symmetric. You can extend the example to add products to a contact and then flip
between the two screens to show how the relationship appears from either direction.
1. Set the OnVisible property of Screen1 to Refresh( Products ).
When you update a one-to-many or many-to-many relationship, only the data of the first argument entity
of the Relate or Unrelate call is refreshed. The second must be refreshed manually if you want to flip
between the screens of this app.

2. Duplicate Screen1.
The duplicate will be named Screen1_1 and form the basis for looking at the relationships from the
contacts side.
3. To create the reverse view, change these formulas on the controls of Screen1_1:
Screen1_1.OnVisible = Refresh( Contacts )
Gallery1_1.Items = Contacts
Title1_1.Text = ThisItem.'Full Name'
Label1_1.Text = "Selected Contact Products"
Gallery2_1.Items = Gallery1_1.Selected.Products
Title2_1.Text = ThisItem.Name
Icon1_1.OnSelect = Unrelate( Gallery1_1.Selected.Products, ThisItem )
ComboBox1_1.Items = Products
Icon2_1.OnSelect = Relate( Gallery1_1.Selected.Products, ComboBox1_1.Selected )
The result will look very similar to the previous screen but comes at the relationship from the Contacts
side.

4. Insert an Arrows up down icon and set its OnSelect property to Navigate( Screen1, None ). Do the
same thing on Screen1 with the formula Navigate( Screen1_1, None ).
With this new screen, users can add a contact to a product and then flip to a view of contacts and see the
associated product. The relationships are symmetric and shared between the two screens.
Update and UpdateIf functions in Power Apps
2/8/2020 • 3 minutes to read • Edit Online

Updates records in a data source.

Description
Update function
Use the Update function to replace an entire record in a data source. In contrast, the UpdateIf and the Patch
functions modify one or more values in a record, leaving the other values alone.
For a collection, the entire record must match. Collections allow duplicate records, so multiple records might match.
You can use the All argument to update all copies of a record; otherwise, only one copy of the record is updated.
If the data source generates a column's value automatically, the value of that column must be reaffirmed.
UpdateIf function
Use the UpdateIf function to modify one or more values in one or more records that match one or more
conditions. The condition can be any formula that results in a true or false and can reference columns of the data
source by name. The function evaluates the condition for each record and modifies any record for which the result
is true.
To specify a modification, use a change record that contains new property values. If you provide this change record
inline with curly braces, property formulas can reference properties of the record that's being modified. You can use
this behavior to modify records based on a formula.
Similar to UpdateIf, you can also use the Patch function to change specific columns of a record without affecting
other columns.
Both Update and UpdateIf return the modified data source as a table. You must use either function in a behavior
formula.
Delegation
When used with a data source, these functions can't be delegated. Only the first portion of the data source will be
retrieved and then the function applied. The result may not represent the complete story. A warning will appear at
authoring time to remind you of this limitation and to suggest switching to delegable alternatives where possible.
For more information, see the delegation overview.

Syntax
Update( DataSource, OldRecord, NewRecord [, All ] )
DataSource – Required. The data source that contains the record that you want to replace.
OldRecord – Required. The record to replace.
NewRecord – Required. The replacement record. This isn't a change record. The entire record is replaced, and
missing properties will contain blank.
All – Optional. In a collection, the same record may appear more than once. Specify the All argument to remove
all copies of the record.
UpdateIf( DataSource, Condition1, ChangeRecord1 [, Condition2, ChangeRecord2, ... ] )
DataSource – Required. The data source that contains the record or records that you want to modify.
Condition(s) – Required. A formula that evaluates to true for the record or records that you want to modify. You
can use column names of DataSource in the formula.
ChangeRecord (s) - Required. For each corresponding condition, a change record of new property values to
apply to records of DataSource that satisfy the condition. If you provide the record inline using curly braces,
property values of the existing record can be used in the property formulas.

Examples
In these examples, you'll replace or modify records in a data source that's named IceCream and that starts with the
data in this table:

FORMULA DESCRIPTION RESULT

Update( IceCream, Replaces a record from the data source.


First( Filter( IceCream, Flavor="Choc
olate" ) ),
{ ID: 1, Flavor: "Mint Chocolate", Qu
antity:150 } )

The IceCream data source has been


modified.

UpdateIf( IceCream, Quantity > 175, Modifies records that have a Quantity
{ Quantity: Quantity + 10 } ) that is greater than 175. The Quantity
field is incremented by 10, and no other
fields are modified.

The IceCream data source has been


modified.

Update( IceCream, Replaces a record from the data source.


First( Filter( IceCream, The Quantity property hasn't been
Flavor="Strawberry" ) ), supplied in the replacement record, so
{ ID: 3, Flavor: "Strawberry Swirl"} ) that property will be blank in the result.

The IceCream data source has been


modified.

UpdateIf( IceCream, true, Sets the value of the Quantity property


{ Quantity: 0 } ) for all records in the data source to 0.

The IceCream data source has been


modified.

Step by step
1. Import or create a collection named Inventory, and show it in a gallery as Show data in a gallery describes.
2. Name the gallery ProductGallery.
3. Add a slider named UnitsSold, and set its Max property to this expression:
ProductGallery.Selected.UnitsInStock
4. Add a button, and set its OnSelect property to this formula:
UpdateIf(Inventory, ProductName = ProductGallery.Selected.ProductName,
{UnitsInStock:UnitsInStock-UnitsSold.Value})
5. Press F5, select a product in the gallery, specify a value with the slider, and then select the button.
The number of units in stock for the product you specified decreases by the amount that you specified.
UpdateContext function in Power Apps
12/3/2019 • 5 minutes to read • Edit Online

Creates or updates context variables of the current screen.

Overview
Use the UpdateContext function to create a context variable, which temporarily holds a piece of information,
such as the number of times the user has selected a button or the result of a data operation.
Context variables are scoped to a screen, which means that you can't build a formula that refers to a context
variable on another screen. If you've used another programming tool, you can think of a context variable as
similar to a local variable. Use the Set function to work with global variables that are available throughout your
app.
Power Apps are based on formulas that automatically recalculate as the user interacts with an app. Context
variables don't offer this benefit and can make your app harder to create and understand. Before you use a
context variable, review working with variables.

Description
To create or update a context variable, pass a single record to the UpdateContext function. In each record,
specify the name of a column, which defines or matches the name of the variable, and the value to which you
want to set that variable.
If you specify the name of a variable that you've previously defined, UpdateContext sets the value of the
variable to the value that you specify.
If you specify the name of a variable that doesn't yet exist, UpdateContext creates a variable with that
name and sets the value of that variable to the value that you specify.
If you've previously defined a variable but don't specify it in this particular UpdateContext formula, its
value remains the same.
Context variables are implicitly created by using the UpdateContext or Navigate function. There is no
explicit declaration required. If you remove all the UpdateContext and Navigate references to a context
variable, then that context variable will cease to exist. To clear a variable set its value to the result of the Blank
function.
You can see your variables' values, definitions, and uses with the Variables view under the File menu in the
authoring environment.
You reference a context variable in a formula by using the variable's column name. For example,
UpdateContext( { ShowLogo: true } ) creates a context variable named ShowLogo and sets its value to
true. You can then use the value of this context variable by using the name ShowLogo in a formula. You can
write ShowLogo as the formula for the Visible property of an image control and show or hide that control
based on whether the value of the context variable is true or false.
As the examples later in this topic show, context variables can hold several kinds of information, including
these:
a single value
a record
a table
an object reference
any result from a formula
A context variable holds its value until the app is closed. If you define a context variable and set its value on a
particular screen, that information remains intact even if the user switches to a different screen. Once the app
is closed, the context variable's value will be lost and must be recreated when the app is loaded again.
Every context variable is scoped to a screen. If you want to define a context variable on one screen and modify
that variable from another screen, you must build a formula that's based on the Navigate function. Or use a
global variable.
UpdateContext has no return value, and you can use it only within a behavior formula.

Syntax
UpdateContext( UpdateRecord )
UpdateRecord – Required. A record that contains the name of at least one column and a value for that
column. A context variable is created or updated for each column and value that you specify.
UpdateContext( { ContextVariable1: Value1 [, ContextVariable2: Value2 [, ... ] ] } )
ContextVariable1 - Required. The name of a context variable to create or update.
Value1 - Required. The value to assign to the context variable.
ContextVariable2: Value2, ... - Optional. Additional context variables to create or update and their values.

Examples
FORMULA DESCRIPTION RESULT

UpdateContext( { Counter: 1 } ) Creates or modifies the context Counter has the value 1. You can
variable Counter, setting its value to reference that variable by using the
1. name Counter in a formula.

UpdateContext( { Counter: 2 } ) Sets the value of the Counter context Counter has the value 2.
variable from the previous example to
2.

UpdateContext( Creates or modifies the context Name has the value Lily, and Score
{ Name: "Lily", Score: 10 } ) variables Name and Score, setting has the value 10.
their values to Lily and 10
respectively.

UpdateContext( Creates or modifies the context Person has the value of record
{ Person: { Name: "Milton", variable Person, setting its value to a { Name: "Milton",
Address: "1 Main St" } } ) record. The record contains two Address: "1 Main St" } }.
columns, named Name and Address.
The value of the Name column is Reference this record as a whole with
Milton, and the value of the Address the name Person, or reference an
column is 1 Main St. individual column of this record with
Person.Name or Person.Address.

UpdateContext( { Person: Works with the Patch function to Person now has the value of record
Patch( Person, {Address: "2 Main St update the Person context variable by { Name: "Milton",
"})}) setting the value of the Address Address: "2 Main St" } }.
column to 2 Main St.

Step-by-step example
1. Name the default screen Source, add another screen, and name it Target.
2. On the Source screen, add two buttons, and set their Text properties so that one says English and the
other says Spanish.
3. Set the OnSelect property of the English button to this expression:
Navigate(Target, ScreenTransition.Fade, {Language:"English"})
4. Set the OnSelect property of the Spanish button to this expression:
Navigate(Target, ScreenTransition.Fade, {Language:"Spanish"})
5. On the Target screen, add a label, and set its Text property to this expression:
If(Language="English", "Hello!", "Hola!")
6. On the Target screen, select Shapes on the Insert tab, and then select the Back arrow.
7. Set the Back arrow's OnSelect property to this formula:
Navigate(Source, ScreenTransition.Fade)
8. From the Source screen, press F5, and then select the button for either language.
On the Target screen, the label appears in the language that corresponds to the button that you
selected.
9. Select the Back arrow to return to the Source screen, and then select the button for the other language.
On the Target screen, the label appears in the language that corresponds to the button that you
selected.
10. Press Esc to return to the default workspace.
Another example
Update and UpdateIf functions in Power Apps
2/8/2020 • 3 minutes to read • Edit Online

Updates records in a data source.

Description
Update function
Use the Update function to replace an entire record in a data source. In contrast, the UpdateIf and the Patch
functions modify one or more values in a record, leaving the other values alone.
For a collection, the entire record must match. Collections allow duplicate records, so multiple records might
match. You can use the All argument to update all copies of a record; otherwise, only one copy of the record is
updated.
If the data source generates a column's value automatically, the value of that column must be reaffirmed.
UpdateIf function
Use the UpdateIf function to modify one or more values in one or more records that match one or more
conditions. The condition can be any formula that results in a true or false and can reference columns of the
data source by name. The function evaluates the condition for each record and modifies any record for which
the result is true.
To specify a modification, use a change record that contains new property values. If you provide this change
record inline with curly braces, property formulas can reference properties of the record that's being modified.
You can use this behavior to modify records based on a formula.
Similar to UpdateIf, you can also use the Patch function to change specific columns of a record without
affecting other columns.
Both Update and UpdateIf return the modified data source as a table. You must use either function in a
behavior formula.
Delegation
When used with a data source, these functions can't be delegated. Only the first portion of the data source will
be retrieved and then the function applied. The result may not represent the complete story. A warning will
appear at authoring time to remind you of this limitation and to suggest switching to delegable alternatives
where possible. For more information, see the delegation overview.

Syntax
Update( DataSource, OldRecord, NewRecord [, All ] )
DataSource – Required. The data source that contains the record that you want to replace.
OldRecord – Required. The record to replace.
NewRecord – Required. The replacement record. This isn't a change record. The entire record is replaced,
and missing properties will contain blank.
All – Optional. In a collection, the same record may appear more than once. Specify the All argument to
remove all copies of the record.
UpdateIf( DataSource, Condition1, ChangeRecord1 [, Condition2, ChangeRecord2, ... ] )
DataSource – Required. The data source that contains the record or records that you want to modify.
Condition(s) – Required. A formula that evaluates to true for the record or records that you want to modify.
You can use column names of DataSource in the formula.
ChangeRecord (s) - Required. For each corresponding condition, a change record of new property values to
apply to records of DataSource that satisfy the condition. If you provide the record inline using curly braces,
property values of the existing record can be used in the property formulas.

Examples
In these examples, you'll replace or modify records in a data source that's named IceCream and that starts
with the data in this table:

FORMULA DESCRIPTION RESULT

Update( IceCream, Replaces a record from the data


First( Filter( IceCream, Flavor="Cho source.
colate" ) ),
{ ID: 1, Flavor: "Mint Chocolate", Q
uantity:150 } )

The IceCream data source has been


modified.

UpdateIf( IceCream, Quantity > Modifies records that have a Quantity


175, { Quantity: Quantity + 10 } ) that is greater than 175. The Quantity
field is incremented by 10, and no
other fields are modified.

The IceCream data source has been


modified.

Update( IceCream, Replaces a record from the data


First( Filter( IceCream, source. The Quantity property hasn't
Flavor="Strawberry" ) ), been supplied in the replacement
{ ID: 3, Flavor: "Strawberry Swirl"} record, so that property will be blank
) in the result.

The IceCream data source has been


modified.

UpdateIf( IceCream, true, Sets the value of the Quantity


{ Quantity: 0 } ) property for all records in the data
source to 0.

The IceCream data source has been


modified.

Step by step
1. Import or create a collection named Inventory, and show it in a gallery as Show data in a gallery
describes.
2. Name the gallery ProductGallery.
3. Add a slider named UnitsSold, and set its Max property to this expression:
ProductGallery.Selected.UnitsInStock
4. Add a button, and set its OnSelect property to this formula:
UpdateIf(Inventory, ProductName = ProductGallery.Selected.ProductName,
{UnitsInStock:UnitsInStock-UnitsSold.Value})
5. Press F5, select a product in the gallery, specify a value with the slider, and then select the button.
The number of units in stock for the product you specified decreases by the amount that you specified.
Lower, Upper, and Proper functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Converts letters in a string of text to all lowercase, all uppercase, or proper case.

Description
The Lower, Upper, and Proper functions convert the case of letters in strings.
Lower converts any uppercase letters to lowercase.
Upper converts any lowercase letters to uppercase.
Proper converts the first letter in each word to uppercase if it's lowercase and converts any other uppercase
letters to lowercase.
All three functions ignore characters that aren't letters.
If you pass a single string, the return value is the converted version of that string. If you pass a single-column
table that contains strings, the return value is a single-column table of converted strings. If you have a multi-
column table, you can shape it into a single-column table, as working with tables describes.

Syntax
Lower( String )
Upper( String )
Proper( String )
String - Required. The string to convert.
Lower( SingleColumnTable )
Upper( SingleColumnTable )
Proper( SingleColumnTable )
SingleColumnTable - Required. A single-column table of strings to convert.

Examples
Single string
The examples in this section use a text-input control, named Author, as their data source. The control contains
the string "E. E. CummINGS".

FORMULA DESCRIPTION RESULT

Lower( Author.Text ) Converts any uppercase letters in the "e. e. cummings"


string to lowercase.

Upper( Author.Text ) Converts any lowercase letters in the "E. E. CUMMINGS"


string to uppercase.

Proper( Author.Text ) Converts the first letter of each word "E. E. Cummings"
to uppercase if it's lowercase, and
converts any other uppercase letters
to lowercase.
Single -column table
The examples in this section convert strings from the Address column of the People data source, which
contains this data:

Each formula returns a single-column table that contains the converted strings.

FORMULA DESCRIPTION RESULT

Lower( Converts any letter that's lowercase to


ShowColumns( People, "Address" ) uppercase.
)

Upper( Converts any letter that's lowercase to


ShowColumns( People, "Address" ) uppercase.
)

Proper( Converts any first letter of a word


ShowColumns( People, "Address" ) that's lowercase to uppercase, and
) converts any other letter that's
uppercase to lowercase.

Step-by-step example
1. Add a Text input control, and name it Source.
2. Add a label, and set its Text property to this function:
Proper(Source.Text)
3. Press F5, and then type WE ARE THE BEST! into the Source box.
The label shows We Are The Best!
User function in Power Apps
3/6/2020 • 2 minutes to read • Edit Online

Returns information about the current user.

Description
The User function returns a record of information about the current user:

PROPERTY DESCRIPTION

User().Email Email address of the current user.

User().FullName Full name of the current user, including first and last names.

User().Image Image of the current user. This will be an image URL of the
form "blob:identifier". Set the Image property of the Image
control to this value to display the image in the app.

NOTE
The information returned is for the current Power Apps user. It will match the "Account" information that is displayed in the
Power Apps players and studio, which can be found outside of any authored apps. This may not match the current user's
information in Office 365 or other services.

NOTE
If you published your application with a User function prior to March 2020, you may find that it, intermitently, will not
retrieve photos. The issues were fixed in the late March 2020 release. To take advantage of the updated implementation,
simply re-open your application, save it, and republish it.

Syntax
User()

Examples
The current Power Apps user has the following information:
Full Name: "John Doe"
Email address: "john.doe@contoso.com"

Image:
FORMULA DESCRIPTION RESULT

User() Record of all information for the current { FullName: "John Doe",
Power Apps user. Email: "john.doe@contoso.com",
Image: "blob:1234...5678" }

User().Email The email address of the current Power "john.doe@contoso.com"


Apps user.

User().FullName The full name of the current Power "John Doe"


Apps user.

User().Image The image URL for the current Power "blob:1234...5678"


Apps user. Set the Image property of
the Image control to this value to With ImageControl.Image:
display the image in the app.
Validate function in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

The Validate function checks whether the value of a single column or a complete record is valid for a data
source.

Description
Before a user submits a data change, you can provide immediate feedback on the validity of that submission,
resulting in a better user experience.
Data sources can provide information on what constitutes valid values within a record. This information can
include many constraints, such as these examples:
whether a column requires a value
how long a string of text can be
how high and low a number can be
how early and late a date can be
The Validate function uses this information to determine whether a value is valid and to return an appropriate
error message if not. You can use the DataSourceInfo function to view the same information that Validate
uses.
Data sources vary in how much validation information they provide, including not providing any at all.
Validate can only verify values based on this information. Even if Validate doesn't find a problem, applying
the data change may still fail. You can use the Errors function to obtain information about the failure.
If Validate finds a problem, the function returns an error message that you can show to the user of the app. If
all values are valid, Validate returns blank. When you work with a collection that has no validation information,
values are always valid.

Syntax
Validate( DataSource, Column, Value )
DataSource – Required. The data source to validate with.
Column – Required. The column to validate.
Value – Required. The value for the selected column to be validated.
Validate( DataSource, OriginalRecord, Updates )
DataSource – Required. The data source to validate with.
OriginalRecord - Required. The record to which updates are to be validated.
Updates - Required. The changes to apply to the original record.

Examples
For these examples, values in the Percentage column of the Scores data source must be between 0 and 100,
inclusive. If the data passes validation, the function returns blank. Otherwise, the function returns an error
message.
Validate with a single column
FORMULA DESCRIPTION RESULT

Validate( Scores, Percentage, 10 ) Checks whether 10 is a valid value for blank


the Percentage column in the Scores
data source.

Validate( Scores, Percentage, 120 ) Checks whether 120 is a valid value "Values must be between 0 and 100."
for the Percentage column in the
Scores data source.

Validate with a complete record


FORMULA DESCRIPTION RESULT

Validate( Scores, EditRecord, Checks whether values in all columns blank


Gallery.Updates ) are valid for the Scores data source.
In this example, the value in the
Percentage column is 10.

Validate( Scores, EditRecord, Checks whether values in all columns "Values must be between 0 and 100."
Gallery.Updates ) are valid for the Scores data source.
In this example, the value in the
Percentage column is 120.
Value function in Power Apps
2/8/2020 • 2 minutes to read • Edit Online

Converts a string of text to a number.

Description
The Value function converts a string of text that contains number characters to a number value. Use this
function when you need to perform calculations on numbers that were entered as text by a user.
Different languages interpret , and . differently. By default, the text is interpreted in the language of the current
user. You can specify the language to use with a language tag, using the same language tags that are returned
by the Language function.
Notes on the format of the string:
The string may be prefixed with the currency symbol for the current language. The currency symbol is
ignored. Currency symbols for other languages are not ignored.
The string may be include a percent sign (%) at the end, indicating that it is a percentage. The number will
be divided by 100 before being returned. Percentages and currency symbols cannot be mixed.
The string may be in scientific notation, with 12 x 103 expressed as "12e3".
If the number is not in a proper format, Value will return blank.
To convert date and time values, use the DateValue, TimeValue, or DateTimeValue functions.

Syntax
Value( String [, LanguageTag ] )
String - Required. String to convert to a numeric value.
LanguageTag - Optional. The language tag in which to parse the string. If not specified, the language of the
current user is used.

Examples
The user running these formulas is located in the United States and has selected English as their language. The
Language function is returning "en-US".

FORMULA DESCRIPTION RESULT

Value( "123.456" ) The default language of "en-US" will 123.456


be used, which uses a period as the
decimal separator.

Value( "123.456", "es-ES" ) "es-ES" is the language tag for 123456


Spanish in Spain. In Spain, a period is
a thousands separator.

Value( "123,456" ) The default language of "en-US" will 123456


be used, which uses a comma as a
thousands separator.
FORMULA DESCRIPTION RESULT

Value( "123,456", "es-ES" ) "es-ES" is the language tag for 123.456


Spanish in Spain. In Spain, a comma is
the decimal separator.

Value( "12.34%" ) The percentage sign at the end of the 0.1234


string indicates that this is a
percentage.

Value( "$ 12.34" ) The currency symbol for the current 12.34
language is ignored.

Value( "24e3" ) Scientific notation for 24 x 103 . 24000


Average, Max, Min, StdevP, Sum, and VarP
functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Aggregate functions that summarize a set of numbers.

Description
The Average function calculates the average, or arithmetic mean, of its arguments.
The Max function finds the maximum value.
The Min function finds the minimum value.
The Sum function calculates the sum of its arguments.
The StdevP function calculates the standard deviation of its arguments.
The VarP function calculates the variance of its arguments.
You can supply the values for these functions as:
Separate arguments. For example, Sum ( 1, 2, 3 ) returns 6.
A table and a formula to operate over that table. The aggregate will be calculated on the values of the
formula for each record.
Fields of the record currently being processed are available within the formula. You simply reference them
by name as you would any other value. You can also reference control properties and other values from
throughout your app. For more details, see the examples below and working with record scope.
These functions operate on numeric values only. Other types of values, such as strings or records, are
ignored. Use the Value function to convert a string into a number.
The Average, Max, Min, and Sum functions can be delegated when used with a data source that supports
delegation for these functions. However, StdevP and VarP can't be delegated for any data sources. If
delegation is not supported, only the first portion of the data will be retrieved and then the function
applied locally. The result may not represent the complete story. A delegation warning will appear at
authoring time to remind you of this limitation and to suggest switching to delegable alternatives where
possible. For more information, see the delegation overview.

Syntax
Average( NumericalFormula1, [ NumericalFormula2, ... ] )
Max( NumericalFormula1, [ NumericalFormula2, ... ] )
Min( NumericalFormula1, [ NumericalFormula2, ... ] )
Sum ( NumericalFormula1, [ NumericalFormula2, ... ] )
StdevP ( NumericalFormula1, [ NumericalFormula2, ... ] )
VarP ( NumericalFormula1, [ NumericalFormula2, ... ] )
NumericalFormula (s) - Required. Numeric values to operate on.
Average( Table, NumericalFormula )
Max( Table, NumericalFormula )
Min( Table, NumericalFormula )
Sum ( Table, NumericalFormula )
StdevP ( Table, NumericalFormula )
VarP ( Table, NumericalFormula )
Table - Required. Table to operate on.
NumericalFormula - Required. Formula to evaluate for each record. The result of this formula is used
for the aggregation. You can use columns of the table in the formula.

Examples
Step by step
Let's say that you had a data source named Sales that contained a CostPerUnit column and a UnitsSold
column, and you set the Text property of a label to this function:
Sum (Sales, CostPerUnit * UnitsSold)
The label would show total sales by multiplying the values in those columns for each record and then
adding the results from all records together:

As a different example, let's say that you had sliders that were named Slider1, Slider2, and Slider3 and a
label with its Text property set to this formula:
Sum (Slider1.Value, Slider2.Value, Slider3.Value)
The label would show the sum of all values to which the sliders were set.
EditForm, NewForm, SubmitForm,
ResetForm, and ViewForm functions in Power
Apps
12/3/2019 • 4 minutes to read • Edit Online

View, edit, or create an item, save the contents, and reset the controls in an Edit form control.

Overview
These functions change the state of the Edit form control. The form control can be in one of these
modes:

MODE DESCRIPTION

FormMode.Edit The form is populated with an existing record and the


user can modify the values of the fields. Once
complete, the user can save the changes to the
record.

FormMode.New The form is populates with default values and the


user can modify the values of the fields. Once
complete, the user can add the record to the data
source.

FormMode.View The form is populated with an existing record but the


user cannot modify the values of the fields.

Description
These functions are often invoked from the OnSelect formula of a Button or Image control so
that the user can save edits, abandon edits, or create a record. You can use controls and these
functions together to create a complete solution.
These functions return no values.
SubmitForm
Use the SubmitForm function in the OnSelect property of a Button control to save any changes
in a Form control to the data source.
Before submitting any changes, this function checks for validation issues with any field that's
marked as required or that has one or more constraints on its value. This behavior matches that of
the Validate function.
SubmitForm also checks the Valid property of the Form, which is an aggregation of all the Valid
properties of the Card controls that the Form control contains. If a problem occurs, the data isn't
submitted, and the Error and ErrorKind properties of the Form control are set accordingly.
If validation passes, SubmitForm submits the change to the data source.
If successful, the Form's OnSuccess behavior runs, and the Error and ErrorKind properties
are cleared. If the form was in FormMode.New mode, it is returned to FormMode.Edit mode.
If unsuccessful, the Form's OnFailure behavior runs, and the Error and ErrorKind properties
are set accordingly. The mode of the form is unchanged.
EditForm
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.
NewForm
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.
ResetForm
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.
ViewForm
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.
DisplayMode Property
The current mode can be read through the Mode property. The mode also determines the value of
the DisplayMode property which can be used by data cards and controls within the form control.
Often, the data card's DisplayMode property will be set to Parent.DisplayMode (referencing
the form) as will the control's DisplayMode property (referencing the data card):

MODE DISPLAYMODE DESCRIPTION

FormMode.Edit DisplayMode.Edit Data cards and controls are


editable, ready to accept changes
to a record.

FormMode.New DisplayMode.Edit Data cards and controls are


editable, ready to accept a new
record.

FormMode.View DisplayMode.View Data cards and controls are not


editable and optimized for
viewing.

Syntax
SubmitForm ( FormName )
FormName - Required. Form control to submit to the data source.
EditForm ( FormName )
FormName - Required. Form control to switch to FormMode.Edit mode.
NewForm ( FormName )
FormName - Required. Form control to switch to FormMode.New mode.
ResetForm ( FormName )
FormName - Required. Form control to reset to initial values. Also switches the form from
FormMode.New mode to FormMode.Edit mode.
ViewForm ( FormName )
FormName - Required. Form control to switch to FormMode.View mode.

Examples
See Understand data forms for complete examples.
1. Add a Button control, set its Text property to show Save, and set its OnSelect property to
this formula:
SubmitForm ( EditForm )
2. Set the OnFailure property of a Form control to blank and its OnSuccess property to this
formula:
Back()
3. Name a Label control ErrorText, and set its Text property to this formula:
EditForm.Error
When the user selects the Save button, any changes in the Form control are submitted to
the underlying data source.
If the submission succeeds, any changes are saved or, if the Form control is in New
mode, a record is created. ErrorText is blank and the previous screen reappears.
If the submission fails, ErrorText shows a user-friendly error message, and the current
screen remains visible so that the user can correct the problem and try again.
4. Add a Button control, set its Text property to show Cancel, and set its OnSelect property
to this formula:
ResetForm ( EditForm ); Back()
When the user selects the Cancel button, the values in the Form control are reset to what
they were before the user started to edit it, the previous screen reappears, and the Form
control is returned to Edit mode if it was in New mode.
5. Add a Button control, set its Text property to show New, and set its OnSelect property to
this formula:
NewForm ( EditForm ); Navigate( EditScreen, None )
When the user selects the New button, the Form control switches to New mode, the
default values for the Form control's data source populate that control, and the screen that
contains the Form control appears. When the SubmitForm function runs, a record is
created instead of updated.
Day, Month, Year, Hour, Minute, Second, and
Weekday functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Returns individual components of a Date/Time value.

Description
The Day function returns the day component of a Date/Time value, ranging from 1 to 31.
The Month function returns the month component of a Date/Time value, ranging from 1 to 12.
The Year function returns the year component of a Date/Time value, starting with 1900.
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 Second function returns the second component of a Date/Time value, ranging from 0 to 59.
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:

EXCEL CODE STARTOFWEEK ENUMERATION DESCRIPTION

1, 17 StartOfWeek.Sunday Numbers 1 (Sunday) through 7


(Saturday). Default.

2, 11 StartOfWeek.Monday Numbers 1 (Monday) through 7


(Sunday).

3 StartOfWeek.MondayZero Numbers 0 (Monday) through 6


(Sunday).

12 StartOfWeek.Tuesday Numbers 1 (Tuesday) through 7


(Monday).

13 StartOfWeek.Wednesday Numbers 1 (Wednesday) through 7


(Tuesday).

14 StartOfWeek.Thursday Numbers 1 (Thursday) through 7


(Wednesday).

15 StartOfWeek.Friday Numbers 1 (Friday) through 7


(Thursday).

16 StartOfWeek.Saturday Numbers 1 (Saturday) through 7


(Friday).

All functions return a number.


See working with dates and times for more information.
Syntax
Day( DateTime )
Month( DateTime )
Year( DateTime )
Hour( DateTime )
Minute( DateTime )
Second( DateTime )
DateTime - Required. Date/Time value to operate on.
Weekday( DateTime [, WeekdayFirst ] )
DateTime - Required. Date/Time value to operate on.
WeekdayFirst - Optional. Excel code specifying which day starts the week. If not supplied, 1 (Sunday first) is
used.

Examples
For the following example, the current time is 3:59:37 PM on Thursday, April 9, 2015.

FORMULA DESCRIPTION RESULT

Year( Now() ) Returns the year component of the 2015


current time and date.

Month( Now() ) Returns the month component of the 4


current time and date.

Day( Now() ) Returns the day component of the 9


current time and date.

Hour( Now() ) Returns the hour component of the 15


current time and date.

Minute( Now() ) Returns the minute component of the 59


current time and date.

Second( Now() ) Returns the minute component of the 37


current time and date.

Weekday( Now() ) Returns the weekday component of the 5


current time and date, using the default
start of the week as Sunday.

Weekday( Now(), 14 ) Returns the weekday component of the 1


current time and date, using an Excel
code to specify the start of the week as
Thursday.

Weekday( Now(), StartOfWeek.Wed Returns the weekday component of the 2


nesday ) current time and date, using a
StartOfWeek enumeration to specify
the start of the week as Wednesday.
With function in Power Apps
2/8/2020 • 4 minutes to read • Edit Online

Calculates values and performs actions for a single record, including inline records of named values.

Description
The With function evaluates a formula for a single record. The formula can calculate a value and/or perform
actions, such as modifying data or working with a connection. Use the ForAll function to evaluate a formula for
all the records in a table of records.
Fields of the record currently being processed are available within the formula. You simply reference them by
name as you would any other value. You can also reference control properties and other values from throughout
your app. For more details, see the examples below and working with record scope.
Use With to improve the readability of complex formulas by dividing it into smaller named sub-formulas. These
named values act like simple local variables confined to the scope of the With. The same inline record syntax that
is used with the UpdateContext function can be used with With. Using With is preferred over context or global
variables as it is self contained, easy to understand, and can be used in any declarative formula context.
Use With to access the fields of the record that are returned by functions such as such as Patch or Match. With
holds the value from these functions long enough to be used in further calculations or actions.
If the Record argument to With is an error, that error will be returned by the function and the Formula will not be
evaluated.

Syntax
With( Record, Formula )
Record – Required. The record to be acted upon. For names values, use the inline syntax
{ name1: value1, name2: value2, ... }
Formula – Required. The formula to evaluate for Record. The formula can reference any of the fields of Record
directly as a record scope.

Examples
Simple named values

With( { radius: 10,


height: 15 },
Pi() * (radius*radius) * height
)
// Result: 4712.38898038 (as shown in a label control)

This example uses a record of named values to calculate the volume of a cylinder. With is being used to capture
all the input values together, making it easy to separate them from the calculation itself.
Nested With
With( { AnnualRate: RateSlider/8/100, // slider moves in 1/8th increments and convert to decimal
Amount: AmountSlider*10000, // slider moves by 10,000 increment
Years: YearsSlider, // slider moves in single year increments, no adjustment
required
AnnualPayments: 12 }, // number of payments per year
With( { r: AnnualRate/AnnualPayments, // interest rate
P: Amount, // loan amount
n: Years*AnnualPayments }, // number of payments
r*P / (1 - (1+r)^-n) // standard interest calculation
)
)

This example nests With functions to create a two-tier calculation for monthly mortgage payments. As long as
there is no conflict, all of the outer With named values are available within the inner With.
Since the slider controls can only move in increments of 1, the sliders are divided or multiplied to create
effectively a custom increment. In the case of the interest rate, the RateSlider has its Max property set to 48,
divided by 8 for a 1/8 percentage point increment and divided by 100 to convert from a percentage to a decimal,
covering the range 0.125% to 6%. In the case of of the loan amount, the AmountSlider has its Max property set
to 60 and multiplied by 10,000, covering the range 10,000 to 600,000.
The With is automatically recalculated as the sliders move and the new loan payment displayed. No variables are
used and there is no need to use the OnChange property of the slider controls.
Here are the detailed instructions for creating this app:
1. Create a new app.
2. Add a Slider control and name it RateSlider. Set its Max property to 48.
3. Add a Label control to the left of the slider control. Set its Text property to "Interest Rate:".
4. Add a Label control to the right of the slider control. Set its Text property to the formula RateSlider/8 &
" %".
5. Add another Slider control and name it AmountSlider. Set its Max property to 60.
6. Add a Label control to the left of this slider control. Set its Text property to "Loan Amount:".
7. Add a Label control to the right of this slider control. Set its Text property to the formula AmountSlider/8 *
10000.
8. Add another Slider control and name it YearsSlider. Set its Max property to 40.
9. Add a Label control to the left of this slider control. Set its Text property to "Number of Years:".
10. Add a Label control to the right of this slider control. Set its Text property to the formula YearsSlider.
11. Add a Label control and set its Text property to the formula shown above.
12. Add a Label control to the left of the last label control. Set its Text property to "Recurring Monthly
Payment:".
Primary key returned from Patch

With( Patch( Orders, Defaults( Orders ), { OrderStatus: "New" } ),


ForAll( NewOrderDetails,
Patch( OrderDetails, Defaults( OrderDetails ),
{ Order: OrderID, // from With's first argument, primary key of Patch result
Quantity: Quantity, // from ForAll's NewOrderDetails table
ProductID: ProductID } // from ForAll's NewOrderDetails table
)
)
)

This example adds a record to the Order table in SQL Server. It then uses the returned primary key for the order,
returned by the Patch function in the OrderID field, to create related records in the OrderDetails table.
Extracted values with a regular expression

With(
Match( "PT2H1M39S", "PT(?:(?<hours>\d+)H)?(?:(?<minutes>\d+)M)?(?:(?<seconds>\d+)S)?" ),
Time( Value( hours ), Value( minutes ), Value( seconds ) )
)
// Result: 2:01 AM (as shown in a label control, use the Text function to see the seconds)

This example extracts the hours, minutes, and seconds from an ISO 8601 duration value and then uses these sub-
matches to create a Date/Time value.
Note that although the sub-matches contain numbers they are still in a text string. Use the Value function to
convert to a number before performing mathematical operations.
Day, Month, Year, Hour, Minute, Second, and
Weekday functions in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Returns individual components of a Date/Time value.

Description
The Day function returns the day component of a Date/Time value, ranging from 1 to 31.
The Month function returns the month component of a Date/Time value, ranging from 1 to 12.
The Year function returns the year component of a Date/Time value, starting with 1900.
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 Second function returns the second component of a Date/Time value, ranging from 0 to 59.
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:

EXCEL CODE STARTOFWEEK ENUMERATION DESCRIPTION

1, 17 StartOfWeek.Sunday Numbers 1 (Sunday) through 7


(Saturday). Default.

2, 11 StartOfWeek.Monday Numbers 1 (Monday) through 7


(Sunday).

3 StartOfWeek.MondayZero Numbers 0 (Monday) through 6


(Sunday).

12 StartOfWeek.Tuesday Numbers 1 (Tuesday) through 7


(Monday).

13 StartOfWeek.Wednesday Numbers 1 (Wednesday) through 7


(Tuesday).

14 StartOfWeek.Thursday Numbers 1 (Thursday) through 7


(Wednesday).

15 StartOfWeek.Friday Numbers 1 (Friday) through 7


(Thursday).

16 StartOfWeek.Saturday Numbers 1 (Saturday) through 7


(Friday).

All functions return a number.


See working with dates and times for more information.

Syntax
Day( DateTime )
Month( DateTime )
Year( DateTime )
Hour( DateTime )
Minute( DateTime )
Second( DateTime )
DateTime - Required. Date/Time value to operate on.
Weekday( DateTime [, WeekdayFirst ] )
DateTime - Required. Date/Time value to operate on.
WeekdayFirst - Optional. Excel code specifying which day starts the week. If not supplied, 1 (Sunday first) is
used.

Examples
For the following example, the current time is 3:59:37 PM on Thursday, April 9, 2015.

FORMULA DESCRIPTION RESULT

Year( Now() ) Returns the year component of the 2015


current time and date.

Month( Now() ) Returns the month component of the 4


current time and date.

Day( Now() ) Returns the day component of the 9


current time and date.

Hour( Now() ) Returns the hour component of the 15


current time and date.

Minute( Now() ) Returns the minute component of the 59


current time and date.

Second( Now() ) Returns the minute component of the 37


current time and date.

Weekday( Now() ) Returns the weekday component of 5


the current time and date, using the
default start of the week as Sunday.

Weekday( Now(), 14 ) Returns the weekday component of 1


the current time and date, using an
Excel code to specify the start of the
week as Thursday.

Weekday( Now(), StartOfWeek.We Returns the weekday component of 2


dnesday ) the current time and date, using a
StartOfWeek enumeration to specify
the start of the week as Wednesday.
Create a canvas app from within a solution
12/3/2019 • 3 minutes to read • Edit Online

Create an app from within a solution if, for example, you want to deploy the app to a different environment.
Solutions can contain not only apps but also customized entities, option sets, and other components. You can
quickly customize an environment in a variety of ways by creating apps and other components from within a
solution, exporting the solution, and then importing it into another environment.
For more information about solutions, see Solutions overview.

Prerequisite
To follow the steps in this topic, you must switch to an environment that contains a Common Data Service
database.

Create a solution
You can skip this procedure if you already have a solution in which you want to create an app or to which you
want to link an app.
1. Sign in to Power Apps, and then (if necessary) switch to the appropriate environment:
If you want to create an app from within a solution, switch to any environment that contains a Common
Data Service database.
If you want to link an existing app to a solution, switch to the environment that contains that app.
2. In the left navigation bar, select Solutions.

3. In the banner under the title bar, select New solution.

4. In the window that appears, specify a display name, a publisher, and a version for your solution.
A name (with no spaces) will be generated automatically based on the display name that you specify, but
you can customize the generated name if you want. You can specify the default publisher for your
environment and 1.0 for the version if you don't have specific needs in those areas.
5. Near the upper-left corner, select Save and Close.

Create a canvas app in a solution


You can create a blank canvas app from within a solution. You can't automatically generate a three-screen app or
customize a template or sample app from within a solution.
1. Sign in to Power Apps.
2. If necessary, switch to the environment that contains the solution in which you want to create a canvas app.
3. In the left navigation bar, select Solutions.

4. In the list of solutions, select the solution in which you want to create a canvas app.
5. In the banner under the title bar, select New > App > Canvas app, and then select the form factor (phone
or tablet) of the app that you want to create.

Power Apps Studio opens with a blank canvas in another browser tab.
6. Create your app (or make at least one change), and then save your changes.
7. On the browser tab where you selected your solution, select Done to refresh the list of components in your
solution.

Your new app appears in the list of components for that solution. If you save any changes to your app, they
will be reflected in the version that's in the solution.

Link an existing canvas app to a solution


If you want to link an app to a solution, both must be in the same environment, and the app must have been
created from within a solution.
1. Sign in to Power Apps.
2. If necessary, switch to the environment that contains the solution to which you want to link an app.
3. In the left navigation bar, select Solutions.

4. In the list of solutions, select the solution to which you want to link an app.
5. In the banner under the title bar, select Add existing > App > Canvas app.
A list of canvas apps that were created within a solution in this environment appears.
6. In the list of apps, select the app that you want to link to the solution, and then select Add.

Known limitations
For information about known limitations, see Use solutions in Power Apps.

Next steps
Create or link more apps and other components, such as entities, flows, and dashboards, to your solution.
Export your solution so that you can deploy it to another environment, on AppSource, and so forth.
Install Northwind Traders database and apps
12/3/2019 • 3 minutes to read • Edit Online

By following the steps in this series of topics, you can discover concepts about relational data as implemented in a
sample database in Common Data Service. You can also explore sample business apps, both canvas and model-
driven, for managing that data and earn practical experience by creating such an app. This first topic explains how
to install the Northwind Traders database in your own environment and gain access to the sample apps, which you
can open for editing to reveal how they were built.
Northwind Traders is a fictitious organization that manages orders, products, customers, suppliers, and many other
aspects of a small business. This sample appeared with the first versions of Microsoft Access and is still available
as an Access template.

Prerequisites
A Power Apps license that supports Common Data Service. You can use a free trial license for 30 days.
An environment with a Common Data Service database. You can create such an environment if you have
appropriate permissions.

Download the solution


Download the Northwind Traders Solution File
This solution file (.zip) contains the definitions of entities, option sets, and business processes; the canvas and
model-driven apps; and any other pieces that are used together.

Install the solution


1. Sign in to Power Apps, and then ensure that you're working in an environment that contains a Common
Data Service database.
2. In the left navigation pane, select Solutions, and then select Import in the toolbar near the top of the
screen:

3. In the Select Solution Package page, select Browse.


4. Find the file that you downloaded, and then select Open.
Unless you selected a different location, the file will be in your Downloads folder.
5. If you have the correct file (the version number might vary), select Next:

6. In the Solution Information page, select Next if the name of the solution and the publisher are correct.

7. In the Import Options page, select Import to confirm SDK message handling, which the sample requires:
Another page appears and shows progress as the solution is installed over the next few minutes:

When the installation finishes, the original page shows the result:
8. Select Close.

Load the sample data


1. Select Apps, and then select Northwind Sample Data.
Wait a few minutes if the Northwind apps don't appear immediately after you install the solution:

2. When the app asks for permission to interact with Common Data Service, select Allow:
3. After the app loads and shows that the sample entities contain no records, select Load Data to populate the
entities:

As the app loads the data, dots march across the top of the app, and the number of records increases.
Entities are loaded in a specific order so that relationships can be established between records. For example,
the Order Details entity has a many-to-one relationship with the Orders and Order Products entities,
which are loaded first.
You can cancel the process at any time by selecting Cancel, and you can remove the data at any time by
selecting Remove Data:
When the data finishes loading, the last row (Many to Many Relationships) shows Done, and the Load
Data and Remove Data buttons are enabled again:

Sample apps
The Northwind solution includes these apps for interacting with this data:
Northwind Orders (Canvas)
Northwind Orders (Model-driven)
You open these apps the same way that you opened the app in the previous procedure.
Canvas
This single-screen app offers a simple master-detail view of the Orders entity, where you can view and edit a
summary of the order and each line item for an order. A list of orders appears near the left edge, and you can
select an arrow in that list to show a summary and the details of that order. More information: Overview of the
canvas app for Northwind Traders.

Model-driven
This app operates on the same data (in the Orders entity) as the canvas app. In the list of orders, show more
information about an order by selecting its number:

A summary of the order appears on a separate form:


If you scroll down the form, it shows the same line items as the canvas app does:

Do it yourself
You can follow step-by-step instructions to create the canvas app shown earlier in this topic. The instructions are
divided into three parts:
1. Create an order gallery.
2. Create a summary form.
3. Create a detail gallery.
If you want to skip ahead, the solution contains a starting-point app for each part. In the list of apps, look for
Northwind Orders (Canvas) - Begin Part 1 and so on.
This overview of the app explains the user interface, data sources, and how relationships are used.
Start by reading the overview
Overview of the canvas app for Northwind Traders
10/7/2019 • 4 minutes to read • Edit Online

Learn about the canvas app for managing relational data in the Northwind Traders database that you installed in
your environment. Then follow step-by-step instructions in subsequent topics to build this app from scratch,
thereby gaining hands-on experience working with relational data.
In this topic, discover:
How an app user shows and manages relational data in the app.
Which types of data drive the app.
How relationships between those types of data were created.
In a single screen, the app user can show, update, create, and delete orders.

Explore the user interface


Order gallery
On the left edge of the app, a gallery shows a list of orders, including the order number, the status, the name of the
customer, and the total cost of the order. The user can scroll through the list to find an order and then show more
information about it by selecting the order's arrow. More information: Create the order gallery.
Summary form
In the upper-right corner, a form summarizes the order that the user selected in the order gallery. The summary
includes much of the same information as that gallery does, but the summary also shows the dates when the
order was created and paid, as well as the name and the picture of the employee who managed the order. The user
can change the data in the form, save those changes, cancel them, or delete the order by selecting an icon near the
right edge of the title bar. More information: Create the summary form.
Detail gallery
In the lower-right corner, another gallery shows information about which products the selected order contains and
in what quantities. Each item in this gallery is known as an order detail. The app user can add and delete any item
in that gallery by using controls in and under it. More information: Create the detail gallery.

Explore the data sources


To create this app, you'll show data from five entities and an option set. In fact, most areas of this app show data
from multiple entities. For example, the order gallery contains this information:
The order number is a field in the Orders entity.
The status is another field in the Orders entity, an option from the Orders Status option set.
The customer name is a field in the Customers entity.
The total cost is calculated based on data in the Order Details entity.
The summary contains some of the same information as the list of orders, but it also contains the name and the
picture of the employee who managed the order. That information is pulled from fields in the Employees entity.
The detail gallery shows records in the Order Details entity, and each product in those details is a record in the
Order Products entity.

Explore the relationships


You can show data from different sources (for example, entities) in the same gallery or form because those entities
have relationships that were created for you in the database.
Many-to -one relationships
For example, information about the customer and the employee for each order resides in the Customers and
Employees entities. Therefore, the Orders entity has many-to-one relationships with those entities because there
are many orders, each of which can be placed by only one customer and managed by only one employee.
Each order also has one or more line items that represent the products that the order contains and their quantities.
Each line item is a record in the Order Details entity, which pulls information about each product from the Order
Products entity. Each detail identifies only one product, but each product can appear in multiple details. Therefore,
the Order Details entity has a many-to-one relationship with the Order Products entity.
One -to -many relationships
Each order can contain multiple line items, but each line item relates to only one order. Therefore, the Orders
entity has a one-to-many relationship with the Order Details entity.
Dot notation for relationships
To show data based on a relationship between entities, you can use the dot property selector to walk across a
relationship from one entity to another. For example, each record in the Orders entity pulls information from the
Customers entity so that the order gallery can show the customer names. In that gallery, you configure this
behavior by setting the Text property of a label to this expression:
ThisItem.Customer.Company

ThisItem specifies a record in the Orders entity and pulls information from the Customers entity about the
customer who placed the order. In this case, the expression specifies that the customer's company name appears.
However, the entire record for that customer is pulled, so you could just as easily show, for example, an email
address for that customer instead.
As another example of walking from one entity to another, you can specify that a gallery should show records in
one entity based on a record that the user selected in another gallery and that's in another entity. To show the
order details, you'll set the detail gallery's Items property to this expression:
Gallery1.Selected.'Order Details'

In this case, Gallery1.Selected specifies a record in the Orders entity, just as ThisItem did in the previous
example. However, this expression doesn't pull just one record as the previous expression did. Instead, it pulls an
entire table of records to show the name and per-unit cost of each product (as reflected in the Order Products
entity) and the quantity (as reflected in the Order Details entity).

Do it yourself
You can follow step-by-step instructions to create the Northwind Orders canvas app. The instructions are divided
into three parts:
1. Create an order gallery.
2. Create a summary form.
3. Create a detail gallery.
If you want to skip ahead, the solution contains a starting-point app for each part. In the list of apps, look for
Northwind Orders (Canvas) - Begin Part 1 and so on.
Continue by creating the order gallery
Create an order gallery in a canvas app
12/3/2019 • 7 minutes to read • Edit Online

Follow step-by-step instructions to create an order gallery in a canvas app for managing fictitious data in the
Northwind Traders database. This topic is part of a series that explains how to build a business app on relational
data in Common Data Service. For best results, explore these topics in this sequence:
1. Create an order gallery ( this topic).
2. Create a summary form.
3. Create a detail gallery.

Prerequisites
Install the Northwind Traders database and apps.
Read through the overview of the canvas app for Northwind Traders.

Create a blank app


1. Sign in to Power Apps, and then create a blank tablet app.
2. Name your app whatever you like, and then select Create.

Power Apps Studio opens so that you can add data sources and controls to your app:
Add the data
1. On the View tab, select Data sources:

2. Type orders into the search box:

3. Select the Orders data source to use in your app:


The Orders entity contains many fields of various types:

Each field has a Display name and a Name, which is sometimes called the logical name. Both names
refer to the same thing. In general, you'll use the display name when you build an app, but some cases
require the more cryptic Name, as noted in a procedure.
4. As we will be working with screens and controls next, in Power Apps Studio switch back to the Tree View
on the left hand side by pressing the three stacked squares icon. You can return to the Data Sources at
any time by pressing the cylinder icon.

Create the order gallery


1. On the Insert tab, select Gallery > Blank vertical to add a Gallery control, which will show the orders.
The control will be placed on the canvas and a fly out dialog will appear asking which data source to
connect to.

2. We could connect it directly to Orders here, but instead we'd like to control the sort order of the gallery.
Ignore the fly out dialog and in the formula bar set the gallery's Items property to this formula:

Sort( Orders, 'Order Number', Descending )

The Sort function orders the list so that the newest order (which has the highest order number) appears
first.
3. After a few moments the Result View will appear below the formula bar. Pull down on the arrow at the left
to see the result of our formula. Scroll to the right to see the Order Number column and ensure it is
sorted the way want (highest to lowest).

4. In the Properties tab near the right edge, open the Layout list:

5. In the list of options, select Title and subtitle:


Two Label controls are added in the gallery's template. By default, these controls show two columns of the
Orders entity, which you'll change next. The gallery's template is replicated vertically for each record in the
entity.
6. Select Edit (next to Fields) in the Properties tab near the right edge.

7. In the Data pane, select Title1 (or select the upper label in the gallery's template).
8. In the formula bar, set the label's Text property to this expression:

"Order " & ThisItem.'Order Number'


The order number appears at the top of each gallery item. In the gallery template, ThisItem grants access
to all fields in the Order entity.
9. In the Data pane, select Subtitle1 (or select the lower label in the gallery's template):

10. In the formula bar, set the label's Text property to this expression:

ThisItem.Customer.Company
After you enter this formula, it may show a red squiggly error for a moment. The error should clear if you
select anything outside the formula bar and then return the cursor to the formula bar. If the error persists
or you don't see a value, select the View tab, select Data sources, and then refresh the Orders entity by
selecting the ellipsis (...) to the right of the data-source name.
When you specify ThisItem.Customer, you're leveraging a many-to-one relationship between the Orders
and Customers entities and retrieving the customer record that's associated with each order. From the
customer record, you're extracting data in the Company column for display.
You can show all the relationships from the Orders entity to other entities, including the Customer entity:

11. Close the Data pane by selecting the close icon (x) in its upper-right corner.

Show each order's status


In this procedure, you'll add space in the gallery for a label and configure it to show each order's status in a
different color based on the data.
1. In the gallery's template, reduce the width of the first label, Title1:
2. Repeat the previous step with the second label, Subtitle1:

3. With the gallery template (or a control in the template) selected, select Label on the Insert tab:
4. Move the new label to the right of the Title1 label:

5. Set the Text property of the new label to this expression:

ThisItem.'Order Status'

In the Orders entity, the Order Status field holds a value from the Orders Status option set. An option set
is similar to an enumeration in other programming tools. Each set of options is defined in the database, so
users can specify only those options that are in the set. The Orders Status option set is also global, not
local, so you can use it in other entities:
Each option in a set has a name that appears if you show it in a label. These names can be localized, and
the app recognizes the same option whether an English user selects Apple, a French user selects Pomme,
or a Spanish user selects Manzana. For this reason, you can't create a formula that relies on a hard-coded
string for an option, as this topic demonstrates later.
In formulas, you must surround Order Status with single quotation marks because it contains a space.
However, that name functions the same way as any other name in Power Apps, such as Customer or
Company, does.
6. On the Home tab, increase the font size of the status label to 20 points, and right align the text:

7. In the formula bar, set the Color property of the status label to this formula:

Switch( ThisItem.'Order Status',


'Orders Status'.Closed, Green,
'Orders Status'.New, Black,
'Orders Status'.Invoiced, Blue,
'Orders Status'.Shipped, Purple
)
Power Apps prevents you from creating a formula that relies on a hard-coded string for each option in a
set because such formulas could produce inappropriate results if the option names are localized. Instead,
the Switch function determines the color based on whatever string appears in the label based on the
user's settings.
With this formula in place, different status values appear in different colors, as the previous graphic shows.

Display each order's total


1. Select the first item in the gallery, which is the gallery's template:

2. On the Insert tab, select Label to add another label:


3. Move the new label so that it appears under the status label:

4. In the formula bar, set the new label's Text property to this formula:

Text( Sum( ThisItem.'Order Details', Quantity * 'Unit Price' ), "[$-en-US]$ #,###.00" )


In this formula, the Sum function adds up the records in the Order Details entity that are associated with
each record in the Order entity through a one-to-many relationship. These line items make up each order,
and you'll use the same one-to-many relationship to show and edit the line items in the lower-right area of
the screen.
This formula shows a blue underline and a delegation warning because Common Data Service doesn't
support delegation of complex aggregate functions (for example, the sum of a multiplication). You can
ignore this information because no order in this example will contain more than 500 line items. If
necessary for a different app, you can increase that limit in App settings.
The Text function in this formula adds a currency symbol and formats the result with thousands and
decimal separators. As written, the formula includes the language tag for U.S. English ([$-en-US ]) and a
dollar symbol ($). If you remove the language tag, it will be replaced with one based on your language
settings, and the label will show the appropriate formats for that tag. If you leave the dollar symbol, the
label will show the appropriate currency symbol based on the user's settings. However, you can force a
different symbol to appear by replacing the dollar symbol with the one that you prefer.
5. On the Home tab, change the font size of the newest label to 20 points, and right align its text:

6. Move the gallery to the left edge of the screen, and decrease the gallery's width to close up some space.
7. Increase the gallery's height so that it's almost as tall as the screen, but leave a little room at the top for a
title bar, which you'll add at the start of the next topic:

Summary
To recap, you started to build a single-screen canvas app by adding the order gallery, which includes these
elements:
An expression to show the order number: "Orders " & ThisItem.OrderNumber
A field in a many-to-one relationship: ThisItem.Customer.Company
A label that shows the name of an option in a set: ThisItem.'Order Status'
A label that changes format based on which option in a set the label shows:
Switch( ThisItem.'Order Status', 'Orders Status'.Closed, Green, ...
A complex aggregate function over a one-to-many relationship:
Sum( ThisItem.'Order Details', Quantity * 'Unit Price' )

Next topic
In the next topic, you'll add an Edit form control to display and edit an summary of whatever order the user
selects in the gallery that you just created.
Create the summary form
Create a summary form in a canvas app
11/7/2019 • 11 minutes to read • Edit Online

Follow step-by-step instructions to create a summary form in a canvas app for managing fictitious data in the
Northwind Traders database. This topic is part of a series that explains how to build a business app on relational
data in Common Data Service. For best results, explore these topics in this sequence:
1. Create an order gallery.
2. Create a summary form ( this topic).
3. Create a detail gallery.

Prerequisites
1. Install the Northwind Traders database and apps.
2. Review the overview of the canvas app for Northwind Traders.
3. Create the order gallery yourself, or open the Northwind Orders (Canvas) - Begin Part 2 app, which
already contains that gallery.

Add a title bar


Across the top of the app, create a title bar, which will hold action buttons by the end of this topic.
1. In the Tree view pane, select Screen1 to ensure that you don't accidentally add a control to the order
gallery:
2. On the Insert tab, select Label to insert a Label control:

The new label should appear only once, above the gallery. If it appears in each item of the gallery, delete
the first instance of the label, ensure that the screen is selected (as the previous step describes), and then
insert the label again.
3. Move and resize the new label to span the top of the screen:
4. Double-click the text of the label, and then type Northwind Orders.
As an alternative, modify the Text property in the formula bar to achieve the same result:

5. On the Home tab, format the label:


Increase the font size to 24 points.
Make the text bold.
Make the text white.
Center the text.
Add a dark-blue fill to the background.
Add an Edit form control
In this section, you'll add controls to show a summary of any order that the user selects in the gallery.
1. On the Insert tab, insert an Edit form control:

By default, the form appears in the upper-left corner, where other controls might make it difficult to find:
2. Move and resize the form to cover the upper-right corner of the screen under the title bar:

3. In the Properties pane, select the Data source drop down.

4. Select the Orders data source.


Add and arrange fields
1. In the Properties tab near the right edge, select Edit fields to open the Fields pane.

2. If the Fields pane is not empty, remove the fields that have already been inserted.

3. After the fields list is empty, select Add field, and then select the check boxes for the Customer and
Employee fields.
4. Scroll down until these fields appear, and then select their check boxes:
Notes
Order Date
Order Number
Order Status
Paid Date
5. At the bottom of the Fields pane, select Add, and then close the Fields pane.
The form shows seven fields, which may be in a different order:

NOTE
If any field shows a red error icon, a problem might have occurred when data was pulled from the source. To resolve
the error, refresh the data:
1. On the View tab, select Data sources.
2. In the Data pane, select Data sources.
3. Next to Orders, select the ellipsis (...), select Refresh, and then close the Data pane.
If the combo box for the customer or employee name still shows an error, check the Primary text and SearchField
of each box by selecting it and then opening the Data pane. For the customer box, both fields should be set to
nwind_company. For the employee box, both fields should be set to nwind_lastname.

6. With the form selected, change the number of columns in the form from 3 to 12 in the Properties tab near
the right edge.
This step adds flexibility as you arrange the fields:
Many UI designs rely on 12-column layouts because they can evenly accommodate rows of 1, 2, 3, 4, 6,
and 12 controls. In this topic, you'll create rows that contain 1, 2, or 4 controls.
7. Move and resize the fields by dragging their handles, just as you would any other control, so that each row
contains these data cards in the specified order:
First row: Order Number, Order Status, Order Date, and Paid Date
Second row: Customer and Employee
Third row: Notes

NOTE
You might find it easier to widen the Notes, Customer, and Employee data cards before you arrange them.

More information about how to arrange fields in a form: Understand data-form layout for canvas apps.

Hide time controls


In this example, you don't need the time portions of the date fields because that level of granularity can distract
the user. If you delete them, you might cause problems in formulas that rely on those controls to update date
values or determine the position of another control in the data card. Instead, you'll hide the time controls by
setting their Visible property.
1. In the Tree view pane, select the Order Date data card.
The card might have a different name, but it contains Order Date.
2. While holding down the Shift key, select the hour, minute, and colon-separator controls in the Order Date
data card.

3. Set the controls' Visible property to false.


All selected controls disappear from the form:

4. Resize the Date picker control to show the complete date:


Next, you'll repeat the last few steps for the Paid Date field.
5. In the Tree view pane, select the time controls in the Paid Date data card:

6. Set the selected controls' Visible property to false:


7. Resize the date picker in the Date Paid card:

Connect the order gallery


1. In the Tree view pane, collapse the form to more easily find the name of the order gallery, and then, if
necessary, rename it to Gallery1.
2. Set the summary form's Item property to this expression:

Gallery1.Selected
The form shows an summary of whatever order the app user selects in the list.

Replace a data card


Order number is an identifier that Common Data Service assigns automatically when you create a record. This
field has a Text input control by default, but you'll replace it with a label so that the user can't edit this field.
1. Select the form, select Edit fields in the Properties tab near the right edge, and then select the Order
number field:
2. Open the Control type list:

3. Select the View text data card:

4. Close the Fields pane.


The user can no longer change the order number:
5. On the Home tab, change the order number's font size to 20 points so that the field is easier to find:

Use a many-to-one relationship


The Orders entity has a many-to-one relationship with the Employees entity: each employee can create many
orders, but each order can be assigned to only one employee. When the user selects an employee in the Combo
box control, its Selected property provides that employee's entire record from the Employees entity. As a result,
you can configure an Image control to show the picture of whatever employee the user selects in the combo box.
1. Select the Employee data card:
2. In the Advanced tab near the right edge, unlock the data card so that you can edit formulas that were
previously read-only:

3. In the data card, reduce the width of the combo box to make room for the employee picture:

4. On the Insert tab, select Media > Image:


An image appears in the data card, which expands to accommodate it:

5. Resize the image, and move it to the right of the combo box:
6. Set the Image property of the image to this formula, replacing the number at the end of DataCardValue if
necessary:

DataCardValue7.Selected.Picture

The picture of the selected employee appears.


7. While holding down the Alt key, select a different employee in the combo box to confirm that the picture
also changes.

Add a Save icon


1. In the Tree view pane, select Screen1, and then select Insert > Icons > Check:
The Check icon appears in the upper-left corner by default, where other controls might make the icon
difficult to find:

2. On the Home tab, change the Color property of the icon to white, resize the icon, and move it near the
right edge of the title bar:

3. In the Tree view pane, confirm that the form's name is Form1, and then set the icon's OnSelect property
to this formula:
SubmitForm( Form1 )

When the user selects the icon, the SubmitForm function gathers any changed values in the form and
submits them to the data source. Dots march across the top of the screen as the data is submitted, and the
order gallery reflects the changes after the process finishes.
4. Set the icon's DisplayMode property to this formula:

If( Form1.Unsaved, DisplayMode.Edit, DisplayMode.Disabled )

If all changes in the form have been saved, the icon is disabled and appears in the DisabledColor, which
you'll set next.
5. Set the icon's DisabledColor property to this value:

Gray
The user can save changes to an order by selecting the Check icon, which is then disabled and dimmed
until the user makes another change:

Add a Cancel icon


1. On the Insert tab, select Icons > Cancel:
The icon appears in the upper-left corner by default, where other controls might make the icon difficult to
find:

2. On the Home tab, change the icon's Color property to white, resize the icon, and move it to the left of the
Check icon:

3. Set the Cancel icon's OnSelect property to this formula:

ResetForm( Form1 )
The ResetForm function discards all changes in the form, which returns it to its original state.
4. Set the Cancel icon's DisplayMode property to this formula:

If( Form1.Unsaved Or Form1.Mode = FormMode.New, DisplayMode.Edit, DisplayMode.Disabled )

This formula differs slightly from the one for the Check icon. The Cancel icon is disabled if all changes have
been saved or the form is in New mode, which you'll enable next. In that case, ResetForm discards the
new record.
5. Set the Cancel icon's DisabledColor property to this value:

Gray
The user can cancel changes to an order, and the Check and Cancel icons are disabled and dimmed if all
changes have been saved:

Add an Add icon


1. On the Insert tab, select Icons > Add.
The Add icon appears in the upper-left corner by default, where other controls might make it difficult to
find:

2. On the Home tab, set the Color property of the Add icon to white, resize the icon, and move it to the left
of the Cancel icon:

3. Set the Add icon's OnSelect property to this formula:

NewForm( Form1 )
The NewForm function shows a blank record in the form.
4. Set the Add icon's DisplayMode property to this formula:

If( Form1.Unsaved Or Form1.Mode = FormMode.New, DisplayMode.Disabled, DisplayMode.Edit )

The formula disables the Add icon under these conditions:


The user makes changes but doesn't save or cancel them, which is the opposite behavior from the
Check and Cancel icons.
The user selects the Add icon but makes no changes.
5. Set the Add icon's DisabledColor property to this value:

Gray
The user can create an order if they make no changes or they save or cancel any changes they've made. (If
the user selects this icon, they can't select it again until they make one or more changes and then save or
cancel those changes):

NOTE
If you create and save an order, you might need to scroll down in the order gallery to show your new order. It won't have a
total price because you haven't added any order details yet.

Add a Trash icon


1. On the Insert tab, select Icons > Trash.
The Trash icon appears in the upper-left corner by default, where other controls might make it difficult to
find:

2. On the Home tab, change the Trash icon's Color property to white, resize the icon, and move it to the left
of the Add icon:

3. Set the Trash icon's OnSelect property to this formula:


Remove( Orders, Gallery1.Selected )

The Remove function removes a record from a data source. In this formula, the function removes the
record that's selected in the order gallery. The Trash icon appears near the summary form (not the order
gallery) because the form shows more details about the record, so the user can more easily identify the
record that the formula will delete.
4. Set the Trash icon's DisplayMode property to this formula:

If( Form1.Mode = FormMode.New, DisplayMode.Disabled, DisplayMode.Edit )

This formula disables the Trash icon if the user is creating a record. Until the user saves the record, the
Remove function has no record to delete.
5. Set the Trash icon's DisabledColor property to this value:

Gray
The user can delete an order.

Summary
To recap, you added a form in which the user can show and edit a summary of each order, and you used these
elements:
A form that shows data from the Orders entity: Form1.DataSource = Orders
A connection between the form and the order gallery: Form1.Item = Gallery1.Selected
An alternate control for the Order number field: View text
A many-to-one relationship to show the employee's picture in the Employee data card:
DataCardValue1.Selected.Picture
An icon to save changes to an order: SubmitForm( Form1 )
An icon to cancel changes to an order: ResetForm( Form1 )
An icon to create an order: NewForm( Form1 )
An icon to delete an order: Remove( Orders, Gallery1.Selected )
Next step
In the next topic, you'll add another gallery to show the products in each order, and you'll change those details by
using the Patch function.
Create the detail gallery
Create a detail gallery in a canvas app
12/2/2019 • 13 minutes to read • Edit Online

Follow step-by-step instructions to create a detail gallery in a canvas app for managing fictitious data in the
Northwind Traders database. This topic is part of a series that explains how to build a business app on relational
data in Common Data Service. For best results, explore these topics in this sequence:
1. Create an order gallery.
2. Create a summary form.
3. Create a detail gallery ( this topic).

Prerequisites
Before you start this topic, you must install the database as described earlier in this topic. You must then either
create the order gallery and the summary form or open the Northwind Orders (Canvas) - Begin Part 3 app,
which already contains that gallery and that form.

Create another title bar


1. At the top of the screen, select the Label control that acts as a title bar, copy it by pressing Ctrl-C, and then
paste it by pressing Ctrl-V:
2. Resize and move the copy so that it appears just under the summary form.
3. Remove the text from the copy in either of these ways:
Double-click the text to select it, and then press Delete.
Set the label's Text property to an empty string ( "").

Add a gallery
1. Insert a Gallery control with a Blank vertical layout:
The new gallery, which will show order details, appears in the upper-left corner:

2. Close the fly out data source dialog, and then resize and move the detail gallery to the lower-right corner,
below the new title bar:

3. Set the Items property of the detail gallery to this formula:


Gallery1.Selected.'Order Details'

If an error appears, confirm that the order gallery is named Gallery1 (in the Tree view pane near the left
edge). If that gallery has a different name, rename it Gallery1.
You've just linked the two galleries. When the user selects an order in the order gallery, that selection
identifies a record in the Orders entity. If that order contains one or more line items, the record in the
Orders entity is linked to one or more records in the Order details entity, and data from those records
appears in the detail gallery. This behavior reflects the one-to-many relationship that was created for you
between the Orders and Order Details entities. The formula that you specified "walks" that relationship
by using dot notation:

Show product names


1. In the detail gallery, select Add an item from the Insert tab to select the gallery template:
Ensure that you've selected the gallery template instead of the gallery itself. The bounding box should be
slightly inside the gallery's boundary and probably shorter than the gallery's height. As you insert controls
into this template, they are repeated for each item in the gallery.
2. On the Insert tab, insert a label into the detail gallery.
The label should appear within the gallery; if it doesn't, try again, but make sure to select the gallery's
template before you insert the label.

3. Set the new label's Text property to this formula:

ThisItem.Product.'Product Name'

If no text appears, select the arrow for Order 0901 near the bottom of the order gallery.
4. Resize the label so that the full text appears:
This expression walks from a record in the Order Details entity. The record is held in ThisItem over to the
Order Products entity through a many-to-one relationship:

The Product Name field (and other fields that you're about to use) are extracted:

Show product images


1. On the Insert tab, insert an Image control into the detail gallery:
2. Resize and move the image and the label to be side by side.

TIP
For fine-grained control over the size and the position of a control, start to resize or move it without pressing the
Alt key, and then continue to resize or move the control while you hold down the Alt key:

3. Set the image's Image property to this formula:

ThisItem.Product.Picture

Again, the expression references a product that's associated with this order detail and extracting the
Picture field to display.
4. Reduce the height of the gallery's template so that more than one Order Detail record appears at a time:

Show product quantity and cost


1. On the Insert tab, insert another label into the detail gallery, and then resize and move the new label to the
right of the product information.
2. Set the new label's Text property to this expression:

ThisItem.Quantity

This formula pulls information directly from the Order Details entity (no relationship required).
3. On the Home tab, change the alignment of this control to Right:

4. On the Insert tab, insert another label into the detail gallery, and then resize and move the label to the
right of the quantity label.
5. Set the new label's Text property to this formula:

Text( ThisItem.'Unit Price', "[$-en-US]$ #,###.00" )

If you don't include the language tag ([$-en-US ]), it will be added for you based on your language and
region. If you use a different language tag, you'll want to remove the $ just after the close square bracket
(]), and then add your own currency symbol in that position.
6. On the Home tab, change the alignment of this control to Right:

7. On the Insert tab, insert another label control into the detail gallery, and then resize and move the new
label to the right of the unit price.
8. Set the new label's Text property to this formula:

Text( ThisItem.Quantity * ThisItem.'Unit Price', "[$-en-US]$ #,###.00" )

Again, if you don't include the language tag ([$-en-US ]), it will be added for you based on your language
and region. If the tag is different, you'll want to use your own currency symbol instead of the $ just after
the close square bracket (]).
9. On the Home tab, change the alignment of this control to Right:

You're done adding controls to the detail gallery for now.


10. In the Tree view pane, select Screen1 to ensure that the detail gallery is no longer selected.

Add text to the new title bar


1. On the Insert tab, insert another label on to the screen:
2. Resize and move the new label above the pictures of the products in the second title bar, and then change
the text's color to white on the Home tab.
3. Double-click the label's text, and then type Product:

4. Copy and paste the product label, and then resize and move the copy above the quantity column.
5. Double-click the new label's text, and then type Quantity:
6. Copy and paste the quantity label, and then resize and move the copy above the unit-price column.
7. Double-click the new label's text, and then type Unit Price:

8. Copy and paste the unit-price label, and then resize and move the copy above the extended-price column.
9. Double-click the text of the new label, and then type Extended:
Display order totals
1. Reduce the height of the detail gallery to make room for the order totals at the bottom of the screen:

2. Copy and paste the title bar in the middle of the screen, and then move the copy to the bottom of the
screen:
3. Copy and paste the product label from the middle title bar, and then move the copy to the bottom title bar,
just to the left of the Quantity column.
4. Double-click the new label's text, and then type this text:
Order Totals:

5. Copy and paste the order-totals label, and then resize and move the copy to the right of the order-totals
label.
6. Set the new label's Text property to this formula:

Sum( Gallery1.Selected.'Order Details', Quantity )

This formula shows a delegation warning, but you can ignore it because no single order will contain more
than 500 products.
7. On the Home tab, set the new label's text alignment to Right:
8. Copy and paste this label control, and then resize and move the copy under the Extended column.
9. Set the copy's Text property to this formula:

Text( Sum( Gallery1.Selected.'Order Details', Quantity * 'Unit Price' ), "[$-en-US]$ #,###.00" )

This formula shows a delegation warning, but you can ignore it because no single order will contain more
than 500 products.

Add space for new details


In any gallery, you can show data but you can't update it or add records. Under the detail gallery, you'll add an
area where the user can configure a record in the Order Details entity and insert that record into an order.
1. Reduce the height of the detail gallery enough to make room for a single-item editing space under that
gallery.
In this space, you'll add controls so that the user can add an order detail:
2. On the Insert tab, insert a label, and then resize and move it under the detail gallery.

3. Double-click the text of the new label, and then press Delete.
4. On the Home tab, set the new label's Fill color to LightBlue:
Select a product
1. On the Insert tab, select Controls > Combo box:

The Combo box control appears in the upper-left corner.


2. In the fly out dialog, select the Order Products data source:
3. In the Properties tab for the combo box, select Edit (next to Fields) to open the Data pane. Ensure that
the Primary text and SearchField are set to nwind_productname.
You specify the logical name because the Data pane doesn't support display names in this case yet:

4. Close the Data pane.


5. In the Properties tab near the right edge, scroll down, turn off Allow multiple selection, and ensure that
Allow searching is turned on:
6. Resize and move the combo box to the light-blue area, just under the product-name column in the detail
gallery:

In this combo box, the user will specify a record in the Product entity for the Order Details record that
the app will create.
7. While holding down the Alt key, select the combo box's down arrow.

TIP
By holding down the Alt key, you can interact with controls in Power Apps Studio without opening Preview mode.

8. In the list of products that appears, select a product:


Add a product image
1. On the Insert tab, select Media > Image:

The Image control appears in the upper-left corner:


2. Resize and move the image to the light-blue area under the other product images and next to the combo
box.
3. Set the Image property of the image to:

ComboBox1.Selected.Picture

You're using the same trick as you used to show the employee picture in the summary form. The Selected
property of the combo box returns the entire record of whatever product the user selects, including the
Picture field.

Add a quantity box


1. On the Insert tab, select Text > Text input:
The Text input control appears in the upper-left corner:

2. Resize and move the text-input box to the right of the combo box, under the quantity column in the detail
gallery:
By using this text-input box, the user will specify the Quantity field of the Order Details record.
3. Set the Default property of this control to "":

4. On the Home tab, set the text alignment of this control to Right:

Show the unit and extended prices


1. On the Insert tab, insert a Label control.
The label appears in the upper-left corner of the screen:
2. Resize and move the label to the right of the text-input control, and set the label's Text property to this
formula:

Text( ComboBox1.Selected.'List Price', "[$-en-US]$ #,###.00" )

This control shows the List Price from the Order Products entity. This value will determine the Unit
Price field in the Order Details record.

NOTE
For this scenario, the value is read-only, but other scenarios might call for the app user to modify it. In that case, use
a Text input control, and set its Default property to List Price.

3. On the Home tab, set the text alignment of the list-price label to Right:
4. Copy and paste the list-price label, and then resize and move the copy to the right of the list-price label.
5. Set the new label's Text property to this formula:

Text( Value(TextInput1.Text) * ComboBox1.Selected.'List Price', "[$-en-US]$ #,###.00" )

This control shows the extended price based on the quantity that the app user specified and the list price of
the product that the app user selected. It's purely informational for the app user.
6. Double-click the text-input control for quantity, and then type a number.
The Extended price label recalculates to show the new value:
Add an Add icon
1. On the Insert tab, select Icons > Add:

The icon appears in the upper-left corner of the screen.

2. Resize and move this icon to the right edge of the light-blue area, and then set the icon's OnSelect
property to this formula:
Patch( 'Order Details',
Defaults('Order Details'),
{
Order: Gallery1.Selected,
Product: ComboBox1.Selected,
Quantity: Value(TextInput1.Text),
'Unit Price': ComboBox1.Selected.'List Price'
}
);
Refresh( Orders );
Reset( ComboBox1 );
Reset( TextInput1 )

In general, the Patch function updates and creates records, and the specific arguments in this formula
determine the exact changes that the function will make.
The first argument specifies the data source (in this case, the Order Details entity) in which the
function will update or create a record.
The second argument specifies that the function will create a record with the default values for the
Order Details entity unless otherwise specified in the third argument.
The third argument specifies that four columns in the new record will contain values from the user.
The Order column will contain the number of the order that the user selected in order gallery.
The Product column will contain the name of the product that the user selected in the combo
box that shows products.
The Quantity column will contain the value that the user specified in the text-input box.
The Unit Price column will contain the list price of the product that the user selected for this
order detail.

NOTE
You can build formulas that use data from any column (in the Order Products entity) for whatever product the app
user selects in the combo box that shows products. When the user selects a record in the Order Products entity,
not only does the product’s name appear in that combo box but also the product’s unit price appears in a label.
Each lookup value in a canvas app references an entire record, not just a primary key.

The Refresh function ensures that the Orders entity reflects the record that you’ve just added to the Order
Details entity. The Reset function clears the product, quantity, and unit-price data so that the user can
more easily create another order detail for the same order.
3. Press F5, and then select the Add icon.
The order reflects the information that you specified:

4. (optional) Add another item to the order.


5. Press Esc to close Preview mode.

Remove an order detail


1. In the center of the screen, select the template of the detail gallery:

2. On the Insert tab, select Icons > Trash:


The Trash icon appears in the upper-left corner of gallery's template.

3. Resize and move the Trash icon to the right side of the detail gallery's template, and set the icon's
OnSelect property to this formula:

Remove( 'Order Details', ThisItem ); Refresh( Orders )


As of this writing, you can't remove a record directly from a relationship, so the Remove function removes
a record directly from the related entity. ThisItem specifies the record to remove, taken from the same
record in the detail gallery where the Trash icon appears.
Again, the operation uses cached data, so the Refresh function informs the Orders entity that the app has
changed one of its related entities.
4. Press F5 to open Preview mode, and then select the Trash icon next to each Order Details record that you
want to remove from the order.
5. Try adding and removing various order details from your orders:

In conclusion
To recap, you added another gallery to show order details and controls adding and removing an order detail in
the app. You used these elements:
A second gallery control, linked to the order gallery through a one-to-many relationship: Gallery2.Items =
Gallery1.Selected.'Order Details'
A many-to-one relationship from the Order Details entity to the Order Products entity:
ThisItem.Product.'Product Name' and ThisItem.Product.Picture
The Choices function to get a list of products: Choices( 'Order Details'.Product' )
The Selected property of a combo box as the complete many-to-one related record:
ComboBox1.Selected.Picture and ComboBox1.Selected.'List Price'
The Patch function to create an Order Details record:
Patch( 'Order Details', Defaults( 'Order Details' ), ... )
The Remove function to delete an Order Details record: Remove( 'Order Details', ThisItem )

This series of topics has been a quick walkthrough of using Common Data Service relationships and option sets
in a canvas app for educational purposes. Before you release any app to production, you should consider field
validation, error handling, and many other factors.
Build global support into canvas apps
12/2/2019 • 6 minutes to read • Edit Online

Power Apps is a global product. You can build and use canvas apps in many different languages and regions.
Both while building and running apps, the text displayed by Power Apps has been translated into a variety of
languages. You will see menu items, dialog boxes, ribbon tabs, and other text in your native language. Typing in
and displaying dates and numbers is also adapted for your particular language and region. For example, some
regions of the world use a . (dot or period) as the decimal separator while others use a , (comma).
The apps you create can be globally aware as well. Use the Language, Text, Value, DateValue and other
functions to adapt what is displayed and used as input in different languages.

Language settings
When using the native studio or a native player, the language used is provided by the host operating system. For
Windows, this can be controlled under "All Settings" and then "Time & language" settings. Windows also allows
you to specify the characters to use for the decimal separator, overriding the language setting.
When using the web experiences, the language used is provided by the browser. Most browser default to the
host operating system's setting with some also providing a way to set the language manually.

Authoring environment
The authoring environment adapts to the language setting of the author. The app itself is stored in a language
agnostic manner, so that authors using different languages can edit the same app.
Names in formulas
Most elements in formula are always in English:
Function names: If, Navigate, Collect, ...
Control property names: Screen.Fill, Button.OnSelect, Textbox.Font, ...
Enumeration names: Color.Aqua, DataSourceInfo.MaxValue, FontWeight.Bold...
Signal records: Compass.Heading, Location. Latitude, App.ActiveScreen, ...
Operators: Parent, in, exactIn, ...
As the authoring experience is localized, control and other object names will appear in the native language of the
author. In Spanish, some of the control names appear as:
When you insert one of these into your app, their name will default to English. This is done for consistency with
the control property names and the rest of the formula. For example, Casilla listed above is inserted as
Checkbox1.
After a control is inserted, you can change the name to whatever you like. While selected, the far left hand side of
the "Content" ribbon displays the name of the control. Selecting this name drops down a text box where you can
edit the name:

If you like, here you can rename the control to Casilla1. The red squiggly, in this case displayed by a browser, is
because the name is not a Spanish word and is of no concern.
You can use whatever names you like for:
Control names
Collection names
Context variable names
Formula separators and chaining operator
Some separators and operators will shift based on the decimal separator of the author's language:

AUTHOR'S LANGUAGE POWER APPS DECIMAL POWER APPS CHAINING


DECIMAL SEPARATOR SEPARATOR POWER APPS LIST SEPARATOR OPERATOR

. (dot or period) . (dot or period) , (comma) ; (semi-colon)

, (comma) , (comma) ; (semi-colon) ;; (double semi-colon)

The change in the Power Apps list separator is consistent with what happens to the Excel list separator. It impacts:
Arguments in function calls.
Fields in a record.
Records in a table.
For example, consider the following formula expressed in a language and region that uses dot or period as the
decimal separator, such as Japan or the United Kingdom:

Now view this same formula in a language and region where a comma is used for the decimal separator, such as
France or Spain:

The highlight shows the operators that change between the two versions. Note that the property selection
operator . (dot or period) in Slider1.Value is always the same, no matter what the decimal separator is.
Internally the formula does not change, all that changes is how it is displayed and edited by the author. Two
different authors using two different languages can view and edit the same formula, with each seeing the
appropriate separators and operators for their language.

Creating a global app


The app you create can adapt to different languages, providing a great user experience for your users around the
world.
Language function
The Language function returns the language tag of the current user. For example, this function returns "en-GB"
for users in Great Britain and "de-DE" for users in Germany.
Among other things, you can use Language to display translated text for your users. Your app can include a
table of translated values in your app:

And then use a formula such as the following to pull translated strings from the table:
LookUp( Table1, TextID = "Hello" && (LanguageTag = Left( Language(), 2 ) || IsBlank( LanguageTag
))).LocalizedText
Be aware that translated strings in other languages could be significantly longer than they are in your language.
In many cases, the labels and other elements that display the strings in your user interface will need to be wider
to accommodate.
For more information, see the documentation for the Language function.
Formatting numbers, dates, and times
Numbers, dates, and times are written in different formats in different parts of the world. The meaning of
commas, decimals, and the order of month, date, and year vary from location to location.
The Text function formats numbers and dates using the language setting of the user.
Text requires a format string to know how you want to format the number or date. This format string can take
one of two forms:
A global aware enumeration. For example, Text( Now(), DateTimeFormat.LongDate ). This formula
will format the current date in a language appropriate format. This is the preferred way to specify the format
string.
A custom format string. For example, Text( Now(), "[$-en-US ]dddd, mmmm dd, yyyy" ) displays the
same text as the enumeration when used in the language "en-US". The advantage of the custom format string
is that you can specify exactly what you want.
The "[$-en-US ]" on the front of the custom format string tells Text in which language to interpret the custom
format string. This is inserted for you and defaults to your authoring language. Normally you will not need to
change this. It is useful when authors from different languages are editing the same app.
The third argument to Text specifies which language to use for the result of the function. The default is the
language setting of the current user.
For more information, see the documentation for the Text function.
Reading numbers, dates, and times
There are four functions for reading numbers, dates, and times provided by the user:
Value: Converts a number in a text string to a number value.
DateValue: Converts a date value in a text string to a date/time value. Any time specified in the text string is
ignored.
TimeValue: Converts a time value in a text string to a date/time value. Any date specified in the text string is
ignored.
DateTimeValue: Converts a date and time value in a text string to a date/time value.
If you have used Excel, all of these functions are combined in the single Value function. They are broken out here
since Power Apps has separate types for date/time values and numbers.
All of these functions have the same arguments:
String, required: A string from the user. For example a string types into a Text input control and read from
the control with the Text property.
Language, optional: The language in which to interpret the String. By default, the language setting of the user.
For example:
Value( "12,345.678", "en-US" ) or Value( "12,345.678" ) when located where "en-US" is the user's
language returns the number 12345.678, ready for calculations.
DateValue( "1/2/01", "es-ES" ) or DateValue( "1/2/01" ) when located where "es-ES" is the user's
language returns the date/time value February 1, 2001 at midnight.
TimeValue( "11:43:02", "fr-FR" ) or DateValue( "11:43:02" ) when located where "fr-FR" is the user's
language returns the date/time value January 1, 1970 at 11:43:02.
TimeDateValue( "11:43:02 1/2/01", "de-DE" ) or DateValue( "11:43:02" ) when located where "de-DE"
is the user's language returns the date/time value February 1, 2001 at 11:43:02.
For more information, see the documentation for the Value and DateValue, TimeValue, and DateTimeValue
functions and working with dates and times.
Calendar and Clock information
The Calendar and Clock functions provide calendar and clock information for the user's current language.
Among other things, use these functions to provide a Dropdown control with a list of choices.
For more information, see the documentation for the Calendar and Clock functions.
Create accessible canvas apps in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

An accessible canvas app will allow users with vision, hearing and other impairments to successfully use the app. In
addition to being a requirement for many governments and organizations, following the below guidelines
increases usability for all users, regardless of their abilities.
Use the Accessibility Checker to help review potential accessibility issues in your app.

Layout and color


Common sense and uncomplicated design helps apps be more accessible to all users. When doing heavy
customization of apps take note of the below suggestions. Power Apps themes are by default accessible.
Ensure all elements are clearly visible and text is of sufficient size. All content must be easily read and
understood by the naked eye.
Avoid using the visibility property of items to bring an element into view. If you need to show something
conditionally, create the content in a new screen and navigate to it and back.
Ensure input elements are labeled on the screen. AccessibilityLabel property defines what the screen reader
will announce.
If customizing colors, ensure the contrast of text:background is 4.5:1 or greater. Software tools that assist this
process are readily available.
Ensure layout follows a logical flow when read top-bottom, left to right.

Keyboard support
When testing your app's accessibility, ensure the app can be used with the keyboard only, the accessibility modes
on iOS and Android, as well as navigated successfully with the screen reader enabled.
For keyboard navigation (with or without the screen reader) ensure that a logical order is followed when using the
TAB key to navigate to input fields by setting each control's TabIndex property:
Label, Image, Icon, Shape controls - if they represent interactive elements (i.e.buttons) set TabIndex to 0; if they
are decorative elements or text, set TabIndex to -1.
Avoid setting tab index higher than zero.

Screen reader support


The following software combinations are the supported recommendations for consuming Power Apps with a
screen reader:
Windows: Microsoft Edge / Narrator
macOS: Safari / VoiceOver
Android: Power Apps app / Talkback
iOS: Power Apps app / VoiceOver
To ensure a satisfying experience with the screen reader it is recommended to:
Ensure all input controls have the AccessibilityLabel property set.
For images set AccessibilityLabel to an appropriate description.
If a picture is not used as a button or a link (i.e. icon is there just for the decoration) and should not be
read by the screen reader, make sure the AccessibilityLabel is empty or not set.
If a picture or an icon is used as a button, then set TabIndex to 0 and AccessibilityLabel to the link
description.

Multimedia
Ensure all videos are captioned and a transcript of all audio recordings is available to the user. Video control
supports closed captions in WebVTT format via the ClosedCaptionsUrl property.
Note that with the screen reader enabled, Timer does not announce button text, but how much time has passed.
Announcements can't be turned off, even if timer is hidden with low opacity.

Working with signatures


If you have a signature field that uses the PenInput control you need to enable an alternative method of signature
input. The recommended way is to show a TextInput control where a user can type their name. Ensure the signing
instructions are placed in the AccessibilityLabel property and the control is placed close to the Pen input - to the
right or immediately below.
Related:
Accessibility properties
Use the Accessibility checker
Accessible colors in Power Apps
Review a canvas app for accessibility in Power Apps
12/3/2019 • 5 minutes to read • Edit Online

Users who have vision, hearing, or other impairments can use your canvas app more easily and successfully if you
consider accessibility as you design how the app looks and behaves. If you're not sure how to make your app more
accessible, you can run the Accessibility checker in Power Apps Studio. This tool not only finds potential
accessibility issues but also explains why each might be a potential problem for users who have a specific disability
and offers suggestions on how to resolve each issue. The Accessibility checker detects screen-reader and keyboard
issues for you, and you can find information about how to fix color-contrast issues by using accessible colors.
The Accessibility checker helps you identify settings that you might want to change, but you should always
consider the suggestions in the context of what your app needs to do. Many suggestions may be worthwhile, but
you can ignore any that might do more harm than good.

Find accessibility issues


1. In the upper-right corner of Power Apps Studio, select the icon for the App checker.

2. In the menu that appears, select Accessibility.

A list of issues appears, sorted first by severity and then by screen.


3. Select the arrow next to an item to show details about it.
4. Select the back arrow to return to the list of items.
5. If you decide to address an issue, select it to open the affected property.
6. After you change one or more properties, select Re-check to update the list of issues.
Resolved items disappear from the list, and new items may appear.

Severity of issues
The Accessibility checker classifies each issue as an error, a warning, or a tip based the issue's severity.
Errors identify issues that make the app difficult or impossible to use and understand for users who have a
disability.
Warnings identify issues that make the app difficult to use or understand for most but not all users who have a
disability.
Tips help you improve the experience of users who have a disability.

Types of issues
ISSUE TITLE SEVERITY ISSUE DESCRIPTION HOW TO FIX WHY FIX
ISSUE TITLE SEVERITY ISSUE DESCRIPTION HOW TO FIX WHY FIX

Missing accessible Error When the accessible- Edit the accessible- If the accessible-label
label label property of an label property to property contains no
interactive control describe the item. text, people who can’t
contains no text. An see the screen won't
interactive control can understand what’s in
be inherently images and controls.
interactive, as a
button is, or it has
interactive properties.
For example, you
might have set the
OnSelect property of
an image or set its
TabIndex property
to 0 or higher.

Focus isn't showing Error When the Change the If the focus isn't
FocusBorderThickne FocusedBorderThic visible, people who
ss of a control is set kness property to a don't use a mouse
to 0. It is good value that's higher can't see it when they
practice to ensure a than 0. interact with the app.
proper color-contrast
ratio between the
focus border and the
control itself so it's
clearly visible.

Missing captions Warning When the Set the Without captions,


ClosedCaptionsURL ClosedCaptionsURL people who have
property of an Audio property to the URL disabilities might not
or Video control is for captions. get any information
empty. from a video or audio
segment.

Missing helpful Warning When any of several Select the warning, By changing this
control settings settings (such as and then set the property setting, you
showing labels and property to true. give the user better
markers for charts information about
and showing default how the controls in
controls for Audio, your app function.
Video, and Pen
input controls) are
turned off.

HTML won't be Warning When a control other Use a method other Your app won't work
accessible than an HTML text than HTML, or correctly or be
control contains remove the HTML accessible if you add
HTML. In that case, from this element. interactive HTML
Power Apps doesn't elements.
support accessibility
of custom HTML
elements.

Turn off autostart Warning When an Audio or Set the control's Video and audio files
Video control's Autostart property that play
Autostart property is to false. automatically can
set to true. distract users. Let
them choose whether
to play a clip.
ISSUE TITLE SEVERITY ISSUE DESCRIPTION HOW TO FIX WHY FIX

Revise screen name Tip When a screen has a Give the screen a People who are blind,
default name, which name that describes have low vision, or a
will be read out by what's on the screen reading disability rely
screen readers when or what it's used for. on screen names to
users navigate the navigate using the
app. screen reader.

Add State Tip When a control that Set the ShowValue Users won't get
indication text has a state, such as a property of the confirmation of their
toggle, but the value control to true to actions if the state of
labels are turned off. show its current state. the control doesn't
appear.

Check the order of Tip When the TabIndex Set all The navigation order
the screen items property is greater TabIndex properties should mirror the
than 0. App creators to 0 or -1 whenever order in which
can set custom tab possible. Instead of controls appear on
orders by setting using TabIndex, use the screen, which is
the TabIndex propert the Enhanced group the default. If manual
y to a value greater control to change the adjustments are
than 0 but it is highly navigation order from made, it is difficult to
discouraged as it is the default. If values maintain the correct
hard to get right, of TabIndex greater order especially in the
maintain, and can than 0 must be used, presence of the
break screen readers. make sure that your browser's address bar
screen elements and other controls
match the order in outside of the app.
which you'd want to This can make a
tab through them. screen reader very
difficult to use. When
read by the screen
reader, the controls
should be presented
in the same order in
which they are seen
on the screen, instead
of an order that's less
intuitive.

Add another input Tip When an app Add a Text input Some users can't use
method contains a Pen control in addition to a pen and require
control. This tip the Pen control for another way to
reminds you to an accessible provide information
include a separate experience. (for example, by
method of input. typing a signature).

Next steps
Create accessible apps
Accessible colors
Accessibility properties
Accessible colors for canvas apps in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Colors used in a canvas app should be accessible to color-blind and low -vision users. All Power Apps themes
are accessible by default. When modifying colors used in an app, follow these guidelines to ensure that they
remain accessible. There are several tools available online which can help you identify color contrast issues.

Minimum contrast for text


Text and its background must have a contrast ratio of at least 4.5:1
Large text must have a contrast ratio of at least 3:1
Disabled text has no contrast requirements
In practical terms, all interactive controls must have adequate color contrast between:
Color and Fill
PressedColor and PressedFill
HoverColor and HoverFill

Minimum contrast for non-text


NOTE
In the WCAG 2.0 standard, contrast requirements only applies to text. For greater accessibility, consider the upcoming
WCAG 2.1 contrast guidelines for essential user interface components like icon buttons. A minimum ratio of 3:1 is
recommended for these components. The guidelines described in this section are optional for WCAG 2.0 compliance.

User interface components


All interactive controls must have adequate color contrast between:
FocusedBorderColor and color outside the control
Additional color contrast checks apply for controls where the entire area is interactive or informative. For
example, a Button or an Icon used as a button. This ensures that the boundaries of the control are clear and
users know where they can click or tap.
If there is a border for such controls, there should be adequate color contrast between:
BorderColor and color outside the control
PressedBorderColor and color outside the control
HoverBorderColor and color outside the control
If there is no border, there should be adequate color contrast between:
Fill and color outside the control
PressedFill and color outside the control
HoverFill and color outside the control
Graphical objects
If an image conveys important information, consider checking it for contrast issues. This applies to controls
where an image can be shown: Audio, Image, Microphone, and Video.
For video content, consider checking it for contrast issues. Alternatively or additionally, provide closed
captions that describe the video.

Provide other visual cues


Ensure that the app does not convey information with just color. For example, users with red-green color
blindness will not be able to distinguish a red error message from a green success message.
Additional cues like an Icon or text styles like Italic and Underline can help convey meaning.

Next steps
Learn about accessibility properties in Power Apps controls and try using the Accessibility checker.
Show or hide content from assistive technologies for
canvas apps
11/28/2018 • 2 minutes to read • Edit Online

In most cases, all users should be able to access all content, but you might occasionally want to show content only
to sighted users or only to screen-reader users. For example, you might want only screen-reader users to access
descriptions of chart trends that are obvious to sighted users. You might also want to hide an icon from screen-
reader users if an adjacent label describes it. Another description on the icon would be unnecessarily verbose.

Hide content from all users


Set Visible to false.

Hide content from sighted users and show it to screen-reader users


Use any of these techniques:
Set Size to 0.
Set Width and Height to 1.
Set X, Y, or both properties such that the control is outside the screen.
Set Color and related properties to transparent.
Position a rectangle Shape above the content, and set Fill to the same color as the background color of the
screen.

NOTE
Users can still use a keyboard to access an interactive control, such as a Button, even if you hide it by using one of the
techniques in the previous list. Set TabIndex to -1 if you want to prevent users from accessing the control by pressing the
Tab key.

Hide content from screen-reader users and show it to sighted users


For Image, Icon, and Shape controls, set AccessibleLabel to the empty string "".

Next steps
Learn about accessibility properties of controls in canvas apps.
Announce dynamic changes with live regions for
canvas apps
11/28/2018 • 2 minutes to read • Edit Online

Dynamic changes pose challenges to the visually-impaired. Users who access an app through a screen reader are
focused on one part of the app. If a change happens elsewhere, those users won't be aware of it.
You can solve this problem by adding live regions, which screen readers track. If content changes in a live region, a
screen reader will announce that change.
The underlying mechanism for live regions are aria-live regions, so the same guidelines apply.

Example uses of live regions


You can use live regions to notify users when events such as these occur:
A validation error occurs in a form.
An action triggered by a button is successful. For example, a user might select a button to add an item to a
collection, and a live region could show the message "Item added".
The user selected a different tab.
A background timer refreshes a news feed.

Create and configure a live region


You can configure only a Label control as a live region. Its Live property determines what type of live region it is.
Off: Not a live region. Screen readers don't announce changes.
Polite: Screen readers announce changes after finishing speaking. Use this value for non-critical notifications
that don't require immediate attention.
Assertive: Screen readers interrupt themselves to announce changes immediately. Use this for critical
notifications that require immediate attention.
If the text content of a live region changes, screen readers will announce the entire text content, not just the
changed portion. If the value of the Text property is set to the empty string "", the screen reader doesn't announce
anything.
To repeat a message, clear text contents by setting the value of the Text property to the empty string "" and then
set the value to the message again.

Best practices
Always set Visible to true. Some screen readers don't detect live regions that disappear and reappear.
Avoid changing the value of Live. Some screen readers don't detect when a non-live region becomes live and
vice-versa.
Position the live region in a logical position in the app, even if it isn't visible. Ensure that its contents are sensible
in context with the elements before and after it. Users can access a live region anytime through regular
navigation with a screen reader, not just when changes happen.

Next steps
Learn how to show content only to screen readers if the live region should be hidden from sighted users.
Understand experimental, preview, and deprecated
features in Power Apps
12/3/2019 • 6 minutes to read • Edit Online

With every release, we make changes and add features to make Power Apps the best tool to fit your needs. We
move the product forward.
We take backward compatibility very seriously. However, with any change or improvement, we might introduce an
unintended side effect, and your app might not work exactly the way it did before.
To help balance improvement against impact on existing apps, we take larger features through a progression of
stages. This article describes this process and how you can control your exposure to features that are under
development.

Feature roll-out stages


Features move through three stages on their way to becoming official parts of the product:
1. Experimental: This feature is a work in progress. Don't depend on it yet; it may go through significant changes.
2. Preview: This feature is almost done and is stable. Start to migrate existing apps to it now.
3. Shipped: This feature is done. All apps have this feature enabled, and you can't turn it off.
At each stage, the number of people who use the feature increases, helping us to validate that the feature is what
you need and that we're not introducing unintended side effects.
Your feedback is critical to this process. Please post your feedback in the Power Apps Community Forum.
How long does a feature remain in each stage? This varies from feature to feature. We look at many factors,
including the number of apps that use the feature, the number of issues reported, and how urgently the feature is
needed. Features can remain in a stage for weeks to many months. We may also skip some stages if we don't
believe it would be helpful.
This table may help you decide when you should jump in:

CAN I USE IT WITH CONFIDENCE? IS IT


STAGE WHEN SHOULD I USE IT? ENABLED BY DEFAULT FOR NEW APPS?

Experimental If you're an early adopter, see No. Experimental features can radically
something useful to you, and would like change or completely disappear at any
to help test the feature. time. For this reason the feature is not
enabled by default and you must
explicitly opt in to use it.

Preview New apps automatically include this Yes. This feature is on track to become a
feature but it can still be turned off. permanent part of the product. You
Start enabling and testing in existing may want to turn it off if you run into a
apps because this feature will be problem. Please report issues; this is the
eventually turned on for them too. main reason the feature is in Preview.
CAN I USE IT WITH CONFIDENCE? IS IT
STAGE WHEN SHOULD I USE IT? ENABLED BY DEFAULT FOR NEW APPS?

Preview (Final validation) For a few features that would have Yes. You can use this feature with
broad impact, we may take the confidence, it is very close to becoming
additional step beyond Preview of permanent. You may want to turn it off
forcing the feature switch on once for if you run into a problem. Please report
existing apps when they are opened in any issues encountered.
the Studio. If you encounter an issue,
the feature can still be turned off, and
your feedback is critical before we take
the next step.

Shipped for new apps All new apps have this feature turned Yes.
on and it cannot be turned off. For
existing apps where the feature is
turned off, the feature will continue to
show as a Preview feature until it is
turned on. If turned on and the switch
becomes unavailable, you can restore
the app to a previous version to return
to a state before the feature was
enabled.

Shipped for all apps All apps have this feature and it cannot Yes.
be disabled.

Documentation
Where can you find information about these features? We treat Preview features as finished features, and you can
learn more about them just as you do any other product features:
Power Apps documentation. We'll provide the basics on the new feature: the benefits, how to get started, and
reference information.
Power Apps community forum. Others will explore the new feature along with you. Learn from their experience,
and share yours.
Power Apps blog. Often, but not always, a blog post accompanies a new feature.
Experimental features are different. They are works in progress, and we don't consider them finished. The short
description in the App settings pane (see below ) might be the only information about them. Experimental features
don't normally appear in the documentation. The community forum is likely your best source of information. In
some cases, an early blog post describes the feature. If you aren't finding enough information, ask in the forums, or
wait for the feature to move to the Preview stage.

Controlling which features are enabled


Experimental and preview features are listed in the app's Advanced settings. From within the app, select the File
menu, select App settings, and then select Advanced settings. Scroll down to the Preview features and
Experimental features sections:
Each feature has a toggle switch. Off means that the feature is disabled. Having all switches turned off is the
baseline and safest way to run your app.
In some cases, you might need to close and reopen the app after you change a setting. The feature description
should indicate when you must perform this step.
At the top of the Advanced settings panel, you can find settings for fully shipped features that aren't preview or
experimental and that you can completely depend on.
These settings are specific to each app, so changing a toggle switch affects only the app that's currently open. If you
create an app, these switches revert to their default settings for that app.

Feature deprecation
Sometimes a feature needs to be retired. Often this occurs when there is a new, better way to accomplish a task.
Unpopular features are also pruned too as all features require some overhead to keep up with product changes
around them.
Feature deprecation also goes through stages. Features are unique and not every stage will be used by all features.

CAN I USE IT WITH CONFIDENCE? IS IT


STAGE WHEN SHOULD I USE IT? ENABLED BY DEFAULT FOR NEW APPS?

Deprecated Existing apps may continue using this Yes, you can still use the feature with
feature for a limited time. You can still confidence. But it will be going away
turn on the feature for new apps. It is soon. For this reason you must explicitly
time to evaluate alternatives. opt in to use the feature in new apps
and it is not recommended.
CAN I USE IT WITH CONFIDENCE? IS IT
STAGE WHEN SHOULD I USE IT? ENABLED BY DEFAULT FOR NEW APPS?

Deprecated (Final warning) For a few features that would have No. The feature is about to be
broad impact, we may take the permanently removed. You must
additional step beyond Deprecated of explicitly opt in to use the feature and it
forcing the feature switch off once for is not recommended.
existing apps the next time they are
opened in the Studio. If there is a issue,
the feature can still be turned back on,
and your feedback is critical before we
take the next step.

Removed for new apps All new apps have this feature turned No. The feature is about to be
off and it cannot be enabled. For permanently removed. The feature is no
existing apps where the feature is longer available for new apps.
turned on, the feature will continue to
show as a Deprecated feature until it is
turned off. If turned off and the feature
switch becomes unavailable, you can
restore the app to a previous version to
return to a state before the feature was
disabled.

Removed for all apps The feature is unavailable for all apps. No.
Save and publish a canvas app in Power Apps
1/24/2020 • 2 minutes to read • Edit Online

Whenever you save changes to a canvas app, you automatically publish them only for yourself and anyone else
who has permissions to edit the app. When you finish making changes, you must explicitly publish them to make
them available to everyone with whom the app is shared.
For information about how to share an app, see Share an app.

Save changes to an app


In Power Apps Studio, select Save on the File menu (on the left edge), and then follow either of these steps:
If you've never saved the app before, provide a name for it, and then select Save.

If the app has ever been saved, select Save. You can also leave version specific notes or comments.
Power Apps can also periodically save the app every 2 minutes. If you have saved the app once, Power Apps will
continue to save a version of the app periodically without requiring the user to press or tap the Save action.
Authors can enable or disable the Auto save setting from the Account tab on the File menu.

Publish an app
1. In Power Apps Studio, select Save on the File menu (on the left edge), and then select Publish.

2. In the Publish dialog box, select Publish this version to publish the app to all users with whom the app is
shared.
NOTE
Whenever you publish a canvas app, your app will be upgraded to run on the latest version of Power Apps – which
means it will get the benefit of all the latest features and performance upgrades we’ve added since you last published.
If you haven’t published an update in several months, you’ll likely see an immediate performance benefit from
republishing now.

Identify the live version


In powerapps.com, select Apps on the File menu (on the left edge), select the details icon for an app, and then
select the Versions tab.
The Live version is published for everyone with whom the app is shared. The most recent version of any app is
available only to those who have edit permissions for it.

To publish the most recent version, highlight the version and select ellipsis (...). Then select Publish this version
from the drop down menu.

Next steps
Find and run the app in a browser or on a phone.
Rename an app from powerapps.com.
Restore an app if you have multiple versions of an app.
Share a canvas app in Power Apps
3/25/2020 • 14 minutes to read • Edit Online

After you build a canvas app that addresses a business need, specify which users in your organization can run
the app and which can modify and even reshare it. Specify each user by name, or specify a security group in
Azure Active Directory. If everyone would benefit from your app, specify that your entire organization can run
it.

IMPORTANT
For a shared app to function as you expect, you must also manage permissions for the data source or sources on which
the app is based, such as Common Data Service or Excel. You might also need to share other resources on which the app
depends, such as flows, gateways, or connections.

Prerequisites
Before you share an app, you must save it to the cloud (not locally) and then publish the app.
Give your app a meaningful name and a clear description, so that people know what your app does and
they can easily find it in a list. On the File menu in Power Apps Studio, select App settings, specify a
name, and then type or paste a description.
Whenever you make changes, you must save and publish the app again if you want others to see those
changes.

Share an app
1. Sign in to Power Apps, and then select Apps near the left edge.

2. Select the app that you want to share by selecting its icon.

3. In the banner, select Share.


4. Specify by name or alias the users or security groups in Azure Active Directory with which you want to
share the app.
To allow your entire organization to run the app (but not modify or share it), type Everyone in the
sharing panel.
You can share an app with a list of aliases, friendly names, or a combination of those (for example,
Jane Doe <jane.doe@contoso.com>) if the items are separated by semi-colons. If more than one
person has the same name but different aliases, the first person found will be added to the list. A
tooltip appears if a name or alias already has permission or can't be resolved.

NOTE
You can't share an app with a distribution group in your organization or with a group outside your organization.

5. If you want to allow those with whom you're sharing the app to edit and share it (in addition to running
it), select the Co-owner check box.
You can't grant Co-owner permission to a security group if you created the app from within a solution.

NOTE
Regardless of permissions, no two people can edit an app at the same time. If one person opens the app for
editing, other people can run it but not edit it.

6. If your app connects to data for which users need access permissions, specify them.
For example, your app might connect to an entity in a Common Data Service database. When you share
such an app, the sharing panel prompts you to manage security for that entity.

For more information about managing security for an entity, see Manage entity permissions later in this
topic.
7. If you want to help people find your app, select the Send an email invitation to new users check box.
8. At the bottom of the share panel, select Share.
Everyone with whom you shared the app can run it in Power Apps Mobile on a mobile device or in
AppSource on Dynamics 365 in a browser. Co-owners can edit and share the app in Power Apps.
If you sent an email invitation, everyone with whom you shared the app can run it by selecting a link in
the invitation.
If a user selects the link on a mobile device, the app opens in Power Apps Mobile.
If a user selects the link on a desktop computer, the app opens in a browser.
Co-owners who receive an invitation get another link that opens the app for editing in Power Apps
Studio.
You can change permissions for a user or a security group by selecting their name and then performing either
of these steps:
To allow co-owners to run the app but no longer edit or share it, clear the Co-owner check box.
To stop sharing the app with that user or group, select the Remove (x) icon.

Security-group considerations
If you share an app with a security group, existing members of that group and anyone who joins it will
have the permission that you specify for that group. Anyone who leaves the group loses that permission
unless they belong to a different group that has access or you give them permission as an individual.
Every member of a security group has the same permission for an app as the overall group does.
However, you can specify greater permissions for one or more members of that group to allow them
greater access. For example, you can give Security Group A permission to run an app, but you can also
give User B, who belongs to that group, Co-owner permission. Every member of the security group can
run the app, but only User B can edit it. If you give Security Group A Co-owner permission and User B
permission to run the app, that user can still edit the app.
Share an app with Office 365 Groups
You can share an app with Office 365 groups. However, the group must be security enabled. Enabling security
ensures the Office 365 group can receive security tokens for authentication to access apps or resources.
Follow these steps to check if an Office 365 group has security enabled:
1. Ensure you have access to the Azure AD cmdlets.
2. Go to Azure Portal > Azure Active Directory > Groups > Select the appropriate group > Copy the
Object Id.
3. Connect to Azure AD using PowerShell:

4. Get the group details using Get-AzureADGroup -ObjectId <ObjectID\> | select * .


In the output, ensure the property SecurityEnabled is set to True:
If the group is not security enabled, you can enable it enable it using PowerShell cmdlet Set-AzureADGroup by
setting the SecurityEnabled property to True:
Set-AzureADGroup -ObjectId <ObjectID> -SecurityEnabled $True

NOTE
You must be the owner of the Office 365 group to enable security.

After a while, you can discover this group in the Power Apps sharing panel and share apps with this group.

Manage entity permissions


Common Data Service
If you create an app based on Common Data Service, you must also ensure that the users with whom you
share the app have the appropriate permissions for the entity or entities on which the app relies. Specifically,
those users must belong to a security role that can perform tasks such as creating, reading, writing, and
deleting relevant records. In many cases, you'll want to create one or more custom security roles with the exact
permissions that users need to run the app. You can then assign a role to each user as appropriate.

NOTE
As of this writing, you can assign security roles to individual users and security groups in Azure Active Directory but not
to Office groups.

Prerequisite
To assign a role, you must have System administrator permissions for a Common Data Service database.
Assign a security group in Azure AD to a role
1. In the sharing panel, select Assign a security role under Data permissions.
2. Select the role or roles in Common Data Service that you want to assign to the user or the security
group in Azure AD with which you want to share the app.
Common Data Service (previous version)
When you share an app that's based on an older version of Common Data Service, you must share the runtime
permission to the service separately. If you don’t have permission to do this, see your environment
administrator.

Share with guests


Power Apps canvas apps can be shared with guest users of an Azure Active Directory tenant. This enables
inviting external business partners, contractors, and third parties to run your company’s canvas apps.

NOTE
Guests may only be assigned the User role, and not the Co-owner role, for apps shared with them.
Power Apps canvas app guest access leverages Azure B2B. Power Apps recognizes guests outlined by states 1 – 4 in
the Azure B2B documentation. Power Apps can't recognize guests that authenticate using Azure AD direct federation.

Prerequisites
In Azure Active Directory (Azure AD ), enable B2B external collaboration for the tenant. More information:
Enable B2B external collaboration and manage who can invite guests
Enable B2B external collaboration is on by default. However, the settings can be changed by a tenant
admin. For more information about Azure AD B2B, see What is guest user access in Azure AD B2B?
Access to an account that can add guest users to an Azure AD tenant. Admins and users with the Guest
Inviter role can add guests to a tenant.
The guest user must have a license with Power Apps use rights that matches the capability of the app
assigned through one of the following tenants:
The tenant hosting the app being shared.
The home tenant of the guest user.
NOTE
Power Apps Per App Plans are scoped to apps in a specific environment, so they cannot be recognized across tenants.
Power Apps included with Office and Power Apps Per User Plans are not bound to a specific environment so they are
recognized across tenants in guest scenarios.

Steps to grant guest access


1. Select New guest user to add guest users in Azure AD. More information: Quickstart: Add a new guest
user in Azure AD.

2. If the guest user doesn't already have a license in their home tenant, assign a license to the guest user.
To assign guest users from admin.microsoft.com, see Assign licenses to one user.
To assign guest users from portal.azure.com, see Assign or remove licenses.

IMPORTANT
You may need to disable the Microsoft 365 admin center preview to assign a license to a guest.

3. Share the canvas app.


a. Sign in to https://make.powerapps.com
b. Go to Apps, select a canvas app, and then on the command bar select Share.
c. Enter an email address for a guest user from an Azure AD tenant. More information: What is guest
user access in Azure AD B2B?
After you share an app for guest access, guests can discover and access apps shared with them from the email
sent to them as part of sharing.

Frequently Asked Questions


What’s the difference between canvas app guest access and Power Apps Portals?
Canvas apps enable building an app, tailored to digitizing a business processes, without writing code in a
traditional programming language such as C#. Guest access for canvas apps enables teams of individuals
made up of different organizations participating in a common business process to access the same app
resources that may be integrated with awide variety of Microsoft and third-party sources. More information:
Overview of canvas-app connectors for Power Apps.
Power Apps Portalsprovide the abilityto build low -code, responsive websites that allow external users to
interact with the data stored in Common Data Service. It allows organizations to create websites that can be
shared with users external to their organization either anonymously or through the login provider of their
choice, such as LinkedIn, Microsoft Account, or other commercial login providers.
The following table outlines a few core capability differences between Power Apps Portals and canvas apps.

INTERFACE AUTHENTICATION ACCESSIBLE DATA SOURCES

Power Apps Portals Browser only experience Allows anonymous and Common Data Service
authenticated access

Canvas apps Browser and mobile apps Requires authentication via Any ~150 out-of-box
Azure AD connectors and any custom
connector

Can guests access customized forms in SharePoint?


Yes. Any user that can access a SharePoint list with a customized form can create and edit items in the list,
using the form, without any Power Apps license.
Can guests access apps embedded in SharePoint?
Yes. Though, access to canvas standalone apps require a license with Power Apps use rights that matches the
capability of the app, including apps that are embedded. When embedding a canvas app in SharePoint via the
Microsoft Power Apps embed control, enter the app id. To do this, enter the app ID in the App web link or ID
box.

When embedding a canvas app in SharePoint via the iFrame HTML tag, reference the app using the full web
URL. To find the URL, go to https://make.powerapps.com, select an app, select the Details tab, and the URL is
displayed under Web link.
How come guests can launch the app shared with them but connections fail to be created?
As with non-guests, the underlying data source(s) accessed by the app must also be made accessible to the
guest.
What license must be assigned to my guest so they can run an app shared with them?
The same license that’s required for non-guests to run an app. For instance, if the app uses premium
connecters then a Power Apps Per App Plan or a Power Apps Per User Plan must be assigned to the guest.

STANDALONE CANVAS
APP USING NON- STANDALONE CANVAS
SHAREPOINT PREMIUM APP USING PREMIUM
CUSTOMIZED FORM CONNECTORS CONNECTORS MODEL DRIVEN APP

SharePoint user (no x


PA license)

Power Apps Included x x


w/ Office

Power Apps Per App x x x x


Plan

Power Apps Per User x x x x


Plan

More details around pricing and capabilities of various plans can be found in Microsoft Power Apps and Power
Automate Licensing Guide.
In Power Apps Mobile, how does a guest see apps for their home tenant?
Any user that has accessed an canvas app, on their mobile device, that’s published in an Azure AD tenant that
isn’t their home tenant must sign-out of Power Apps and sign back in to Power Apps Mobile.
In Power Apps Mobile, how does a guest see apps in the guest tenant?
As the guest user, open the email received when an app in the guest tenant was shared, and select the Open
the app button. This applies to both Azure Active Directory and Microsoft Account users.
Must a guest accept the Azure AD guest invitation prior to sharing an app with the guest?
No. If a guest launches an app shared with them prior to accepting a guest invitation the guest will be
prompted to accept the invitation as part of the sign-in experience while launching the app.
What Azure AD tenant are connections for a guest user created in?
Connections for an app are always made in the context of the Azure AD tenant the app is associated. For
instance, if an app is created in the Contoso tenant then connections made for Contoso internal and guest
users are made in the context of the Contoso tenant.
Can guests use Microsoft Graph via Microsoft Security Graph connector or a custom connector using Microsoft Graph APIs?
No, Azure AD guests can't query Microsoft Graph to retrieve information for a tenant in which they’re a guest.
What InTune policies apply to guests using my Power Apps?
InTune only applies policies of a user’s home tenant. For instance, if Alice@Contoso.com shares an app with
Vikram@Fabrikam.com, InTune continues to apply Fabrikam.com policies on Virkam’s device regardless of the
Power Apps he runs.
What connectors support guest access?
All connectors that do not perform Azure AD authentication of any type supports guest access. The following
table enumerates all connectors that perform Azure AD authentication and which connectors currently support
guest access. Many of these will be updated leading up to general availability.

CONNECTOR SUPPORTS GUEST ACCESS

10to8 Appointment Scheduling No

Adobe Creative Cloud No

Adobe Sign No

Asana No

AtBot Admin No

AtBot Logic No

Azure AD Yes

Azure Automation Yes

Azure Container Instance Yes

Azure Data Factory Yes

Azure Data Lake Yes

Azure DevOps No

Azure Event Grid No

Azure IoT Central Yes

Azure Key Vault No

Azure Kusto Yes


CONNECTOR SUPPORTS GUEST ACCESS

Azure Log Analytics Yes

Azure Resource Manager Yes

Basecamp 2 No

Bitbucket No

Bitly No

bttn No

Buffer No

Business Central No

CandidateZip No

Capsule CRM No

Cloud PKI Management No

Cognito Forms No

Common Data Service No

Common Data Service (Legacy) No

D&B Optimizer No

Derdack SIGNL4 No

Disqus No

Document Merge No

Dynamics 365 No

Dynamics 365 AI for Sales Yes

Dynamics 365 for Fin & Ops No

Enadoc No

Eventbrite No

Excel Online (Business) No

Excel Online (OneDrive) No


CONNECTOR SUPPORTS GUEST ACCESS

Expiration Reminder No

FreshBooks No

GoToMeeting No

GoToTraining No

GoToWebinar No

Harvest No

HTTP with Azure AD No

Infusionsoft No

Inoreader No

Intercom No

JotForm No

kintone No

LinkedIn No

Marketing Content Hub No

Medium No

Metatask No

Microsoft Forms No

Microsoft Forms Pro No

Microsoft Graph Security No

Microsoft Kaizala No

Microsoft School Data Sync No

Microsoft StaffHub No

Microsoft Teams Yes

Microsoft To-Do (Business) No

Muhimbi PDF No
CONNECTOR SUPPORTS GUEST ACCESS

NetDocuments No

Office 365 Groups Yes

Office 365 Outlook No

Office 365 Users Yes

Office 365 Video No

OneDrive No

OneDrive for Business No

OneNote (Business) No

Outlook Customer Manager No

Outlook Tasks Yes

Outlook.com No

Paylocity No

Planner No

Plumsail Forms No

Power BI Yes

Project Online No

ProjectWise Design Integration No

Projectwise Share No

SharePoint Yes

SignNow No

Skype for Business Online No

Soft1 No

Stormboard No

Survey123 No

SurveyMonkey No
CONNECTOR SUPPORTS GUEST ACCESS

Toodledo No

Typeform No

Vimeo No

Webex Teams No

Windows Defender Advanced Threat Protection (ATP) No

Word Online (Business) No


Share Excel data used by your app
12/2/2019 • 2 minutes to read • Edit Online

You can share Excel data with your app users in a cloud account, such as OneDrive.
For example, you might create an app that shows the names and phone numbers of the technical-support group
at your company. The information is stored in an Excel spreadsheet, which you put in a folder in Dropbox. You
then share the folder with your app users so that they can see the names and phone numbers.
You must share the data so that users can run and even modify your app. Users who aren't given the sharing
permissions won't see the data in the Excel file.
This topic shows you how to share data in an Excel spreadsheet using Dropbox, OneDrive, and Google Drive. To
create an app that displays data from an Excel file, see Create an app from a set of data.

Share data in Dropbox


1. Sign in to Dropbox using the same account that you used to create a connection from Power Apps to
Dropbox.
2. Select the folder that contains the Excel file, and then select Share:

3. In the dialog box, enter the email addresses with which your app users sign in to Dropbox.

4. If your app users will add, modify, or delete data in your app, select Can edit. Otherwise, select Can view.
5. Select Share.
For more information, see Sharing folders on Dropbox.

Share data in OneDrive


1. Sign in to OneDrive using the same account that you used when you created a connection from Power
Apps to OneDrive.
2. Select the folder that contains the file, and then select Share:
NOTE
In OneDrive for Business, share the file itself, not the folder that contains the file.

3. In the dialog box, select Email.

4. Specify the email addresses with which your app users sign in to OneDrive, and then select Share.

For more information, see Share OneDrive files and folders.

Share data in Google Drive


1. Sign in to Google Drive using the same account with which you created a connection from Power Apps to
Google Drive.
2. Right-click the folder that stores your Excel file, and then select Share.
3. In the dialog box, enter the email addresses with which your app users sign in to Google Drive:

4. If your app users will add, modify, or delete data in your app, then select Can edit in the list of permissions.
Otherwise, select Can view.
5. Select Done.
For more information, see Share Google Drive files and folders.
Known limitations
For information about how to share Excel data within your organization, review these limitations.
Share canvas-app resources in Power Apps
3/6/2020 • 3 minutes to read • Edit Online

Before you share a canvas app, consider the types of resources on which it relies, such as one or more of the
following:
entities in Common Data Service
For information about giving users access to this data, see Manage entity permissions.
a connection to a data source
an on-premises data gateway
a custom connector
an Excel workbook or other service
a flow
Some of these resources are shared automatically when you share the app. Other resources require you or the
people with whom you share the app to take extra steps so that the app works as you expect.
You can also share your connections, custom connectors and on-premises data gateway with your entire
organization.

Connections
Some connections (such as SQL Server with SQL or Windows authentication) are implicitly shared with the app
when you share the app with other users. Other connections require users to create their own connections and
explictly grant security privleges (such as security roles for the Common Data Service, OneDrive for Business,
SQL Server with Azure AD authentication).
You can determine whether a connection is automatically shared as part of the app when you share the app with
other users; allowing you to update sharing permissions. To do this, go to make.powerapps.com and select Data -
> Connections from left navigation. Then select the required connection. If the Share button appears on top
navigation or if the Share option displays when you select More Commands (...), the selected connection can be
shared with other users.
Implicit sharing
When you share an app that uses a connection that can be shared, the app connection is implicitly shared along
with the app. For example, following message appears when you go to make.powerapps.com, select Apps, choose
an app that uses such connection, select More Commands (...) and then select Share:

If you select Confirm and share the chosen app with other users, the app connection is implicitly shared with
those users along with the app.

On-premises data gateways


If you create and share an app that includes data from an on-premises source, the on-premises data gateway itself
and certain types of connections to that gateway will be shared automatically. For any connection that isn’t shared
automatically, you can share it manually (as the previous section shows) or let the app prompt users to create their
own connections. To show the connection or connections with which a gateway has been configured:
1. Open powerapps.com, click or tap Manage in the left navigation bar, and then click or tap Gateways.
2. Click or tap a gateway, and then click or tap the Connections tab.
NOTE
If you share one or more connections manually, you might need to reshare them under these circumstances:

You add an on-premises data gateway to an app that you’ve already shared.
You change the set of people or groups with whom you’ve shared an app that has an on-premises data
gateway.

Custom connectors
When you share an app that uses a custom connector, it is automatically shared, but users must create their own
connections to it.
On powerapps.com, you can view or update permissions for a custom connector. In the left navigation bar, click or
tap Manage, click or tap Connections, and then click or tap New connection (in the upper-right corner). Click
or tap Custom, and then click or tap a custom connector to display details about it.

Excel workbooks
If a shared app uses data to which not all users have access (such as an Excel workbook in a cloud-storage
account), share the data.

Flows
If you share an app that includes a flow, users who run the app will be prompted to confirm or update any
connections on which the flow relies. In addition, only the person who created the flow can customize its
parameters. For example, you can create a flow that sends mail to an address that you specify, but other users
can’t change that address.
2 minutes to read
Embed an app in Teams
3/17/2020 • 2 minutes to read • Edit Online

You can share an app you've created by embedding it directly into Microsoft Teams. When completed, users can
select + to add your app to any of your team channels or conversations in the team you are in. The app appears as
a tile under Tabs for your team.
An admin can upload the app so it shows up for all teams in your tenant under the All tabs section. See Share an
app in Microsoft Teams.

NOTE
Team custom app policies must be set to allow uploading custom apps. If you are unable to embed your app in Teams, check
with your administrator to see if they've setup custom app settings.

Prerequisites
You need a valid Power Apps license.
To embed an app into Teams, you need an existing app created using Power Apps.

Download the app


1. Sign in to make.powerapps.com, and then select Apps in the menu.

2. Select More actions (...) for the app you want to share in Teams, and then select Add to Teams.
3. In the Add to Teams panel, select Download. Power Apps will then generate your Teams manifest file using
the app description and logo you've already set in your app.

Add the app as a personal app


1. To add the app as a personal app or as a tab to any channel or conversation, select Apps in the left
navigation and then select Upload a custom app.
NOTE
The Upload a custom app only appears if your Teams administrator has created a custom app policy and turned on
Allow uploading of custom apps.

2. Select Add to add the app as a personal app or select Add to team to add the app as a tab within an
existing channel or conversation.

Publish the app to the Teams catalog


If you're an admin, you can also publish the app to the Microsoft Teams catalog.

Use context from Teams


To build deeply integrated apps with Teams, you can use Team's context variables with the Param() function. For
example, use the following formula in screen's Fill property to change the background of app based on user's
theme within Teams:
Switch(
Param("theme"),
"dark",
RGBA(
32,
31,
31,
1
),
"contrast",
RGBA(
0,
0,
0,
1
),
RGBA(
243,
242,
241,
1
)
)

To test the app, publish it and then play it within Teams.


The following context variables from Teams are supported:
locale
channelId
channelType
chatId
groupId
hostClientType
subEntityId
teamId
teamType
theme
userTeamRole

NOTE
This feature was added in March, 2020. If you embedded your app within Teams before this, you may need to re-add your
app to Teams to use this functionality.

Improve the performance of your app


You can optionally preload your app within Teams to increase performance.
1. Sign in to make.powerapps.com, and then select Apps in the menu.
2. Select More actions (...) for the app you want to share in Teams, and then select Settings.
3. In the Settings panel, toggle Preload app for enhanced performance to Yes. App will then pre-load
whenever embedded in Teams.
4. For the changes to take effect, remove and add your app into Teams again.

NOTE
This allows users to download the app file while authentication is in progress for embedded scenarios. However, the users can
run your app only after successful authentication. This ensures that your app data will not be available to unauthenticated
users.

See also
Welcome to Microsoft Teams
Edit a canvas app in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Edit any canvas app that you built, that you own, or for which you have Can edit permissions. You can edit an app
in Power Apps Studio. If you try to edit an app that's open for editing elsewhere, a message tells you whether you
already have it open or another user does.

Verify your permissions


1. Sign in to Power Apps, and then click or tap Apps in the File menu (on the left edge).

2. In the app-category selector, click or tap Apps I can edit.


You can edit any app in the list that appears. You can also search for an app by typing one or more
characters in the search box near the upper-right corner.

NOTE
If you still don't see the app that you want to edit, verify that you've selected the correct environment near the
upper-right corner.

3. Click or tap the ellipsis icon (...) for the app you want to edit, and then click or tap Edit.

Collaborate on an app
Anybody who has Can edit permission for an app can edit it, but only one person can edit an app at a time. If you
try to edit an app that someone else is already editing, this message appears. You can't proceed until the other
person closes the app (or that person's session times out).
In addition, this message appears if you open an app for editing and then try to open it on another device or in
another browser window. You can override the previous session, but you might lose any changes that you haven't
saved.

Next Steps
Learn more about how to add a screen, a control or a data connection.
Delete a canvas app from Power Apps
12/3/2019 • 2 minutes to read • Edit Online

This article shows you how to delete a canvas app from your Power Apps account and from the accounts of
anybody with whom the app was shared.

Delete an app from your account


1. Open powerapps.com, and then select Apps in the left Tree view pane.

2. (optional) Near the upper-right corner, filter the list of apps to show only those apps that you own or only
those apps to which you contribute.

NOTE
If the app that you want to delete doesn't appear, make sure that you're in the right environment.

3. Select More Commands (...) for the app that you want to delete.

4. Select the trash-can icon to delete the app.


NOTE
You must have the Contributor permission for an app before you can delete it.

5. In the dialog box that appears, select Delete from cloud.

IMPORTANT
This action will permanently delete this app not only from your account but also from the accounts of all users with
whom this app was shared.

More resources
Share an app
Change app name and tile
Restore an app to a previous version
Restore a canvas app to a previous version in Power
Apps
3/6/2020 • 2 minutes to read • Edit Online

This article shows you how to restore a canvas app to a previous version that was saved to the cloud from your
Power Apps account.

NOTE
You can only restore app versions created in last six months.

Restore an app from your account


1. Open powerapps.com, and then click or tap Apps in the left navigation bar.

2. (optional) Near the upper-left corner, filter the list of apps to show only those apps that you own or only
those apps to which you contribute.

NOTE
If the app that you want to restore doesn't appear, make sure that you're in the right environment.

3. Near the right edge, click or tap the info icon for the app that you want to restore.
4. Click or tap the Versions tab, and then click or tap Restore for the version that you want to restore.

5. In the confirmation dialog box, click or tap Restore.


A new version is added to your list.

More resources
Share an app
Change app name and tile
Delete an app
Change app name and icon for a canvas app in
Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Customize a canvas app by changing its name and icon.

Prerequisites
1. Create an app, or open one for editing.
2. On the File menu, click or tap App settings.

Rename an app
Under App name, click or tap Rename this app, and then type a different name.

Change an app tile


Follow one or more of these steps:
Click or tap a different background color from the list of options.

Click or tap an icon from the list of default icons.

Click or tap Browse file, click or tap the image that you want to use, and then click or tap Open.

NOTE
For best results, use a square-shaped icon.
Next step
On the File menu, click or tap Save to republish your app with the new settings.

More resources
Share an app
Delete an app
Restore an app to a previous version
Change screen size and orientation of a canvas app
in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

Customize a canvas app by changing its screen size and orientation.

Prerequisites
Create an app or open one for editing, and then select App settings on the File menu.

Change screen size and orientation


1. Under App settings, select Screen size + orientation.

2. In the Orientation list, select Portrait or Landscape.


3. (Tablet apps only) Under Aspect ratio, perform either of these steps:
Select the ratio that matches the target device for this app.
Select Custom to set your own size, and then specify a width between 50 - 3840 and a height between
50 - 2160.

4. Under Scale to fit, specify either On or Off.


This setting is on by default so that app screens resize to fit the available space on the device. When this
setting is on, the app's Width property matches its DesignWidth, and the app's Height matches its
DesignHeight.
If you turn this setting off, the app adjusts to the aspect ratio of the device on which it's running and takes up
all of the available space. The app doesn't scale and, as a result, screens can show more information.
When this setting is turned off, Lock aspect ratio is automatically turned off and disabled. In addition, the
Width property of all screens is set to Max(App.Width, App.DesignWidth) , and their Height property is set to
Max(App.Height, App.DesignHeight) so that they track the dimensions of the window in which the app is
running. With this change, you can create apps that respond to different devices and window dimensions.
More information: Create responsive layout
5. Under Lock aspect ratio, specify either On or Off.
If this setting is on, the app retains the screen orientation and aspect ratio that you specified in steps 2 and 3,
no matter the device. For example, a phone app that's running in a web browser retains the ratio for a
phone, showing a dark bar on each side instead of filling the window.
If this setting is off, the app adjusts to the aspect ratio of the device on which it's running (and distorting the
UI if necessary).
6. Under Lock orientation, specify either On or Off.
If you lock the app's orientation, the app retains the orientation that you specify. If the app is running on a
device for which the screen is in a different orientation, the app displays incorrectly and may show unwanted
results. If you unlock the app's orientation, it adjusts to the screen orientation of the device on which it's
running.
You can also modify the app's orientation by enabling Enable app embedding user experience in
Advanced settings. This feature top-left aligns the app when it's embedded and changes the background
color of the hosting canvas to white.
7. Select Apply to save your changes.

Next step
On the File menu, select Save to republish your app with the new settings.
Create responsive layouts in canvas apps
12/2/2019 • 13 minutes to read • Edit Online

Before you build a canvas app in Power Apps, you specify whether to tailor the app for a phone or a tablet. This
choice determines the size and shape of the canvas on which you'll build your app.
After you make that choice, you can make a few more choices if you select File > App settings > Screen size +
orientation. You can choose portrait or landscape orientation and screen size (tablet only). You can also lock or
unlock the aspect ratio and support device rotation (or not).
Those choices underlie every other choice you make as you design screen layouts. If your app runs on a device of
a different size or on the web, your entire layout scales to fit the screen where the app is running. If an app
designed for a phone runs in a large browser window, for example, the app scales to compensate and looks
oversized for its space. The app can't take advantage of the additional pixels by showing more controls or more
content.
If you create a responsive layout, controls can respond to different devices or window sizes, making various
experiences feel more natural. To achieve responsive layout, you adjust some settings and write expressions
throughout your app.

Disable Scale to fit


You can configure each screen so that its layout adapts to the actual space in which the app is running.
You activate responsiveness by turning off the app's Scale to fit setting, which is on by default. When you turn
this setting off, you also turn off Lock aspect ratio because you're no longer designing for a specific screen shape.
(You can still specify whether your app supports device rotation.)

To make your app responsive, you must take additional steps, but this change is the first step toward making
responsiveness possible.

Understand app and screen dimensions


To make your app's layouts respond to changes in the screen dimensions, you'll write formulas that use the Width
and Height properties of the screen. To show these properties, open an app in Power Apps Studio, and then select
a screen. The default formulas for these properties appear on the Advanced tab of the right-hand pane.
Width = Max(App.Width, App.DesignWidth)

Height = Max(App.Height, App.DesignHeight)

These formulas refer to the Width, Height, DesignWidth, and DesignHeight properties of the app. The app's
Width and Height properties correspond to the dimensions of the device or browser window in which your app
is running. If the user resizes the browser window (or rotates the device if you've turned off Lock orientation), the
values of these properties change dynamically. The formulas in the screen's Width and Height properties are
reevaluated when these values change.
The DesignWidth and DesignHeight properties come from the dimensions that you specify in the Screen size
+ orientation pane of App settings. For example, if you select the phone layout in portrait orientation,
DesignWidth is 640, and DesignHeight is 1136.
As they're used in the formulas for the screen's Width and Height properties, you can think of DesignWidth and
DesignHeight as the minimum dimensions for which you'll design the app. If the actual area available to your
app is even smaller than these minimum dimensions, the formulas for the screen's Width and Height properties
ensure that their values won't become any smaller than minimums. In that case, the user must scroll to view all of
the screen's content.
After you establish your app's DesignWidth and DesignHeight, you won't (in most cases) need to change
default formulas for each screen's Width and Height properties. Later, this topic discusses cases in which you
might want to customize these formulas.

Use formulas for dynamic layout


To create a responsive design, you locate and size each control by using formulas instead of absolute (constant)
coordinate values. These formulas express each control's position and size in terms of the overall screen size or
relative to other controls on the screen.

IMPORTANT
After you write formulas for the X, Y, Width and Height properties of a control, your formulas will be overwritten with
constant values if you subsequently drag the control in the canvas editor. When you start to use formulas to achieve
dynamic layout, you should avoid dragging controls.

In the simplest case, one control fills an entire screen. To create this effect, set the control's properties to these
values:

PROPERTY VALUE

X 0

Y 0

Width Parent.Width

Height Parent.Height

These formulas use the Parent operator. For a control placed directly on a screen, Parent refers to the screen.
With these property values, the control appears in the upper-left corner of the screen (0, 0) and has the same
Width and Height as the screen.
Later in this topic, you'll apply these principles (and the Parent operator) to position controls inside other
containers, such as galleries, group controls, and components.
As an alternative, the control can fill only the top half of the screen. To create this effect, set the Height property to
Parent.Height / 2, and leave the other formulas unchanged.
If you want a second control to fill the bottom half of the same screen, you can take at least two other approaches
to constructing its formulas. For simplicity, you might take this approach:

CONTROL PROPERTY FORMULA

Upper X 0

Upper Y 0

Upper Width Parent.Width

Upper Height Parent.Height / 2

Lower X 0

Lower Y Parent.Height / 2

Lower Width Parent.Width

Lower Height Parent.Height / 2

This configuration would achieve the effect that you want, but you'd need to edit each formula if you changed your
mind about the relative sizes of the controls. For example, you might decide that the top control should occupy
only the top one-third of the screen, with the bottom control filling the lower two-thirds.
To create that effect, you'd need to update the Height property of the Upper control and the Y and Height
properties of the Lower control. Instead, consider writing the formulas for the Lower control in terms of the
Upper control (and itself), as in this example:

CONTROL PROPERTY FORMULA

Upper X 0

Upper Y 0

Upper Width Parent.Width

Upper Height Parent.Height / 2

Lower X 0

Lower Y Upper.Y + Upper.Height

Lower Width Parent.Width

Lower Height Parent.Height - Lower.Y

With these formulas in place, you need only change the Height property of the Upper control to express a
different fraction of the height of the screen. The Lower control automatically moves and resizes to account for the
change.
You can use these formula patterns for expressing common layout relationships between a control, named C, and
its parent or a sibling control, named D.
RELATIONSHIP BETWEEN C
AND ITS PARENT PROPERTY FORMULA ILLUSTRATION

C fills width of parent, with a X N


margin of N

Width Parent.Width - (N * 2)

C fills height of parent, with Y N


a margin of N

Height Parent.Height - (N * 2)

C aligned with right edge of X Parent.Width - (C.Width


parent, with margin of N + N)

C aligned with bottom edge Y Parent.Height -


of parent, with margin of N (C.Height + N)

C centered horizontally on X (Parent.Width -


parent C.Width) / 2

C centered vertically on Y (Parent.Height -


parent C.Height) / 2

RELATIONSHIP BETWEEN C
AND D PROPERTY FORMULA ILLUSTRATION

C horizontally aligned with D X D.X


and the same width as D

Width D.Width
RELATIONSHIP BETWEEN C
AND D PROPERTY FORMULA ILLUSTRATION

C vertically aligned with D Y D.Y


and same height as D

Height D.Height

Right edge of C aligned with X D.X + D.Width - C.Width


right edge of D

Bottom edge of C aligned Y D.Y + D.Height -


with bottom edge of D C.Height

C centered horizontally X D.X + (D.Width -


relative to D C.Width) / 2

C centered vertically relative Y D.Y + (D.Height -


to D C.Height) /2

C positioned to the right of X D.X + D.Width + N


D with a gap of N

C positioned below D with a Y D.Y + D.Height + N


gap of N

C fills space between D and X D.X + D.Width


right edge of parent
RELATIONSHIP BETWEEN C
AND D PROPERTY FORMULA ILLUSTRATION

Width Parent.Width - C.X

C fills space between D and Y D.Y + D.Height


bottom edge of parent

Hierarchical layout
As you construct screens that contain more controls, it will become more convenient (or even necessary) to
position controls relative to a parent control, rather than relative to the screen or a sibling control. By organizing
your controls into a hierarchical structure, you can make your formulas easier to write and maintain.
Galleries
If you use a gallery in your app, you'll need to lay out controls within the gallery's template. You can position these
controls by writing formulas that use the Parent operator, which will refer to the gallery template. In the formulas
on controls within a gallery template, use the Parent.TemplateHeight and Parent.TemplateWidth properties;
don't use Parent.Width and Parent.Height, which refer to the overall size of the gallery.

Container control
You can use an experimental feature, the Container control, as a parent control. To turn this feature on, select File
> App settings > Advanced settings.
Consider the example of a header at the top of a screen. It's common to have a header with a title and several
icons with which your users can interact. You can construct such a header using the Container control, containing
a Label control and two Icon controls:
Set the properties for these controls to these values:

PROPERTY HEADER MENU CLOSE TITLE

X 0 0 Parent.Width - Menu.X +
Close.Width Menu.Width

Y 0 0 0 0

Width Parent.Width Parent.Height Parent.Height Close.X - Title.X

Height 64 Parent.Height Parent.Height Parent.Height

For the Header control, Parent refers to the screen. For the others, Parent refers to the Header control.
Having written these formulas, you can adjust the size or position of the Header control by changing the formulas
for its properties. The sizes and positions of the child controls will automatically adjust accordingly.
Components
If you use another experimental feature, named Components, you can construct building blocks and reuse them
throughout your app. As with the Container control, the controls that you place within a component should base
their position and size formulas on Parent.Width and Parent.Height , which refer to the size of the component.
More information: Create a component.

Adapting layout for device size and orientation


So far, you've learned how to use formulas to change each control's size in response to the available space, while
keeping controls aligned relative to each other. But you might want or need to make more substantial layout
changes in response to different device sizes and orientations. When a device is rotated from portrait to landscape
orientation, for example, you might want to switch from a vertical layout to a horizontal one. On a larger device,
you can present more content or rearrange it to provide a more appealing layout. On a smaller device, you might
need to split up content across multiple screens.
Device orientation
The default formulas for a screen's Width and Height properties, as this topic described earlier, won't necessarily
provide a good experience if a user rotates a device. For example, an app designed for a phone in portrait
orientation has a DesignWidth of 640 and a DesignHeight of 1136. The same app on a phone in landscape
orientation will have these property values:
The screen's Width property is set to Max(App.Width, App.DesignWidth) . The app's Width (1136) is larger than
its DesignWidth (640), so the formula evaluates to 1136.
The screen's Height property is set to Max(App.Height, App.DesignHeight) . The app's Height (640) is smaller
than its DesignHeight (1136), so the formula evaluates to 1136.
With a screen Height of 1136 and a device height (in this orientation) of 640, the user must scroll the screen
vertically to show all of its content, which might not be the experience that you want.
To adapt the screen's Width and Height properties to the device orientation, you can use these formulas:
Width = Max(App.Width, If(App.Width < App.Height, App.DesignWidth, App.DesignHeight))

Height = Max(App.Height, If(App.Width < App.Height, App.DesignHeight, App.DesignWidth))

These formulas swap the app's DesignWidth and DesignHeight values, based on whether the device's width is
less than its height (portrait orientation) or more than its height (landscape orientation).
After you adjust the screen's Width and Height formulas, you might also want to rearrange controls within your
screen to better use the available space. For example, if each of two controls occupies half of the screen, you might
stack them vertically in portrait but arrange them side by side in landscape.
You can use the screen's Orientation property to determine whether the screen is oriented vertically or
horizontally.

NOTE
In landscape orientation, the Upper and Lower controls appear as left and right controls.

CONTROL PROPERTY FORMULA

Upper X 0

Upper Y 0

Upper Width If(Parent.Orientation =


Layout.Vertical, Parent.Width,
Parent.Width / 2)

Upper Height If(Parent.Orientation =


Layout.Vertical, Parent.Height /
2, Parent.Height)

Lower X If(Parent.Orientation =
Layout.Vertical, 0, Upper.X +
Upper.Width)

Lower Y If(Parent.Orientation =
Layout.Vertical, Upper.Y +
Upper.Height, 0)

Lower Width Parent.Width - Lower.X

Lower Height Parent.Height - Lower.Y


Screen sizes and breakpoints
You can adjust your layout based on the size of the device. The screen's Size property classifies the current device
size. The size is a positive integer; the ScreenSize type provides named constants to help with readability. This
table lists the constants:

TYPICAL DEVICE TYPE (USING DEFAULT APP


CONSTANT VALUE SETTINGS)

ScreenSize.Small 1 Phone

ScreenSize.Medium 2 Tablet, held vertically

ScreenSize.Large 3 Tablet, held horizontally


TYPICAL DEVICE TYPE (USING DEFAULT APP
CONSTANT VALUE SETTINGS)

ScreenSize.ExtraLarge 4 Desktop computer

Use these sizes to make decisions about your app's layout. For example, if you want a control to be hidden on a
phone-sized device but visible otherwise, you could set the control's Visible property to this formula:
Parent.Size >= ScreenSize.Medium

This formula evaluates to true when the size is medium or larger and false otherwise.
If you want a control to occupy a different fraction of the screen width based on the screen size, set the control's
Width property to this formula:

Parent.Width *
Switch(Parent.Size,
ScreenSize.Small, 0.5,
ScreenSize.Medium, 0.3,
0.25)

This formula sets the control's width to half of the screen width on a small screen, three-tenths of the screen width
on a medium screen, and a quarter of the screen width on all other screens.

Custom breakpoints
The screen's Size property is calculated by comparing the screen's Width property to the values in the app's
SizeBreakpoints property. This property is a single-column table of numbers that indicate the width breakpoints
that separate the named screen sizes:
In an app created for tablet or web, the default value in the app's SizeBreakpoints property are [600, 900, 1200].
In an app created for phones, the value is [1200, 1800, 2400]. (The values for phone apps are doubled because
such apps use coordinates that are effectively double the coordinates used in other apps.)

You can customize your app's breakpoints by changing the values in the app's SizeBreakpoints property. Select
App in the tree view, select SizeBreakpoints in the property list, and then edit the values in the formula bar. You
can create as many breakpoints as your app needs, but only sizes 1 through 4 correspond to named screen sizes.
In formulas, you can refer to sizes beyond ExtraLarge by their numeric values (5, 6, and so forth).
You can also specify fewer breakpoints. For example, your app might need only three sizes (two breakpoints), so
the possible screen sizes will be Small, Medium, and Large.

Known limitations
The authoring canvas doesn't respond to the sizing formulas created. To test responsive behavior, save and publish
your app, and then open it on devices or in browser windows of various sizes and orientations.
If you write expressions or formulas in the X, Y, Width, and Height properties of a control, you'll overwrite those
expressions or formulas if you later drag the control to a different location or resize the control by dragging its
border.
Test Studio (experimental)
1/21/2020 • 5 minutes to read • Edit Online

Build end-to-end UI tests for your Canvas app using Test Studio. Maintain your app quality by continually
validating your app works as expected when new changes or updates are deployed.

Overview
Testing is an important part of the Software Development Life Cycle (SDLC ). Testing can help ensure the quality
of the app delivered to customers. It can identify issues or defects early in the release process and provides an
opportunity to fix these issues to make the app more reliable before releasing changes. Depending on the size and
usage of the app, manual testing of new changes may be enough. However, as the app grows in complexity and
usage, you may need to consider a test strategy instead of manual testing. If the app is mission-critical, even a
small mistake can have a significant impact.
Increased app changes can result in longer testing cycles. Eventually, regression testing of the app may be longer
than the time spent to develop new features. In fast paced development, thoroughly testing every feature in the
app becomes a bottleneck to releasing software updates. One option to reduce the time taken during a test cycle
and on regression testing is test automation. Test automation can help you test your app with minimal effort,
reducing testing time and identifying critical issues before release.
Power Apps Test Studio is a low -code solution to write, organize, and automate tests for canvas apps. In Test
Studio, you can write tests using Power Apps expressions or use a recorder to save app interaction to
automatically generate the expressions. You can play written tests back within the Test Studio to validate app
functionality, and also run the tests in a web browser and build the automated tests into your app deployment
process.

NOTE
This feature is still experimental and we recommend you use it to write tests for non-production apps. For more information,
see Experimental and preview features.
Test Studio Terminology
Following section explains key Test Studio terminology:
Test Cases
Test cases are made up of a series of instructions or actions, called test steps. Test cases are executed to validate
your app, or specific features in your app, are working as you expect. For example, in an Expense app, you would
like to ensure that only expenses with associated actual cost can be submitted. A test case can help verify this
condition or requirement is always met.
In the Test Studio, test steps are written using the Power Apps expression language. Test expressions can consist of
both the functions available when building your app and additional expressions to support automated testing.
Test Suites
Test suites are used to organize or group test cases together. As the number of test cases in the app grows, you
may consider organizing the test cases in specific features or functionality. For example, you may have one test
suite with test cases to validate expense report submissions and another test suite that focuses just on expense
approvals.
Test cases contained in test suites are run sequentially. The app state is persisted across all test cases in a suite. For
example, if you have a test case that completes on Screen 5 in your app, the next test case in your test suite will
begin running from Screen 5. It allows you to break down a complex test scenario into multiple test cases within a
single suite, and the state is shared across all test cases. If your second test case expects to begin at the start screen
of the app, you can navigate to the start screen as the first step in your test case. It’s important to remember that
the app is not reloaded at the beginning of every test case in a test suite when planning your test execution.
Test Assertions
Every test case should have an expected result. To validate the expected result of a test against the actual result of
your test, you can write Test Assertions. An assertion is an expression that evaluates to true or false in the test. If
the expression returns false, the test case will fail.
In the expense app example above, you can write an assertion to validate whether an expense report is created
with an expense line item having zero cost associated.

Best practices
When testing canvas app using Test Studio, consider the following best practices to gain maximum benefits to
improve your app quality:
1. Determine which test cases should be automated.
It’s difficult to automate all tests and we do not recommend that you completely rely on test automation.
Manual testing should be performed in addition to test automation. Tests best suited to automation are:
Repetitive tests.
High business impact functionality tests.
Features that are stable and not undergoing significant change.
Features that require multiple data sets.
Manual testing that takes significant time and effort.
2. Keep test cases small.
While a single test case can support testing all functionality in your app, we recommend that you avoid
writing a monolithic test case and try to divide it into multiple test cases. Each test case could test a specific
feature or functionality in your app. A failed assertion in a large test case may cause other functionality to
remain untested. Using multiple test cases contained in test suite allows other functionality to get tested
regardless if a previous test case failed. This strategy also makes it easier to isolate test failures.
3. Keep expressions to a single test action.
A test action can contain multiple expressions. Large multi-action test expressions for a single step may
impact your ability to debug and isolate any test failures. Consider dividing a test step with multiple actions
into more test steps of single actions to identify issues faster.
4. Every test case should have an expected result.
Each test case should have one or more expected results. Test assertions should be used to validate the
expected outcome(s) of your test against the actual outcome(s). Multiple assertions can be written for a
single test case.
5. Use Test suites.
For maintenance, group or categorize similar test cases together and provide descriptions to describe the
purpose and expected results of your test.

Known limitations
While work to provide full control coverage in Power Apps Test Studio is in progress, following functionality is
currently unavailable:
Components.
Code components written in the Power Apps Component Framework.
Nested galleries.
Media controls.
Formula-level-error management experimental feature needs to be turned on for the app.
Support for controls not listed in the Select and SetProperty functions.
Person type columns.
Working with Test Studio (experimental)
2/5/2020 • 10 minutes to read • Edit Online

In this quickstart, you'll create tests for a canvas app called Kudos. You can also explore and discover testing
concepts and apply them to writing tests for your own canvas apps. The sample Kudos app is part of a suite of
employee engagement apps available to download from Employee Experience Starter Kit.

NOTE
This feature is still experimental and we recommend you use it to write tests for non-production apps. For more information,
see Experimental and preview features.

Open Test Studio


You do not need to enable this in your app like other experimental features. Test Studio is available by default for
all canvas apps.
1. Sign in to Power Apps.
2. Create a new app or edit an existing app.
3. Save your app to Power Apps to open Test Studio.

NOTE
You must save an app before you can write tests for the app.

4. Select Advanced tools in the left navigation.


5. Select Open tests to open the Test Studio for this application. This opens Test Studio in a new browser tab.
NOTE
Tests are published and stored in the app package. Exporting and importing a canvas app package to another environment
will also include all the test definitions such as Test Suites and Test Cases you have created.

Create a test suite


By default, a test suite and test case are created for you in Test Studio. Test suites are used to organize your test
cases. An app can contain one or more test suites. You can use the default test suite and case to begin writing your
tests immediately or create a new test suite.
1. Select New suite.
2. Update the Test suite name and description by selecting the fields on the main grid.

Create a test case


Depending on how you want to organize or group your tests together, you can create multiple test cases in a test
suite. Each case can test a specific feature or a subset of functionalities in your app.
1. Select a test suite.
2. Select New Case in the top menu to create a new case.
3. Update the Test case name and description by selecting the fields on the main grid.

Record a test case


A test case consists of test steps that contain actions. Test actions are written using Power Apps expressions that
perform a task. You can use the recorder to automatically generate the test steps as you interact with your app.
After you record, you can update the test case, add new steps, delete steps, and write test assertions to validate the
result of your test.

NOTE
Only published app plays in record mode. Publish any recent changes to the app before you start recording a test case.
Recording without publishing recent changes causes last published version of the app to play in record mode.

1. Select Record from the top menu. This opens the published app with recording mode in a new browser
tab.

IMPORTANT
Recording on an existing test case overrides any existing test steps already present.
2. Interact with your app. Your actions are recorded in the left pane.
3. Once interaction completes, select Done. Optionally, you can select Cancel to return to the Test Studio
without your interactions getting recorded.

4. View the test steps and the expressions that were automatically generated for you in the Test Studio.
5. Edit the step description text in the main grid if required. You can also update the test step actions by
selecting the formula on the main grid.

Add Test Steps and Test Assertions


Every test case should have an expected result. In Kudos example, one of the expected results of sending a Kudo is
creating a new record in the Common Data Service (Common Data Service) database. You will now update the
test case and add additional test steps to validate a record was created successfully.
You need following steps to verify successful record creation:
Initialize a variable for the Kudo record count in the database at the beginning of the test case.
Initialize a variable for the Kudo record count in the database at the end of the test case.
Write a Test assertion expression to validate it incremented by one count. If the count does not increase by one,
the test assertion fails, and your test case fails.
To add test steps and test assertions in Kudos app:
1. Select Step 1 or the step above which you want to insert a new step.
2. Select Insert a step above from the top menu or by selecting the option from the active row. This creates
an empty step.

NOTE
When you select Insert step above, a new blank step is added above the current step. You can also use Assert,
SetProperty, Select or Trace actions instead. This adds step with respective action formula that you can edit.

3. Update the step description. For example, “Count Kudo in database”.


4. Enter an expression or formula into the action input to count the records in the database before executing
the test.
You can use any supported expression. You can also query any data sources, collections, variables, or run
flows that are contained in your app, as well as create new global variables or collections to use in your
tests.
Set(kudosBeforeTest, CountRows(Filter(Kudos, Receiver.Email = "someone@example.com")))

5. Select Step 2 or the step above which you want to insert a new step.
6. Select Insert a step above from the top menu or by selecting the option from the active row. This creates
an empty step.
7. Enter an expression or formula in the action input to Trace and write the kudosBeforeTest value to the test
results record.
Trace("kudosBeforeTest : " & kudosBeforeTest);

8. Go to the bottom of the test case and insert a new step to count the records in the database after the test
has completed.
Set(kudosAfterTest, CountRows(Filter(Kudos, Receiver.Email = "someone@example.com")))

9. Add a final step validate the record count in the database has increased by count of 1 and enter the below
assertion action to verify this:
Assert(kudosAfterTest = kudosBeforeTest + 1, "Kudos count incorrect. Expected : " & kudosBeforeTest + 1
& " Actual :" & kudosAfterTest)

10. Save the test case from the top-right menu in the Test Studio.

Play back your test


You can play back your recorded test to validate app functionality. You can play back all tests within a single test
suite, or a single test case.
Before you play the recording back with recent changes, you must publish the app:

IMPORTANT
If you skip, the recording play back will not contain your recent test changes. The last published test case or suite will play
against the app.

1. Click Publish. This automatically saves and publishes your test.

2. Select either a test suite or a single test case.


3. Click Play. The published app opens in Play mode, and you can see your test steps playing back
automatically. A green check mark indicates when a test step is executed successfully. If a step fails, a red
failure indicator along with a failure message is displayed
4. Click Done to return to Test Studio.
Failed Assertion
In this section, you'll change the test assertion to experience a failed test:
1. Edit the assertion step by selecting the expression box.
2. Update + 1 to + 2 in test action. This means that the test expects 2 records to be created, which is
incorrect. If the test is successful, only one record should be created in the database.
Assert(kudosAfterTest = kudosBeforeTest + 2, "Kudos count incorrect. Expected : " & kudosBeforeTest + 2
& " Actual :" & kudosAfterTest)

3. Select Publish.
4. Select Play.
5. View the test playing back. The final step now fails and shows an error and the message you provided in
the assertion step.
Playing tests in a browser
You have the option to copy a link to play a test in separate browser outside the Test Studio. This helps integrate
your tests in continuous build and release pipeline such as Azure DevOps.
The play link for selected test is persisted. It doesn't change for the test suite or test case. You can update your tests
without the need to modify build and release processes.
To play tests in your browser:
1. Select a test suite or test case in the right pane.
2. Click Copy play link.

3. You are prompted to publish your tests if there are any unpublished changes.

4. You can select to skip the publish process and copy the play link. New test changes do not play if you skip.
5. Open a browser and paste the URL into the address bar to play the test.
6. View your test playing back.

Processing Test Results


The test panel visible when playing back tests in Test Studio is not visible when using browser. Due to this, you
cannot determine the specific test step that executes, or if test passes or fails.
To determine test results outside of the Test Studio, there are two properties called OnTestCaseComplete and
OnTestSuiteComplete available in the test object that you can use to process the results of your tests. When
integrating tests into a continuous build and release pipeline like Azure DevOps, these properties can be used to
determine if you should proceed with the app deployment.
The expression entered for these properties triggers when each case or suite completes. You can customize these
properties to process and send the results of your tests to various data sources or services such as:
SQL Server.
Common Data Service.
Power Automate.
Email using Office 365.
These settings apply to every test suite or test case in your app. After each test suite or test case completes, the
test results and any trace messages contained in the tests are available in the TestCaseResult and
TestSuiteResult records.
The TestCaseResult record contains the following properties:
TestCaseName – the name of the test case.
TestCaseId – the Id of the test case.
TestSuiteName – the test suite name that the case belongs to.
TestSuiteId – the test suite id that the case belongs to.
StartTime – the start execution time of the test.
EndTime – the end execution time of the test.
Traces – the result of any test Assertions and any messages from the Trace function.
Success – indicates if the test case completed successfully.
TestFailureMessage – if the case failed, the failure message.
The TestSuiteResult record contains the following properties:
TestSuiteName – the test suite name.
TestSuiteId – the test suite id.
StartTime – the start execution time of the test suite.
EndTime – the end execution time of the test suite.
TestsPassed – the number of test cases that completed successfully in the suite.
TestsFailed - the number of test cases that failed in the suite.
In this quickstart, you'll create two custom entities in Common Data Service database to store the test results by
customizing the OnTestCaseComplete and OnTestSuiteComplete properties:
1. Click Test in the left pane or click View on the suite header.
2. Select the OnTestCaseComplete action.
3. Input an expression to process the results of your test. The following sample saves each test case results to
the custom AppTestResults entity in Common Data Service. The test results can optionally be stored to
SQL, SharePoint, or any other data source. You may need to set or increase the Trace field in your data
source as required.

NOTE
The following samples require a Common Data Service connection. You can create a simple app or build an app from
scratch using Common Data Service. Also, refer to the Patch function reference for more details to modify records of
a data source used in following samples.

//Save to Common Data Service


Patch(AppTestResults
, Defaults(AppTestResults)
, {
TestPass: TestCaseResult.TestCaseName & ":" & Text(Now())
,TestSuiteId: TestCaseResult.TestSuiteId
,TestSuiteName: TestCaseResult.TestSuiteName
,TestCaseId: TestCaseResult.TestCaseId
,TestCaseName: TestCaseResult.TestCaseName
,StartTime: TestCaseResult.StartTime
,EndTime: TestCaseResult.EndTime
,TestSuccess: TestCaseResult.Success
,TestTraces: JSON(TestCaseResult.Traces)
,TestFailureMessage: TestCaseResult.TestFailureMessage
}
);

4. Select the OnTestSuiteComplete action.


5. Input an expression to process the results of your test. In following sample, you'll saving each test suite
results to the custom AppTestSuiteResults entity in Common Data Service.

//Save to Common Data Service


Patch(AppTestSuiteResults
, Defaults(AppTestSuiteResults)
, {
TestSuiteId: TestSuiteResult.TestSuiteId
,TestSuiteName: TestSuiteResult.TestSuiteName
,StartTime: TestSuiteResult.StartTime
,EndTime: TestSuiteResult.EndTime
,TestPassCount: TestSuiteResult.TestsPassed
,TestFailCount: TestSuiteResult.TestsFailed
}
);

Other example of expressions you could use in these properties are:


Send results to a flow in Power Automate.
MyTestResultsFlow.Run(JSON(TestCaseResult))

Email your results:


Office365.SendMailV2(“someone@example.com”, “Test case results”, JSON(TestCaseResult,
JSONFormat.IndentFour))

Receive an app notification of the test result:


For example, receive a notification after the test completes when playing the test in a browser, outside of the
Test Studio.

Notify(TestCaseResult.TestCaseName & " : "


& If( TestCaseResult.Success
, " Passed"
, TestCaseResult.TestFailureMessage)
,If( TestCaseResult.Success
, NotificationType.Success
, NotificationType.Error)
)

Test Functions
In addition to the functions available in Power Apps, following are common functions that you will typically use
when authoring tests.
Select
SetProperty
Assert
Trace
Customize a SharePoint list or library form by using
Power Apps
2/21/2020 • 6 minutes to read • Edit Online

You can easily customize the form for a SharePoint list or SharePoint document library by opening Power Apps in
a browser. You don't need to write traditional code, such as C#, or download another app, such as InfoPath. When
you publish your changes, the form is embedded within the SharePoint list for use by all of its users. In Power
Apps, you can also review analytics reports, easily create conditional formatting, and connect to other data sources.
To follow the steps in this topic, you'll create a simple list so that you can see how customization works, and then
you can apply the same concepts to your own list.

NOTE
If the Customize forms option isn't available or doesn't work correctly for your list, it might contain data types that
Power Apps doesn't support. Also, you can't move your form to a different list or environment.
Custom forms for lists are only supported in generic lists. Support for generic document libraries is coming soon. Custom
list and library templates are currently not supported; including but not limited to lists such as Announcements, Contacts
and Tasks.
Custom forms for document libraries only supports editing custom metadata. Editing or managing file(s) is not supported.

Create a list
On a SharePoint site, create a list, and then add these columns to that list:
Details (yes/no)
Price (currency)
Availability (date without time)
Color (choice)

Open the form


1. In the command bar, select PowerApps, and then select Customize form.
Power Apps Studio opens in the same browser tab.
2. If the Welcome to Power Apps Studio dialog box opens, select Skip.

Move and remove a field


1. Drag the Availability field to the bottom of the list of fields.
The fields appear in the order that you specify.
2. Hover over the Attachments field, select the ellipsis (...) that appears, and then select Remove.
The field that you specify disappears from the form.

Set conditional formatting


You can configure the Price, Availability, and Colors fields to appear only if Details is set to yes.
1. In the left navigation bar, expand Details_DataCard1, and note the numeral that appears at the end of
DataCardValue.
2. Set the Visible property of the Color, Availability, and Price cards to this formula (replacing, if necessary,
the numeral with the one that you noted in the previous step):
If(DataCardValue2.Value = true, true)
3. While holding down the Alt key, select the Details toggle (by clicking or tapping it) multiple times.
The three fields that you configured appear and disappear from the form.

Save and publish the form


1. Open the File menu, select Save, and then select Publish to SharePoint twice.
2. In the upper-left corner, select the back arrow, and then select Back to SharePoint.

Further customize your form


1. Open your list, select New in the command bar, and then select Customize near the top of the form.
2. Customize your form in a variety of ways, such as those that these topics describe:
Change its size, orientation, or both (for example, to make the form wider).
Customize one or more cards (for example, change a card's display text or input control).
Create a lookup field.
More information: Understand SharePoint forms integration.

Use the default form


1. From your list in SharePoint, open the settings page (by selecting the gear icon near the upper-right corner),
and then select List settings.
2. Under General settings, select Form settings.
3. On the Form Settings page, select one of these options, and then select OK.
Use the default SharePoint form - When a user opens your list and selects New in the command
bar, the default form for the list will appear.
Use a custom form created in Power Apps - When a user opens your list and selects New in the
command bar, your custom form will appear. (As an alternative, you can publish the form again in
Power Apps.)
You can toggle back and forth between options, as needed.

Delete the custom form


1. From your list in SharePoint, open the settings page (by selecting the gear icon near the upper-right corner),
and then select List settings.
2. Under General settings, select Form settings.
3. On the Form Settings page, select Use the default SharePoint form, and then select Delete custom
form.

Q&A
Forms vs. apps
Q: How does a customized form differ from a standalone app that I create from SharePoint or Power Apps?
A: If you customize the form for a SharePoint list, the form doesn't appear as an app in Power Apps Studio or
Power Apps Mobile. You can open the form only from the list for which you created it.
Q: When should I customize a form to manage data in a SharePoint list, and when should I create a standalone
app?
A: Customize a form if you want your users to manage data without leaving SharePoint (for example, in a desktop
browser). Create an app if you want your users to manage data outside of SharePoint (for example, on a mobile
device).
Q: Can I customize a form and create an app for the same list?
A: Yes.
Q: Can I customize a list and create an app using the same features?
A: Yes.
Q: Can I customize a form in an environment other than the default environment in my organization?
A: No.
Manage your custom form
Q: How can I easily share my form with others?
A: Open the form, select Copy link, and then send the link to anyone whom you want to use the form.
Q: Can I update my form without making my changes visible to others?
A: Yes. You can change your form and save as many times as you want, but your changes won't be visible to
anyone else unless you select Publish to SharePoint twice.
Q: If I customize a list form and make a mistake, can I revert to a previous version?
A: Yes.
1. Open your list, select PowerApps on the command bar, and then select Customize forms.
2. In Power Apps Studio, select File, and then select See all versions. The Versions page opens in a new
browser tab.

NOTE
If you don't see the See all versions button, select Save. The button should appear.

3. Without closing the Versions page or the browser tab, go back to the Save page in the other browser tab,
click or tap the arrow at the top of the left navigation pane, and then click or tap Back to SharePoint to
unlock your form and close Power Apps Studio.
4. Go back to the Versions page in the other browser tab, locate the version that you want to restore, and then
select Restore.

NOTE
If you get an error message saying that the restore failed because the form is locked by another user, wait until the
user unlocks the form, and then try again.
Q: Can I move my form from one list to another?
A: No.
Administer your custom form
Q: How do I share my form?
A: You don't need to share the form—the form inherits permissions from the SharePoint list. When you're done
customizing it, just publish it back to SharePoint so that others can use it.
Q: Who can customize forms?
A: Anyone with SharePoint permissions to manage, design, or edit the associated list.
Q: Do I need a Power Apps license to create or use custom list forms?
A: You need an Office 365 plan that includes Power Apps.
Q: What happens when guest users access a list that has a custom form?
A: Guest users get an error message if they try to access a list form that's been customized using Power Apps.
Q: As an administrator, how do I get a list of all customized forms in my organization?
A: If you're a tenant administrator for Power Apps or you have environment-administrator permissions on the
default Power Apps environment of your organization, do the following:
1. In the Power Apps admin center, select the default environment for your organization from the list of
environments.
2. At the top of the default environment page, select Resources.
3. From the list of apps, look for apps with a SharePoint Form app type—these are the customized forms.
Understand SharePoint forms integration
12/3/2019 • 3 minutes to read • Edit Online

You can now easily customize any SharePoint list form in Power Apps. In this article, we'll walk through the details
of how these forms work and how you can customize them further.
If you've customized a form for a SharePoint list, you've likely noticed that the default generated form works for all
operations, like creating, showing, or editing an item. This is accomplished with the help of generated formulas and
the SharePointIntegration control.

Understand the default generated form


The default generated form consists of the following controls and their corresponding defaults:
FormScreen1 - This is the screen that contains the form.
SharePointForm1 - This is the form that's used to create, show, or edit the list item.
Data Source - The list for which the form has been customized.
Item - The selected item from the list. This is set to First() item in the list for your convenience when
working in Power Apps Studio.
If(IsBlank(SharePointIntegration.Selected) ||
IsEmpty(SharePointIntegration.Selected),First('YourListName'),SharePointIntegration.Sele
cted)
OnSuccess - Once the item is created or saved successfully, the form is reset and SharePoint hides
the form.
ResetForm (SharePointForm1); RequestHide()
SharePointIntegration - The control responsible for communicating user actions between SharePoint and
Power Apps.
Data Source - The list for which the form has been customized.
'YourListName'
OnNew - Sets SharePointForm1 in new mode.
NewForm (SharePointForm1)
OnView - Sets SharePointForm1 in view mode.
ViewForm (SharePointForm1)
OnEdit - Sets SharePointForm1 in edit mode.
EditForm (SharePointForm1)
OnSave - Submits the changes to SharePointForm1. On successful submission of the form, the
SharePointForm1.OnSuccess formula is executed.
SubmitForm (SharePointForm1)
OnCancel - Resets the changes to SharePointForm1. SharePoint always hides the form when a
user clicks or taps Cancel in SharePoint.
ResetForm (SharePointForm1)
These defaults ensure that the form works when running within SharePoint - they change the Power Apps form
mode as the user interacts with it in SharePoint, and they ensure that the changes are submitted to SharePoint.

Understand the SharePointIntegration control


The SharePointIntegration control communicates user actions between SharePoint and Power Apps.

NOTE
You can access the properties for the SharePointIntegration control only when the form is running in SharePoint, not when
you're customizing the form in Power Apps Studio. These properties may not be available in OnStart or OnVisible.

The SharePointIntegration control has the following properties:


Selected - The selected item from the SharePoint list.
OnNew - How an app responds when a user clicks or taps the New button or opens the Create item form in
SharePoint.
OnView - How an app responds when a user clicks or taps an item or opens the Item detail form in SharePoint.
OnEdit - How an app responds when a user clicks or taps the Edit all button or opens the Edit item form in
SharePoint.
OnSave - How an app responds when a user clicks or taps the Save button in SharePoint.
OnCancel - How an app responds when a user clicks or taps the Cancel button in SharePoint.
SelectedListItemID - Item ID for the selected item in a SharePoint list.
Data Source - The list that contains the record that the form will show, edit, or create. Note that if you change this
property, the Selected and SelectedItemID properties may stop working.

Customize the default form


Now that you have a better understanding of the default generated form and the SharePointIntegration control,
you can change the formulas to further customize the forms. Here are some things to keep in mind when you
customize forms:
To create separate custom experiences for creating, showing, or editing an item, set the OnNew, OnView,
or OnEdit formulas of the SharePointIntegration control to set variables or navigate to different screens.
Use the OnSave formula of the SharePointIntegration control to customize what happens when a user
clicks or taps Save in SharePoint. If you have multiple forms, make sure to submit the changes only for the
form currently being used.
TIP
Set different values for a variable in the OnNew, OnView, and OnEdit formulas. You can use this variable in the
OnSave formula to determine which form is being used.

Make sure to include RequestHide() in the OnSuccess formula of all your forms. If you forget this,
SharePoint will not know when to hide the form.
You can't control the hiding of a form when a user clicks or taps Cancel in SharePoint, so make sure you
reset your forms in the OnCancel formula of the SharePointIntegration control.
The properties for the SharePointIntegration control may not be available in OnStart or OnVisible, and
those events execute only once while the list is loaded. You can use OnNew, OnView, or OnEdit formulas
to run logic before the form is shown to the user every time.
Integrate Power Apps, Power Automate, and Power
BI with SharePoint Online
12/10/2019 • 2 minutes to read • Edit Online

Do you have SharePoint Online and want to better automate and streamline your business processes? Have you
worked with Power Apps, Power Automate, or Power BI, but you're not sure how to use them with SharePoint
Online? You've come to the right place! This series of tutorials explores how to build out a basic canvas app for
project management based on SharePoint lists and three key technologies that integrate with SharePoint Online:
Power Apps, Power Automate, and Power BI. These technologies work together, making it easy to measure your
business, act on the results, and automate your workflows. When you're done with this series, you will have a cool
scenario like the following:

Business scenario
In this series of tutorials, the company Contoso has a SharePoint Online site where they manage the lifecycle of
projects, from request, to approval, to development, to final review. A project requestor, such as a department
head, requests an IT project by adding an item to a SharePoint list. A project approver, such as an IT manager,
reviews the project, and then approves it or rejects it. If approved, the project is assigned to a project manager,
and additional detail is added to a second list through the same app. A business analyst reviews current and
completed projects using a Power BI report embedded in SharePoint. Power Automate is used to send approval
email and respond to Power BI alerts.

Getting started quickly


The scenario we present in this series of tutorials is simple compared to a full-blown project management and
analysis app, but it still takes some time to complete all the tasks. If you just want a quick introduction to using
Power Apps, Power Automate, and Power BI with SharePoint, check out the following articles:
PowerApps: Create an app from within SharePoint using Power Apps and Create an app to manage data in a
SharePoint list
Power Automate: Wait for approval in Power Automate
Power BI: Embed with report web part in SharePoint Online
When you're done, we hope you'll be back to check out this full scenario.
Even within the scenario, you can focus on the tasks that interest you, and complete the tasks as you have time.
After you set up SharePoint lists in task 1, you can work through tasks 2-5 in any order; then tasks 6-8 are
sequential. Lastly, we have included two finished apps and a Power BI Desktop report as part of the download
package for this scenario. You can look at these and learn by example even if you don't go through all the steps in
each task.

Prerequisites
To complete the scenario, you need the following subscriptions and desktop tools. The Office 365 Business
Premium subscription includes Power Apps and Power Automate.

SUBSCRIPTION OR TOOL LINK

Office 365 Business Premium subscription Trial subscription

Power BI Pro subscription Trial subscription (click TRY FREE)

Power BI Desktop Free download (click DOWNLOAD FREE)

Ideally, you have basic familiarity with each technology, but you can still complete the scenario if you're new to
some of these technologies. Use the following content to get up to speed:
Get started with SharePoint
Power Apps Guided Learning
Power Automate Guided Learning
Power BI Guided Learning

Next steps
The next step in this tutorial series is to set up the SharePoint Online lists that we use throughout the series.
Set up lists for SharePoint Online integration with
Power Apps, Power Automate, and Power BI
12/2/2019 • 5 minutes to read • Edit Online

NOTE
This article is part of a tutorial series on using Power Apps, Power Automate, and Power BI with SharePoint Online. Make
sure you read the series introduction to get a sense of the big picture, as well as related downloads.

SharePoint has a ton of features for sharing and collaboration, but we will focus on one feature for this scenario:
SharePoint lists. A list is just a collection of data that you can share with team members and other site users. We'll
review the lists used for this scenario, then you can create them in your own SharePoint Online site.

Step 1: Understand the lists


The first list is Project Requests, where a project requestor adds a request. The project approver then reviews the
request and approves or rejects it.

LIST COLUMN DATA TYPE NOTES

Title Single line of text Default column, used for project name

Description Single line of text

ProjectType Single line of text Values: new hardware, upgraded


hardware, new software, upgraded
software

RequestDate Date

Requestor Single line of text

EstimatedDays Number Enables comparison of requestor


estimate to project manager estimate to
actual

Approved Single line of text Values: pending, yes, no

NOTE
We also use the ID column, which is generated by SharePoint and hidden by default. We use basic data types for simplicity,
but a real app might use more complex types, like Person or Group for the Requestor column. For information on data
types supported by Power Apps, see Connect from Microsoft Power Apps to SharePoint.

The second list is Project Details, which tracks details for all approved projects, like which project manager is
assigned.
LIST COLUMN DATA TYPE NOTES

Title Single line of text Default column, used for project name

RequestID Number Matches the value in the Project


Requests list ID column

ApprovedDate Date

Status Single line of text Values: not started, in progress,


completed

ProjectedStartDate Date When the project manager estimates


that the project will start

ProjectedEndDate Date When the project manager estimates


that the project will end

ProjectedDays Number Working days; would typically be


calculated, but isn't in this scenario

ActualDays Number For completed projects

PMAssigned Single line of text Project manager

Step 2: Create and review the lists


To continue with the scenario, you need to create the two SharePoint lists and populate them with sample data.
We'll show you how to do this by creating the list and pasting sample data into it. Make sure you have the Excel
files from the download package.

NOTE
Use Internet Explorer for this step.

Create the lists


1. In Internet Explorer, in your SharePoint site, click or tap New, then List.

2. Enter the name "Project Requests", then click or tap Create.


The Project Requests list is created, with the default Title field.

Add columns to the list


1. Click or tap , then Single line of text.

2. Enter the name "Description", then click or tap Save.


3. Repeat steps 1. and 2. for the other columns in the list:
a. Single line of text > "ProjectType"
b. Date > "RequestDate"
c. Single line of text > "Requestor"
d. Number > "EstimatedDays"
e. Single line of text > "Approved"
Copy data into the list
1. Click or tap Quick edit.

2. Select the cells in the grid.


3. Open the project-requests.xlsx workbook and select all the data (not the headings).

4. Copy the data and paste it into the grid in SharePoint, then click or tap Done.

5. Repeat the list creation and copy process for the "Project Details" list, using the project-details.xlsx
workbook. Refer to the Project Details table in Step 1: Understand the lists for the column names and data
types.

Step 3: Update connections to samples - optional


As noted in the introduction to this tutorial series, we included two sample apps and a report in the download
package. You can complete this scenario without using these samples, but if you want to use the samples, you need
to update the connections to the SharePoint lists. You update them so that they use your lists as a data source,
rather than ours.
Update connections for the sample apps
1. In Power Apps Studio, click or tap Open in the left pane.
2. Click or tap Browse, then open the project-management-app.msapp file that you downloaded.
3. Click or tap Allow, so that Power Apps can use SharePoint.
4. On the ribbon, on the View tab, click or tap Data sources.

5. In the Data panel, click or tap the ellipsis (. . .) next to Project Details, then click or tap Remove.

6. Click or tap Add Data Source.

7. We'll show you two ways to connect to the list, depending on whether Power Apps already established a
SharePoint connection for you:
If you see a SharePoint connection already, click or tap that connection.

If you don't see a SharePoint connection, click or tap New connection.

Then click or tap SharePoint, and click or tap Create.

8. Enter the URL for the SharePoint Online site that contains the lists you created, then click or tap Go.
9. Select the Project Details list, then click or tap Connect.

The Data panel now shows the connection that you created.

10. Click or tap the ellipsis (. . .) next to Project Details, then click or tap Refresh.

11. Click in the upper right corner to run the app, and make sure the connection works properly.
12. Click or tap File, then save the app to the cloud.
13. Repeat the steps in this section for project-requests-app.msapp, using the Project Requests list.
Update connections for the sample report
1. Open project-analysis.pbix in Power BI Desktop.
2. On the ribbon, on the Home tab, click or tap Edit queries, then Data source settings.

3. Click or tap Change Source.


4. Enter the URL for your SharePoint Online site, then click or tap OK, then Close.

5. Power BI Desktop displays a banner under the ribbon, so you can apply changes and bring in data from the
new source. Click or tap Apply Changes.

6. Sign in with a Microsoft account (the account you use to access SharePoint Online), then click or tap
Connect.

Next steps
The next step in this tutorial series is to generate an app to handle project requests.
Generate a canvas app to handle project requests
12/3/2019 • 5 minutes to read • Edit Online

NOTE
This article is part of a tutorial series on using Power Apps, Power Automate, and Power BI with SharePoint Online. Make
sure you read the series introduction to get a sense of the big picture, as well as related downloads.

Now that the SharePoint lists are in place, we can build and customize our first app. Power Apps is integrated with
SharePoint, so it's easy to generate a basic three screen app directly from a list. This app allows you to view
summary and detailed information for each list item, update existing list items, and create new list items. If you
create an app directly from a list, the app appears as a view for that list. You can then run that app in a browser, as
well as on a mobile phone.

TIP
The download package for this scenario includes a finished version of this app: project-requests-app.msapp.

Step 1: Generate an app from a SharePoint list


1. In the Project Requests list you created, click or tap PowerApps, then Create an app.

2. Give the app a name, like "Project Requests app", then click or tap Create. When the app is ready, it opens in
Power Apps Studio.

Step 2: Review the app in Power Apps Studio


1. In Power Apps Studio, the left navigation bar by default shows a hierarchical view of the screens and
controls in the app.
2. Click or tap the thumbnail icon to switch views.

3. Click or tap each screen to view it in the middle pane. There are three screens:
(a). The browse screen, where you browse, sort, and filter the data pulled in from the list.
(b). The details screen, where you view more detail about an item.
(c). The edit/create screen, where you edit an existing item or create a new one.
Step 3: Customize the app's browse screen
1. Click or tap the browse screen.
This screen has a layout that contains a gallery to show list items, as well as other controls, like a search bar
and sort button.
2. Select the BrowseGallery1 gallery by clicking or tapping any record except the first one.

3. In the right pane, under Properties, click or tap Project Requests.


4. Update the fields to match the following list:
RequestDate
Requestor
Title

5. With BrowseGallery1 still selected, select the Items property.

6. Change the formula to SortByColumns(Filter('Project Requests', StartsWith(Title,


TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending)).

This allows you to sort and search by the Title field, instead of the default that Power Apps picked. See
Formula deep-dive for more information.
7. Click or tap File, then Save. Click or tap to go back to the app.

Step 4: Review the app's details screen and edit screen


1. Click or tap the details screen.
This screen has a different layout that contains a display form to show the details for an item selected in the
gallery. It has controls to edit and delete items, and to go back to the browse screen.

2. Click or tap the edit screen.


This screen contains an edit form to edit the selected item, or create a new one (if you come here directly
from the browse screen). It has controls to save or discard changes.

Step 5: Run the app from the list


1. In the Project Requests list, click or tap All Items, then Project Requests app.

2. Click Open, which opens the app in a new browser tab.

3. In the app, click or tap for the first item in the browse gallery.

4. Click or tap to edit the item.


5. Update the Description field – change the last word from "group" to "team," then click or tap
6. Close the browser tab.
7. Go back to the Project Requests list, click or tap Project Requests app, then All Items.

8. Verify the change you made from the app.

This is a pretty simple app, and we only made a few basic customizations, but you can see it's possible to quickly
build something interesting. We're going to move on to the next task, but look around the app a little more if you
want, and see how the controls and formulas work together to drive app behavior.

Formula deep-dive
This section is optional, but it will help you understand more about how formulas work. In step 3 of this task, we
modified the formula for the Items property of BrowseGallery1. Specifically, we changed the sort and search to
use the Title field, instead of the field that Power Apps picked. Here's the modified formula:
SortByColumns ( Filter ( 'Project Requests', StartsWith ( Title, TextSearchBox1.Text ) ), "Title", If (
SortDescending1, Descending, Ascending ) )
But what does this formula do? It determines the source of data that appears in the gallery, filters the data based
on any text entered in the search box, and sorts the results based on the sort button in the app. The formula uses
functions to do its work. Functions take parameters (i.e. input), perform an operation (like filtering), and return a
value (i.e. output):
The SortByColumns function sorts a table based on one or more columns.
The Filter function finds the records in a table that satisfy a formula that you specify.
The StartsWith function tests whether one text string begins with another.
The If function returns one value if a condition is true, and returns another value if the same condition is false.
When you put the functions together in the formula, here's what happens:
1. If you enter text in the search box, the StartsWith function compares that text to the start of each string in
the Title column of the list.
StartsWith ( Title, TextSearchBox1.Text )
For example, if you enter "de" in the search box, you see four results, including items that start with
"Desktop" and "Device." You won't see all the "Mobile devices" items because those don't start with "de."
2. The Filter function returns rows from the Project Requests table. If there is no text in the search box to
compare, Filter returns all rows.
Filter ( 'Project Requests', StartsWith ( Title, TextSearchBox1.Text )
3. The If function looks at whether the variable SortDescending1 is set to true or false (the sort button in the
app sets it). The function then returns a value of Descending or Ascending.
If ( SortDescending1, Descending, Ascending )
4. Now the SortByColumns function can sort the gallery. In this case, it sorts based on the Title field, but this
can be a different field than the one you search on.
If you stuck with us up to this point, we hope you have a better sense of how this formula works, and how you can
combine functions and other elements to drive the behavior your apps require. For more information, see Formula
reference for Power Apps.

Next steps
The next step in this tutorial series is to Create a flow to manage project approvals.
Create a flow to manage project approvals
12/2/2019 • 4 minutes to read • Edit Online

NOTE
This article is part of a tutorial series on using Power Apps, Power Automate, and Power BI with SharePoint Online. Make
sure you read the series introduction to get a sense of the big picture, as well as related downloads.

In this task we'll create a flow that drives the process of approving projects. Power Automate is integrated with
SharePoint, so it's easy to create a flow directly from a list. The flow we'll create is triggered when an item is added
to the Project Requests list. The flow sends an email to the project approver, who approves or rejects the request
directly in email. The flow then sends an approval or rejection email to the project requestor and updates our
SharePoint lists appropriately.

Step 1: Configure the flow template


1. In the Project Requests list, click or tap Flow, then Create a flow.

2. In the right pane, click or tap Start approval when a new item is added.

3. If you're not already signed in, sign into SharePoint and Outlook, then click or tap Continue.
You now see the template for this flow, ready for you to complete. The boxes in the flow represent steps.
They take input from previous steps, as well as input that you provide. Each step can then provide output to
subsequent steps.

4. In the Assigned To box, enter a name that is valid in your tenant.

The next box in the flow responds to the project approver's decision and routes the flow to one of two
branches: If yes or If no.

Step 2: Create actions for Approve = yes


By default, this branch sends an approval email to the requestor. We'll also update the Project Requests list, and
add an item to the Project Details list because the project has been approved.
1. In the If yes branch, click or tap Inform item creator of approval, then Edit to see the default options for
the email sent to the requestor.

2. By default, an email is sent to the person who created the list item, with the subject line and message body
that you see. You can update these if you like.

3. Click or tap Add an Action.

4. Under Choose an action, search for "SharePoint", then click or tap SharePoint – Update item.

5. Enter the SharePoint site URL and list name.


6. Select the Id box, then click or tap ID in the dynamic content dialog box.

Dynamic content is available throughout the flow, based on previous steps. In this case, the SharePoint list
information is available, and we can use it in the actions that we create.
7. Select the Title box, search for "Title" in the dynamic content dialog box, then click or tap Title.

8. In the Approved box, enter "Yes". This part of the flow should now look like the following image.

9. Click or tap Add an Action again. This time we'll add an item to the Project Details list for the project that
was approved.
10. Under Choose an action, search for "SharePoint", then select SharePoint – Create item.

11. Enter the SharePoint site URL and list name.

12. Select the Title box, search for "Title" in the dynamic content dialog box, then click or tap Title.

13. Select the RequestId box, then click or tap ID in the dynamic content dialog box.

14. In the PMAssigned box, enter "Unassigned". This part of the flow should now look like the following
image.

Step 3: Review action for Approve = no


By default, this branch sends a rejection email to the requestor. We'll also update the Project Requests list. The
project isn't moving forward, so we don't add an item to the Project Details list.
1. In the If no branch, click or tap Inform item creator of rejection, then Edit to see the default options for
the email sent to the requestor.

2. By default, an email is sent to the person who created the list item, with the subject line and message body
that you see. You can update these if you like.

3. Click or tap Add an Action.

4. Under Choose an action, search for "SharePoint", then click or tap SharePoint – Update item.
5. Enter the SharePoint site URL and list name.

6. Select the Id box, then click or tap ID in the dynamic content dialog box.

7. Select the Title box, search for "Title" in the dynamic content dialog box, then click or tap Title.
8. In the Approved box, enter "No". This part of the flow should now look like the following image.

9. At the top right of the screen, click or tap Create flow.


The flow is now complete, and it should look like the following image if you collapse the boxes.

10. At the top right of the screen, click or tap Done.


Step 4: Run the approval flow
1. In the Project Requests list, click Quick Edit and add an item like the following:
Title = "New monitor for Megan"
Description = "Megan needs a 24" monitor"
ProjectType = "New hardware"
RequestDate = "02/03/2017"
Requestor = "Megan Bowen"
EstimatedDays = "1"
Approved = "Pending"

2. Click Done at the top of the page when you're finished.

3. Check the inbox of the approver's email account. You should have an email like the following.

4. After you click Approve or Reject, the flow runs another process, and you get feedback like the following,
directly in the email.
5. The flow sends an email to Megan with Allan's response, as in the following image. This email comes from
Megan because she owns the flow.

Next steps
The next step in this tutorial series is to create an app to manage projects.
Create a canvas app to manage projects
12/2/2019 • 12 minutes to read • Edit Online

NOTE
This article is part of a tutorial series on using Power Apps, Power Automate, and Power BI with SharePoint Online. Make
sure you read the series introduction to get a sense of the big picture, as well as related downloads.

In this task, we'll build a canvas app from scratch. This app allows a user to assign a manager to projects and to
update project details. You will see some of the same controls and formulas you saw in the first app, but you will
build more of the app yourself this time. The process is more complex, but you'll learn more, so we think it's a fair
trade-off.

TIP
The download package for this scenario includes a finished version of this app: project-details-app.msapp.

Quick review of Power Apps Studio


Power Apps Studio has three panes and a ribbon that make app creation feel like building a slide deck in
PowerPoint:
1. Left navigation bar, which shows a hierarchical view of all the app's screens and controls, as well as thumbnails
of the screens
2. Middle pane, which contains the app screen you are working on
3. Right-hand pane, where you set options like layout and data sources
4. Property drop-down list, where you select the properties that formulas apply to
5. Formula bar, where you add formulas (like in Excel) that define app behavior
6. Ribbon, where you add controls and customize design elements
Step 1: Create screens
With that review out of the way, let's start building an app.
Create and save the app
1. In Power Apps Studio, click or tap New, then under Blank app, click or tap Phone Layout.

2. Click or tap File, which opens to an App settings tab. Enter the name "Project Management app".

3. Click or tap Save as, verify that the app will save to the cloud, then click Save in the lower right corner.

4. Click or tap to go back to the app.


Add four screens to the app
In this step, we'll create four blank screens for the app. We'll use different screen layouts, depending on the screen's
purpose. We'll add to these screens in later steps.

SCREEN PURPOSE

SelectTask Opening screen; navigate to other screens

AssignManager Assign a manager to an approved project

ViewProjects View a list of projects, with summary information

UpdateDetails View and update the details for a project

1. On the Home tab, click or tap NewScreen, then Scrollable screen.

2. Rename the screen to SelectTask.

3. Create and rename additional screens:


a. Click or tap NewScreen, then Scrollable screen. Rename the screen to AssignManager.
b. Click or tap NewScreen, then List screen. Rename the screen to ViewProjects.
c. Click or tap NewScreen, then Form screen. Rename the screen to UpdateDetails.
4. Select the ellipsis (. . .) next to Screen1, then click or tap Delete.

The app should now look like the following image.


Step 2: Connect to a SharePoint list
In this step, we'll connect to the Project Details SharePoint list. We only use one list in this app, but you could
easily connect to both if you want to extend the app.
1. In the left navigation bar, click or tap the SelectTask screen.
2. In the right pane, click or tap Add data source.

3. Click or tap New connection.

4. Click or tap SharePoint.

5. Select Connect directly (cloud services), then click or tap Create.


6. Enter a SharePoint URL, then click or tap Go.

7. Select the Project Details list, then click or tap Connect.

The Data sources tab in the right pane now shows the connection that you have created.

Step 3: Build the SelectTask screen


In this step, we'll provide a way to navigate to the other screens in the app - working with some of the controls,
formulas, and formatting options that Power Apps provides.
Update the title and insert introductory text
1. In the left navigation bar, select the SelectTask screen.
2. In the middle pane, select the default [Title], then in the formula bar, update the Text property to "Contoso
Project Management".

3. On the Insert tab, click or tap Label, then drag the label down below the top banner.
4. In the formula bar, set the following properties for the label:
Color property = DarkGray
Size property = 18
Text property = "Click or tap a task to continue..."

Add two navigation buttons


1. On the Insert tab, click or tap Button, then drag the button below the label.

2. In the formula bar, set the following properties for the button:
OnSelect property = Navigate(AssignManager, Fade). When you run the app and click this
button, you navigate to the second screen in the app, with a fade transition between the screens.
Text property = "Assign Manager"
3. Resize the button to accommodate the text.

4. Insert another button with the following properties:


OnSelect property = Navigate(ViewProjects, Fade).
Text property = "Update Details"
NOTE
The button is labeled Update Details, but we first navigate to the ViewProjects screen to select a project to
update.

Run the app


The app doesn't do a lot yet, but you can run it if you like:
1. Click or tap the SelectTask screen (the app always starts from the selected screen in Preview mode in
Power Apps Studio).
2. Click or tap in the upper right corner to run the app.
3. Click or tap one of the buttons to navigate to another screen.
4. Click or tap in the upper right corner to close the app.

Step 4: Build the AssignManager screen


In this step, we'll use a gallery to display all projects that have been approved but don't yet have a manager. We'll
add other controls, so you can assign a manager.

NOTE
We'll build a page later in the app that allows you to edit all fields for a project (including the manager field), but we thought
it would be cool to build a screen like this one as well.

1. Save the changes you've made so far.


2. In the left navigation bar, click or tap the AssignManager screen.
Update the title and insert introductory text
1. Change [Title] to Assign Manager.
2. Add a label with the following properties:
Color property = DarkGray
Size property = 18
Text property = "Select a project, then assign a manager"
Add a back arrow to return to the SelectTask screen
1. Click or tap the blue bar at the top of the screen.
2. On the Insert tab, click or tap Icons, then click or tap Left.

3. Move the arrow to the left side of the blue bar, and set the following properties:
Color property = White
Height property = 40
OnSelect property = Navigate(SelectTask, Fade)
Width property = 40

Add and modify a gallery


1. On the Insert tab, click or tap Gallery, then Vertical.

2. Select Title, subtitle, and body from the Layout menu in the right pane.
The gallery now has the right layout, but it still has the default sample text. We'll fix that next.

3. Set the following properties for the gallery:


BorderThickness property = 1
BorderStyle property = Dotted
Items property = Filter('Project Details', PMAssigned="Unassigned"). Only projects with no
manager assigned are included in the gallery.

4. In the right pane, update the fields to match the following list:
ApprovedDate
Status
Title
5. Resize labels in the gallery as appropriate, and remove the arrow from the first gallery item (we don't need
to navigate anywhere from this gallery).

The screen should now look like the following image.

Change the color of an item if it's selected


1. Select the gallery, then set the TemplateFill property to If (ThisItem.IsSelected=true, Orange, White).
2. Select an item in the gallery. The screen should now look like the following image.

Add a label, text input, and OK button to submit manager assignments


1. Click or tap outside the gallery you've been working on.
2. On the Insert tab, click or tap Label. Drag the label below the gallery, to the left. Set the following
properties for the label:
Size property = 20
Text property = "Manager:"
3. On the Insert tab, click or tap Text, then Text input. Drag the text input below the gallery, in the center. Set
the following properties for the drop down:
Default property = ""
Height property = 60
Size property = 20
Width property = 250

4. On the Insert tab, click or tap Button. Drag the button below the gallery, to the right. Set the following
properties for the button:
Height property = 60
OnSelect property = Patch('Project Details', LookUp('Project Details', ID =
Gallery1.Selected.ID ), {PMAssigned: TextInput1.Text}). For more information, see Formula
deep-dive.
This formula updates the Project Details list, setting a value for the PMAssigned field.
Size property = 20
Text property = "OK"
Width property = 80

The completed screen should now look like the following image.
Step 5: Build the ViewProjects screen
In this step, we'll change properties for the gallery on the ViewProjects screen. This gallery displays items from
the Project Details list. You select an item on this screen, then you edit the details on the UpdateDetails screen.
1. In the left navigation bar, click or tap the ViewProjects screen.
2. Change [Title] to "View Projects".
3. In the left navigation bar, click or tap BrowserGallery1 under ViewProjects.
4. Select Title, subtitle, and body from the Layout menu in the right pane.

The gallery now has the right layout, with the default sample text.
5. Select the refresh button , and set its OnSelect property to Refresh('Project Details').
6. Select the new item button , and set its OnSelect property to NewForm (EditForm1);
Navigate(UpdateDetails, ScreenTransition.None).
Add a back arrow to return to the SelectTask screen
1. In the left navigation bar, click or tap the AssignManager screen.
2. Select the back arrow you added there, and copy it.
3. Paste the arrow into the ViewProjects screen and position it to the left of the refresh button.

All its properties come along with it, including the OnSelect property of Navigate(SelectTask, Fade).
Change the data source for the BrowseGallery1 gallery
1. Select the BrowseGallery1 gallery, and set the Items property of the gallery to
SortByColumns(Filter('Project Details', StartsWith(Title, TextSearchBox1.Text)), "Title",
If(SortDescending1, Descending, Ascending)).
This sets the data source of the gallery to the Project Details list, and uses the Title field for search and
sort.
2. Select the in the first gallery item, and set the OnSelect property to Navigate(UpdateDetails, None).

3. In the right pane, update the fields to match the following list:
Status
PMAssigned
Title

The completed screen should now look like the following image.
Step 6: Build the UpdateDetails screen
In this step, we'll connect the edit form on the UpdateDetails screen to our data source, and we'll make some
property and field changes. On this screen, you edit details for a project that you selected on the View Projects
screen.
1. In the left navigation bar, click or tap the UpdateDetails screen.
2. Change [Title] to "Update Details".
3. In the left navigation bar, click or tap EditForm1 under UpdateDetails.
4. Set the following properties for the form:
DataSource property = 'Project Details'
Item property = BrowseGallery1.Selected
5. With the form still selected, in the right pane click or tap the checkbox for the following fields, in the order
shown:
Title
PMAssigned
Status
ProjectedStartDate
ProjectedEndDate
ProjectedDays
ActualDays
6. Select the cancel button , and set its OnSelect property to ResetForm (EditForm1); Back().
7. Select the save button and check out the OnSelect formula - SubmitForm (EditForm1). Because we're
using the edit form control, we can use Submit(), instead of using Patch() like we did earlier.
The completed screen should now look like the following image (if the fields are blank, make sure you select an
item on the View Projects screen).

Step 7: Run the app


Now that the app is complete, let's run it to see how it works. We'll add a link on the SharePoint site to the app. You
will be able to run the app in the browser, but you might need to share the app for other people to run it. For more
information, see Share your apps.
Add a link to the app
1. In the Office 365 app launcher, click or tap PowerApps.
2. In Power Apps, click or tap the ellipsis (. . .) for Project Management app, then Open.

3. Copy the address (URL ) for the app in the browser.

4. In SharePoint, click or tap EDIT LINKS.


5. Click or tap (+) link.

6. Enter "Project Management app", and paste in the address for the app.

7. Click or tap OK, then Save.

Assign a manager to a project


Now that we have the app in our SharePoint site, we'll assume the role of the project approver - we'll look for any
projects that don't have a manager assigned, and assign a manager to one of the projects. Then we'll assume the
role of the project manager, and add some information about a project that is assigned to us.
1. First, let's look at the Project Details list in SharePoint. Two projects have a value of Unassigned in the
PMAssigned column. We will see these in the app.

2. Click or tap the link that you created to the app.


3. On the first screen, click or tap Assign Manager.

4. On the Assign Manager screen, you see the two unassigned projects from the list. Select the New BI
software project.

5. In the Manager text input, enter "Joni Sherman", then click OK.
The change is applied to the list, and the gallery refreshes so only the remaining unassigned project is
displayed.

6. Go back to the SharePoint list and refresh the page. You'll see that the project entry is now updated with the
project manager name.
Update details for the project
1. Click or tap to go back to the first screen, then click or tap Update Details.

2. On the View Projects screen, enter "New" in the search box.

3. Click for the New BI software item.

4. On the Update Details screen, set the following values:


The ProjectedStartDate field = "3/6/2017"
The ProjectedEndDate field = "3/24/2017"
The ProjectedDays field = "15"

5. Click or tap to apply the change to the SharePoint list.


6. Close the app, and go back to the list. You see that the project entry is now updated with the date and day
changes.

Formula deep-dive
This is the second optional section on Power Apps formulas. In the first deep-dive, we looked at one of the
formulas that Power Apps generates for the browse gallery in a three-screen app. In this deep-dive, we'll look at a
formula that we use for the AssignManager screen of our second app. Here's the formula:
Patch( 'Project Details', LookUp( 'Project Details', ID = Gallery1.Selected.ID ), {PMAssigned:
TextInput1.Text} )
What does this formula do? When you select an item in the gallery and click the OK button, the formula updates
the Project Details list, setting the PMAssigned column to the value that you specify in the text input. The
formula uses functions to do its work:
The Patch function modifies one or more records of a data source.
The LookUp function finds the first record in a table that satisfies a formula.
When you put the functions together in the formula, here's what happens:
1. When you click the OK button, the Patch function is called to update the Project Details list.
2. Within the Patch function, the LookUp function identifies which row of the Project Details list to update.
It does this by comparing the ID of the selected gallery item to the ID in the list. For example, an ID of 12
means that the entry for New BI software should be updated.
3. Now that the Patch function has the right ID, it updates the PMAssigned field to the value in
TextInput1.Text.

Next steps
The next step in this tutorial series is to create a Power BI report to analyze projects.
Create a Power BI report to analyze projects
12/2/2019 • 12 minutes to read • Edit Online

NOTE
This article is part of a tutorial series on using Power Apps, Power Automate, and Power BI with SharePoint Online. Make
sure you read the series introduction to get a sense of the big picture, as well as related downloads.

In this task, we'll create a Power BI report based on the two SharePoint lists. We'll bring the list data into Power BI
Desktop and clean it up a little, do some basic data modeling, and create a set of visuals that tell us something
about the data.

TIP
The download package for this scenario includes a finished version of this report: project-analysis.pbix.

Quick review of Power BI Desktop


Before we dive into report creation, let's review Power BI Desktop. This is a powerful tool, with a lot of features, so
we will focus on an overview of the areas that you will use in this task. There are three main work areas or views in
Power BI Desktop: Report view, Data view, and Relationships view. Power BI Desktop also includes Query
Editor, which opens in a separate window.
The following screen shows the three view icons along the left of Power BI Desktop: Report, Data, and
Relationships, from top to bottom. The yellow bar along the left indicates the current view; in this case, Report
view is displayed. Change views by selecting any of those three icons.

The Report view has five main areas:


1. The ribbon, which displays common tasks associated with reports and visualizations.
2. The Report view, or canvas, where visualizations are created and arranged.
3. The Pages tab area along the bottom, which lets you select or add a report page.
4. The Visualizations pane, where you change visualizations, customize colors or axes, apply filters, drag fields,
and more.
5. The Fields pane, where query elements and filters can be dragged onto the Report view, or dragged to the
Filters area of the Visualizations pane.
The Data view has three main areas:
1. The ribbon, which has the Modeling tab selected below. On this tab, you create calculated tables and columns,
and make other changes to the data model.
2. The center pane, which shows data for the selected table.
3. The Fields pane, where you control how fields are displayed in your reports.

We don't use the Relationships view in this task, but you can check it out later after we bring the list data into
Power BI Desktop.
In Query Editor, you build queries and transform data, then load that refined data model into Power BI Desktop.
Query Editor has four main areas:
1. The ribbon, which has many options for shaping and transforming the data that you bring in.
2. The left pane, where queries are listed and available for selection, viewing, and shaping.
3. The center pane, where data from the selected query is displayed and available for shaping.
4. The Query Settings window, which lists the query's properties and data transform steps that have been
applied.

Step 1: Get data into Power BI Desktop


In this step, we'll first connect to the two lists. Then we'll clean up the data by removing columns we don't need for
our data analysis. We'll also change the data types on some of the remaining columns so that calculations work
properly. For more information on getting and cleaning data in Power BI Desktop, see the Getting Data section in
our Guided Learning course.
Connect to SharePoint lists
1. In Power BI Desktop, on the Home tab, click or tap Get Data, then More…

2. In the Get Data dialog box, click or tap SharePoint Online List, then Connect.
3. Enter the URL for your SharePoint site, then click or tap OK.

4. If you get the following dialog box, make sure you're signed in with the right credentials, then click or tap
Connect.

5. Select Project Details and Project Requests, then click or tap Edit.
The lists are now displayed as tables in Query Editor.

Remove unnecessary columns from the tables


1. In the left navigation pane, click or tap Project Details.
2. In the middle pane, select the FileSystemObjectType column, then click or tap Remove Columns.

3. Remove the two columns after the Id column: ServerRedirectedEmbedURL and ContentTypeId.

TIP
Use the Shift key to select both columns, then click or tap Remove Columns.

4. Remove all columns to the right of the PMAssigned column (a total of 22 columns). The table should
match the following image:
5. Repeat the process you just went through, now for Project Requests: remove FileSystemObjectType,
ServerRedirectedEmbedURL, ContentTypeId, and all columns to the right of the Approved column (a
total of 22 columns). The table should match the following image:

Change the data type on Project Details columns


1. Select the ProjectedDays column, click or tap Data Type: Any, then Whole Number.

2. Repeat the previous step for the ActualDays column.


3. Select the ApprovedDate column, click or tap Data Type: Any, then Date.

4. Repeat the previous step for the ProjectedStartDate and ProjectedEndDate columns.
Change the data type on Project Requests columns
1. Select the EstimatedDays column, click or tap Data Type: Any, then Whole Number.
2. Select the RequestDate column, click or tap Data Type: Any, then Date.
Apply and save changes
1. On the Home tab, click Close and Apply to close Query Editor and go back to the main Power BI Desktop
window.

2. Click or tap File, then Save, and save with the name project-analysis.pbix.

Step 2: Improve the data model


Now that we have the data from our SharePoint lists pulled into Power BI Desktop, we'll move on to data
modeling. Data modeling can be a time-consuming process, but we'll briefly show you some interesting things you
can do to get more out of the list data in Power BI Desktop:
Change how the two tables are related to each other
Add a date table so we can make calculations based on weekdays
Add calculated columns to calculate timespans between project milestones
Add measures to calculate variance in projected versus actual days for a project
After these steps are complete, we can build visualizations that take advantage of the improvements to our model.
For more information on modeling data in Power BI Desktop, see the Modeling section in our Guided Learning
course.
Change table relationships
When Power BI Desktop brought the lists in, it created a relationship between them based on the Id column in
both tables. The relationship should actually be between the Id column in the Project Requests table, and the
RequestId column in the Project Details table. Let's fix that:
1. Click or tap the Data view icon.

2. On the Modeling tab, click or tap Manage Relationships. We'll stay on this tab in the Data view for all
the data modeling steps.

3. Make sure the existing relationship is selected, click or tap Delete, then Delete again to confirm.
4. Click New to create a different relationship.
5. In the Create Relationship dialog box:
a. For the first table, select Project Requests, and the Id column.
b. For the second table, select Project Details, and the RequestId column.
c. The screen should look like the following image. When you're ready, click or tap OK, then Close.

Add a date table to make date -based calculations easier


1. Click or tap New Table.

2. Enter this formula into the formula bar: Dates = CALENDARAUTO ().
This formula creates a table called Dates with a single date column. The table covers all dates from your
other table, and it updates automatically if additional dates are added (i.e. if data is refreshed).
This formula and the other ones in this section use Data Analysis Expressions (DAX), a formula language for
Power BI and other technologies. For more information, see DAX basics in Power BI Desktop.
3. Press Enter to create the Dates table.

Add a calculated column to the Dates table


1. While still on the date table, click or tap New Column.

2. Enter this formula into the formula bar: IsWeekDay = SWITCH (WEEKDAY (Dates[Date]), 1,0,7,0,1).
This formula determines whether a date in the Date column is a weekday. If the date is a weekday, the
IsWeekDay column gets a value of 1; otherwise it gets a value of 0.
3. Press Enter to add the IsWeekDay column to the Dates table.

Add a calculated column to the Project Details table


1. In the right pane, click or tap the Project Details table, then New Column.

2. Enter this formula into the formula bar:

ApprovedStartDiff = CALCULATE(SUM(Dates[IsWeekday]),
DATESBETWEEN(Dates[Date],
'Project Details'[ApprovedDate],
'Project Details'[ProjectedStartDate]
)
)

This formula calculates the difference in days between when a project was approved and when it is
projected to start. It uses the IsWeekday column from the Dates table, so it counts only weekdays.
3. Press Enter to add the ApprovedStartDiff column to the Project Details table.
Add a calculated column to the Project Requests table
1. In the right pane, click or tap the Project Requests table, then New Column.

2. Enter this formula into the formula bar:

RequestDateAge = CALCULATE(SUM(Dates[IsWeekday]),
DATESBETWEEN(Dates[Date],
'Project Requests'[RequestDate],
NOW()
)
)

This formula calculates the difference in days between when a project was requested and today's date
(NOW ()). Again, the formula counts only weekdays. This column is used to look for the project that has been
pending the longest.
3. Press Enter to add the RequestDateAge column to the Project Requests table.

Add a measure to the Project Details table


1. In the right pane, click or tap the Project Details table, then New Measure.
2. Enter this formula into the formula bar:

VarProjectedActual = DIVIDE(
SUM('Project Details'[ActualDays]) - SUM('Project Details'[ProjectedDays]),
SUM('Project Details'[ProjectedDays])
)

This formula calculates the variance between actual and projected days for a project. We add this as a
measure, rather than a calculated column, so it returns the correct results regardless of how the data is
filtered or aggregated in a report.
3. Press Enter to add the VarProjectedActual measure to the Project Details table.

Add a measure to the Project Requests table


1. In the right pane, click or tap the Project Requests table, then New Measure.

2. Enter this formula into the formula bar:

MaxDaysPending = MAXX(
FILTER('Project Requests', 'Project Requests'[Approved]="Pending"),
'Project Requests'[RequestDateAge]
)

This formula finds the project that has been pending the longest, based on the calculated column we defined
earlier.
3. Press Enter to add the MaxDaysPending measure to the Project Requests table.
Step 3: Create report visualizations
Now we're at the step that many people think of when they think of data analysis: creating visualizations so we can
find patterns in our data. In this step, we'll create four visualizations:
A column chart that shows projected days versus actual days on projects
A column chart that shows the variance for each project
A card that shows the project that has been pending the longest
A table that shows the time between project approval and projected start date
After we've created these report visualizations in Power BI Desktop, we'll publish the data and reports to the Power
BI service, so we can create and share dashboards. For more information on creating reports in Power BI Desktop,
see the Visualizations section in our Guided Learning course.
Create a bar chart to show projected versus actual
1. Click or tap the Report view icon. We'll stay in this view for the rest of our time in Power BI Desktop.

2. In the Visualizations pane on the right, click or tap Clustered column chart.

3. Drag PMAssigned and Title from Project Details in the Fields pane to Axis in the Visualizations pane.

4. Drag ActualDays and ProjectedDays from Project Details in the Fields pane to Value in the
Visualizations pane.
5. The visualization should now look like the following image.

6. Drag Status from Project Details in the Fields pane to the Filters area of the Visualizations pane, then
select the Completed check box.

The chart is now filtered to show only completed projects, which makes sense because we are comparing
projected days to actual days.
7. Click the arrows in the upper left corner of the chart to move up and down the hierarchy of project
managers and projects. In the following image, you see what the drill down into projects looks like.
Create a bar chart to show variance from projected
1. Click or tap on the canvas outside the visualization you just created.
2. In the Visualizations pane on the right, click or tap Clustered column chart.

3. Drag PMAssigned and Title from Project Details in the Fields pane to Axis in the Visualizations pane.

4. Drag VarProjectedActual from Project Details in the Fields pane to Value in the Visualizations pane.

5. Drag Status from Project Details in the Fields pane to the Filters area of the Visualizations pane, then
select the Completed check box.
The visualization should now look like the following image.

You can see from this chart how much more variability there is for projects that were run by Irvin Sayers
versus Joni Sherman. Drill in to see the variability by project, and whether the days projected was more or
less than the actual days.

6. Before we create more visualizations, move and resize the ones you already created, so they fit side-by-side.
Create a card that shows the longest pending project
1. Click or tap on the canvas outside the visualization you just created.
2. In the Visualizations pane on the right, click or tap Card.

3. Drag MaxDaysPending from Project Requests in the Fields pane to Fields in the Visualizations pane.

4. Click or tap Format (paint roller), then set Border to On.

5. Set Title to On, then add the title "Max days pending approval".
The visualization should now look like the following image.

After we publish this report, we'll use this tile to trigger an alert if the maximum value for a pending project
reaches a certain threshold.
Create a table that shows the time between project approval and projected start date
1. Click or tap on the canvas outside the visualization you just created.
2. In the Visualizations pane on the right, click or tap Table.

3. Drag PMAssigned, Title, and ApprovedStartDiff from Project Details in the Fields pane to Values in
the Visualizations pane.

4. Drag ProjectedStartDate from Project Details in the Fields pane to the Filters area of the
Visualizations pane, then select all dates except for (Blank).
5. Resize the columns of the table so you can see all the data, and sort by ApprovedStartDiff, descending.
The visualization should now look like the following image.

6. In the Values area, click or tap the down arrow for ApprovedStartDiff, then click or tap Average. Now we
can see the average duration between project approval and projected start date.

7. Click or tap the down arrow for ApprovedStartDiff again, click or tap Conditional formatting, then click
or tap Background color scales.
8. Set colors for the Minimum and Maximum fields as shown below, then click or tap OK.

The visualization should now look like the following image.

As you can see, projects that Irvin Sayers runs tend to start a lot later after approval. There could be factors
other than the assigned manager, but this would be worth looking into.
That brings us to the end of the report section, and you should now have a complete report based on data
imported from SharePoint and cleaned up and modeled in Power BI Desktop. If everything went according to plan,
your report should look like the following image.
Next steps
The next step in this tutorial series is to publish the Power BI project report and create a dashboard.
Publish the Power BI project report and create a
dashboard
12/2/2019 • 2 minutes to read • Edit Online

NOTE
This article is part of a tutorial series on using Power Apps, Power Automate, and Power BI with SharePoint Online. Make
sure you read the series introduction to get a sense of the big picture, as well as related downloads.

In this task, we'll publish our dataset and report to the Power BI service; then we'll create a dashboard based on the
report. In many cases a report has a large number of visualizations and only a subset are used in a dashboard. In
our case, we'll add all four visualizations to the dashboard.

Step 1: Publish the dataset and report


1. In Power BI Desktop, on the Home tab, click or tap Publish.

2. If you're not already signed in to the Power BI service, enter an account, then click or tap Sign in.

3. Enter a password, then click or tap Sign in.

4. Choose a destination for the report, then click or tap Select. We recommend publishing to a group
workspace to simplify access to the report in SharePoint. In this case, we are publishing to the Project
Management group workspace. For more information, see Collaborate in your Power BI app workspace.
5. After publishing completes, click or tap Open 'project-analysis.pbx' in Power BI.

6. The Power BI service loads the report in a browser. If the left navigation pane isn't expanded, click or tap the
menu at the top left (a) to expand it.

You can see that when we published, Power BI Desktop uploaded a dataset (d) and a report (c). You create
dashboards in the service, not Power BI Desktop, and this workspace doesn't have any dashboards yet (b).
We'll create one shortly.

Step 2: Configure credentials for refresh


1. In the service, click or tap in the top right corner, then click or tap Settings.
2. Click or tap Datasets, then project-analysis.
3. Expand Data source credentials, then click or tap Edit credentials.

4. Select OAuth2 for Authentication method, then click or tap Sign in.

5. Select or sign in to an account that has permissions for the SharePoint lists.

When the process completes, you'll get the following message in the service.

Step 3: Create a dashboard


1. To get back to your report, under REPORTS click or tap project-analysis.
2. Click or tap the chart on the upper left, then click or tap .
3. Enter a name for the dashboard you want to pin to, then click or tap Pin.

4. Click or tap the chart on the upper right, then click or tap tap .

5. Select the existing dashboard, then click or tap Pin.


6. Repeat the pinning process for the other two visuals.
7. In the left navigation pane, click or tap the dashboard name.

8. Review the dashboard. If you click on a tile, you will go back to the report.

That wraps up most of the work in Power BI. If that was your first experience creating reports and dashboards,
congratulations! If you're already a pro, we hope you could move through it quickly. Now we will add alerting to
make sure we know if the dashboard needs our attention.

Next steps
The next step in this tutorial series is to set up data alerts for the Power BI project report.
Embed the Power BI project report in SharePoint
Online
12/2/2019 • 2 minutes to read • Edit Online

NOTE
This article is part of a tutorial series on using Power Apps, Power Automate, and Power BI with SharePoint Online. Make
sure you read the series introduction to get a sense of the big picture, as well as related downloads.

We'll now embed our Power BI report in the same SharePoint Online site that hosts our two lists. Power BI
supports a variety of approaches to embedding, including directly integrating into SharePoint pages for web and
mobile views.
With this type of embedding, Power BI embeds the report as a web part, provides appropriate access for users, and
lets you click through from the embedded report to the report at powerbi.com. First, we'll generate an embed link
in Power BI, then use that link in a page that we create. For more information on embedding, see Embed with
report web part in SharePoint Online.

Step 1: Generate an embed link


1. Sign in to Power BI, then in the left navigation pane, click or tap the report name.

2. Click or tap File, then Embed in SharePoint Online.

3. Copy the embed link from the dialog box to a file, then click or tap Close. We will use the link after we create
a SharePoint page.
Step 2: Embed the report
1. Sign in to SharePoint, then click or tap Site contents.

2. You could just include a report on the team home page, but we'll show you how to create a separate page
for it also. Click or tap New, then Page.

3. Enter a name for the page, like "Project Analysis".


4. Click or tap then Power BI.
5. Click or tap Add report.

6. In the right pane, copy the embed URL into the Power BI report link box. Set both Show Filter Pane and
Show Navigation Pane to On.

7. The report is now embedded in the page. Click Publish to make it available to anyone who can access the
underlying report.

Step 3: Grant access to the report.


If you are using Office 365 Groups as we recommend, make sure users who need access are members of the
group workspace within the Power BI service. This ensures that users can view the contents of that group. For
more information, see Collaborate in your Power BI app workspace.
That wraps up our work in Power BI for this scenario. You started by pulling data from our SharePoint lists into
Power BI, and have now come full circle to embedding your Power BI report back into SharePoint.

Next steps
The next step in this tutorial series is to run through the workflow we created end-to-end.
Set up data alerts for the Power BI dashboard
12/2/2019 • 2 minutes to read • Edit Online

NOTE
This article is part of a tutorial series on using Power Apps, Power Automate, and Power BI with SharePoint Online. Make
sure you read the series introduction to get a sense of the big picture, as well as related downloads.

In this task we'll add an alert in Power BI to let us know if pending projects are taking too long to approve, and a
flow that responds when that alert occurs. For more information on alerts, see Data alerts in Power BI service.

Step 1: Create an alert


1. In the Power BI service, open the dashboard you created in the last task.
2. On the card with the single number, click or tap the ellipsis (. . .).

3. Click or tap .

4. In the right pane, click or tap Add alert rule.

5. Look at the options that are available for alerts, such as how frequently an alert should run. Enter a value of
25 for Threshold, then click or tap Save and close.
The alert won't fire right now even though 56 is above the threshold of 25. It will fire when data is updated, which
we'll see when we run through the scenario end-to-end.
When the alerts fires, Power BI sends email to the creator of the alert, and we'll see how to send additional mail
using Power Automate, in the next step.

Step 2: Create a flow that responds to the alert


1. Sign into flow.microsoft.com, click or tap Services, then Power BI.

2. Click or tap Send an e-mail to any audience when a Power BI data alert is triggered.

3. Click or tap Use this template.


4. If you're not already signed in, sign into Outlook and Power BI, then click or tap Continue.

5. In the Alert Id drop-down list, select Alert for Max days pending approval.

6. In the To box, enter a valid email address.

7. Click or tap Edit to see other fields that you can update.

8. At the top right of the screen, click Create flow, then Done.

We will see this flow run when we run through the scenario end-to-end. Now we'll move on to the last task in this
scenario - embedding a Power BI report into SharePoint.

Next steps
The next step in this tutorial series is to embed the Power BI project report in SharePoint Online.
Walk end-to-end through the completed SharePoint
Online integration scenario
12/3/2019 • 4 minutes to read • Edit Online

NOTE
This article is part of a tutorial series on using Power Apps, Power Automate, and Power BI with SharePoint Online. Make
sure you read the series introduction to get a sense of the big picture, as well as related downloads.

We have covered a huge amount of ground in this series of tutorials, from building canvas apps and flows, to
creating reports and embedding them in SharePoint. We hope you've learned a lot and have enough exposure to
how these technologies integrate, so that you can integrate canvas apps, flows, and reports into SharePoint based
on your own needs. Before we finish, we want to walk through the scenario end-to-end and see how all the parts
work together.

Step 1: Add a project to the Project Requests list


1. In the Project Requests list, click or tap All Items, then Project Requests app.

2. Click Open, which opens the app in a new browser tab.

3. In the app, click or tap to create a new item.


4. Fill out the form with the following values:
Title = "Mobile devices for design team"
Approved = "Pending"
Description = "The design team will now use Contoso-supplied devices"
EstimatedDays = "30"
ProjectType = "New hardware"
RequestDate = "03/01/2017"
Requestor = "Emily Braun"
5. Click or tap , then close the browser tab.
6. Go back to the Project Requests list, click or tap Project Requests app, then All Items.

7. Verify the new entry in the list.

Step 2: Approve the project


1. When you add the item in Step 1, the flow should run and send out an approval mail. Check the inbox of
the approver's email account.
2. Click Approve. The flow runs another process, and you get feedback like the following directly in the email.

3. Check the inbox of the requestor's email account, and you should see an approval email.

4. Verify the updated entry in the list.

Step 3: Assign a manager to the project


1. First, let's look at the Project Details list in SharePoint. The new project has a value of Unassigned in the
PMAssigned column.

2. In the SharePoint site, in the left navigation, click or tap Project Management app.
3. On the first screen, click or tap Assign Manager.

4. On the Assign Manager screen, you see the two unassigned projects from the list. Select the Mobile
devices for design team project.

5. In the Manager text input, enter "Joni Sherman", then click OK.
The change is applied to the list, and the gallery refreshes so only the remaining unassigned project is
displayed.

6. Close the app, and go back to the SharePoint list. You'll see that the project entry is now updated with the
project manager name.

Step 4: Add time estimates for the project


1. Click or tap to go back to the first screen, then click or tap Update Details.
2. On the View Projects screen, enter "Mobile" in the search box.

3. Click for the Mobile devices for design team item.

4. On the Update Details screen, set the following values:


The Status field = "Not started"
The ProjectedStartDate field = "3/6/2017"
The ProjectedEndDate field = "3/24/2017"
The ProjectedDays field = "15"
5. Click or tap to apply the change to the SharePoint list.
6. Close the app, and go back to the list. You'll see that the project entry is now updated with the date and day
changes.

Step 5: Review report data for existing projects


1. In SharePoint Online, click or tap Site contents, then Site Pages.
2. Open the Project Analysis page that we created earlier.
3. Review the variance visualization.

As we noted when we created this visualization, there is a lot more variance for projects that were run by
Irvin Sayers versus Joni Sherman.
4. Drill into the visualization, and you see that much of the variance comes from two projects that took a lot
longer than projected.
5. Review the table that shows how long it takes for projects to go from approval to projected start date.

As we noted when we created this visualization, the projects that Irvin Sayers is assigned to take longer to
start, with two projects taking much longer than the rest.

Step 6: Respond to pending project delays


1. In the Power BI service, click or tap the project-analysis dataset, then click or tap REFRESH NOW. The
refresh triggers the alert we set up for pending projects.
2. After the refresh is complete, the Notification Center at top right shows a new notification icon.

This can take some time, so check back if you don't see it right away.
3. Open the Notification Center to see the details of the alert that fired.

4. Check the inbox for the person who created the alert (Megan Bowen in our case).

5. Check the inbox for the person you added in the data alerts flow (Allan DeYoung in our case).

6. Now that you have information on pending projects, you can go back and approve any that have been
waiting for your attention.
That brings us to the conclusion of our end-to-end walkthrough and this series of tutorials. We encourage you to
continue your journey at the following sites:
Power Apps
Power Automate
Power BI
Power Users Community
SharePoint
Microsoft Tech Community
Let us know in the comments if you have any feedback on this series, suggestions for additions, or ideas for
additional content that will help you work with the technologies that we covered.
Use Cognitive Services in Power Apps
1/21/2020 • 7 minutes to read • Edit Online

This article shows you how to build a basic canvas app that uses the Azure Cognitive Services Text Analytics API to
analyze text. We'll show you how to set up the Text Analytics API, and connect to it with the Text Analytics
connector. Then we'll show you how to create a canvas app that calls the API.

NOTE
If you are new to building apps in Power Apps, we recommend reading Create an app from scratch before diving into this
article.

Introduction to Azure Cognitive Services


Azure Cognitive Services are a set of APIs, SDKs, and services available to make your applications more intelligent,
engaging, and discoverable. These services enable you to easily add intelligent features – such as emotion and
video detection; facial, speech and vision recognition; and speech and language understanding – into your
applications.
We'll focus on "language understanding" for this article, working with the Text Analytics API. This API enables you
to detect sentiment, key phrases, topics, and language from your text. Let's get started by trying out a demo of the
API, then signing up for a preview version.
Try out the Text Analytics API
The API has an online demo – you can see how it works, and look at the JSON that the service returns.
1. Go to the Text Analytics API page.
2. In the See it in action section, use the example text, or enter your own text. Then click or tap Analyze.

3. The page shows formatted results on the Analyzed text tab, and the JSON response on the JSON tab.
JSON is a way to represent data - in this case, data returned by the Text Analytics API.

Sign up for the Text Analytics API


The API is available as a free preview, and it is associated with an Azure subscription. You manage the API through
the Azure portal.
1. If you don't already have an Azure subscription, sign up for a free subscription.
2. In this page, enter information for the Text Analytics API, as this image shows. Select the F0 (free) pricing
tier.

3. In the lower-left corner, click or tap Create.


4. On the Dashboard, click or tap the API that you just created.

5. Click or tap Keys.

6. Copy one of the keys on the right of the screen. You use this key later when you create a connection to the
API.
Build the app
Now that you have the Text Analytics API up and running, you connect to it from Power Apps, and build an app
that calls the API. This is a single screen app that provides functionality similar to the demo on the Text Analytics
API page. Let's get started on building this!
Create the app and add a connection
First, you create a blank phone app and add a connection with the Text Analytics connector. If you need more
information about these tasks, see Create an app from scratch and Manage your connections in Power Apps.
1. In powerapps.com, choose Start from blank > (phone) > Make this app.

2. In the middle pane of the Power Apps Studio, choose connect to data.
3. On the Data panel, click or tap New connection > Text Analytics.
4. Copy your key into Account Key, then click or tap Create.
Add controls to the app
The next step in creating the app is to add all the controls. Normally when we build apps, we add formulas to the
controls as we go, but in this case we'll focus on the controls first, then add a few formulas in the next section. The
following image shows the app with all the controls.

Follow the steps below to create this screen. If a control name is specified, that name is used in a formula in the
next section.
1. On the Home tab, click or tap New Screen, then Scrollable screen.
2. On Screen2, select [Title] and change it to Text Analysis.
3. Add a Label control for the introductory text.
4. Add a Text input control, so you can enter text to analyze. Name the control tiTextToAnalyze. The app
should now look like the following image.

5. Add three Check box controls, so you can choose which API operations to perform. Name the controls
chkLanguage, chkPhrases, and chkSentiment.
6. Add a button, so you can call the API after selecting which operations to perform. The app should now look
like the following image.

7. Add three Label controls. The first two hold results from the language and sentiment API calls; the third is
just an introduction for the gallery at the bottom of the screen.
8. Add a Blank vertical gallery control, then add a Label control to the gallery. The gallery holds results from
the key phrases API call. The app should now look like the following image.
9. In the left pane, select Screen1 > ellipsis (. . .) > Delete (you don't need this screen for the app).
We're keeping this app simple to focus on calling the Text Analytics API, but you could add things - like logic to
show and hide controls based on the check boxes selected, error handling if the user doesn't select any options, and
so on.
Add logic to make the right API calls
OK, you have a nice-looking app, but it doesn't do anything yet. You'll fix that in a moment. But before we dive into
the details, let's understand the pattern that the app follows:
1. The app makes specific API calls based on the check boxes selected in the app. When you click or tap
Analyze text, the app makes 1, 2, or 3 API calls.
2. The app stores data that the API returns in three different collections: languageCollect, sentimentCollect,
and phrasesCollect.
3. The app updates the Text property for two of the labels, and the Items property for the gallery, based on
what's in the three collections.
With that background, let's add the formula for the OnSelect property of the button. This is where all the magic
happens.
If( chkLanguage.Value = true,
ClearCollect( languageCollect,
TextAnalytics.DetectLanguageV2(
{
text: tiTextToAnalyze.Text
}
).detectedLanguages.name
)
);

If( chkPhrases.Value = true,


ClearCollect( phrasesCollect,
TextAnalytics.KeyPhrasesV2(
{
language: "en",
text: tiTextToAnalyze.Text
}
).keyPhrases
)
);

If( chkSentiment.Value = true,


ClearCollect( sentimentCollect,
TextAnalytics.DetectSentimentV2(
{
language: "en",
text: tiTextToAnalyze.Text
}
).score
)
)

There's a bit going on here, so let's break it down:


The If statements are straightforward – if a specific check box is selected, make the API call for that
operation.
Within each call, specify the appropriate parameters:
In all three calls, you specify tiTextToAnalyze.Text as the input text.
In DetectLanguage(), numberOfLanguagesToDetect is hard-coded as 1, but you could pass this
parameter based on some logic in the app.
In KeyPhrases() and DetectSentiment(), language is hard-coded as "en", but you could pass this
parameter based on some logic in the app. For example, you could detect the language first, then set
this parameter based on what DetectLanguage() returns.
For each call that is made, add the results to the appropriate collection:
For languageCollect, add the name of the language that was identified in the text.
For phrasesCollect, add the keyPhrases that were identified in the text.
For sentimentCollect, add the sentiment score for the text, which is a value of 0-1, with 1 being
100% positive.
Display the results of the API calls
To display the results of the API calls, reference the appropriate collection in each control:
1. Set the Text property of the language label to: "The language detected is " & First(languageCollect).name .
The First() function returns the first (and in this case only) record in languageCollect, and the app displays
the name (the only field) associated with that record.
2. Set the Text property of the sentiment label to:
"The sentiment score is " & Round(First(sentimentCollect.Value).Value, 3)*100 & "% positive." .
This formula also uses the First() function, gets the Value (0-1) from the first and only record, then formats
it as a percentage.
3. Set the Items property of the key phrases gallery to: phrasesCollect .
You're now working with a gallery so you don't need the First() function to extract a single value. You
reference the collection, and the gallery displays the key phrases as a list.

Run the app


Now that the app is finished, run it to see how it works: click or tap the run button in the upper right corner . In
the following image, all three options are selected, and the text is the same as the default text on the Text Analytics
API page.

If you compare the output of this app to the Text Analytics API page at the beginning of this article, you see that the
results are the same.
We hope you now understand a little more about the Text Analytics API, and you've enjoyed seeing how to
incorporate it into an app. Let us know if there are other Cognitive Services (or other services in general) that you
would like us to focus on in our articles. As always, please leave feedback and any questions in the comments.
Transform your InfoPath form to Power Apps
12/10/2019 • 13 minutes to read • Edit Online

Are you a builder of great things in InfoPath who's looking to learn how to deliver those great things on a more
robust platform?

Key advantages of Power Apps over InfoPath


Like most InfoPath power users, you've been using your unique skill set to build awesome forms for a while. You're
very satisfied with your forms, but you also know their limitations: the "classic" feel, a less-than-ideal experience for
mobile devices, the uncertainty of their future viability, and always being trapped in a box when it comes to
connecting to other services without writing code.
The Power Apps team has heard these and many other challenges. They've worked hard to incorporate a better
experience and enable you to create canvas apps by leveraging your existing business and technology skills. By
using Power Apps, you can quickly build and deploy the right business solutions without writing code.
Power Apps enable a powerful future
Power Apps is a Software as a Service (SaaS ) platform that's designed to let you quickly build high-functioning
apps that you can deploy to the web, SharePoint, Dynamics 365, Teams, Power BI, or a mobile device without any
extra work. Because you can deploy them by just giving someone the URL to your published app, they're also just
as easy to update.
Share your apps
Have you ever tried to build an app and then publish it for iOS or Android devices? It's complicated. If you want to
deploy a second app or update that existing one, your users must take a lot more steps. Not with Power Apps. Your
users install Power Apps Mobile on their devices and sign in. Voila, they have all of the highly functional apps that
you have shared with them. In the future, when you update those apps or push new apps out to them, those apps
will show up on your users' devices. Mobile apps without the pain of managing devices is a big win for you and
your business.
Speaking of mobile
With Power Apps, you can leverage the power of the user's mobile device. You have access to acceleration, the
camera, the compass, the connection information, and location signals: all from within your app. This opens up a
whole world of possibilities for building apps to get work done. Of course, touch functionality is just automatic in
Power Apps: nothing extra to code when you build your app.
Get out of the box
With InfoPath, you normally work with data from one source. However, things got tricky if you wanted to update
another source (such as a SharePoint list in another site collection) or connect to external services. Concepts such
as code behind kept you awake at night. Power Apps is designed to allow you to work with multiple data sources
and service connections in one app. Currently, more than 200 connectors support a combination of on-premises
and cloud data, including Microsoft Office 365 and Azure services such as Power Automate and Dynamics 365.
You can also connect to a multitude of third-party services such as Dropbox, Google, Salesforce, Slack, and other
popular targets.
Now you can build solutions to scale where your users need to take you, not just where the original data lived.

Power Apps and SharePoint: even better together


Power Apps is a great tool for making your SharePoint experience better in two ways. You have the option to either
customize the forms for a SharePoint list or to create a standalone app for working with SharePoint data.
Customizing a SharePoint form is great if you want to customize how users add, view, or edit items in a list that
they use for their everyday work. Clicking Customize Forms will create a single-screen "forms app" that will
change modes (new/edit/view ) based on context. SharePoint manages these apps; their permissions are the same
as the list permissions for editing/viewing.
Creating a Power Apps canvas app from SharePoint allows you to run the app by itself on a mobile device.
You can also embed the app in a SharePoint page. Clicking this will create a three-screen app (browse list, view
details, and create/update an item). The permission/sharing model for these apps isn't tied to SharePoint but
instead is managed from Power Apps.
Now that you understand the difference between the two options, the following section will give you an overview
of using each.

SharePoint forms
The Power Apps and SharePoint teams have worked together to create a customization story for you to use with
SharePoint. If you're like most InfoPath developers, you learned InfoPath to interact with SharePoint. SharePoint is
great, but the default forms are a bit pedestrian and don't allow for customization or business logic without
InfoPath. Well, that was the old way.
With Power Apps you can now customize your list forms as native functionality. And when you do so, you get the
full power of Power Apps. In the screenshot below, you can see an example of a Power Apps form with a Power BI
report embedded. The entire solution was done in less than 15 minutes.

Another important feature of Power Apps is the ability to easily connect to another SharePoint site collection or a
different environment from the same form. For example, do you want to make one form that displays and updates
data from your SharePoint Online and SharePoint on-premises environment at the same time? No problem. If you
install the on-premises data gateway, you are up and running in a few minutes, connecting Power Apps, Power BI,
Power Automate, and Azure Logic Apps with your on-premises data. No changes to firewall rules are required. You
can go a step further by connecting this app with Power Automate.

A standalone SharePoint app


Use this technique if, instead of just updating the list-form experience, you want to build a full, standalone app
based on your SharePoint data. This is also the best way to get started, so you can start to learn how the Power
Apps canvas works and build future apps from any of the multitudes of data sources.
To get started, follow these steps:
1. Open the SharePoint list from which you would like to build an app.
2. On the menu bar, select PowerApps, and then select Create an app.
3. Provide a name, and then select Create.
Power Apps will build you an app that you can customize.
Start with a simple custom list that contains just a couple of fields of different types for your first app. This will let
you build a solid foundation without being overwhelmed. Don't worry; you'll be a pro in no time and ready to
tackle those complex apps. For help walking through this first app, check out this documentation or this community
video. The examples below will show common InfoPath tasks and how to do them in Power Apps. Each of these
builds on a simple SharePoint list app.

How do you do that with Power Apps?


Now that you know the fundamental concepts, let's go further. With your first app under your belt, this section will
help you apply some of the common InfoPath concepts in Power Apps.
Hide/show/lock a field based on a value
Successful forms often enforce strong business logic by, for example, changing the state of a field based on a value
or an action. With Power Apps, you can set the DisplayMode property of a control to Edit or View to specify
whether a user can change the field. You can also use a simple If formula to do so conditionally. First, select the
card that you want to edit, and then select the lock icon. This step unlocks the card so that you can change the
value.

In the right-hand pane, scroll to the DisplayMode property so that you can edit it.
In this example, use an If formula:
If(ThisItem.Color = "Blue", DisplayMode.View, DisplayMode.Edit)

This formula says that, if the current item's Color field is Blue, the Animal field is read-only. Otherwise, the field is
editable.
To hide the card instead of making it read-only, insert a similar function in the Visible property right above
DisplayMode.
You can also play with, for example, showing an approval button only if the user's email address matches the
approver's email address. (Hint: Use User().Email to access the current user's email address.) So you could store
the approver's email address in YourDataCard and then set the button's Visible property to this formula:
If( YourDataCard.Text = User().Email, true, false )

Conditional formatting
In a similar manner as above where you hid the field, you can also provide visual feedback to users. Maybe you
want to highlight text in red if the entered value falls out of the acceptable range or change an upload button's text
and color after the user uploads a file. You can do both by using a function, such as If, in properties such as Color
or Visible.
For example, you could use the If function paired with the IsMatch function to change the text color of the email
field to red if the user doesn't enter a properly formatted email in the input box. You would do this by setting the
Color value of TextInput1 (where the user types in an email address) to this formula:
If( IsMatch(TextInput1.Text, Email), Black, Red )

IsMatch supports a plethora of predefined patterns, such as Email, or you can create your own. For more
information about conditional formatting, check out this community video.
Implementing role-based security
The first function to consider is DataSourceInfo. What information you get back from the data source will vary, but
often you can use this formula to confirm whether the user has access to edit the data (replace YourDataSource
with the name of your data source):
DataSourceInfo( YourDataSource, DataSourceInfo.EditPermission )

With this, you can show a form or button only if the user has access to edit. Check out the DataSourceInfo
documentation for the full list of information for which you can query in the function.
You'll need to dig deeper if you want to use Active Directory groups to manage access to buttons or forms in your
app. To do this, you'll take advantage of the flexibility of Power Apps and create your own connector using the
Microsoft Graph API. If that sounds daunting, you can follow this blog post for step-by-step guidance.
Send an email from your app
You can send an email message from Power Apps in many ways, but the easiest is to use the Office 365 Outlook
Connector. With this connector, you can send a message as yourself from your app. You can also get email
messages and other tasks that interact with your mailbox. There is documentation or this community video about
sending email.
You can send more complex message (for example, as part of a SharePoint approval workflow ) by using Power
Automate and connecting your app to the flow that you create. Once you connect your app to Power Automate,
you've opened up the full power of a workflow engine that, like Power Apps, is very well connected to external data
and services. For more information about how to connect Power Apps and Power Automate, check out this
documentation.
If you still haven't found the email option you're looking for, you can also leverage the Power Apps connectors for
Benchmark Email, Gmail, MailChimp, Outlook.com, SendGrid, or SMTP. Connectivity is the beauty of Power Apps.
Workflows
It's hard to talk about business apps and business logic without a workflow engine. The good news is the Power
Apps team didn't reinvent the wheel and give you another workflow engine. Instead, they provide you with a
robust connector to the Power Automate service. You can automate processes and tasks across more than 200
different services through their easy-to-use workflow engine. For more information about how to connect Power
Apps and Power Automate, check out this documentation.
Variables with Power Apps
When you build solutions, it's natural to think variables must be involved. Power Apps offers multiple types of
variables, but use them only when necessary. Instead of thinking about getting data, storing it in a variable, and
then referencing that variable, think about just referencing that data directly. You can better understand this model
if you compare it to Excel. In Excel, Total isn't a variable; it's the sum of other fields. So, if you want to use that value
elsewhere on the sheet, you specify the cell in which you calculated the total. The documentation has a great
explanation of all of this. Be open to a different thought process.
If you still need a variable (there are many cases that you do), this will help you understand the different options.
Keep in mind that, with Power Apps, you don't have to define variables. Just use a function to specify a name and a
value to store, and your variable is created. You can view the variables you've created by selecting Variables on the
View tab. Variables are held in memory, and their values are lost when you close the app. You can create these
types of variables:
Global variables are what you most commonly think of first. Use the Set function to specify a value for a
global variable and make it available throughout your app:
Set( YourVariable, YourValue )

Then you can reference YourVariable by name throughout your app.


Context variables are available only on the screen where they're defined. When you leave the screen, they're
reset. They're often used, for example, to store information passed from a previous screen or to track if the
form has been submitted. To set a context variable, use the UpdateContext function, as in this example:
UpdateContext( { Submitted: "true" } )

This example sets the value of a variable, named Submitted, to true. You might add this formula to the
OnSelect property of a submit button to track that the information has been submitted and change all of
the fields to read-only.
Collections store tables of information that can be updated individually. Use the Collect to create a shopping
cart, for example, as the user tags various SharePoint items they want to send. A community video shows
that concept in action.
Cascading dropdowns
Cascading dropdowns are very useful because you can, for example, filter the choices in one dropdown based on
the value selected in the previous dropdown. In Power Apps, these are often created by having two data sources in
your app. The first data source is the data you're viewing or updating, and the second data source stores the values
to build the cascading effect. This graphic shows an example of the second data source with the choice options.

In this example, you could add a dropdown named ddSelectType and set its Items property to this formula:
Distinct( Impacts, Title )

The dropdown would show only show Cost, Program Impact, and Schedule. Then you could add a second
dropdown and set its Items property to this formula:
Filter( Impacts, ddSelectType.Selected.Value in SCategory )

Just like that you have cascading dropdowns. For more information, check out this post from the Power Apps team
SharePoint: Cascading Dropdowns in 4 Easy Steps! or this community video. Don't worry: you can do it just as
easily without SharePoint.
Don't build one super app
With Power Apps, you can call one app from another. So, instead of the mass InfoPath form you built that's held
together with bubble gum, you can build a group of apps that call each other, and even pass data across, making
development simpler.

Next steps
With Power Apps and the information in this topic, you're now ready to go out into the world and start to conquer
it one app at a time. As you continue on your journey, below are some handy links to help, such as the link to the
Power Apps community site. Engage today with the community, and grow your skills much faster than you would
on your own.
Formula reference - Always a great way to become inspired, just browsing some of the default functions.
Power Apps community - See examples, engage with others, ask and answer questions, and help the Power
Apps community grow.
Canvas apps for enterprise developers, partners, and
ISVs
12/3/2019 • 2 minutes to read • Edit Online

As a developer, you can extend canvas apps in Power Apps, enabling even more powerful solutions for
organizations and customers.

Canvas apps for enterprise developers


As an enterprise developer, empower your organization to build robust, tailored solutions on Power Apps:
Build custom connectors: Develop custom connectors to connect to your organization's data and web
services. Learn more
Build Azure Functions: Craft Azure Functions to extend apps with custom server-side logic. Learn more
Embed apps: Embed apps directly into your website experiences to create integrated solutions, surfacing
apps where people in your organization already do their work. Learn more
Build offline-capable apps: Develop offline-capable apps so your users are productive whether they are
online or offline. Learn more

Canvas apps for ISVs and Microsoft partners


As a Microsoft partner or Independent Software Vendor (ISV ), accelerate customer adoption by extending your
products to integrate with your customers' data and business processes:
Build and certify custom connectors: Bring your product into the Microsoft cloud by building a
connector that enables Power Apps to talk to your service. Learn more
List your solution on AppSource: Generate new leads for your business by building an app with Power
Apps and publishing it to AppSource for new customers to test-drive. Learn more
Get started today for free: Sign-up for the Power Apps Community Plan for free and start building apps
in a dedicated individual environment. Learn more
Custom connectors for canvas apps
12/3/2019 • 2 minutes to read • Edit Online

Without writing any code, you can build workflows and canvas apps with Azure Logic Apps, Power Automate, and
Power Apps. To help you integrate your data and business processes, these services offer 180+ connectors - for
Microsoft services and products, as well as other services, such as GitHub, Salesforce, and Twitter.
Sometimes though, you might want to call APIs, services, and systems that aren't available as pre-built
connectors. To support more tailored scenarios, you can build custom connectors with their own triggers and
actions. We have a complete set of basic and advanced tutorials for custom connectors on the Connectors
documentation site. We recommend that you start with the custom connector overview, but you can also go
straight to the following topics for details on a specific area:
Create a custom connector from an OpenAPI definition
Create a custom connector from a Postman collection
Create a custom connector from scratch
Use a custom connector from a Power Apps app
Share custom connectors in your organization
Submit your connectors for Microsoft certification
Custom connector FAQ
Integrate canvas apps into websites and other
services
12/2/2019 • 3 minutes to read • Edit Online

The apps that you build are often most useful when they're available right where people do their work. By
embedding canvas apps in an iframe, you can integrate those apps into websites and other services, such as Power
BI or SharePoint.
In this topic, we'll show you how to set parameters for app embedding; then we'll embed our Asset Ordering app
in a website.

Keep the following restrictions in mind:


Only Power Apps users in the same tenant can access the embedded app.
To access Power Apps using Internet Explorer 11, you must turn off Compatibility View.
You can also integrate canvas apps into SharePoint Online without using an iframe. More information: Use the
Power Apps web part.

Set URI parameters for your app


If you have an app you want to embed, the first step is to set parameters for the Uniform Resource Identifier (URI),
so that the iframe knows where to find the app. The URI is in the following form:

https://apps.powerapps.com/play/[AppID]?source=iframe
IMPORTANT
As of August 2019, the URI format has changed from https://web.powerapps.com/webplayer to
https://apps.powerapps.com/play. Please update any embedded iframes to use the new URI format. References to the
previous format will be redirected to the new URI to ensure compatibility.
Previous format:
https://web.powerapps.com/webplayer/iframeapp?source=iframe&appId=/providers/Microsoft.PowerApps/apps/[AppID]

The only thing you have to do is substitute the ID of your app for [AppID ] in the URI (including '[' & ']'). We'll
show you how to get that value shortly, but first here are all the parameters available in the URI:
[appID ] - It provides the ID of the app to run.
tenantid - is an optional parameter to support guest access and determines which tenant to open the app
from.
screenColor - is used to provide a better app loading experience for your users. This parameter is in the format
RGBA (red value, green value, blue value, alpha) and controls the screen color while the app loads. It is best to
set it to the same color as your app's icon.
source - does not affect the app, but we suggest you add a descriptive name to refer to the source of the
embedding.
Lastly, you can add any custom parameters you want using the Param() function, and those values can be
consumed by your app. They are added to the end of the URI, such as
[AppID]?source=iframe&param1=value1&param2=value2 . These parameters are read only during launch of the app. If
you need to change them, you must relaunch the app. Note that only the first item after [appid] should have a
"?"; after that use the "&" as illustrated here.
Get the App ID
The app ID is available on powerapps.com. For the app you want to embed:
1. In powerapps.com, on the Apps tab, click or tap the ellipsis ( . . . ), then Details.

2. Copy the App ID.


3. Substitute the [AppID] value in the URI. For our Asset Ordering app, the URI looks like this:

https://apps.powerapps.com/play/76897698-91a8-b2de-756e-fe2774f114f2?source=iframe

Embed your app in a website


Embedding your app is now as simple as adding the iframe to the HTML code for your site (or any other service
that supports iframes, such as Power BI or SharePoint):

<iframe width="[W]" height="[H]" src="https://apps.powerapps.com/play/[AppID]?


source=website&screenColor=rgba(165,34,55,1)" allow="geolocation; microphone; camera"/>

Specify values for the iframe width and height, and substitute the ID of your app for [AppID] .

NOTE
Include allow="geolocation; microphone; camera" in your iframe HTML code to allow your apps to use these capabilities
on Google Chrome.

The following image shows the Asset Ordering app embedded in a Contoso sample website.
Keep the following points in mind for authenticating users of your app:
If your website uses Azure Active Directory (AAD ) based authentication, no additional sign-in is required.
If your website uses any other sign-in mechanism or is not authenticated, your users see a sign-in prompt on
the iframe. After they sign-in, they will be able to run the app as long as the author of the app has shared it with
them.
As you can see, embedding apps is simple and powerful. Embedding enables you to bring apps right to the places
you and your customers work – websites, Power BI dashboards, SharePoint pages, and more.
Develop offline-capable canvas apps
3/4/2020 • 6 minutes to read • Edit Online

Mobile users often need to be productive even when they have limited or no connectivity. When you build a
canvas app, you can perform these tasks:
Open Power Apps Mobile and run apps when offline.
Determine when an app is offline, online, or in a metered connection by using the Connection signal object.
Use collections and leverage the LoadData and SaveData functions for basic data storage when offline.
This article includes an example using Twitter data. An even simpler example that doesn't require a connection is
included in the LoadData and SaveData function reference.

Limitations
LoadData and SaveData combine to form a simple mechanism to store small amounts of data on a local
device. By using these functions, you can add simple offline capabilities to your app.
These functions are limited by the amount of available app memory because they operate on an in-memory
collection. Available memory can vary depending on the device, the operating system, the memory that Power
Apps Mobile uses, and the complexity of the app in terms of screens and controls. If you store more than a few
megabytes of data, test your app with expected scenarios on the devices on which you expect it to run. You'll
generally have 30-70 megabytes of available memory.
The functions also don't automatically resolve merge conflicts when a device comes online. Configuration on
what data is saved and how to handle reconnection is up to the maker when writing expressions.
For updates on offline capabilities, return to this topic, and subscribe to the Power Apps blog.

Overview
When you design offline scenarios, you should first consider how your apps work with data. Apps in Power Apps
primarily access data through a set of connectors that the platform provides, such as SharePoint, Office 365, and
Common Data Service. You can also build custom connectors that enable apps to access any service that
provides a RESTful endpoint. This could be a Web API or a service such as Azure Functions. All these connectors
use HTTPS over the Internet, which means your users must be online for them to access data and any other
capabilities that a service offers.

Handling offline data


In Power Apps, you can filter, search, sort, aggregate, and manipulate data in a consistent way regardless of the
data source. Sources range from in-memory collections in the app to SharePoint lists to SQL databases and
Common Data Service. Because of this consistency, you can easily retarget an app to use a different data source.
More importantly for offline scenarios, you can use local collections for data management with almost no
changes to an app's logic. In fact, local collections are the primary mechanism for handling offline data.
Build an offline app
To keep the focus on the offline aspects of app development, this topic illustrates a simple scenario focused
around Twitter. You'll build an app that enables you to read Twitter posts and submit tweets while being offline.
When the app comes online, the app posts tweets and reloads the local data.
At a high level, the app performs these tasks:
When the user opens the app:
If the device is online, the app fetches data through the Twitter connector and populates a collection
with that data.
If the device is offline, the app loads the data from a local cache file by using the LoadData function.
The user can submit tweets. If the app is online, it posts the tweets directly to Twitter and refreshes the
local cache.
Every five minutes while the app is online:
The app posts any tweets in the local cache.
The app refreshes the local cache and saves it by using the SaveData function.
Step 1: Add Twitter to a blank phone app
1. In Power Apps Studio, select File > New.
2. On the Blank app tile, select Phone layout.
3. On the View tab, select Data sources.
4. In the Data pane, select Add data source.
5. Select New Connection > Twitter > Create.
6. Enter your credentials, create the connection, and then close the Data pane.
Step 2: Collect existing tweets
1. In the Tree view pane, select App, and then set its OnStart property to this formula:

If( Connection.Connected,
ClearCollect( LocalTweets, Twitter.SearchTweet( "PowerApps", {maxResults: 10} ) );
Set( statusText, "Online data" ),
LoadData( LocalTweets, "LocalTweets", true );
Set( statusText, "Local data" )
);
SaveData( LocalTweets, "LocalTweets" );

2. In the Tree view pane, select the ellipsis menu for the App object, and then select Run OnStart to run
that formula.
NOTE
The LoadData and SaveData functions might show an error in Power Apps Studio because browsers don't
support them. However, they'll perform normally after you deploy this app to a device.

This formula checks whether the device is online:


If the device is online, the formula loads up to 10 tweets with the search term "PowerApps" into a
LocalTweets collection.
If the device is offline, the formula loads the local cache from a file called "LocalTweets" if it's available.
Step 3: Show tweets in a gallery
1. On the Insert tab, select Gallery > Blank flexible height.
2. Set the Items property of the Gallery control to LocalTweets .
3. In the gallery template, add three Label controls, and set the Text property of each label to one of these
values:
ThisItem.UserDetails.FullName & " (@" & ThisItem.UserDetails.UserName & ")"
Text(DateTimeValue(ThisItem.CreatedAtIso), DateTimeFormat.ShortDateTime)
ThisItem.TweetText
4. Make the text in the last label bold so that the gallery resembles this example.

Step 4: Show connection status


1. Under the gallery, insert a label, and then set its Color property to Red.
2. Set the newest label's Text property to this formula:
If( Connection.Connected, "Connected", "Offline" )

This formula determines whether the device is online. If it is, the label shows Connected; otherwise, it shows
Offline.
Step 5: Add a box to compose tweets
1. Under the connection-status label, insert a Text input control, and rename it NewTweetTextInput.
2. Set the text-input box's Default property to "" .
Step 6: Add a button to post the tweet
1. Under the text-input box, add a Button control, and set its Text property to this value:
"Tweet"

2. Set the button's OnSelect property to this formula:

If( Connection.Connected,
Twitter.Tweet( "", {tweetText: NewTweetTextInput.Text} ),
Collect( LocalTweetsToPost, {tweetText: NewTweetTextInput.Text} );
SaveData( LocalTweetsToPost, "LocalTweetsToPost" )
);
Reset( NewTweetTextInput );

3. In the OnStart property for the App, add a line at the end of the formula:

If( Connection.Connected,
ClearCollect( LocalTweets, Twitter.SearchTweet( "PowerApps", {maxResults: 100} ) );
Set( statusText, "Online data" ),
LoadData( LocalTweets, "LocalTweets", true );
Set( statusText, "Local data" )
);
SaveData( LocalTweets, "LocalTweets" );
LoadData( LocalTweetsToPost, "LocalTweetsToPost", true ); // added line

This formula determines whether the device is online:


If the device is online, it posts the tweet immediately.
If the device is offline, it captures the tweet in a LocalTweetsToPost collection and saves it to the device.
Then the formula resets the text in the text-input box.
Step 7: Check for new tweets
1. On the right side of the button, add a Timer control.
2. Set the timer's Duration property to 300000.
3. Set the timer's AutoStart and Repeat properties to true.
4. Set the timer's OnTimerEnd to this formula:

If( Connection.Connected,
ForAll( LocalTweetsToPost, Twitter.Tweet( "", {tweetText: tweetText} ) );
Clear( LocalTweetsToPost );
ClearCollect( LocalTweets, Twitter.SearchTweet( "PowerApps", {maxResults: 10} ) );
SaveData( LocalTweets, "LocalTweets" );
)

This formula determines whether the device is online. If it is, the app tweets all the items in the
LocalTweetsToPost collection and then clears the collection.

Test the app


1. Open the app on a mobile device that's connected to the Internet.
Existing tweets appear in the gallery, and the status shows Connected.
2. Disconnect the device from the Internet by enabling the device's airplane mode and disabling wi-fi.
The status label shows that the app is Offline.
3. While the device is offline, write a tweet that includes PowerApps, and then select the Tweet button.
The tweet is stored locally in the LocalTweetsToPost collection.
4. Reconnect the device to the Internet by disabling the device's airplane mode and enabling wi-fi.
Within five minutes, the app posts the tweet, which appears in the gallery.
We hope this article gives you an idea of the capabilities that Power Apps has for building offline apps. As always,
please provide feedback in our forum and share your examples of offline apps in the Power Apps community
blog.
Let customers test drive your canvas app on
AppSource
12/5/2019 • 4 minutes to read • Edit Online

Are you passionate about building canvas apps in Power Apps? Do you want to share a canvas app with
customers? AppSource.com supports Power Apps Test Drive solutions as a way for you to share apps with
customers and generate leads for your business.

What is a Test Drive solution?


A Test Drive solution enables your customers to try out a real app, without signing up for a Power Apps plan or
installing any applications. Customers just sign into AppSource.com using their Azure Active Directory (AAD )
account and run the app in a web browser. Without Test Drive, customers can only read about your app or watch a
video that describes it. With Test Drive, customers get a better idea of what your solution is and what functionality
your app has. And they have the experience of actually using the app. Customers won't be able to look under the
hood to see how your app is built, so your intellectual property is protected. We collect and share lead information
for users that launch your Test Drive app to help you grow your business.
Here is the example of an app listing on AppSource.com:

Selecting the Free Trial link from the app listing above launches the associated Power Apps Test Drive app
directly within the user's browser:
How do I build a Test Drive solution?
Building an app for a Test Drive solution is just like building any app in Power Apps, but you use embedded data
instead of external data connections. Using embedded data reduces the barrier of deploying the app to your
customer, so there is zero friction for them to try it out. The full solution that you ultimately distribute to
customers typically includes data connections, but embedded data works well for a Test Drive solution.
Power Apps natively supports building apps with embedded data, so you just need sample data for your app to
use. This data should be captured in an Excel file as one or more tables. In Power Apps, you then pull the data
from the Excel tables into the app and work with it there, rather than through an external connection. The three-
step process below shows you how to pull data in and use that data in your app.
Step 1: Import data into the app
Assume you have an Excel file with two tables: SiteInspector and SitePhotos.

Import these two tables into Power Apps by using the option Add static data to your app.
You now have the tables as data sources in your app.

Step 2: Handling read-only and read-write scenarios


The data you imported is static, therefore read-only. If your app is read-only (i.e. it only displays data to the user),
reference the tables directly in the app. For example, if you want to access the Title field in the SiteInspector
table, use SiteInspector.Title in your formula.
If your app is read-write, first pull the data from each table into a collection, which is a tabular data structure in
Power Apps. Then work with the collection rather than the table. To pull data from the SiteInspector and
SitePhotos tables into the SiteInspectorCollect and SitePhotosCollect collections:

ClearCollect( SiteInspectorCollect, SiteInspector );


ClearCollect( SitePhotosCollect, SitePhotos )

The formula clears both collections, then collects data from each table into the appropriate collection:
Call this formula somewhere in your app to load the data.
View all collections in your app by navigating to File > Collections.
For more information, see Create and update a collection in your app.
Now if you want to access the Title field, use SiteInspectorCollect.Title in your formula.
Step 3: Add, update, and delete data in your app
You've seen how to read data directly and from a collection; now we'll show you how to add, update, and delete
data in a collection:
To add a row to a collection, use Collect( DataSource, Item, ... ):

Collect( SiteInspectorCollect,
{
ID: Value( Max( SiteInspectorCollect, ID ) + 1 ),
Title: TitleText.Text,
SubTitle: SubTitleText.Text,
Description: DescriptionText.Text
}
)

To update a row in a collection, use UpdateIf( DataSource, Condition1, ChangeRecord1 [, Condition2,


ChangeRecord2, ...] ):
UpdateIf( SiteInspectorCollect,
ID = record.ID,
{
Title: TitleEditText.Text,
SubTitle: SubTitleEditText.Text,
Description: DescriptionEditText.Text
}
)

To delete a row from a collection, use RemoveIf( DataSource, Condition [, ...] ):

RemoveIf( SiteInspectorCollect, ID = record.ID )

NOTE
Collections hold data only while the app is running; any changes are discarded when the app is closed.

In summary, you can create a version of your app with embedded data, which simulates the experience of your
app connecting to external data. After the data is embedded, you will be ready to publish this app as a Test Drive
solution on AppSource.com.

How do I list my Test Drive solution on AppSource.com?


Now that your app is ready, it's time to publish it to AppSource.com. In order to start this process, please complete
the application form on PowerApps.com.
Once you apply you will receive an email with instructions on how to submit your app to be published on
AppSource.com. The onboarding documentation that captures the full end-to-end process can also be
downloaded here.
Create a component for canvas apps
3/5/2020 • 10 minutes to read • Edit Online

IMPORTANT
This feature is still in public preview. For more information, see Experimental and preview features.

Components are reusable building blocks for canvas apps so that app makers can create custom controls to use
inside an app, or across app using component library. Components can use advanced features, such as custom
properties and enable complex capabilities. This article introduces component concepts and some examples.
Components are useful in building larger apps that have similar control patterns. If you update a component
definition inside the app, all instances in the app reflect your changes. Components also reduce duplication of
efforts by eliminating the need to copy/paste controls and improve performance. Components also help create
collaborative development and standardizes look-and-feel in an organization when you use a component library.

Components in canvas app


You can create a component from within an app as explained in this article, or by creating a new component inside
a component library. A component library should be used for requirements to use components across multiple
app screens. You can also copy the existing components into an existing or a new component library.
To create a component within an app, go to Tree View, select Components tab, and then select New
Component:

Selecting New component opens an empty canvas. You can add controls as part of the component definition on
the canvas. If you edit a component in the canvas, you'll update instances of the same component in other app
screens. Apps that reuse an already created component can also receive component updates after you publish
component changes.
You can select a component from the list of existing components in left navigation after you select a screen. When
you select a component, you insert an instance of that component onto the screen; just as you insert a control.
Components available inside the app are listed under Custom category in list of components inside tree view.
Components imported component libraries are listed under Library components category:

NOTE
Components discussed in this article are different from the Power Apps component framework that enables developers and
makers to create code components for model-driven and canvas apps. For more information, read Power Apps component
framework overview.

Scope
Think of a component as an encapsulated black box with properties as the interface. You can't access controls in
the component from outside of the component. And you can't refer to anything outside of the component from
inside the component. Exception is data sources shared between app and its components. Scope restrictions keep
the data contract of a component simple and cohesive, and it helps enable component-definition updates,
especially across apps with component libraries. You can update the data contract of the component by creating
one or more custom properties.

NOTE
You can insert instances of components into a screen within a component library, and preview that screen for testing
purposes. Also, note that the component library does not display when using Power Apps mobile.

Custom properties
A component can receive input values and emit data if you create one or more custom properties. These scenarios
are advanced and require you to understand formulas and binding contracts.
Input property is how a component receives data to be used in the component. Input properties appear in the
Properties tab of the right-hand pane if an instance of the component is selected. You can configure input
properties with expressions or formulas, just as you configure standard properties in other controls. Other
controls have input properties, such as the Default property of a Text input control.
Output property is used to emit data or component state. For example, the Selected property on a Gallery
control is an output property. When you create an output property, you can determine what other controls can
refer to the component state.
The following walk-through further explains these concepts.

Create an example component


In this example, you'll create a menu component that resembles the following graphic. And you can change the
text later to use it in multiple screens, apps, or both:

NOTE
We recommend that you use component library when creating components for reuse. Updating components inside an app
only makes the component updates available inside the app. When you import components from one app to another, new
updates to components in original app do not propagate to the app that imported those components earlier. When using
component library, you get prompted to update components if components inside a library are updated and published.

Create a new component


1. Sign in to make.powerapps.com.
2. Select Apps and select Canvas app from blank.
3. Provide an app name, select any layout, and then select Create.
4. In the Tree View, select Components and then select New Component to create a new component.
5. Select the new component in left navigation, then select ellipsis (...) and select Rename. Type or paste the
name as MenuComponent.
6. In the right-hand pane, set the component's width to 150 and its height to 250, and then select New
custom property. You can also set the height & width to any other value as appropriate.

7. In the Display name, Property name, and Description boxes, type or paste text as Items.

Don't include spaces in property name as you'll refer to the component by this name when you write a
formula. For example, ComponentName.PropertyName.
The display name appears on the Properties tab of the right-hand pane if you select the component. A
descriptive display name helps you and other makers understand the purpose of this property. The
Description appears in a tooltip if you hover over the display name of this property in the Properties tab.
8. In the Data type list, select Table, and then select Create.
The Items property is set to a default value based on the data type that you specified. You can set it to a
value that suits your needs. If you specified a data type of Table or Record, you may want to change the
value of the Items property to match the data schema that you want to input to the component. In this
case, you'll change it to a list of strings.
You can set the property's value in the formula bar if you select the name of the property on the
Properties tab of the right-hand pane.

As the next graphic shows, you can also edit the property's value on the Advanced tab of the right-hand
pane.
9. Set the component's Items property to this formula:

Table({Item:"SampleText"})
10. In the component, insert a blank vertical Gallery control and select Layout on the property pane as Title.
11. Make sure that the property list shows the Items property (as it does by default). And then set the value of
that property to this expression:

MenuComponent.Items

This way, the Items property of the Gallery control reads and depends on the Items input property of the
component.
12. Optional - set the Gallery control's BorderThickness property to 1 and its TemplateSize property to 50.
You can also update values for border thickness and template size to any other value as appropriate.
Add component to a screen
Next, you'll add the component to a screen and specify a table of strings for the component to show.
1. In the left navigation bar, select the list of screens, and then select the default screen.

2. On the Insert tab, open the Components menu, and then select MenuComponent.

The new component is named MenuComponent_1 by default.


3. Set the Items property of MenuComponent_1 to this formula:

Table({Item:"Home"}, {Item:"Admin"}, {Item:"About"}, {Item:"Help"})

This instance resembles this graphic, but you can customize the text and other properties of each instance.

Create and use output property


So far, you've created a component and added it to an app. Next, you'll create an output property that reflects the
item that the user selects in the menu.
1. Open the list of components, and then select MenuComponent.
2. In the right-hand pane, select the Properties tab, and then select New custom property.
3. In the Display name, Property name, and Description boxes, type or paste Selected.
4. Under Property type, select Output, and then select Create.

5. On the Advanced tab, set the value of the Selected property to this expression, adjusting the numeral in
the gallery name if necessary:

Gallery1.Selected.Item

6. On the default screen of the app, add a label, and set its Text property to this expression, adjusting the
numeral in the component name if necessary:

MenuComponent_1.Selected

MenuComponent_1 is the default name of an instance, not the name of the component definition. You
can rename any instance.
7. While holding down the Alt key, select each item in the menu.
The Label control reflects the menu item that you selected most recently.

Import and export components


NOTE
This feature will be deprecated. Component libraries are the recommended way to reuse the components across the apps.
When using component library, an app maintains dependencies on the components it uses. The app maker will be alerted
when the updates to dependent components become available. Hence, all new reusable components should be created
within the component libraries instead.

Import components from another app


To import one or more components from one app into another, select Import components from Insert menu
and then using Custom drop-down. Or by using Components in tree view on the left navigation.
A dialog box lists all apps that contain components that you have permission to edit. Select an app, and then select
Import to import the most recent published version of all of the components in that app. After you import at least
one component, you can edit your copy and delete any that you don’t need.

You can save an app with existing components to a file locally and then reuse the file by importing it. You can use
the file to import components to another app.
If the app contains a modified version of the same component, you're prompted to decide whether to replace the
modified version or cancel the import.
After you create components in an app, other apps can consume the components from this app by importing
them.
Export components from your app
You can export components to file and download them for import to another app.
Select Export components option from Components section in left navigation tree view:
You can also use Insert menu and then select Custom drop-down instead.

Selecting Export components downloads the components to a file:

Downloaded component file uses .msapp file name extension.


Import components from exported components file
To import components from an exported components file, select Import components from either Insert menu.
And then using Custom drop-down, or by using Components in tree view on the left navigation. From the
components dialog box, select Import file instead of selecting any other components or apps:

From the Open dialog box, browse to the location of the component file and select Open to import components
inside the app.
Import components from exported app
You can save an app locally using File -> Save As option:
Once you save the app, you can reuse the components of this app using the same method of importing
components from file. Follow the steps explained in importing components from exported components file
section above.

Known limitations
You can't save data sources, forms, and data tables with components.
Collections in components are not supported.
You can't insert a component into a gallery or a form.
A master instance of a component is a local master and scoped to the app. If you change a master instance,
only copies of the component within the app will reflect the change. Copies in other apps will remain the same
unless you import the component library again. All master instances in those apps will be automatically
detected and updated.
You can't package media files when you import a component.
Components don't support the UpdateContext function, but you can create and update variables in a
component by using the Set function. The scope of these variables is limited to the component, but you can
access them from outside the component through custom output properties.

Next steps
Learn component library to create a repository of reusable components.
Component library
3/5/2020 • 6 minutes to read • Edit Online

IMPORTANT
This feature is still in public preview. For more information, see Experimental and preview features.

In the overview article for creating components, you are introduced to components inside canvas app. As you
create components inside an app, you can also create a library of components that can be reused. By creating a
component library, app makers easily share and update one or more components with other makers.
Component libraries are containers of component definitions that make it easy to:
Discover and search components.
Publish updates across environments.
Notify app makers of available component updates.

NOTE
Component libraries are the recommended way to reuse components across apps. When using component library, an app
maintains dependencies on the components it uses. The app maker will be alerted when the updates to dependent
components become available. Hence, all new reusable components should be created within the component libraries
instead. An earlier Power Apps feature that allowed importing components from one canvas app to another will be
deprecated.

Difference between an app and a component library


A component library provides a centralized and managed repository of components for reusability.
Insert pane on left navigation defaults to components tab if you create a component library. When you create an
app, this view shows screens instead of components.
The screens inside a component library are available for testing only. It provides library creators a way to quickly
test the created components on actual screen and also validate the update behavior as components are enhanced
over time. To use the components from component library, you must create an app that uses component library.
You can preview component library components using the screens inside the library with the play option. When
you select component tab, the play option is disabled. Component library doesn't display when using Power
Apps mobile.

NOTE
Component library discussed in this article is different from the Power Apps component framework that enables developers
and makers to create code components for model-driven and canvas apps. For more information, read Power Apps
component framework overview.

Working with component library


You can create a new component library or edit an existing component library from the same interface. Browse to
make.powerapps.com, select Apps, and then select Component Libraries:
Create an example component library
The steps to create components inside a component library are same as creating components inside an app.
You'll create a component library. And then reuse the steps for creating components from components overview
example. And then you'll use the component library to provide the reusable components in a new app.
1. Sign in to make.powerapps.com.
2. select Apps in left navigation, select Component Libraries, and then select New component library.
3. Name the component library as Menu components; you can also provide a different name of your choice.
4. Follow the steps to create components from components overview example. You don't have to open
Power Apps Studio or create a new blank app, since you already have created a new component library.
Start with step 2.
After following steps to create components, follow next set of steps to also add components to a screen
the steps to create output property.
5. After you completed the components creation and testing, save the component library by selecting File
menu and then selecting Save.
You also have an option to save a Version note. Version note is useful to retrieve versions of a component
library. And when upgrading the components used in apps from this component library.
TIP
Version note is useful when reviewing versions of a component library and for the app makers using your
component library to review changes and update apps consuming these components as needed. Read update a
component library for more details.

6. Saved component library can be published. Only published component library updates are available for
apps that consume a component library. Select Publish to publish the component library version:
Import from a component library
After you create a component library and publish, apps can consume the components from this component
library by importing the library. You can also share a component library.
To import from a component library, edit an existing app or create a new app. After app opens in canvas app
studio, select Insert or the + on the left navigation. And then select Get more components to list the
component libraries available in current environment:

You'll see the list of component libraries available in current environment on right side of the screen. Select an
individual component from a component library. Or use Select all to import all of the components from the
library at once:
NOTE
If maker doesn't see the component library listed in import section, ensure the component library is shared with the maker.
For more details, read component library permissions.

Notice you can select and import more than one component and across different component libraries.
Components available inside the app are listed under Custom category in list of components in the Insert pane.
Components available from imported component libraries are listed under Library components category:
Update a component library
You can modify existing component library and save any changes with additional version notes. However, the
updated component library version must be published for use in existing apps that use the component library.
Example component library steps above explain how to publish a component library after saving it.
Makers of other apps are notified of updated components being available. The notification appears when makers
edit the apps in canvas app studio. And can choose to update the components:

Select Review, and you'll see the option to update the component:

Notice the version note you added when publishing component library version shows up here.
Select Update to update the components.

Component library permissions


Sharing a component library works the same way you share a canvas app. When you share a component library,
you allow others to reuse the component library. Once shared, others can edit the component library and import
components from this shared component library for creating and editing apps. If shared as co-owner, user can
use, edit, share component library but not delete or change owner.

Known limitations
Known limitations applicable to components also applies to component library.
You can't import components using component library from locally saved component library file. If you
try to import a locally saved component library using File -> Save As -> This Computer and download
the component library file as an app, following error message appears:

You can't add existing component libraries to a solution. However, you can create new component libraries
for solutions using add component library flow.
If you import a component from a component library, you can't edit it inside the consuming app. If you
select Edit component, you'll see an option to create a copy of the component inside current app for you
to make changes:

If you select Create a copy, the component is copied to the local app. The local copy of the component
appears under the Custom category in the Insert pane. This local copy of the component won't receive
updates if a new version of the originating component library is published later.
When a component is added to an app from the component library and the theme of the app is updated,
the component becomes a local app component and is no longer associated to the master component in
the component library.

Next steps
Learn behavior formulas for canvas app.
See also
Read canvas app components overview and working with components in an app.
Behavior formulas for components
2/28/2020 • 2 minutes to read • Edit Online

IMPORTANT
This feature is still in public preview. For more information, see Experimental and preview features.

Specify one or more behavior formulas that run when an event triggers a change in component instances.
For example, set a component's OnReset property to one or more formulas that do initialization, clear input. And
reset values when the Reset function runs on the component instances.

OnReset
With a component master selected, select OnReset in the drop-down list of properties (on the left side of the
formula bar), and then enter one or more formulas.

To test OnReset, configure a control to reset the component. For example, set the OnSelect property of a button
to this formula: Reset(ComponentName).
Example - Reset timer

In this time picker component, two variables are used to display the time _selectedHour and _selectedMinute.
When the picker gets reset, these variables should be reset to a default value, say 12: 12. The OnReset property for
the component has the following formula: Set(_selectedHour,12); Set(_selectedMinute,12)
To trigger reset, go to a screen and insert an instance of the component. Add a button and configure OnSelect of
the button to call Reset(TimerComponent_instance) to trigger OnReset.

Update OnReset using custom property


Besides resetting a component instance from the outside of the component, there's another method to trigger the
OnReset from the inside. "Raise OnReset when value changes" is an option when creating a custom input
property. And it allows the value changes of this property to trigger OnReset of the component. This method is
designed to set and reset default value easily.
Example
Example above shows reviewing order numbers and updating the numbers. The numeric up and down component
is used to increase or decrease number of orders. When selecting the gallery on the left, the default number of
numeric up and down component is reset to display the order number of selected tool. "Raise OnReset when
value changes" made it possible to reset the default value when the input changes.
To do so, check "Raise OnReset when value changes" of the default input property. OnReset of the component
is set to Set(_numericValue,'Numeric up down'.DefaultValue). _numericValue is the variable to store the
value of the current order value. And set the Default of the text input control to If(IsBlank(_numericValue),
'Numeric up down'.DefaultValue, _numericValue).
See also
Canvas app components overview
Canvas app components library
Preview: Embed canvas apps in your applications
12/3/2019 • 2 minutes to read • Edit Online

[This topic is pre-release documentation and is subject to change.]


Power Apps is high productivity, a low -code development platform that empowers app makers and enables anyone
to build rich experiences. By embedding canvas apps in your application, you can quickly and easily transform your
customers into app makers. Your new app makers can extend your applications from creating simple custom forms
to adding feature rich screens and everything in between.They can connect to data, create business logic, and
orchestrate workflows all from within your application. By enabling your customers to act as app makers, your
applications and services can finally cross that last mile and fit perfectly into your customers’ workflows making
them even more valuable and indispensable.
The new canvas apps embedding SDK enables you to embed canvas apps in your applications.

IMPORTANT
This is a preview feature.
Preview features aren’t meant for production use and may have restricted functionality. These features are available
before an official release so that customers can get early access and provide feedback.

Using the canvas apps embedding SDK and documentation


For information on how to download and use the Canvas apps embedding SDK, download the docs here.
What are model-driven apps in Power Apps?
2/15/2020 • 2 minutes to read • Edit Online

Model-driven app design is a component-focused approach to app development. Model-driven app design
doesn’t require code and the apps you make can be simple or very complex. Unlike canvas app development
where the designer has complete control over app layout, with model-driven apps much of the layout is
determined for you and largely designated by the components you add to the app.

Model-driven app design provides the following benefits:


Rich component-focused no-code design environments
Create complex responsive apps with a similar UI across a variety of devices from desktop to mobile
Rich design capability
Your app can be distributed as a solution

The approach to model-driven app making


At a fundamental level, model-driven app making consists of three key focus areas.
Modeling business data
Defining business processes
Composing the app
Modeling business data
To model business data you determine what data your app will need and how that data will relate to other data.
Model-driven design uses a metadata-driven architecture so that designers can customize the application without
writing code. Metadata means “data about data” and it defines the structure of the data stored in the system.
Tutorial: Create a custom entity that has components in Power Apps
Defining business processes
Defining and enforcing consistent business processes is a key aspect of model-driven app design. Consistent
processes help make sure your app users focus on their work and not on remembering to perform a set of manual
steps. Processes can be simple or complex and often change over time. To create a process, from the
PowerApps.com Model-driven area select > Advanced customizations > Open solution explorer. Next,
on the left navigation pane in solution explorer select Processes, and then select New. More information:
Business process flows overview and Apply business logic with Common Data Service.
Composing the model-driven app
After modeling data and defining processes, you build your app by selecting and configuring the components you
need using the app designer.

Next steps
Build your first model-driven app
Understand model-driven app components
Model-driven sample apps
3/17/2020 • 2 minutes to read • Edit Online

In powerapps.com, use a sample app to explore design possibilities and discover concepts that you can apply as
you develop your own apps. Each sample app uses fictitious data to showcase a real-world scenario.
Be sure to check out documentation specific to each sample app for more details.

Get sample apps


In order to play or edit model-driven sample apps, the apps must first be provisioned in a Common Data Service
database. First create a trial environment and database and be sure to select Depoly sample apps and data.
IMPORTANT
This option installs all available sample apps in your database. Sample apps are for educational and demonstration purposes
and we do not recommend installing them in production databases.

Customize a sample app


1. Sign in to powerapps.com
2. From the Create page, select the sample app and click Create.

3. The App designer will open providing multiple options for customizing the app.
4. For additional customization options, click Advanced from the left navigation in the portal.

Remove sample apps and data


Deleting a sample app requires deleting the corresponding managed solution.
Deleting the solution also deletes any sample data specific to the custom entities for the app.
If customizations were made to the sample app, there may be dependencies, which must be removed before
deleting the solution.
Steps
1. Login to the Power Apps admin portal.
2. Select an environment.
3. Click Dynamics 365 Administration Center.
4. Select your Database from the list and click OPEN.

5. Navigate to Settings/Solutions.
6. Select the solution for the app that is to be deleted and click delete.

Alternatively navigate to the list of solutions by clicking Advanced in the maker portal and delete everything in the
URL after .dynamics.com/
IMPORTANT
Do not delete other system solutions unless you're aware of the impact.

Install or uninstall Sample Data


1. Follow steps 1-4 above.
2. Navigate to Settings/Data Management/Sample Data.
3. If sample data is installed, the option to remove is available. Otherwise the option to install is available.
Build your first model-driven app from scratch
3/17/2020 • 2 minutes to read • Edit Online

Model-driven app design is a component-focused approach to app development. In this topic, you simplify how to
create a model-driven app by using one of the standard entities that's available in your Power Apps environment.

TIP
To learn all about building model-driven apps, start here: Understand model-driven app components.

Sign in to Power Apps


Sign in to Power Apps. If you don't already have a PowerApps account, select the Get started free link.

Create your model-driven app


1. Select the environment you want, or go to the Power Apps admin center to create a new one.
2. On the Home page, select Model-driven app from blank.

3. Select Create.
4. On the Create a New App page, enter the following details, and then select Done:
Name: Enter a name for the app, such as My first app.
Unique Name: By default, the unique name uses the name your specify in the Name box without spaces and
preceded by the publisher prefix and an underscore (_). For example, crecf_Myfirstapp. More information:
Change the solution publisher prefix
Description: Type a short description of what the app is or does, such as This is my first app. For information
about the additional app properties, see Create an app.
Add components to your app
From the app designer you add components to your app.
1. Select the Open the Site Map Designer edit button to open the sitemap designer.

2. On the sitemap designer select New Subarea, in the right pane select the Properties tab, and then select
the following properties.
Type: Entity
Entity: Account
3. Select Save And Close.
4. On the app designer canvas select Forms, and then on the right pane under the Main Forms group select
the Account form.

5. On the app designer canvas select Views, and then select the Active Accounts, All Accounts, and My
Active Accounts views.
6. On the app designer canvas select Charts, and then select the Accounts by Industry chart.
7. On the app designer toolbar, select Save.

Publish your app


On the app designer toolbar, select Publish.
After publishing the app it's ready for you to run or share with others.
Next steps
In this topic, you built a simple model-driven app.
To see how your app looks when you run it, see Run a model-driven app on a mobile device.
To learn how to share your app, see Share a model-driven app.
To get started and learn all about building model-driven apps, see Understand model-driven app components
Understand model-driven app components
3/17/2020 • 4 minutes to read • Edit Online

A well designed model-driven app consists of several components you select using the designer to build the
appearance and functionality of the finished app. The components and component properties that designers use
to make up an app become the metadata.
To understand how each of these components relates to app design, they're separated here into data, UI, logic, and
visualization categories.

Data
These components determine what data the app will be based upon and what designer is used to create or edit the
component.

COMPONENT DESCRIPTION DESIGNER

Entity An item with properties that you track, PowerApps entity designer
such as a contact or account. Many
standard entities are available. You can
customize a non-system standard
entity (production entity) or create a
custom entity from scratch.

Relationship Entity relationships define how entities PowerApps entity designer


can be related to each other. There are
1:N (one-to-many), N:1 (many-to-one),
and N:N (many-to-many) types of
relationships . For example, adding a
lookup field to an entity creates a new
1:N relationship between the two
entities and lets you put that lookup
field on a form.

Field A property that is associated with an PowerApps entity designer


entity. A field is defined by a data type,
which determines the type of data that
can be entered or selected. Examples
include text, number, date and time,
currency, or lookup (creates a
relationship with another entity). Fields
typically are used with forms, views, and
searches.

Option set field This is a special type of field, which PowerApps option set designer
provides the user a set of
predetermined options. Each option has
a number value and label. When added
to a form, this field displays a control
for the user to select an option. There
are two kinds of option sets; option
sets, where the user can only select one
option, and multi-select options sets,
which allow more than one selection.
More information: Define data for your model-driven app

UI
These components determine how users interact with the app.

COMPONENT DESCRIPTION DESIGNER

App Determines the application App designer


fundamentals such as components,
properties, client type, and URL for
your app.

Site map Specifies the navigation for your app. Site map designer

Form A set of data-entry fields for a given Form designer


entity that matches the items that your
organization tracks for the entity. For
example, a set of data-entry fields that
where user's input relevant information
to track a customer's previous orders
along with specific requested reorder
dates.

View Views define how a list of records for a View designer


specific entity is displayed in your
application. A view defines the columns
to display, width of each column, sort
behavior, and the default filters.

Logic
Determines the business processes, rules, and automation the app will have. PowerApps makers use a designer
that is specific to the type of process or rule.
TYPE OF LOGIC DESCRIPTION DESIGNER

Business process flow An online process that walks users Business process flow designer
through a standard business process.
For example, use a business process
flow if you want everyone to handle
customer service requests the same
way, or to require staff to gain approval
for an invoice before submitting an
order.

Workflow Workflows automate business Workflow designer


processes without a user interface.
Designers use workflows to initiate
automation that doesn't require any
user interaction.

Actions Actions are a type of process that let Process designer


you manually invoke actions, including
custom actions, directly from a
workflow.

Business rule Used to apply rule or recommendation Business rule designer


logic to a form, such as to set field
requirements, hide fields, or validate
data. App designers use a simple
interface to implement and maintain
fast-changing and commonly used
rules.

Flow Flow is a cloud-based service that lets Power Automate


you create automated workflows
between apps and services to get
notifications, synchronize files, collect
data, and more.
More information: Apply business logic in your model-driven app
Additional options for adding custom business logic
Use plug-ins to extend business processes
Workflow extensions

Visualizations
Determines what type of data visualizations and reporting the app will have available.

COMPONENT DESCRIPTION DESIGNER

Chart A single graphic visualization that can Chart designer


be displayed within a view, on a form,
or be added to a dashboard.

Dashboard Functions as a palate for one or more Dashboard designer


graphic visualizations that provide an
overview of actionable business data.

Embedded Power BI Add embedded Power BI tiles and Combination of chart designer,
dashboards to your app. Power BI is a dashboard designer, and Power BI
cloud-based service that provides
business intelligence insight.
Advanced model-driven app making
The solution explorer is a comprehensive tool used for advanced model-driven app building. Within the solution
explorer you can navigate through a hierarchy that consists of all app components using the navigation pane on
the left side of the tool.

To open solution explorer,


1. On the PowerApps Home page, select Settings, and then select Advanced Settings.
2. On the Dynamics 365 Business Management page, select Settings, select Customizations, and then
select Customize the System.

More information: Advanced app making and customization

Related topics
Validate and publish your model-driven app
Share your model-driven app
Define data for your model-driven app
12/2/2019 • 2 minutes to read • Edit Online

Data for your model-driven app is defined in Common Data Service.


You define your app data using the following components: entity, field, and relationship.
For detailed information about working with these components in Common Data Service to define data for your
model-driven app, see the following topics under Common Data Service section:

COMPONENT TOPIC

Entity Work with entities

Field Work with fields

Relationships Work with relationships

Next step
Use app designer to build an app
Model-driven app common field properties
3/17/2020 • 4 minutes to read • Edit Online

You can view and edit common properties of entity fields for a model-driven app using Power Apps solution
explorer or Power Apps portal. The Power Apps portal provides an easy way to create and edit entity fields with
the Common Data Service. The portal enables configuring the most common options, but certain options can only
be set using solution explorer.

Common field properties in Power Apps portal


1. From the Power Apps portal, select Data > Entities and select the entity that has the fields you want to
view.
2. Select the field that you want to view.

The following table describes the common properties of fields. Certain types of fields have special properties.
These are described in Create and edit fields for Common Data Service.

PROPERTY DESCRIPTION

Display Name The text to be displayed for the field in the user interface.
PROPERTY DESCRIPTION

Name The unique name across your environment. A name will be


generated for you based on the display name that you've
entered, but you can edit it before saving. Once a field is
created the name cannot be changed as it may be referenced
in your applications or code. The name will have the
customization prefix for your Common Data Service Default
Publisher prepended to it.

Data type Controls how values are stored as well as how they are
formatted in some applications. Once a field is saved, you
cannot change the data type with the exception of converting
text fields to autonumber fields.

Required A record can't be saved without data in this field.

Searchable This field appears in Advanced Find and is available when


customizing views.

Calculated or Rollup Use to automate manual calculations. Use values, dates, or


text.

Advanced Options Add a description, and specify a maximum length and IME
mode for the field.

There are many different types of fields, but you can only create some of them. For more information about all
types of fields, see Types of fields and field data types. You can set additional options depending on your choice of
Data type.

Common field properties in solution explorer


Fields in a form display controls people use to view or edit data in an entity record. Fields can be formatted to
occupy up to four columns within a section.
You can access Common field properties in solution explorer. Under Components, expand Entities, expand the
entity you want, and then select Forms. In the list of forms, open the form of type Main. Then double-click one of
the fields to view Common field properties.
The following table describes properties that all fields have. Certain types of fields have special properties. These
are described in Special field properties.

TAB PROPERTY DESCRIPTION

Display Label Required: By default the label will


match the display name of the field. You
can override that name for the form by
entering a different label here.

Display label on the form You can choose not to display the label
at all.

Field Behavior Specify the field level behavior using the


check boxes.

Locking This will prevent the field from being


removed from the form accidentally.
This will prevent any configuration you
have applied to the field, such as event
handlers, from being cleared if the field
were removed. To remove this field a
customizer would need to clear this
setting first.

Visibility Showing the field is optional and can be


controlled using scripts. More
information: Visibility options
TAB PROPERTY DESCRIPTION

Availability Choose if you want the tab to be


available on the phone.

Formatting Select the number of columns the When the section containing the fields
control occupies has more than one column you can set
the field to occupy up to the number of
columns that the section has.

Details Display Name, Name, and These read-only fields are for reference.
Description Click the Edit button for convenient
access to the field definition if you want
to edit it.

Each instance of a field in the form has


a name property so that they can be
referenced in form scripts, but this
name is managed by the application.
The first instance of the field is the
name of the field specified when it was
created. More information: Create and
edit fields

For each additional time that a field is


included in a form, the name appends a
number starting with 1 to the end. So if
the field name is 'new_cost', the first
instance is 'new_cost', the second is
'new_cost1', and so on for each instance
of the field in the form.

Note: The field Description value


provides tooltip text for the field when
people place their cursor over it.

Events Form Libraries Specify any JavaScript web resources


that will be used in the field OnChange
event handler.

Event Handlers Configure the functions from the form


libraries that should be called for the
field OnChange event. More
information: Configure Event Handlers

Business Rules Business Rules View and manage any business rules
that reference this field. More
information: Create business rules and
recommendations

Controls Controls Add controls and specify their


availability on Web, Phone and Tablet .

Next steps
Use the Main form and its components
Overview of model-driven app special field
properties
12/2/2019 • 3 minutes to read • Edit Online

All fields have the properties listed in Common field properties, but certain fields have additional properties, such
as this entitlement field that can be opened from the main form for the case entity.

Lookup field properties


NOTE
The options described in the table below are available only for single-entity lookup fields.

SECTION PROPERTY DESCRIPTION


SECTION PROPERTY DESCRIPTION

Related Records Filtering Only show records where When this is enabled, the records that
display when users search for a record
will have additional filtering applied. This
helps provide more relevant searches
when setting the value of the lookup.

By default, this is turned off.

The relationship combinations that are


possible when you filter related records
are listed in the table following this
one.*

The first list is populated with all the


potential relationships you can use to
filter this lookup. Select one.

The second list is then populated with


all relationships that connect the related
entity (selected in first list) to the target
entity. Select one.

Select the Allow users to turn off


filter check box to give users the
option to turn off the filter you define
here.

When users select the Look Up More


Records option while setting the value
for a lookup, they see this dialog box.

If you’ve selected the Allow users to


turn off filter option while configuring
the lookup field, users will see the check
box to turn off the filter. This makes it
possible for them to see a wider range
of records. If you want to make sure
that users only see a limited range of
records defined by this filter, clear the
Allow users to turn off filter check
box.

Additional Properties Display Search Box in lookup dialog You can choose not to display the
search box in the lookup dialog.
SECTION PROPERTY DESCRIPTION

Default View This view is used to filter the results of


the inline search and set the default
view shown in the lookup dialog when
users select the Look Up More
Records option.

The default view also controls which


fields are included in the inline lookup.

For lookups that only allow selection of


a single entity type, the fields displayed
in the inline lookup are set to be the
first two fields included in the default
view. In this example, Main Phone and
Email are the first two columns in the
default view configured for an account
lookup.

For system lookups that allow for


multiple entity types, the first two
columns of the entity lookup view are
shown.

View Selector You can choose from three options:

- Off: Don’t allow users to choose a


different view.
- Show All Views: All views are
available.
- Show Selected Views: When you
choose this option you can use the Ctrl
key and your cursor to choose which
views to show. The Lookup view for the
entity can’t be de-selected.

*Possible Relationship Combinations

FIRST LIST RELATIONSHIP SECOND LIST RELATIONSHIP AVAILABLE?

N:1 1:N Yes

N:1 N:1 Yes

N:1 N:N Yes

1:N 1:N Yes

1:N N:1 No

1:N N:N No

N:N 1:N Yes

N:N N:1 No

N:N N:N No
Two option field properties
On the formatting tab, two option fields have the following formatting choices:
Two radio buttons: Two labeled controls with labels. Only one may be selected.
Checkbox: A single checkbox to set the true value, otherwise false.
List: A drop-down list containing both values.
Multiple lines of text field properties
Multiple lines of text and single line of text fields that use the Text Area format have a Row Layout property.
With this property you can specify a value for Number of Rows or select Automatically expand to use
available space.

Next steps
Use the Main form and its components
Translate localizable text for model-driven apps
3/17/2020 • 4 minutes to read • Edit Online

If you have customized entity or field text, such as field labels or drop-down list values, you can provide the users in
your environment who are not working with the base language version of your environment with this customized
text in their preferred languages.
The process has the following steps:
1. Enable other languages for your environment
2. Export the localizable text
3. Get the localizable text translated
4. Import the localized text

Enable other languages for your environment


If you haven't already enabled the languages for your environment, use the steps described in Enable the language
to enable them.

IMPORTANT
Each language can take several minutes to enable. During this time, other users of the environment may not be able to use
your app. You should enable languages at time that will be least disruptive to users.

TIP
While you are enabling the languages, note the LCID values used for each language. This value will represent the language in
the exported data for the localizable text. Language codes are four-digit or five-digit locale IDs. Valid locale ID values can be
found at Locale ID (LCID) Chart).

Export the localizable text


The scope of the localizable text that will be exported is the unmanaged solution that contains the localizable text.
1. From the Power Apps portal select Solutions.
2. In the All Solutions list select the unmanaged solution that contains the localizable text you want.
3. In the menu bar select Translations > Export Translations.
You could see an alert that says:

Exporting customized labels for translation can take several minutes. Do not click the export link again
until the first export has finished. Are you sure that you want to export now?

Click OK if you want to continue.

When the export is completed, save the translations zip file. The file is named something like
CrmTranslations_{0}_{1}.zip , where {0} is the unique name of the solution and {1} is the version number of the
solution.

Get the localizable text translated


You can send this file to a linguistic expert, translation agency, or localization firm.
If you have the knowledge to translate the text, or if you just want to see the format, you can extract the zip file that
you exported you will see that it contains two XML files.
[Content_Types].xml
CrmTranslations.xml

You can open the CrmTranslations.xml file with Microsoft Office Excel.

TIP
Unless you normally open XML files with Excel, it may be easier to open Excel, then choose to open the file by pasting in the
path to the extracted CrmTranslations.xml file.

IMPORTANT
Make sure you do not change the file format. If you save the file in another format you will not be able to import it back.

When you view the data in Excel, look at the Localized Labels tab.
Any custom entities or fields will have empty cells for the localizable text. Add the localized values for those items.

NOTE
If you have changed the display name or description for any standard entity or entity field, the localized strings will still reflect
the translations for the original value. Those should be localized to reflect the new value.

The Display Strings tab contains text that is displayed for other UI elements such as Ribbon commands, error
messages, and form labels.
Updating localizable text in the base language
If you change the display name for any standard entity or entity field which is included in any special message, you
can update information in the Display Strings tab to use the customized name.

TIP
Although the UI exposed to edit system entity messages includes many references to entity names, it doesn't include all of
them. Using this technique may find more. More information: Edit system entity messages

For example, if you change the display name for the Account entity to Company, search through the base language
column in the Display Strings for the following matches: account , accounts , Account , and Accounts then make
appropriate replacements to company , companies , Company , and Companies respectively.

IMPORTANT
Do not do a general find/replace in the file for this. You should take care that the matching text actually refers to the names
you have changed.

Import the localized text


Importing the text requires compressing the files and importing them into the system.
Compress the files
After changes are made to the CrmTranslations.xml file, you must compress the file together with the
[Content_Types].xml file into the zip format. Just select both files and then click with the right mouse button to
open the context menu. In the context menu, choose Send to > Compressed (zipped) folder.
Import the files
From the same unmanaged solution that you exported the translations from, in the menu choose Translations >
Import Translations.

Select the file that contains the compressed translated text and select Import.
After the translated text is imported, you should publish all customizations to see the changes in your app(s).

Community tools
Easy Translator is a tool that XrmToolBox community developed. Use Easy Translator to export and import
translations with contextual information.

NOTE
The community tools are not supported by Microsoft. If you have questions about the tool, please contact the publisher.
More Information: XrmToolBox.

Next steps
Regional and language options for your organization
Edit system entity messages
Design model-driven apps by using the app designer
12/2/2019 • 2 minutes to read • Edit Online

With Power Apps, model-driven apps are comprised of components such as entities, dashboards, forms, views,
charts, and business processes.
The app designer helps you bring together all these components quickly. Its tile-based information structure and
simplified interface make the process of building an app much easier, and you can create apps that are specific to
your business roles and functions without having to write any code.
Each app that you create can have its own site map with the integrated and easy-to-use site map designer. Just
drag and drop areas, groups, and subareas to the canvas. Components that you select in the site map are also
added as entities in the app designer.
You can add or remove entities as necessary, and also add other components.
Once you're done adding components, you can validate your app to check if you have missed adding any required
components, add those, and then publish the app for users.
The following table shows the steps you'll take to create an app.

STEP DESCRIPTION RELATED TOPICS

Define app properties. Create or edit an app

Define navigation for an app using the Create a site map for an app
site map designer.

Apps are composed of components like Add or edit app components


dashboards, entities, business process
flows, forms, views, and charts. Include
the required ones in your app by using
the app designer.

Check your app for any required Validate and publish an app
components you haven't added. After
all required components are added
make the app available for use.

Give users access to the apps you Share a model-driven app


created by using security roles.

Support matrix for the app designer and site map designer
The following table shows the supported operating systems and browsers.

BROWSER/OS WINDOWS 10 WINDOWS 8.1 WINDOWS 8 MAC OS X

Microsoft Edge Yes

Internet Explorer 11 Yes Yes


BROWSER/OS WINDOWS 10 WINDOWS 8.1 WINDOWS 8 MAC OS X

Internet Explorer 11 Yes


Modern

Internet Explorer 10 Yes

Internet Explorer 10 Yes


Modern

Mozilla Firefox Yes Yes Yes

Google Chrome Yes Yes Yes

Apple Safari Yes

Next steps
Build your first model-driven app from scratch
Create a model-driven app by using the app
designer
3/17/2020 • 3 minutes to read • Edit Online

In this topic you learn the basics of how to create and edit a model-driven app by using the tile-based app
designer.

Prerequisites
Verify the following prerequisites before you start creating an app:
A Power Apps environment. More information: Create an environment
System administrator or system customizer security role. More information: About predefined security roles

Create an app
1. On the Power Apps Home page, select the Model-driven app from blank option for a model-driven app.
2. Select Create.
3. On the Create a New App page, enter the following details:
Name: Enter a name for the app.
Unique Name: The unique name is automatically populated based on the app name that you
specify. It is prefixed with a publisher prefix. You can change the part of the unique name that's
editable. The unique name can only contain English characters and numbers.

NOTE
The publisher prefix is the text that's added to any entity or field created for a solution that has this publisher.

Description: Type a short description of what the app is or does.


Icon: By default, the Use Default App thumbnail check box is checked. To select a different web
resource as an icon for the app, clear the check box, and then select an icon from the drop-down list.
This icon will be displayed on the preview tile of the app.
Use existing solution to create the App: Select this option to create the app from a list of installed
solutions. When you select this option, Done switches to Next on the header. If you select Next, the
Create app from existing solution page opens. From the Select Solution drop-down list, select a
solution from which you want to create the app. If any site map is available for the selected solution,
the Select Sitemap drop-down list will appear. Select the site map, and then select Done.

NOTE
By selecting Default Solution when you add a site map, the components that are associated with that site
map are automatically added to the app.
Choose a welcome page: This option allows you to select from the web resources available in your
organization. The welcome pages you create can contain information that's useful to users, such as
links to videos, upgrade instructions, or getting started information. The welcome page is displayed
when an app is opened. Users can select Do not show this Welcome Screen next time on the
welcome page to disable the page so it doesn't appear the next time the app starts. Notice that the
Do not show this Welcome Screen next time option is a user-level setting and can't be controlled
by administrators or app makers. More information about how to create a web resource, such as an
HTML file that you can use as a welcome page: Create and edit web resources to extend the web
application
To edit app properties later, go to the Properties tab in the app designer. More information: Manage app
properties

NOTE
You can't change the unique name and app URL suffix on the Properties tab.

4. Select Done or—if you selected Use an existing solution to create the App—select Next to select from
the available solutions that were imported in the organization.
A new app is created and is shown in Draft status. You'll see the app designer canvas for the new app. From
there you can add components, such as entities, views, and dashboards to make your app useful. More
information: Add or edit app components

Edit an app
1. Sign in to Power Apps.
2. On the left navigation pane select Apps, select a model-driven app, and then on the toolbar select Edit.
3. In the app designer add or edit components to the app, as required. More information: Add or edit app
components
Next steps
Add or edit app components
Create a model-driven app site map using the site
map designer
2/28/2020 • 9 minutes to read • Edit Online

In this tutorial you perform several site map tasks such as creating a new site map, and adding an area, group, and
subarea.
Site maps define the navigation for your app. Create a site map for your app with ease by using the tile-based site
map designer. Use the designer to drag components onto the design canvas, preview your work, and instantly
publish the site map. System customizers or any user with the required privileges can quickly create site maps for
apps.
The site map designer also lets you define the area, subarea, or group titles in the languages supported by the
environment.
A default site map is available. You can edit this site map or configure site maps for new apps by using the site
map designer. The site map designer is integrated with the app designer.

Prerequisites
Make sure that you have the System Administrator or System Customizer security role or equivalent permissions.
Specifically, any user with the following privileges can also create apps:
Create, Read, and Write privileges for the App entity
Read and Write privileges for the Customizations entity
Read privileges for the Solution entity
You can view or set these privileges on the Customization tab of a security role.

Create a site map for an app


1. On the app designer canvas, in the Site Map area, select Open the Site Map Designer .
The site map designer opens a canvas that is prepopulated with one area, one group, and one subarea.
Select the area, group, or subarea tile to change its properties.

NOTE
Selecting Open the Site Map Designer from the app designer canvas automatically creates a new site map (if
there's no existing site map), and gives the new site map the same name as the app name and the same unique
name as the app unique name.
2. Add an area to the site map.
3. Add a group to the site map.
4. Add a subarea to a group in the site map.
5. Select Save.

NOTE
The new site map is associated with the app when you go back to the app designer and select Save. When a site
map is configured, Configured appears on the site map tile; otherwise Not Configured appears on the tile. If you
open the site map designer from the app designer and configure a new site map, but close the browser before
associating the site map with the app, the site map will be automatically associated with the app the next time you
open the app designer, based on the app unique name.

6. Select Publish.

Edit the default site map


Your environment comes with a default site map.
1. Open solution explorer.
2. In the solution window, under Components, select Client Extensions.
3. On the component toolbar, select Add Existing > Site Map.
4. In the list of solution components, select the site map named Site Map, and then select OK.
5. Double-click to select the site map you added that has the display name Site Map and is in a Managed
state. You can also select the site map, and then on the toolbar, select Edit.
The site map opens in the site map designer.
6. Add an area to the site map.
7. Add a group to the site map.
8. Add a subarea to a group in the site map.
9. Select Save.
10. Select Publish.

Add an area to the site map


1. Select Add on the site map designer canvas, and then select Area.
or
From the Components tab, drag the Area tile to the empty box on the canvas. You'll see the empty box
when you move the tile to the correct place on the canvas.
2. Select the area you just added. You'll see the Properties tab highlighted in the pane to the right of the
canvas.
3. Add or edit the area properties.
Under General, do the following:
Title: Enter the title for the area in the base language of the organization.
Icon: A default application icon is selected. Select a different icon for the area from the list of web
resources available in the solution.
ID: A unique ID is automatically generated, but you can enter a different one if you want. We
recommend that you use the provided ID because if the ID you enter is not unique, users might get
an error when they're using the app, or you might get an error when you import a solution that
contains this site map.
Show Groups: Select this check box to show groups of subareas in the navigation pane.
Under Advanced, do the following:
More Titles: If your organization uses multiple languages, select a language (Locale) for the title,
enter the title, and then select Add . You can create, edit, or delete titles for as many languages as
your organization uses. However, you can have only one title per language.
More Description: If your organization uses multiple languages, select a language for the
description, enter the description, and then select Add . You can create, edit, or delete descriptions
for as many languages as your organization uses. However, you can have only one description per
language.
URL: Enter the URL to render for the Dynamics 365 for Outlook folder that represents the area.

Add a group to the site map


1. On the site map designer canvas, select the area you want to add the group to.

2. Select Add , and then select Group.


or
From the Components tab, drag the Group tile to an empty box under the Area in the canvas. You'll see
the empty box when you move the tile to the correct place in the canvas.
3. Select the group you just added.
4. On the Properties tab, add or edit the group properties:
Under General, do the following:
Title: Enter the title for the group in the base language of the organization.
ID: A unique ID is automatically generated. Enter a different one if required. We recommend using
the automatic ID because if the ID you enter is not unique, you might get an error when you import
a solution containing this site map.
Under Advanced, do the following:
More Titles: If your organization uses multiple languages, select a language (Locale) for the title,
enter the title for the group, and then select Add . You can create, edit, or delete titles for as many
languages as your organization uses. However, you can have only one title per language.
More Descriptions: If your organization uses multiple languages, select a language for the
description, enter the description for the group, and then select Add . You can create, edit, or
delete descriptions for as many languages as your organization uses. However, you can have only
one description per language.
URL: Enter the URL to render for the Dynamics 365 for Outlook folder that represents the group.
Set as Profile: Select this check box to indicate whether this group represents a user-selectable
profile for the workplace. The group set as a user-selectable profile is made available as options in
your personal options. This only applies for groups within the Workplace area.

Add a subarea to a group in the site map


1. Select Add on the site map designer canvas, and then select Subarea.
or
From the Components tab, drag the Subarea tile to an empty box under the Group section in the canvas.
You'll see the empty box when you move the tile to the correct place in the canvas.
2. Select the subarea you just added.
3. On the Properties tab, add or edit the subarea properties:
Under General, do the following:
Type: Select whether the subarea you are adding is a dashboard, entity, web resource, or URL.
Entity: Select the entity that the subarea is for. This field is disabled if the subarea type is other than
Entity in the Type drop-down list.
URL: Specify a URL for the main page of the application to show when this subarea is selected. This
field is disabled if you've selected Entity in the Type drop-down list.
Default Dashboard: Select the default dashboard to be displayed for this subarea. This field is
disabled if you haven't selected Dashboard in the Type drop-down list.
Title: Enter the title for the subarea in the base language of the organization.
Icon: A default application icon is selected. Select a different icon for the subarea from the list of web
resources available in the solution.
ID. A unique ID is automatically generated. Enter a different unique ID if required.
Parameter Passing. Select this check box to pass information about the organization and language
context to the URL. This check box is checked only when the subarea type is a web resource or a
URL -based subarea.
Under Advanced, do the following:
Privileges: This defines whether a subarea is displayed based on privileges available in any security
roles that are assigned to the user. Select the name of the entity to check privileges for, and then
select the check boxes to assign privileges.
More Titles: If your organization uses multiple languages, select a language for the title, enter the
title for the subarea, and then select Add. You can create, edit, or delete titles for as many languages
as your organization uses. However, you can have only one title per language.
More Descriptions: If your organization uses multiple languages, select a language for the
description, enter the description for the subarea, and then select Add. You can create, edit, or delete
descriptions for as many languages as your organization uses. However, you can have only one
description per language.
SKUs: Select the versions of Dynamics 365 that display this subarea.
Client: Select the type of client that displays this subarea.
Outlook Shortcut: Select the icon to display in Dynamics 365 for Outlook.
Offline Availability: Select this check box to make this subarea available to users when they are
offline in Dynamics 365 for Outlook.

Organize areas, groups, and subareas


You can organize your areas, groups, and subareas by dragging them to new positions. A container box appears
where you can drop the tiles. Here are some things you can do:
Move a subarea to a new position within the same group or a different group under the same area.
Move a subarea to a new position within a group under a different area.
Move a group to a new position within the same area.
Move a group to a new position in a different area.
Move an area to a new position.

Clone a component in a site map


To make a copy of an existing component, select the component, and then on the toolbar, select Clone. All details
of the cloned component are same as the base component except the ID and title. The ID is generated randomly.
When you clone an area, the cloned area is added to the right of the currently selected area. When you clone a
group, the cloned group is added to the right of the currently selected group. When you clone a subarea, the
cloned subarea is added below the currently selected subarea.

Delete an area, group, or subarea from a site map


To delete a site map component, select the component tile, and then on the toolbar, select Delete. When you
delete an area, all groups and subareas in the area are also deleted. Similarly, when you delete a group, the group
and subareas in it are deleted.

Clients supported
The following table explains the clients supported for different site maps.

SITE MAPS SUPPORTED CLIENTS

New apps Unified Interface


SITE MAPS SUPPORTED CLIENTS

Site map for the Dynamics 365 - custom app Legacy web app and Dynamics 365 for Outlook

MOdel-driven apps (Sales, Sales Hub, Customer Service, Legacy web app and Unified Interface
Customer Service Hub, Field Service, Project Service
Automation)

Next steps
Create or edit an app
Add or edit app components
Tutorial: Add or edit model-driven app components
in the Power Apps app designer
3/17/2020 • 7 minutes to read • Edit Online

In this tutorial you learn how to add components to and remove components from a model-driven app.
A model-driven app is composed of various components. You can add two types of components to an app:
artifacts and entity assets. In the context of the app designer, entities, dashboard, and business process flows are
all artifacts of an app. Entity assets consist of forms, views, charts, and dashboards.
The app designer refers to existing metadata in the default solution. You can use it to create components like
forms, views, charts, and dashboards.

App designer layout


The app designer has two main areas. On the left side is the canvas where you add app components.

On the right side are tabs that you'll use to select components and set component properties.
On the canvas, you'll see areas for the site map, business process flow, dashboard, and entities. When you select a
dashboard or business process flow, or configure a site map, the app designer automatically adds the entities that
are used in these components to the canvas. After the entities are in place, all you need to do is select each entity
and add required entity assets such as forms, views, and charts to it.
You can also use Search Canvas to search for components on the canvas. When you select Search Canvas, a
new search tab opens to the right of the tabs in the rightmost pane.

Open an app
1. Sign in to Power Apps.
2. Select an existing model-driven app or select Model-driven app from blank. For information about how
to create an app, see Create or edit a model-driven app by using the app designer.

Add an artifact (entity, dashboard, or business process flow)


When you add a dashboard or business process flow to an app, the entities they use are automatically added to
the app. When you add an entity, the tiles for its assets are automatically added. There are two ways you can add
artifacts to the designer canvas: by using the Add button on the command bar or by using the tiles on the
Components tab.
Here are the steps for adding a dashboard to the app. Use the same steps to add a business process flow or entity.
1. On the app designer canvas, select the Dashboards tile.
On the app designer canvas, the rightmost pane shows you dashboards that are available in the default
solution.

TIP
Alternatively, you can also do one of the following:

Select Add , and then select Dashboards.


On the Components tab, under Artifacts, select Dashboards.

2. In the search box, type a few keywords for the dashboard name you're looking for.
The dashboard list will be filtered to show results that match your keywords.
3. If you want your users to use only selected dashboards, select the check box for the dashboards you want
to add. You can select from the following types of dashboards:
Classic Dashboards appear on both the web app and the Unified Interface app.
Interactive Dashboards appear only on the Unified Interface app. If you have selected the client type
for the app as web app, the Interactive Dashboards option will not be displayed.
Those dashboards will be added to the Dashboard tile on the app designer canvas. The Dashboard tile
also shows a count of the number of dashboards you added to the app. If you don't select a dashboard, All
will appear instead of the dashboard count, and all dashboards will be available to users when they use the
app.
All entities the dashboard uses are also added to the Entity View area. For example, if you add the
Customer Service Manager dashboard, the Case, Entitlement, and Queue Item entities are added to the
Entity View area. For each entity, tiles for its assets are also added. You can use these tiles to add forms,
views, and charts. More information: Add or edit app components in the Power Apps app designer

4. If the dashboard you want doesn't exist in the default solution, create a dashboard by selecting Create
New on the Components tab to the right of the canvas.
The dashboard designer opens. More information: Create and edit dashboards

NOTE
When you're adding a business process flow or entity, the Create New option opens the corresponding designer.
To learn more about creating business process flows or entities, see Create a business process flow and Create a
custom entity.

5. When you're done adding artifacts, on the command bar, select Save.

Add entity assets (forms, views, charts, or dashboards)


With the artifacts in place, you can start adding entity assets like forms, views, charts, and dashboards to the app.
Additionally, if you're using the Unified Interface client, you can also add entity dashboard assets to the app.
This section describes the steps for adding a form to the app. Use the same steps to add a view or chart to the
app.
1. On the app designer canvas, select the Forms tile for the entity you want to add a form to.
On the app designer canvas, the entire row for the entity is selected. On the right side, you'll see all existing
forms for the selected entity.

NOTE
Alternatively, you can also do one of the following:

Select Add , and then select Forms.


On the Components tab, under Entity Assets, select Forms.

TIP
For all entities selected for the app, a More Options button (...) appears in the Select Entities list on the
Components tab. To add all assets for the selected entity, select More Options (...), and then select Add All
Assets.

2. If you want your app users to use only selected forms, select the check boxes for the forms you want to
add. The forms define how users will see and interact with data in the app.
The form tile of the selected entity will display the number of forms added.
For example, if you don't select any form for an entity, all the forms for that entity will be displayed to end
users while they use the app. This behavior is similar for views and charts also, if no view or chart is
selected. This helps to create apps quickly when you need to work with all available components; there's no
need to select each component during app design.
If no dashboards or business process flows are selected, all the dashboards and business process flows will
be available for users while they use the app.

NOTE
For the app to run, each entity that you add must have at least one active form. If you've selected multiple forms,
the first active form that appears in the default solution will be used when users run the app.

3. If you want to add a new form that's not available in the list, select Create New.
In the drop-down list, select the type of form you want to create.

NOTE
The drop-down list is available only when you're adding forms. It isn't available for views and charts.

The form designer opens. More information: Create and design forms
When you're adding a view or a chart, the Create New option opens the corresponding designer. More
information: Understand views and Create or edit a system chart

NOTE
When you're adding a view, you can reference only public views that are listed under the Views node in the solution
explorer.

4. Select the down arrow to expand the tile and see a list of forms that have been added.

5. Repeat these steps to add entity views and charts to the app.
6. Select Save.

Edit or remove artifacts


To edit a dashboard or a business process flow, select the down arrow to expand the tile, and then
select the site map designer button corresponding to the dashboard or business process flow that you
want to edit.
The designer for the selected artifact opens.

To remove a dashboard or a business process flow, select the down arrow to expand the tile, and then
select the dashboard or business process flow that you want to remove. On the command bar, select
Remove.
Another way to remove a dashboard or business process flow is by clearing the corresponding check box
on the Components tab.
To edit or remove an entity, select the entity tile, and then on the command bar, select Edit or Remove.
When you edit an entity, the solution explorer opens, where you can make changes to the entity.
Another way to remove a component is to select the dashboard, business process flow, or entity tile. On the
Components tab, clear the check boxes for the artifacts you want to remove from the designer.

NOTE
When you make any changes to an entity—like changing an entity display name or description—the changes don't
appear in the app designer unless the changes are published in the solution explorer.

Edit or remove entity assets


Edit entity assets
1. Select the down arrow to expand the tile for forms, views, charts, or dashboards.
2. Select the form, view, chart, or dashboard that you want to edit.
3. On the command bar, select Edit.
or

Select the site map designer button corresponding to the form, view, chart, or dashboard.
Remove entity assets
1. Select the down arrow to expand the tile for forms, views, charts, or dashboards.
2. Select the form, view, chart, or dashboard that you want to edit.
3. On the command bar, select Remove.
Alternatively, you can select the forms, views, charts, or dashboards tile, and then on the Components tab, clear
the check boxes for the assets you want to remove from the designer.

Next steps
Create a site map for an app

Validate and publish an app


Add an entity as a lookup option in your app
11/14/2019 • 2 minutes to read • Edit Online

With Unified Interface apps, for an entity to be available in a lookup it must be added to the app. For example,
contact records have the ability to be assigned to a user or a team.

However, if the user entity is included in the app but the team entity is not, only user records will appear in a
lookup.

Add the team entity to an app


1. Open the app in the App Designer.
2. Select the Components tab, select Entities, and then select Team.

3. Select Save, and the select Publish to make your change available to app users.
Create and design model-driven app forms
2/5/2020 • 3 minutes to read • Edit Online

With Power Apps, forms provide the user interface that people use to interact with the data they need to do their
work. It's important that the forms people use are designed to allow them to find or enter the information they
need efficiently.
In the default solution or an unmanaged solution, you can create new forms or edit existing forms for all entities
that allow form customization. In an unmanaged solution, you can edit the managed properties for an
unmanaged custom entity that was created for the solution. If you’re viewing a managed solution, you can’t
create new forms or edit existing forms for entities. However, if the managed properties for an entity in the
managed solution are set to allow customization, you can add or edit forms to that entity.

Type of forms
There are different types of forms, and each type has a specific functionality or use. More information: Type of
forms in Power Apps.

Main form dialogs (Preview)


With the client API, you can use main form dialogs so users can open a related record entity on a parent or base
form without navigating away from the form. More information: Open main form in a dialog using client API

Updated versus classic entities


Power Apps provides many options for designing forms. With Unified Interface, most entities were updated to
better suit the responsive interface. Updated entities as well as your own custom entities include support for the
Dynamics 365 for tablets client, business process flows, and business rules. When you use these entities, you can
design once and deploy to all clients.
There are still a number of entities, referred to here as classic entities, that retain the appearance and capabilities
from earlier versions. These entities are used less often. They are listed here:

Address Article Article Comment Bulk Delete Connection


Operation

Discount Discount List Document Location Email Attachment Follow

Goal Goal Metric Import Source File Invoice Product Order Product

Price List Queue Item Quote Product Rollup Field Rollup Query

Saved View Service Service Activity SharePoint Site Site

Territory Unit Unit Group

Form display FAQ


Why is my form not visible in the form selector drop down in my app?
A form may not be available because it hasn’t been added to the app.
1. Open the app in app designer.
2. In the Entity View area select Forms next to the entity.
3. On the Components tab verify the main forms that are included for the app. Verify that the form you
want to display is checked. If not, select it, save, and then publish the app.

Why isn't my form displayed as the default form in the app?


A form can be set as the default form through the form order configuration or when a user sets the default form
as a personalization setting.
1. Open solution explorer. Expand the entity that has the forms your want to order, and then selectForms.
2. On the toolbar select Form Order > Main Form Set.
3. The form order is displayed. Select the form and use the up and down arrows to move the form within
the form order. The form at the top of the list is the default form.

4. Select OK to save the form order changes.


5. On the form designer toolbar, select Publish to make the form order available in apps.
Form order user personalization setting
Notice that, when an app user changes the form selection in the form selector drop down of an app, that form
becomes the default form for the user. This personalization overrides the default form specified for the entity in
the app.

Related topics
Assign form order
Control access to forms
How main forms appear in different clients
Overview of the model-driven form designer
12/2/2019 • 2 minutes to read • Edit Online

The new model-driven form designer provides a modern WYSIWYG authoring experience when you work with
model-driven forms. It includes several improvements not available in the classic model-driven form designer.
The designer shows a real-time WYSIWYG preview (Unified Interface only) while you author a form. Changes to
the form are instantly reflected in the preview, enabling you to see exactly how the form will appear to users when
published. An always available property pane makes the common task of updating properties quick and easy.
Updates to properties are also instantly reflected in the form preview. The fields pane with searching and filtering
capabilities helps makers quickly find and add fields to the form. The components pane makes it easy to discover
and use components and provide a rich end-user experience. The tree view helps visualize the hierarchy of the
form’s fields and components and to quickly find and select a particular field or component on the form.
The form designer interface has the following areas:
Command bar – Displays available actions such as Save, Publish, Undo, and Redo.
Panes – Displays panes with specific functions
Fields pane to add fields to a form.
Components pane to add components to a form.
Tree view to see the hierarchy of components on the form and select them.
Form preview – Displays a real-time preview of the form as it will appear to users when published.
Property pane – Displays properties of the selected element, and also allows you to make changes.
Preview size switcher - Changes the size of the form preview helping you to see how the form will appear on
various screen sizes.
Zoom slider - Zooms in or out of the form preview helping you take a closer look.
Fit to width - Quick action to fit the form preview to the available width.

See also
Create, edit, or configure forms using the form designer
Add, configure, move, or delete fields on a form
Add, configure, move, or delete components on a form
Add, configure, move, or delete sections on a form
Add, configure, move, or delete tabs on a form
Configure header properties in the form designer
Add and configure a sub-grid component on a form
Add and configure a quick view component on a form
Configure a lookup component on a form
Using the tree view in the form designer
Create and edit fields
Create, edit, or configure forms using the form
designer
12/3/2019 • 2 minutes to read • Edit Online

Use the new form designer to create, edit, or configure forms for model-driven apps.

IMPORTANT
The new model-driven form designer does not currently support editing card forms. More information: Form types

Create a form
1. Sign in to Power Apps.
2. On the left navigation pane, expand Data, and then select Entities.
3. Select an entity, such as the account entity, and then select the Forms tab.
4. Select Add form, and then select one of the following
Main form
The contents of the new form are filled using the existing main form definition. If multiple main forms
exist, the form at the top of the list in the form order is used to fill the new form.
Quick create form
Quick view form
5. When you are done making changes to the form, select Save to save the form, or select Publish if you want
to save and make your changes visible to app users.

Edit a form
1. Sign in to Power Apps.
2. On the left navigation pane, expand Data, and then select Entities.
3. Select an entity, such as the account entity, and then select the Forms tab.
4. Select the form name that you want to edit.
You can also select the row for a form, and then in the command bar, select Edit form
Another alternative is to select ... next to the form name, and then in the menu, select Edit form.
5. When you are done making changes to the form, select Save to save the form, or select Publish if you want
to save and make your changes visible to app users.

Configure a form
These are the properties available to configure a form when you create or edit a form using the form designer.

NAME DESCRIPTION

Title Enter a name that is meaningful to other makers and app


users. This name is shown to app users. If users have access
to multiple forms for an entity they will use this name to
differentiate between the available forms.

This property is required.


NAME DESCRIPTION

Description Enter a description that explains how the form is different


from other main forms. This description is only shown to
makers in the list of forms for an entity in the solution
explorer.

Max Width Set a maximum width (in pixels) to limit the width of the
form. The default value is 1900.

This property is required.

Show image Show the entity’s Primary Image if it has one set. This
setting will enable showing the image field in the header of
the form.

See Enable or disable entity options for more information


about entity options.

See also
Overview of the model-driven form designer
Add, configure, move, or delete fields on a form
Add, configure, move, or delete components on a form
Add, configure, move, or delete sections on a form
Add, configure, move, or delete tabs on a form
Configure header properties in the form designer
Add and configure a sub-grid component on a form
Add and configure a quick view component on a form
Configure a lookup component on a form
Using the tree view in the form designer
Create and edit fields
Add, configure, move, or delete fields on a form
12/2/2019 • 7 minutes to read • Edit Online

Add, configure, move, or delete fields using the form designer.

Add fields to a form


To add fields to a form, use the Fields pane. The Fields pane lets you search and filter to help you quickly find
fields. It also includes the option to show only unused fields.

Add fields to a form using drag and drop

NOTE
When adding or moving fields using drag and drop be aware that the form preview is responsive and may be rendering
multiple section columns as stacked. To ensure that the field being added or moved is in the correct section column, drop
or paste it anchored to another field that is already in that section column.

1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. In the command bar, select Add field, or in the left pane, select Fields. The Fields pane is open by default
when the form designer is opened.
3. In the Fields pane, search, filter, or scroll to find the field you want to add. If you can't find a field, it might
already be on the form. Clear Show only unused fields to view all fields, including those already added to
the form.
4. In the Fields pane, select a field and drag it onto the form preview. As you drag the field on the form preview,
you will see drop targets where you can add the field.
5. Drop the field in the location you want. Note the following:
Fields can be dropped before or after any existing field or component.
Fields can also be dropped in the empty area within a section. In this case the field will be added in an
available space so as to evenly distribute fields and components across the section columns.
Hovering over a tab header when dragging a field changes the currently selected tab, allowing you to
add the field to a different tab.
6. Repeat steps 3-5 above if you want to add more fields.
7. In the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.
Add fields to a form using selection
1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. In the form preview, select another existing field or section. Note the following:
When you select an existing field, the new field is added after the existing field.
When you select a section, the new field is added in an available space so as to evenly distribute fields
across the section columns.
3. In the command bar, select Add field, or in the left pane, select Fields. The Fields pane is open by default
when the form designer is opened.
4. In the Fields pane, search, filter, or scroll to find the field you want to add. If you can't find a field, it might
already be on the form. Clear Show only unused fields to view all fields, including those already added to
the form.
5. In the Fields pane, select a field to add it to the form. Alternatively, select ... next to the field you want, and
then select Add to selected section.
6. Repeat steps 2-5 above if you want to add more fields.
7. In the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.

Configure fields on a form


These are the properties available to configure a field when you create or edite a form using the form designer.

Field properties
AREA NAME DESCRIPTION

Display options Field label By default the label will match the
display name of the field. You can
override that name for the form by
entering a different label here.

This property is required.


AREA NAME DESCRIPTION

Display options Field name The name of the field. This comes from
the field properties on the entity and is
read-only.

Display options Hide label When selected, the field label is hidden.

Display options Read-only field When selected, the field value is not
editable.

Display options Lock field Lock this field so it can't be removed.

Display options Hide field When selected, the field is hidden by


default and can be shown using code.

Display options Hide on phone The field can be hidden to render a


condensed version of the form on
phone screens.

Formatting Field width When the section containing the fields


has more than one column you can set
the field to occupy up to the number of
columns that the section has.

Move fields on a form


You can move a field on a form using drag and drop or cut and paste actions.
Move fields on a form using drag and drop
1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. In the form preview, select the field that you want to move and drag and drop it. As you drag the field on the
form preview, you will see drop targets where you can move the field to. Note the following:
Fields can be dropped before or after any existing field or component.
Fields can also be dropped in the empty area within a section. In this case the field will be added in an
available space so as to evenly distribute fields and components across the section columns.
Hovering over a tab header when dragging a field changes the currently selected tab, allowing you to
add the field to a different tab.
3. Repeat step 2 above if you want to move more fields.
4. On the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.
Move fields on a form using cut and paste
1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. In the form preview, select the field that you want to move.
3. On the command bar, select Cut.
4. In the form preview, select another existing field, component or section. You can also switch to a different tab if
needed.
5. On the command bar, select Paste or select the chevron, and then select Paste before. Note the following:
When you select Paste, the field that is moved is pasted after the existing field or component.
When you select Paste before, the field that is moved is pasted before the existing field or component.
When you select a section, the field that is moved is added in an available space so as to evenly
distribute fields and components across the section columns. The Paste before action is not applicable
and therefore not available in this case.
6. Repeat steps 2-5 above if you want to move more fields.
7. On the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.

Delete fields on a form


1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. In the form preview, select the field that you want to delete from the form.
3. On the command bar, select Delete.
4. Repeat steps 2-3 if you want to delete more fields.
5. On the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.

NOTE
If you delete a field by mistake, on the command bar, select Undo to revert the form to its previous state.
You can't delete a field that is locked or is required and not present anywhere else on the form.

Create a new field on the entity when editing a form


1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. On the command bar, select Add field, or in the left pane, select Fields. The Fields pane is open by
default when the form designer is opened.
3. In the Fields pane, select + New field.
4. In the New field dialog, provide the Display name and Name for the field.
5. In the New field dialog, select the Data type and configure any other required properties of the field.

NOTE
Some field types are not available when you create a field from within the form designer. If a field type you want
is not available, you can follow the steps outlined in Create and edit fields for Common Data Service using Power
Apps portal

6. Select Done to create a new field on the entity. The field appears in the Fields pane.
7. If you want to add the newly created field to the form, follow the steps outlined in the Add fields to a
form section.

NOTE
When a field is created on the entity, it is not limited to the current form and will be available for use in other places.

See also
Overview of the model-driven form designer
Create, edit, or configure forms using the form designer
Add, configure, move, or delete components on a form
Add, configure, move, or delete sections on a form
Add, configure, move, or delete tabs on a form
Configure header properties in the form designer
Add and configure a sub-grid component on a form
Add and configure a quick view component on a form
Configure a lookup component on a form
Using the tree view in the form designer
Create and edit fields
Add, configure, move, or delete components on a
form
12/2/2019 • 6 minutes to read • Edit Online

By using the form designer, makers can easily add and configure popular components such as sub-grid, quick
view, arc knob, linear slider, and more.

Add components to a form


To add components to a form, use the Components pane. The Components pane also lets you search to
quickly find components.

Add components to a form using drag and drop


NOTE
When adding or moving components using drag and drop, be aware that the form preview is responsive and might render
multiple section columns as stacked. To ensure that the component that's added or moved is in the correct section column,
drop or paste it anchored to another field or component that is already in that section column.

1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. On the command bar, select Add component, or in the left pane, select Components to see a list of
available components. You can also hover over a component in the list to see a preview image, description,
and other details of that component.
3. In the Components pane, search or scroll to find the component that you want to add and then select it.
4. Drag and drop the component onto the form preview. As you drag the component on the form preview,
you will see drop targets where you can add the component.
Note the following:
Components can be dropped before or after any existing component or field.
Components can also be dropped in the empty area within a section. In this case the component will be
added in an available space so as to evenly distribute fields and components across the section
columns.
Hovering over a tab header when dragging a component changes the currently selected tab, allowing
you to add the component to a different tab.
When you drop the component, in most cases, you will see a dialog to configure the properties of the
component. Ensure that you have configured all the required properties of the component.
5. In the dialog to configure the properties of the component, under Show component on, the Web,
Mobile, and Tablet options are selected by default to ensure the component is used when the form is
displayed on the web, mobile app, and tablet app. Based on your requirements you can clear some of
these options to limit the usage of the component. Select Done.
6. Repeat steps 3-5 above to add more components.
7. On the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.
Add components for a field on the form
1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. In the form preview, select an existing field.
3. In the property pane, under the Components area, select + Component.
4. The Add component dialog displays a list of components that are available for the current field type. You can
hover over a component in the list to see a preview image, description, and other details of that component.
5. In the Add component dialog, search or scroll to find the component you want to add and then select it. In
most cases, a dialog is displayed so you can configure the properties of the component. Ensure that you have
configured all the required properties of the component.
6. In the dialog to configure the properties of the component, under Show component on, the Web, Mobile,
and Tablet options are selected by default to ensure the component is used when the form is displayed on the
web, mobile app, and tablet app. Based on your requirements you can clear some of these options to limit the
usage of the component. Select Done.
7. Repeat steps 2-6 above if you want to add more components to the same or another field.
8. On the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.
Configure components on a form
1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. In the form preview, select an existing field.
3. In the property pane, under the Components area, select the component that you want to configure.
4. You might see a dialog to configure the properties of the component. Change the properties of the
component as needed and select Done.
5. Repeat steps 2-4 to configure more components on the same or another field.
6. On the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.

Move components on a form


You can move components on a form by either drag-and-drop or cut-and-paste actions.
Move components on a form using drag and drop
1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. In the form preview, select the component that you want to move and drag and drop it. As you drag the
component on the form preview, drop targets appear where you can move the component.
Note the following:
Components can be dropped before or after any existing component or field.
Components can also be dropped in the empty area within a section. In this case the component will be
added in an available space to evenly distribute components and fields across the section columns.
Hovering over a tab header when dragging a component changes the currently selected tab, allowing
you to add the component to a different tab.
3. Repeat steps 2-3 above to move more components.
4. On the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.
Move components on a form using cut and paste
1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. In the form preview, select the component that you want to move.
3. On the command bar, select Cut.
4. In the form preview, select another existing component, field, or section. You can switch to a different tab if
needed.
5. On the command bar, select Paste or select the chevron, and then select Paste before.
Note the following:
When you select Paste, the component being moved is pasted after the existing component or field.
When you select Paste before, the component being moved is pasted before the existing component
or field.
When you select a section, the component being moved is added in an available space so as to evenly
distribute components and fields across the section columns. The Paste before action is not applicable
and therefore not available in this case.
6. Repeat steps 2-5 above if you want to move more components.
7. On the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.

Delete components on a form


1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. In the form preview, select the component that you want to delete from the form, and then on the
command bar, select Delete.
3. Repeat step 2 if you want to delete more components.
4. On the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.

NOTE
If you delete a component by mistake, on the command bar, select Undo to revert the form to its previous
state.
You can't delete a component that is locked or is using a required field that is not present anywhere else on the
form.

See also
Overview of the model-driven form designer
Create, edit, or configure forms using the form designer
Add, configure, move, or delete fields on a form
Add, configure, move, or delete sections on a form
Add, configure, move, or delete tabs on a form
Configure header properties in the form designer
Add and configure a sub-grid component on a form
Add and configure a quick view component on a form
Configure a lookup component on a form
Using the tree view in the form designer
Create and edit fields
Add, configure, move, or delete sections on a form
3/1/2020 • 6 minutes to read • Edit Online

Add, configure, move, or delete sections on a form using the form designer.

Add sections to a form


To add sections to a form, use the Components pane.

NOTE
Sections can only be added on main forms and quick view forms. More information: Form types

Add sections to a form using drag and drop

NOTE
When adding or moving sections using drag and drop be aware that the form preview is responsive and may be rendering
multiple tab columns as stacked. To ensure that the section being added or moved is in the correct tab column, drop or
paste it anchored to another section that is already in that tab column.

1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. In the command bar, select Add component, or in the left pane, select Components.
3. In the Components pane, select a section component and drag it onto the form preview. As you drag the
section on the form preview, you will see drop targets where you can add the section.
4. Drop the section in the location you want. Note the following:
Sections can be dropped before or after any existing section.
Sections can also be dropped in the empty area within a tab. In this case the section will be added in an
available space so as to evenly distribute sections across the tab columns.
Hovering over a tab header when dragging a section changes the currently selected tab, allowing you
to add the section to a different tab.
5. Repeat steps 3-4 above if you want to add more sections.
6. In the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.
Add sections to a form using selection
1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. In the form preview, select another existing section or tab. Note the following:
When you select an existing section, the new section is added after the existing section.
When you select a tab, the new section is added in an available space so as to evenly distribute sections
across the tab columns.
3. In the command bar, select Add component, or in the left pane, select Components.
4. In the Components pane, select a section component to add it to the form. Alternatively, select ... next to the
section component you want, and then select Add to selected tab.
5. Repeat steps 2-4 above if you want to add more sections.
6. In the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.

Configure sections on a form


These are the properties available to configure a section when you create or edit a form using the form designer.

AREA NAME DESCRIPTION

Display options Section label The localizable label for the section
visible to users.

This property is required.

Display options Name The unique name for the section that is
used when referencing it in scripts. The
name can contain only alphanumeric
characters and underscores.

This property is required.

Display options Hide label When selected, the section label is


hidden.

Display options Lock section Lock this section to keep it from being
removed.

Display options Hide section When selected, the section is hidden by


default and can be shown using code.

Display options Hide on phone The section can be hidden to render a


condensed version of this form on
phone screens.

Formatting Columns Specify up to four columns for the


section.

Move sections on a form


You can move sections using drag and drop or cut and paste actions.
Move sections on a form using drag and drop
1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. In the form preview, select the section label or empty space within the section that you want to drag and drop.
As you drag the section on the form preview, you will see drop targets where you can move the section to.
Note the following:
Sections can be dropped before or after any existing section.
Sections can also be dropped in the empty area within a tab. In this case the section will be added in an
available space to evenly distribute sections across the tab columns.
Hovering over a tab header when dragging a section changes the currently selected tab, allowing you
to add the section to a different tab.
3. Repeat step 2 above if you want to move more sections.
4. On the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.
Move sections on a form using cut and paste
1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. In the form preview, select the section that you want to move.
3. In the command bar, select Cut.
4. In the form preview, select another existing section or tab. You can also switch to a different tab if needed.
5. On the command bar, select Paste or select the chevron, and then select Paste before. Note the following:
When you select Paste, the section being moved is pasted after the existing section.
When you select Paste before, the section being moved is pasted before the existing section.
When you select a tab, the section moved is added in an available space to evenly distribute sections
across the tab columns. The Paste before action is not applicable and therefore not available in this
case.
6. Repeat steps 2-5 above if you want to move more sections.
7. On the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.

Delete sections on a form


1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. In the form preview, select the section that you want to delete from the form.
3. On the command bar, select Delete.
4. Repeat steps 2-3 above if you want to delete more sections.
5. On the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.

NOTE
Sections can only be deleted on main forms and quick view forms. More information: Form types
If you delete a section by mistake, on the command bar, select Undo to revert the form to its previous state.
You can't delete a section that contains a field that is required or locked.
You can't delete a section that is locked.
A tab needs to have at least one section in each tab column. If you delete the last remaining section in a tab
column a new section will be automatically added.
In the Unified Interface, sections won't be rendered if you have selected to hide them including the title and the
border. This is different than the legacy web client, and is by design to ensure proper rendering of the form
across differing view ports from extra wide to narrow.

See also
Overview of the model-driven form designer
Create, edit, or configure forms using the form designer
Add, configure, move, or delete fields on a form
Add, configure, move, or delete components on a form
Add, configure, move, or delete tabs on a form
Configure header properties in the form designer
Add and configure a sub-grid component on a form
Add and configure a quick view component on a form
Configure a lookup component on a form
Using the tree view in the form designer
Create and edit fields
Add, configure, move, or delete tabs on a form
12/2/2019 • 5 minutes to read • Edit Online

Add, move, or delete tabs on a form using the form designer.

Add tabs to a form


To add tabs to a form, use the Components pane.

NOTE
Tabs can only be added on main forms. More information: Form types

Add tabs to a form using drag and drop


1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. On the command bar, select Add component, or in the left pane, select Components.
3. In the Components pane, select a tab component and drag and drop it onto the form preview. As you drag
the tab on the form preview, you will see drop targets where you can add the tab. Note the following:
Tabs can be dropped before or after any existing tabs by hovering over the tab headers.
Tabs can also be dropped before or after the current tab by hovering over the left or right edge of the
current tab.
4. Repeat step 3 above if you want to add more tabs.
5. On the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.
Add tabs to a form using selection
1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. In the form preview, select another existing tab or the form. Note the following:
When you select an existing tab, the new tab will be added after the existing tab.
When you select the form, the new tab will be added as the last tab on the form.
3. On the command bar, select Add component, or in the left pane, select Components.
4. In the Components pane, select a tab component to add it to the form. Alternatively, select ... next to the tab
component you want, and then select Add to form.
5. Repeat steps 2-4 above if you want to add more tabs.
6. On the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.

Configure tabs on a form


These are the properties available to configure a tab when you create or edit a form using the form designer.

AREA NAME DESCRIPTION

Display options Tab label The localizable label for the tab visible
to users.

This property is required.

Display options Name The unique name for the tab that is
used when referencing it in scripts. The
name can contain only alphanumeric
characters and underscores.

This property is required.

Display options Expand this tab by default The tab state can toggle between
expanded or collapsed using form
scripts or by people selecting the label.
Choose the default state for the tab.

Display options Hide tab When selected, tab is hidden by default


and can be shown using code.

Display options Hide on phone The tab can be hidden to render a


condensed version of this form on
phone screens.

Formatting Layout Tabs may have up to three columns.


Use these options to set the number of
tabs and what percentage of the total
width they should fill.

Move tabs on a form


You can move a tab on a form using drag and drop or cut and paste actions.
Move tabs on a form using drag and drop
1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. In the form preview, select the tab header of the tab that you want to move and drag and drop it. As you drag
the tab on the form preview, you will see drop targets where you can move the tab. Note the following:
Tabs can be dropped before or after any existing tabs by hovering over the tab headers.
Tabs can also be dropped before or after the current tab by hovering over the left or right edge of the
current tab.
3. Repeat step 2 if you want to move more tabs.
4. On the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.
Move tabs on a form using cut and paste
1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. In the form preview, select the tab that you want to move.
3. On the command bar, select Cut.
4. In the form preview, select another existing tab or the form.
5. On the command bar, select Paste or select the chevron, and then select Paste before. Note the following:
When you select Paste, the tab moved is pasted after the existing tab.
When you select Paste before, the tab moved is pasted before the existing tab.
When you select the form, the tab moved is added as the last tab on the form. The Paste before action
is not applicable and therefore not available in this case.
6. Repeat steps 2-5 above if you want to move more tabs.
7. On the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.

Delete tabs on a form


1. Open the form designer to create or edit a form. More information: Create a form or Edit a form
2. In the form preview, select the tab that you want to delete from the form.
3. On the command bar, select Delete.
4. Repeat steps 2-3 above if you want to delete more tabs.
5. On the command bar, select Save to save the form, or select Publish if you want to save and make your
changes visible to users.

NOTE
Tabs can only be deleted on main forms. More information: Form types
If you delete a tab by mistake, on the command bar, select Undo to revert the form to its previous state.
You can't delete a tab that contains sections with required or locked fields.
You can't delete a tab that has locked sections.
A form must have at least one tab. You can't delete the last remaining tab on the form.

See also
Overview of the model-driven form designer
Create, edit, or configure forms using the form designer
Add, configure, move, or delete fields on a form
Add, configure, move, or delete components on a form
Add, configure, move, or delete sections on a form
Configure header properties in the form designer
Add and configure a sub-grid component on a form
Add and configure a quick view component on a form
Configure a lookup component on a form
Using the tree view in the form designer
Create and edit fields
Configure header properties in the form designer
2/15/2020 • 9 minutes to read • Edit Online

Makers can control the density of model-driven app form headers to match the needs of anyone using the form.

High-density header
High-density form header ensures that key information is always visible to users. Using high-density header, the
record title never truncates. Even long record titles are displayed using multiple lines. Similarly, high-density
header also ensures that up to four field values are directly visible in the header and never truncated or hidden.
To ensure that key information is always visible, the framework displays read-only field values and users can't
directly edit the field values in the header. Visualizations such as custom components or web resources also
aren't allowed.
When a form does not specify header density or when a new form is created, the framework defaults to high-
density header.

Low density header


Low density form header allows users to directly edit the field values in the header. It also allows visualizations
such as custom components and web resources.
However, often this comes at the cost of key information being truncated or not readily visible. Low -density
header truncates the record title as well as field values displayed in the header. Often only one or two fields are
directly visible in the header and the rest overflow and are displayed in a flyout requiring an extra click.

Configuring header density


To configure the header density of a model-driven form, follow these steps:
1. Open the form designer to create or edit a form.
2. Select the form header by selecting the header in the form preview or by using the tree view.
3. In the property pane, select High density to use high-density form header or clear it to use low -density form
header.
4. In the command bar, select Save to save the form, or select Publish to save and make your changes visible to
users.

NOTE
Use the new form designer. The classic form designer does not provide the ability to configure the header density.

Header flyout
The header flyout is displayed when users select the chevron in the form header. It enables users to edit field
values and also displays visualizations such as custom components or web resources that are a part of the form
header.
The behavior of the header flyout changes depending on the header density configuration.
High-density header flyout
With a high-density form header, the header flyout displays all header fields including the four fields that are
directly displayed in the header. The framework defaults to show the header flyout when high-density header is
being used. Makers can control the visibility of the header flyout with a high-density header.

Low-density header flyout


With a low -density form header, the header flyout displays only overflow fields, such as fields that the form is
unable to display directly in the header based on the width of the form. The header flyout is also automatically
displayed or hidden based on the number of fields in the header and the width of the form. Makers can't control
the visibility of the header flyout when using a low -density header.

Show or hide the header flyout


To show or hide the header flyout for a model-driven form, follow these steps:
1. Open the form designer to create or edit a form.
2. Select the form header in the form preview or use the tree view to select it.
3. In the property pane, select High density to use high-density form header.
4. In the property pane, select Show header flyout to make the header flyout visible or clear it to hide the
header flyout.
5. In the command bar, select Save to save the form, or select Publish to save and make your changes visible to
users.

NOTE
Use the new form designer. The classic form designer does not provide the ability to show or hide the header flyout.
The visibility of header flyout can only be controlled when using high-density form header. When using low-density
header, the header flyout is automatically displayed or hidden based on the number of fields in the header and the
width of the form.
An image for an entity will be displayed in the header only if the Primary Imagine attribute is defined for the entity
and the form property Show image in the form is enabled. More information: Image fields.
Developers can specify an image for an entity by using the EntityMetadata.PrimaryImageAttribute attribute.

Form designer messages related to form headers


When you edit forms using the new or classic form designer, you might see messages related to form headers.
Below, you can find details on each message and why you are seeing it.
We've upgraded your form to show a high density header that displays more data. You can edit this setting in
the properties of the header.
This message is displayed in the form designer when a maker creates a new main form (including via the Save-
as action) or edits a main form that has not previously been configured for header density.
The framework defaults to high-density header and this message helps makers become aware of that behavior.
Makers can override the framework default at any time by manually configuring the form header density as
outlined earlier.
This form isn't using high density header, access the setting in the header properties. High density header
helps display more data.
This message is displayed in the form designer when a maker opens a main form for editing that is configured to
use low -density header.
The message helps increase awareness about the high-density header and its benefits.
Field moved to header flyout: The header supports displaying up to four read-only field values. The field [field
display name] will now only be available from the flyout.
This message is displayed in the form designer when a form is using high-density header with the header flyout
visible.
High-density header displays read-only values of the first four fields in the header. When makers add a field in
the header in the top four positions, it causes an existing field that was directly displayed in the header to become
extended and visible only in the header flyout.
The message informs the maker of the change and confirms whether to proceed with the action.
Header field limit exceeded: The header supports displaying up to four read-only field values. Remove unused
fields to add more.
This message is displayed in the form designer when a form is using high-density header with the header flyout
hidden.
High-density header displays read-only values of up to four fields in the header. Because the header flyout is
hidden, users will be unable to see the additional fields.
The message informs the maker that there are already four fields in the header and prevents adding additional
fields in the header that users will not be able to see.
Header does not display custom components: The header supports displaying up to four read-only field
values. Remove the custom component from the field before adding it to the header.
This message is displayed in the form designer when a form is using high-density header with the header flyout
hidden.
High-density header displays read-only values of fields in the header. Because the header flyout is hidden, users
will be unable to see any custom components associated with the fields in the header.
The message informs the maker that they are trying to add a field with an associated custom component to the
header and they must remove the custom component before adding the field to the header. This is because users
won't be able to see the custom component in the header.
Header displays read-only field values: The header supports displaying up to four read-only field values. To
provide editability to the user, add the field to a section in the form.
This message is displayed in the form designer when a form is using high density header with the header flyout
hidden.
High-density header displays read-only values of fields in the header. Because the header flyout is hidden, users
will be unable to edit field values.
The message informs the maker that any fields added to the header will be read-only and that any fields they
want users to edit should also be added to a section in the form.
Header field values are not editable: Moving a field from the body to the header will display as a read-only
value. To maintain editability, copy the field to the header.
This message is displayed in the form designer only for forms using high-density header with the header flyout
hidden.
High-density header displays read-only values of fields in the header. Because the header flyout is hidden, users
will be unable to edit field values.
The message informs the maker that they are trying to move a field from the form body to the form header.
Doing so will make it read-only. It gives the maker the choice of moving the field to the header or adding a copy
of the field to the header. Moving the field to the header will make the field unavailable in the original location on
the form body for users to edit. Adding a copy of the field to the header will leave the field in the original location
as-is, ensuring that users can continue to edit it within the form body.
Form headers now default to high density to display more data. Use the new form designer to edit header
density.
This message is displayed in the classic form designer when a maker opens a main form for editing and it is
configured to use low density header.
This message helps increase awareness about the high density header and its benefits and that makers should
use the new form designer to configure header density.
This message is displayed in the classic form designer when a maker opens a main form for editing and it is
configured to use low density header.
The message helps increase awareness about the high-density header and its benefits and that makers should
use the new form designer to configure header density.
This form is using high density header. For the best authoring experience with this form, use the new form
designer.
This message is displayed in the classic form designer when a maker opens a main form for editing and it is
configured to use high-density header.
The classic form designer does not provide a WYSIWYG authoring experience. It also does not detect and
prevent or warn makers about the implications of changes they make to the form header. For example, when you
edit a form that is using high-density header with the header flyout hidden, the classic form designer will not
prevent makers from adding more than four fields to the header even though these field will not be available to
users.
The message informs the maker that when editing a form that is using high-density header, they should use the
new form designer. This helps ensure the maker is aware of the impact of their changes to the form header.

See also
Overview of the model-driven form designer
Create, edit, or configure forms using the form designer
Add, configure, move, or delete fields on a form
Add, configure, move, or delete components on a form
Add, configure, move, or delete sections on a form
Add, configure, move, or delete tabs on a form
Add and configure a sub-grid component on a form
Add and configure a quick view component on a form
Configure a lookup component on a form
Using the tree view in the form designer
Create and edit fields
Add and configure a sub-grid component on a form
12/2/2019 • 2 minutes to read • Edit Online

A form that displays the details of a record can use a sub-grid component to display a list of related or unrelated
records in a tabular format. Makers can add and configure a sub-grid component using the form designer.

Add a sub-grid component


You add a sub-grid component the same way as you add any other component. More information: Add,
configure, move, or delete components on a form

Configure a sub-grid component


These are the properties available to configure when using a sub-grid component on a form using the form
designer.

AREA NAME DESCRIPTION

Display options Label The localizable label for the sub-grid


visible to users.

This property is required.

Display options Name The unique name for the sub-grid that
is used when referencing it in scripts.
The name can contain only
alphanumeric characters and
underscores.

This property is required.

Display options Hide on phone The sub-grid can be hidden to render a


condensed version of the form on
phone screens.

Display options Show related records When selected, the sub-grid displays
only records related to the current
record that is displayed on the form.

The Entity drop-down list is also


filtered to only list entities that are
related to the current entity.

Display options Entity The entity whose records you want to


display in the sub-grid.

When Show related records is


selected, the list of entities is filtered to
show only entities that are related to
the current entity. In addition to the
entity name, the name of the lookup
field is also displayed in parentheses.
AREA NAME DESCRIPTION

Display options Default view The view of the entity selected in the
Entity property that will be used to get
and display the list of records in the
sub-grid.

Display options Allow users to change view When selected, app users can change
from the Default view to another view
of the entity selected in the Entity
property.

Display options Show all views When selected, app users can change
from the Default view to all other
views of the entity selected in the
Entity property.

This property is only available when


Allow users to change view is
selected.

Display options Selected views A list of views of the entity selected in


the Entity property that app users can
change from the Default view.

This property is only available when


Allow users to change view is
selected and Show all views is cleared.

See also
Overview of the model-driven form designer
Create, edit, or configure forms using the form designer
Add, configure, move, or delete fields on a form
Add, configure, move, or delete components on a form
Add, configure, move, or delete sections on a form
Add, configure, move, or delete tabs on a form
Configure header properties in the form designer
Add and configure a quick view component on a form
Configure a lookup component on a form
Using the tree view in the form designer
Create and edit fields
Add and configure a quick view component on a
form
12/2/2019 • 2 minutes to read • Edit Online

A main form that displays the details of a record can use a quick view component to display read-only details of
a related record (lookup). The data displayed by the quick view component is defined by the quick view form of
the related entity. When there is no related record, such as a lookup, the quick view component is automatically
hidden.

Add a quick view component


You add a quick view component in the same way as you add any other component. More information: Add,
configure, move, or delete components on a form

Configure a quick view component


These are the properties available to configure when using a quick view component on a form using the form
designer.

AREA NAME DESCRIPTION

Display options Label The localizable label for the quick view
visible to users.

This property is required.

Display options Name The unique name for the quick view
that is used when referencing it in
scripts. The name can contain only
alphanumeric characters and
underscores.

This property is required.

Display options Hide label When selected, the quick view label is
hidden.

Display options Quick view forms A list of quick view forms that are
displayed to app users.

To configure the list of quick view


forms

Select Select forms ..., and then in the


Lookup drop-down select a lookup
field where you want to display a quick
view form.

Depending on the lookup field you


select in the Lookup drop-down, you
will see drop-downs that will let you
select quick view forms for one or
more entities.
See also
Overview of the model-driven form designer
Create, edit, or configure forms using the form designer
Add, configure, move, or delete fields on a form
Add, configure, move, or delete components on a form
Add, configure, move, or delete sections on a form
Add, configure, move, or delete tabs on a form
Configure header properties in the form designer
Add and configure a sub-grid component on a form
Configure a lookup component on a form
Using the tree view in the form designer
Create and edit fields
Configure a lookup component on a form
12/2/2019 • 2 minutes to read • Edit Online

A lookup field can be used to link to a record in another entity. A lookup component is automatically used when
a lookup field is added to a form. Makers can configure a lookup component using the form designer.

Configure a lookup component


These are the properties available to configure when using a lookup component on a form using the form
designer.

AREA NAME DESCRIPTION

Display options Entity The related entity that the lookup field
connects to.

Display options Default view The view of the entity selected in the
Entity property that can be used to
get and display the list of records that
app users can select in the lookup
drop-down.

Display options Allow users to change view When selected, app users can change
from the Default view to another view
of the entity selected in the Entity
property.

Display options Show all views When selected, app users can change
from the Default view to all other
views of the entity selected in the
Entity property.

This property is only available when


Allow users to change view is
selected.

Display options Selected views A list of views of the entity selected in


the Entity property that app users can
change to from the Default view.

This property is only available when


Allow users to change view is
selected and Show all views is
unselected.

See also
Overview of the model-driven form designer
Create, edit, or configure forms using the form designer
Add, configure, move, or delete fields on a form
Add, configure, move, or delete components on a form
Add, configure, move, or delete sections on a form
Add, configure, move, or delete tabs on a form
Configure header properties in the form designer
Add and configure a sub-grid component on a form
Add and configure a quick view component on a form
Using the tree view in the form designer
Create and edit fields
Using the tree view in the form designer
12/2/2019 • 2 minutes to read • Edit Online

The Tree View pane displays a visual hierarchy of the components on the form. The icons in the tree view help
you quickly identify the type of field or component.
You can also use the tree view to select fields and components present on the form. The tree view is helpful
when you want to select hidden elements that are not visible on the form preview.
You can expand or collapse nodes in the tree view to see or hide the elements within a node. When you select an
element in the tree view, it becomes highlighted in the form preview, and the property pane displays the
properties for the element.

Open the tree view


1. Open the form designer to create or edit a form.
More information: Create a form or Edit a form
2. In the left pane, select Tree view.

See also
Overview of the model-driven form designer
Create, edit, or configure forms using the form designer
Add, configure, move, or delete fields on a form
Add, configure, move, or delete components on a form
Add, configure, move, or delete sections on a form
Add, configure, move, or delete tabs on a form
Configure header properties in the form designer
Add and configure a sub-grid component on a form
Add and configure a quick view component on a form
Configure a lookup component on a form
Create and edit fields
Type of model-driven app forms in Power Apps
12/3/2019 • 2 minutes to read • Edit Online

There are different types of forms and each type has a specific functionality or use. The following table describes
the types of forms available.

FORM TYPE DESCRIPTION MORE INFORMATION

Main Used in model-driven apps, Dynamics Design considerations for main forms
365 for tablets, and Dynamics 365 for
Outlook.

These forms provide the main user


interface for interacting with entity
data.

Quick Create Used in model-driven apps, Dynamics Create and edit quick create forms
365 for tablets, and Dynamics 365 for
Outlook.

For updated entities, these forms


provide a basic form optimized for
creating new records.

Quick View Used in model-driven apps, Dynamics Create and edit quick view forms
365 for tablets, and Dynamics 365 for
Outlook.

For updated entities, these forms


appear within the main form to display
additional data for a record that is
referenced by a lookup field in the
form.

Card Used in views for Power Apps apps. Create a card form
Card forms are designed to present
information in a compact format that is
suitable for mobile devices.

While each form type has specific needs, when working with forms you use the Form Editor. More information:
Overview of the form editor user interface

Next steps
Overview of the form editor user interface
Create or edit a model-driven app main form for an
entity
3/11/2020 • 2 minutes to read • Edit Online

In this topic you learn how to create or edit a main form for an entity.
When you create a new form for an entity, its form type is Main. When the new form opens, it is identical to the
form named Information. You can add or edit fields, sections, tabs, navigation, and properties associated with the
form, and then save the form.
Each main form is composed of one or more tabs. Each tab can have one or more sections. Each section contains
one or more fields. If you want to base your new form on an existing one, you can clone a form.
Make sure that you have the System Administrator or System Customizer security role or equivalent permissions
to perform this task.

How to create or edit a main form


1. Sign in to Power Apps.
2. Expand Data, select Entities, select the entity that you want, and then select the Forms tab.
3. To create a new main form, on the toolbar select Add form > Main Form.
-OR - To edit an existing main form, select any form with the Type of Main.
4. Change the form design in any of the following ways, as needed:
Add a tab to a form
Add a section to a form
Add a field to a form
Add or edit a sub-grid on a form
Edit form headers and footers
Remove a tab section field
5. Edit the properties for parts of the form, as needed:
Edit form properties
Edit form field properties
Edit tab properties
Edit section properties
6. When you finish editing the form, select Save > Save As, enter a name for the form, and then select OK.
7. When your customizations are complete, you can publish them: select Publish.
Next steps
Overview of the model-driven form designer
Overview of the form editor user interface
Create or edit model-driven app quick create forms
for a streamlined data entry experience
3/26/2020 • 5 minutes to read • Edit Online

In this topic, you create and edit a quick create form.


With quick create forms, your app can have a streamlined data entry experience with full support for logic defined
by form scripts and business rules. In a Power Apps model-driven app, quick create forms appear when you select
the Create button in the navigation bar or when you choose + New when creating a new record from a lookup or
sub-grid.
Dynamics 365 mobile apps use quick create forms for creating new records. If an entity already has a quick create
form configured for it, the mobile apps use that form. If an entity doesn't have a configured quick create form,
Power Apps generates a quick create form for creating records in the mobile apps based on the main form
definition.

Entities with quick create forms


By default only the following system entities have quick create forms.

Account Campaign Response Case Competitor

Contact Lead Opportunity

Although you can create quick create forms for system activity entities, with the exception of the appointment
entity, they do not support quick create forms. Currently, the option to disable the quick create form for the
appointment entity is not supported. Any of the other updated entities and any custom entities can be enabled to
support these forms by selecting Enable quick create forms in the entity definition and creating a quick create
form for the entity.
You can enable custom activity entities to support quick create forms, and you can create quick create forms for
those entities. However, the quick create form for custom activity entities will not be used when people select
Create on the navigation bar. These quick create forms can be used only when people add a new record for a sub-
grid that displays that specific custom activity entity.

Create a quick create form


Although you can define multiple quick create forms, only one quick create form can be used by everyone. The
form everyone will use is set using the form order. Quick create forms cannot be assigned to security roles and
they do not provide the capability for the user to switch forms.

NOTE
The entity must have the Enable quick create forms option enabled for the quick create form to be displayed.
You must also add the entity and the quick create form to your app.
Some fields, such as the CREATEDON field, aren't available to add to a quick create form.

How to create a quick create form


1. Sign in to Power Apps.
2. Expand Data, select Entities, select the entity that you want, and then select the Forms tab.
3. On the toolbar select Add form > Quick Create Form.
4. In the form designer drag any fields from the Field Explorer into the sections on the form.
5. When you are finished, select Save.
6. Select Publish to see the new form in the application.

Edit a quick create form


While quick create forms support form scripts and business rules, their purpose is different from main forms and
they don't support all the capabilities of main forms. Quick create forms always have one section with three
columns. You can't add additional sections or columns.
The following controls cannot be added to quick create forms:
Sub-grids
Quick View Forms
Web resources
iFrames
Notes
Bing Maps
If you add a composite field to a quick create form, it will be displayed as separate fields.
To edit a quick create form
1. Sign in to Power Apps.
2. Expand Data, select Entities, select the entity that you want, and then select the Forms tab.
3. In the form list, select a form where the form Type is Quick Create.
4. Drag any fields from the Field Explorer into the sections in the form.
See Configure event handlers for information about editing event handlers for form scripts.
5. When you are finished, select Save.
6. Select Publish to see the modified form in the application.

Enable Quick Create Form property behavior for activities


The Enable quick create forms property can be enabled or disabled for all standard activities except recurring
appointments. This property lets you change the form that is displayed by default for most activities. By default, the
Enable quick create forms property is enabled and the quick create form is the form displayed in the app areas
and activity entities that support it.
Unified interface client form display behavior
The following table indicates what form is displayed by default when the Enable quick create forms property is
enabled in the unified interface client.

LOCATION WHERE FORM IS ACCESSED FORM DISPLAYED

Specific activity associated grid Quick create

Specific activity sub grid Quick create

Activities (activitypointer) grid Quick create

Activities (activitypointer) associated grid Quick create

Activities (activitypointer) sub grid Quick create

Global command bar + button1 Quick create


LOCATION WHERE FORM IS ACCESSED FORM DISPLAYED

Timeline wall Quick create

Activities (activitypointer) grid Main

Specific activity grid Main

1Activities appear in the global Create or + New buttons when the Enable quick create forms property is
enabled. In this case, the quick create form is used if it exists or the main form if it does not. If Enable quick
create forms is disabled, the entry for the entity will not appear.
Classic web client form display behavior
The following table indicates what form is displayed by default when the Enable quick create forms property is
enabled in the classic web client.

LOCATION WHERE FORM IS ACCESSED FORM DISPLAYED

Specific activity associated grid Quick create

Specific activity sub grid Quick create

Activities (activitypointer) grid Main

Activities (activitypointer) associated grid Main

Activities (activitypointer) sub grid Main

Global command bar + button Main

Specific activity grid Main

Classic web client social pane behavior


The social pane is a special case because it doesn't use the Enable quick create forms property but uses different
forms for different activity entities as indicated here.

ACTIVITY FORM DISPLAYED

Task Quick create

Phone Call Quick create

Email Main

Appointment Main

Custom activity Main

Solution import Allow Quick Create value behavior


When you import a solution from version 8.2 regardless of the value of the Enable quick create forms property
in the solution, the following entities will be reset to the default form display value and the main form will display:
task, phone call, email, and appointment. In this situation, you'll need to reset the Enable quick create forms
option back to enabled for those activity entities after the import.
If there is a customization made in a version 9.0 solution to entities where Enable quick create forms is enabled,
the value will not change after import. However, if you have set the Enable quick create forms option to disabled
for the task, phone call, email, and appointment entities, the value will be overwritten to enabled. In this situation,
you'll need to reset the Enable quick create forms option back to disabled for those activity entities after the
import.
See also
Overview of the form editor user interface
Create a model-driven app quick view form to view
information about a related entity
3/26/2020 • 2 minutes to read • Edit Online

In this topic you learn how to create a quick view form and how to add a quick view control to a main form.
A quick view form can be added to another form as a quick view control. It provides a template to view
information about a related entity record within a form for another entity record. This means your app users do
not need to navigate to a different record to see the information needed to do their work.
Quick view controls are associated with a lookup field that is included in a form. If the lookup field value is not set,
the quick view control will not be visible. Data in quick view controls cannot be edited and quick view forms do
not support form scripts.
Because quick view forms are viewed using a quick view control in a form, they do not include header, footer, or
navigation areas. Security roles cannot be assigned to quick view forms and they cannot be activated or
deactivated.

Create a quick view form


You create quick view forms using the form editor in a manner similar to the way you create other forms. Quick
view forms are read-only. Use them to create forms that are for reading purposes only.
1. Sign in to Power Apps.
2. Expand Data, select Entities, select the entity that you want, and then select the Forms tab.
3. On the toolbar, select Add form > Quick View Form.
4. In the Form panel, enter a Display Name and Description to differentiate this quick view form from any
others.
5. In the form designer drag any fields from the Fields Explorer into the section on the form.

IMPORTANT
Required fields cannot be removed from a form. If you add a Required field to the form and want to remove it, you
have to delete the form and then recreate it. When you set the Required property for a field, a record can't be saved
without data in this field.

6. To save the form select Save.


7. Select Publish to see the new form in the application.

Edit a quick view form


Quick view forms have a simplified layout because they are designed to be viewed within a form section. Only
one single column tab is available. You can add only additional single column sections, fields, subgrids, and
spacers.
IMPORTANT
Required fields cannot be deleted. If you add a Required field to the form, you cannot delete it. If you do not want the field
in the form you have to delete the form and then recreate it.

When you edit a quick view form, you must publish your changes before they will be visible in the application.

Add a quick view control to a main form


Quick view forms can only be added to a main form where a lookup field exists that targets the entity of the quick
view form.
1. Sign in to Power Apps.
2. Expand Data, select Entities, select the entity that you want, and then select the Forms tab.
3. Select a form, which Type is Main.
4. In the form designer, from the Components pane, select Quick view.
5. In the Select quick view forms dialog box, select the Lookup field, and then select the Lookup field value.
More information: Quick view control properties.

6. Select Done to close the Select quick View forms dialog box. The quick view form appears on the form.
7. To save the form select Save.

Next steps
Create and design forms
Create or edit quick create forms
Create a card form
12/3/2019 • 2 minutes to read • Edit Online

Card forms are used in views for Unified Interface apps. Card forms are designed to present information in a
compact format that is suitable for mobile devices. For example, the default card form for the My Active Accounts
view defines the information displayed for each account record.

Although card forms can be created and edited in the same way as other form types, card forms are added to apps
differently. Instead of adding a form as an app component, custom card forms are added to views by using the
Read Only Grid control.

Create a card form


1. To create a card form, sign in to Power Apps.
2. Expand Data, select Entities, select the entity you want, and then select the Forms tab.
3. On the toolbar select Add form, and then select Card form. Alternatively, you can open an existing Form type
that's a Card form to edit it.
4. Add the fields that you want. We recommend that you limit the number of fields so that the form displays well
on small screens.
5. Select Save and then select Publish.
Add a card form to a view
1. Sign in to Power Apps.
2. Expand Data, select the entity you want, and then select the Views tab.
3. Select the view that you want, and then on the view designer toolbar, select Switch to classic.
4. Select Custom Controls from the Common Tasks pane.
5. Select Add Control, from the list of controls select Read Only Grid, and then select Add.

NOTE
There are two read only grid controls. The default read only grid control that is named Read-only Grid (default)
doesn’t support custom card forms.

6. From the Read Only Grid properties page configure the following properties, and then select OK.

Card Form. Select the pencil icon and then select the card form you want to display in the view.
By default, the primary entity associated with the view is already selected, but you can change it.
Reflow behavior. If you want to change whether the card form displays when resized, select the
pencil icon . More information: Allow grid to reflow into list
Select the client types, Web, Phone, or Tablet, where you want the Read Only Grid control to
display.

7. Select OK to close the Custom Controls properties page.


8. On the classic view designer toolbar, select Save and Close.

See also
Use custom controls for model-driven app data visualizations
Overview of the model-driven app form editor user
interface
12/3/2019 • 6 minutes to read • Edit Online

The form editor displays commands in three tabs: File, Home, and Insert.
File tab
Home tab
Insert tab
The form editor is divided into three areas: Navigation, Body, and Explorer.

Navigation
Located on the left side, use the navigation area to control access to related entities or to add links to URLs to be
displayed in the main pane of the form. To edit navigation, you must first select the Navigation command in the
Select group of the Home tab.
Main forms provide navigation options through the navigation bar, but use the same data in the navigation area
to control what navigation options are available. More information: Edit Navigation
Body
Located in the center, use the body area to control the layout of the form. You can select and drag form elements
to position them. Double-clicking on an element will open the properties for the element.
By default, for the Case, Contact, and Account Main forms, the first section under the Summary tab shows the
account or contact card form of type Quick View. For custom entities, this section is not available by default. You
can insert a new section and a quick view form in it. The card form shows a maximum of five fields. Other than
fields, it isn’t possible to show other controls in the Blue tile even if the quick view form contains it.

NOTE
To preserve the card format (as shown in the following image), we recommend that you do not move the quick view form
to any other section on the form.
More information: Create and edit quick view forms
To add a field, select it from the Field Explorer and drag it into a section.
To add an element that is not a field, select where you want to place it and use the appropriate
command from the Insert tab add it.
To remove an element, select it and use the Remove command in the Edit group of the Home tab.
To edit the Header or Footer for the form you must first select the corresponding command in the
Select group of the Home tab.
Explorer
Located on the right side, the content of the explorer area depends on the context.
When you select Body, Header, or Footer in the Select group of the Home tab, you’ll see the Field Explorer.
Use the Field Explorer to drag fields you want to display into a section in the form or within the header or footer.
You can include the same field multiple times in a form. Use the New Field button as a shortcut to create a new
field.
When you select Navigation in the Select group of the Home tab you’ll see the Relationship Explorer. Drag
any of the relationships into one of the groups within the navigation area. You cannot add the same relationship
twice. Relationships are available based on how they are configured. If you configure a relationship to not display,
it won’t display in the Relationship Explorer. For information about how to configure default display options for
relationships, see Navigation pane item for primary entity.
You can use the New 1:N and New N:N buttons as a shortcut to add new entity relationships.

File tab
Select the File tab to add/view the following options:
New Activity Add a new activity
New Record Add a new record
Tools Utilize options like Import data, Duplicate detection, and Bulk delete wizard
Options Change the default display settings to personalize the default solution, and manage your email
templates
General
Synchronization
Activities
Formats
Email Templates
Email Signatures
Email
Privacy
Languages
Help
Close

Home tab
The Home tab displays the commands listed in the following table:

GROUP COMMAND DESCRIPTION

Save Save (Ctrl+S) Save the form.

Save As Create a copy of this form with a


different name.

Save and Close Save the form and close the form
editor.

Publish Publish the form. More information:


Publishing customizations

Edit Change properties Change properties of the selected item


in the body.

See the following sections depending


on the selected item:

- Tab Properties
- Section properties
- Common Field properties
- Special field properties
- Sub-grid properties
- Quick view control properties

Remove Remove the selected item.

Undo (Ctrl+Z) Undo the previous action.

Redo (Ctrl+Y) Redo the previous action.

Select Body Edit the main body of the form.

Header Edit the form header.

Footer Edit the form footer.


GROUP COMMAND DESCRIPTION

Navigation Edit the form navigation.

More information: Edit Navigation

Form Business Rules View, edit, or create new business rules


with the Business Rules explorer. Note:
For the interactive forms, only the
“Entity” and “All Forms” scope is
supported.

More information: Create and edit


business rules

Form Properties More information: Form Properties

Preview Use this to see how form looks after it


is published. You can also preview to
test scripts associated with from events.

Enable Security Roles Use this to set which security roles will
have access to the forms. More
information: Control access to forms
Important: If you create a new form,
only the System Administrator and
System Customizer security roles will
have access to the form. You must
assign access to other security roles
before people can use it.

Show Dependencies See which solution components depend


on this form and which solution
components are required by this form.

Managed Properties Managed properties command has two


properties Customizable and Can be
Deleted. Setting these properties to
false means the form won’t be
customizable and cannot be deleted
after you included it in a solution,
export that solution as a managed
solution, and import that managed
solution into a different environment.
More information: Managed properties

Upgrade Merge forms If applicable, this option lets you merge


this form with a form from a previous
version of Dynamics 365 form

Insert tab

The Insert tab displays the commands in the following table:


GROUP COMMAND DESCRIPTION

Section Add a section to a selected tab. You can


include a section with one to four
columns.

You can also insert a Reference panel in


the interactive forms. Reference panel is
also added as a section to the Main -
Interactive experience form. By default
the Reference panel section is added to
the Case, Account, Contact and custom
entity forms.

More information: Section properties

3 Tabs Three Columns Insert a three-column tab with equal


widths.

More information: Tab Properties

Three Columns Insert a three-column tab with a wider


middle column.

2 Tabs Two Columns Insert a two-column tab with a wider


right column.

Two Columns Insert a two-column tab with a wider


left column.

Two Columns Insert a two-column tab with equal


width columns.

1 Tab One Column Insert a one-column tab.

Control Sub-Grid Format a sub-grid and insert it into the


form.

More information: Sub-grid properties

Spacer Insert an empty space.

Quick View Form Insert a Quick View Form.

More information: Quick view control


properties

Web Resource Insert a web resource to embed


content from other locations in one
page.

More information: Web Resource


properties

IFRAME You can add an IFRAME to a form to


integrate content from another website
within a form.
GROUP COMMAND DESCRIPTION

Timeline Insert a timeline control in the form.


This control shows the timeline of
activities related to the entity on a
form.

Navigation Link Using this option, you can insert a link


into a form navigation.

Timer Insert a timer control to an entity form


to track time against an SLA. More
information: Add a timer control

Knowledge Base Search Insert a search control that users can


use to search knowledge articles. More
information: Knowledge Base Search
control

Relationship Assistant Using this option, you can insert a


relationship assistant control in the
form.

NOTE
The following components aren’t supported in the Main forms:
Bing maps
Yammer
Activity Feeds

Next steps
Use the Main form and its components
Model-driven app form properties
12/2/2019 • 2 minutes to read • Edit Online

You can access Form properties in solution explorer. Under Components, expand Entities, expand the entity you
want, and then select Forms. In the list of forms, open the form of type Main. Then on the Home tab, select Form
Properties.

The following table lists the form properties:

TAB PROPERTY DESCRIPTION

Events Form Manage which


Libraries JavaScript web
resources are
available in
the form and
the order in
which they will
be loaded.
TAB PROPERTY DESCRIPTION

Event Configure
Handers which
JavaScript
functions from
the Form
Libraries will
run for the
OnLoad and
OnSave form
events and
the order in
which they’ll
be run.

Display Form Name Enter a name


that will be
meaningful to
people. This
name will be
shown to
people when
they use the
form. If they
can use
multiple forms
configured for
the entity
they will use
this name to
differentiate
between
available
forms.

Description Enter a
description
that explains
how this form
is different
from other
main forms.
This
description is
only shown in
the list of
forms for an
entity in the
solution
explorer.

Form Select from


Assistant the check box
if you want to
enable form
assistant or
view the form
as expanded
by default.
TAB PROPERTY DESCRIPTION

Page You can


Navigation choose not to
show
navigation
items.

In forms for
updated
entities this
means the
primary name
value for the
record
currently
being viewed
will not
appear in the
navigation bar
to allow
navigation to
associated
views.

In forms using
the classic
presentation,
the navigation
options to
choose
associated
views on the
left side of the
form will not
be shown.

Image When an Display Set a Max


entity has an Width (in
image field pixels) to
and the limit the width
entities’ of the form.
Primary The default
Image option value is 1900.
is set, this
setting will
enable
showing the
image field in
the header of
this form.

See Enable or
disable entity
options for
more
information
about entity
options.
TAB PROPERTY DESCRIPTION

Display Enter in pixels


the max width
that you want
for the form
here.

Parameters Parameters Each form can


be opened
with code
using a URL.
The URL may
also contain
data that can
be passed to
the form
using a query
string that is
appended to
the URL.
Query strings
look like this
example:
?
p_firstName=Jim&p_lastName=Daly

As a security
measure,
forms will not
accept any
unknown
query string
parameters.
Use this
parameters
list to specify
parameters
this form
should accept
to support
code that will
pass data to
the forms
using a query
string.

The name and


type of data
will be
checked and
the form
won’t open if
invalid query
string
parameters
are passed to
it.

Note: The
name cannot
start with an
underscore (_)
or crm_. It
must start
must start
TAB PROPERTY DESCRIPTION
with
alphanumeric
characters
followed by an
underscore (_).
For example,
parameter_1
or
1_parameter.
The name
cannot
contain
hyphens (-),
colons (:),
semicolons (;),
commas (,) or
periods (.).

Non-Event Dependent Each event


Dependencie Fields handler has a
s similar
Dependent
Fields
property so
that any fields
that are
needed by the
script can be
registered.
Anyone who
tries to
remove the
dependent
fields will not
be able to.

Some scripts
operate on
the form but
are not
configured in
an event
handler.
Scripts that
are initiated
from the
command bar
do not have a
place where
dependent
fields can be
registered.
This form
property
provides a
place for
dependent
fields for
those scripts
to be
registered.
Next steps
Use the Main form and its components
Sub-grid properties for model-driven app main
forms overview
3/26/2020 • 7 minutes to read • Edit Online

You can configure a sub-grid on a form to display a list of records.


You can access Sub-Grid properties from the Power Apps site.
1. Sign in to Power Apps.
2. Expand Data, select Entities, select the entity that you want, and then select the Forms tab.
3. In the list of forms, open a form of type Main, and then select Components.
4. From the Components pane, select Subgrid.

5. In Entity, select an entity whose records you want to display in the sub-grid. The Entity drop-down list is
filtered to list only entities that are related to the current entity.
6. In Default view, select a default view for the sub-grid. The is the view of the entity selected in the Entity
property that will be used to get and display the list of records in the sub-grid.
7. Select Show related records to display only records related to the current record that is displayed on the
form.
8. Select Done to add the sub-grid to the form. The properties of the sub-grid appear in the Properties pane.
PROPERTY DESCRIPTION

Name Required: The unique name for the sub-grid that is used
when referencing it in scripts. The name can contain only
alphanumeric characters and underscores.

Label Required: The localizable label for the sub-grid visible to


users.

Hide label Whether the label should be displayed on the form. This is
required if you enable Display Search Box. You can also
choose to have the panel header color.

Hide on phone Specify whether the section should be available on phone.

Show related records Sub-grid will display only records related to the current
record.
If you do not select this property, the sub-grid will display
records filtered only by the default view or, if the view selector
is enabled, any views the user chooses.

The option you choose will affect the behavior of the show list
control. More information: Show list behavior
PROPERTY DESCRIPTION

Entity Depending on the option you choose for Show related


records, this list displays either:

- Only related records: A list of entities that are related to this


entity with the name of the lookup field on that entity which
defines the relationship in parentheses.
- All record types: A list of all entities.

Default view Choose the view that will be applied by default. If you do not
enable any other views using the View Selector property.
This will be the only view.

Use the Edit button to open the default view for editing. Use
the New button to create a new view to use for this sub-grid.

Allow users to change view When selected, app users can change from the Default view
to another view of the entity selected in the Entity property.

Sub-grid properties for model-driven app main forms: Classic


You can configure a sub-grid on a form using the classic form designer to display a list of records or a chart. Select
Show Chart Only on the Display tab to show a chart instead of a list.

These are the properties available to configure when using a sub-grid component on a form using the classic form
designer.
TAB PROPERTY DESCRIPTION

Display Name Required: The unique name for the


sub-grid that is used when referencing
it in scripts. The name can contain only
alphanumeric characters and
underscores.

Label Required: The localizable label for the


sub-grid visible to users.

Display label on the Form Whether the label should be displayed


on the form. This is required if you
enable Display Search Box. You can
also choose to have the panel header
color.

Records Choose from two options:

- Only Related Records: Sub-grid will


display only records related to the
current record.
- All Record Types: Sub-grid will
display records filtered only by the
default view or, if the view selector is
enabled, any views the user chooses.

The option you choose will affect the


behavior of the show list control. More
information: Show list behavior

Entity Depending on the option you choose


for Records, this list displays either:

- Only Related Records: A list of


entities that are related to this entity
with the name of the lookup field on
that entity which defines the
relationship in parentheses.
- All Record Types: A list of all entities.

Default View Choose the view that will be applied by


default. If you do not enable any other
views using the View Selector
property. This will be the only view.

Use the Edit button to open the default


view for editing. Use the New button
to create a new view to use for this
sub-grid.

Display Search Box Display the search box. When this


option is chosen the Display Label on
the Form option is required.
TAB PROPERTY DESCRIPTION

Display Index Only forms using the Classic forms


support display index.

Select this check box if you want the


alphabetical index to be available with
the list. This lets you jump to records
starting with a particular letter or
number.

View Selector You have three options:

- Off: Only the default view can be


used.
- Show All Views: Allow people to
choose any view.
- Show Selected Views: Use the Ctrl
key with your cursor to select which of
the available views to show.

Default Chart Select which chart to show if Show


Chart Only is selected.

Show Chart Only Rather than a list of records a chart will


be displayed.

Display Chart Selection If Show Chart Only is selected, allow


people to choose different charts.

Availability Specify whether the section should be


available on phone.

Formatting Layout Select the number of columns the


control occupies.

When the section containing the sub-


grid has more than one column you
can set the field to occupy up to the
number of columns that the section
has.
TAB PROPERTY DESCRIPTION

Row Layout Number of Rows will determine how


many records are shown on a page of a
sub-grid.

If Automatically expand to use


available space is chosen the form will
allow space for two records and will
expand the space as the number of
records increases. If the number
exceeds the Number of Rows, people
can navigate to additional pages to
view the records.

If Automatically expand to use


available space is not chosen the
form will provide space for the number
of records defined by Number of
Rows and people can navigate to
additional pages to view any additional
records.

Controls Controls Choose to add controls and select the


radio button to have them for Web,
Phone or Tablet.

In forms using the Classic forms, actions performed on a sub-grid were available in the ribbon. Developers can
customize the behavior of these actions or add additional actions by customizing the ribbon.
In forms using the Updated forms actions for sub-grids are placed near the sub-grid, making them easier to
access. However the command bar does not allow for custom actions to be added. Developers can edit the ribbon
to modify the actions for the remaining three actions: show list, add record, and delete record.

Show list behavior


When displaying a list in forms with the Updated forms, each sub-grid displays the Open View button in the
top right corner when the entity is also displayed as one of the entities included in the navigation area of the form
editor. Choosing this button will open the view. The behavior will change depending on the option chosen for the
Records property.
When you select Only Related Records the view will open using one of the associated views in the same window.
To return to the form, use the back button or choose the current record primary name value in the navigation bar.
When you select All Record Types the view will open in a new window.

Add record behavior


When displaying a list in forms with the Updated forms, each sub-grid displays the Add record button in the
top right side of the sub-grid. Choosing this button will allow you to add a record. This behavior will change
depending on the option chosen for the Records property and if the lookup is for activity records.
When you select Only Related Records the default behavior is the behavior to add existing records. People see
an in-line lookup to search for an existing record first. This helps prevent creating duplicate records. If they can't
find an existing record, they can choose the New option. When a new record is created any of the field mappings
defined in the relationship will be applied. More information: Map entity fields
When you select All Record Types the default behavior is to add a new record. The quick create form will be
shown if the target entity has one. If not, the default entity main form is shown.
If the sub-grid displays activities, people will first need to choose the type of activity and then they will see the
"add new record" behavior.

Delete record behavior


When you select a record in a sub-grid the Delete button appears on the right side of the row. The behavior of
this delete action is different depending on the type of relationship with the current entity.
When the sub-grid uses a 1:N (one-to-many) relationship, the normal record delete behavior is to show a
confirmation dialog before deleting the record.
When the sub-grid uses a N:N (many-to-many) relationship, the record in the relationship (or intersect) entity
relating to two records is deleted without a confirmation and the record will no longer be displayed in the sub-
grid. But the record that was displayed is not deleted.

Next steps
Use the Main form and its components
Tab properties for model-driven app forms overview
3/26/2020 • 2 minutes to read • Edit Online

In the body of a form, tabs provide horizontal separation. Tabs have a label that can be displayed. If the label is
displayed, tabs can be expanded or collapsed to show or hide their content by choosing the label.
Tabs contain up to three columns and the width of each column can be set to a percentage of the total width.
When you create a new tab, each column is pre-populated with a section.
You can access Tab properties from the Power Apps site.
1. Sign in to Power Apps.
2. Expand Data, select Entities, select the entity that you want, and then select the Forms tab.
3. In the list of forms, open the form of type Main. Then select one of the tabs on the form to view the tab
properties.

PROPERTY DESCRIPTION

Tab label Required: The localizable label for the tab visible to users.

Name Required: The unique name for the tab that is used when
referencing it in scripts. The name can contain only
alphanumeric characters and underscores.

Expand this tab by default The tab state can toggle between expanded or collapsed using
form scripts or by people selecting the label. Choose the
default state for the tab.

Hide tab Showing the tab is optional and can be controlled using
scripts. Choose whether to make the tab visible. More
information: Visibility options

Hide on phone Choose if you want the tab to be available on the phone. For
a condensed version of this form on phone screens, you can
hide the tab.

Formatting Tabs may have up to three columns. Use these options to set
the number of tabs and what percentage of the total width
they should fill.
Tab properties for model-driven app main forms: Classic
These are the properties available to configure when using a tab on a form using the classic form designer. The
following table shows properties that you can set for tabs on the form:

TAB PROPERTY DESCRIPTION

Display Name Required: The unique name for the tab


that is used when referencing it in
scripts. The name can contain only
alphanumeric characters and
underscores.

Label Required: The localizable label for the


tab visible to users.

Show the label of this tab on the When the label is displayed people can
Form select it to toggle whether the tab is
expanded or collapsed. Choose whether
you want to show the label.

Expand this tab by default The tab state can toggle between
expanded or collapsed using form
scripts or by people selecting the label.
Choose the default state for the tab.
TAB PROPERTY DESCRIPTION

Visible by default Showing the tab is optional and can be


controlled using scripts. Choose
whether to make the tab visible. More
information: Visibility options

Availability Choose if you want the tab to be


available on the phone.

Formatting Layout Tabs may have up to three columns.


Use these options to set the number of
tabs and what percentage of the total
width they should fill.

Events Form Libraries Specify any JavaScript web resources


that will be used in the tab
TabStateChange event handler.

Event Handlers Configure the functions from the


libraries that should be called for the
tab TabStateChange event. More
information: Configure Event Handlers

Next steps
Use the Main form and its components
Design considerations for model-driven app main
forms
12/2/2019 • 2 minutes to read • Edit Online

Main forms are the primary user interface where people view and interact with their data. Main forms provide the
widest range of options and are available for model-driven apps, the exception being Dynamics 365 for phones.
One of the main design objectives for main forms is that you design them once and deploy them everywhere. The
same main form you design for a model-driven app is also used in Dynamics 365 for Outlook and Dynamics 365
for tablets. The advantage to this approach is that you don’t have to integrate changes into multiple forms.
However there are several important factors to consider in designing these forms.

Custom forms for different groups


Because you can create multiple main forms and assign different security roles to each form you can present
different groups in your organization with a form that is optimized for how they use the application. You can even
provide each group with different options so that they have different forms to choose from. More information:
Control access to forms
You can expect that managers and decisions makers will want forms that are optimized to provide quick reference
to key data points. They will like to see charts more than lists and they may not perform a lot of data entry.
People who interact directly with customers may need forms tailored to tasks they perform most frequently. They
may want forms that allow for the most efficient data entry.
You’ll need to find out what people in your organization want and need. This is frequently an iterative process
where you gather input, try different things and build forms that people can use. Keep in mind that you have a
variety of tools available to you and that not everything has to be done within the form. Use business rules,
workflow processes, dialogs and business process flows together with your forms to provide a solution that works
for your organization.
You’ll have to balance this with the amount of time you want to spend managing forms. Creating and editing forms
is relatively easy, but as you create more forms, you have to manage more forms.

Presentation differences
Although you don’t have to manage multiple forms for each presentation, you must consider how differences in
the presentation can be accounted for in the main form. Main form presentations describes the different ways that
the main form may be presented. The primary things to take into consideration are:
Dynamics 365 for tablets doesn’t support image, HTML, or Silverlight web resources to be added to forms.
The layout of Dynamics 365 for tablets forms is auto-generated based on the main form. There is no special
form editor for Dynamics 365 for tablets forms. You need to verify that the form presentation works well for
both clients.
If you have unsupported scripts that interact with DOM elements found in the web application, those scripts
won’t work in the Dynamics 365 for tablets forms because the same DOM elements aren’t available.
Dynamics 365 for Outlook Reading Pane forms don’t allow for scripting. The visibility of form elements
depend on the default settings and can’t be changed at runtime using scripts.
Form performance
Forms that load slowly or don’t respond quickly are sure to affect productivity and user adoption of the app.
Optimize form performance provides a number of recommendations you should consider when designing forms
so that customizations don’t adversely affect form performance.
Next steps
Create and design forms
Create and edit quick create forms
How model-driven app main forms appear on
different devices
12/2/2019 • 9 minutes to read • Edit Online

The main form is used by all model-driven app clients. This form provides a consistent user experience whether
someone is using a web browser, Dynamics 365 for phones, Dynamics 365 for tablets, or Dynamics 365 for
Outlook.

Main forms
Any main forms that exist for an entity may be displayed differently depending on the factors in the following table
below. When you design a main form, consider how it works in each different presentation.

PRESENTATION DESCRIPTION

Updated For the Updated entities and classic entities and any custom
entities in Dynamics 365 (online) and Dynamics 365 on-
premises, the updated form provides a new user experience.
These forms have the newer command bar design, and enable
additional features such as auto-save and business process
flows.

Dynamics 365 for tablets Dynamics 365 for tablets presents the content of the main
form in a manner optimized for a tablet.

Dynamics 365 for phones Dynamics 365 for phones presents the content of the main
form in a manner optimized for a phone.

Classic These forms are for the entities that haven't been updated.
They use the ribbon rather than the command bar and the
navigation pane on the left side of the form.

These forms have a two-column layout.

Updated forms
This diagram represents common components found in updated entity forms.
For updated entities, the layout of the form works with a wide range of displays and window sizes. As the width of
window decreases, tab columns move down so that you can scroll down to work with them instead of being
compressed or requiring you to scroll to the right.
The following table summarizes available components of the main form for updated entities.

COMPONENT SUMMARY

Navigation bar Uses the data in the site map to provide the ability to move
to different areas of the application.

The navigation pane used in classic forms isn’t included in the


updated form. In the context of a record, the navigation bar
provides access to views of related records. Rather than
navigating to related records using the navigation pane or by
using the navigation bar, adding sub-grids configured to show
useful related entity records provides a better experience for
most people.

Command bar Uses the data defined for ribbons to provide commands
relevant for the record.

The first five commands are displayed followed by an ellipsis (


) that provides a flyout menu to choose additional
commands.

Image When an entity has an image field and the entity Primary
Image option is set to Default Image, an image can be
displayed in the header when the form is configured to show
the image.

Header Fields placed in the header remain visible when people scroll
down through the body of the form.

Up to four fields can be placed in the header. Multiple lines of


text, web resources, or iFrames aren’t allowed in the header.
The header and footer share some properties with sections.

Process Control When an entity has active business process flows, the process
control displays below the header. More information: Business
process flows
COMPONENT SUMMARY

Body The body is the scrollable part of the form that contains the
tabs.

Tabs In the body of the form, tabs provide horizontal separation.


Tabs have a label that can be displayed. If the label is
displayed, tabs can be expanded or collapsed to show or hide
their content by selecting the label.

Tabs contain up to three columns and the width of each


column can be set to a percentage of the total width. When
you create a new tab, each column is prepopulated with a
section.

Sections A section occupies the space available in a tab column.


Sections have a label that can be displayed and a line may be
shown below the label.

Sections can have up to four columns and include options for


displaying how labels for fields in the section are displayed.

Fields Fields display controls people use to view or edit data in an


entity record. Fields can be formatted to occupy up to four
columns within a section.

Spacer A spacer allows for an empty space to be added to a section


column.

Sub-grids Sub-grids allow for the display of a list within the form. The
ability to display charts using a sub-grid isn’t available in
forms for updated entities.

Quick View Form A quick view form displays data from a record referenced by a
lookup field on the form. The entity that is the target of the
lookup must have a quick view form before one can be added
to the form. More information: Create and edit quick view
forms

Web Resources HTML and Microsoft Silverlight web resources can be added
to main forms but they won’t be displayed when using
Dynamics 365 for phones and tablets.

iFrame An inline-frame that you configure to show a webpage from


another website. Important:
When the page displayed in an iFrame is on another
domain, browsers apply a higher level of security. This
may complicate the requirements for the contents of
an iFrame to interact with data in the form.
Displaying an entity form within an iFrame embedded
in another entity form is not supported.

Bing Maps When this control is present in a form for an updated entity
and the system setting Enable Bing Maps is enabled with a
valid Bing Maps key, this control can be used one time in a
form to show the location for one of the addresses in an
updated entity. More information: Configuring Bing maps
COMPONENT SUMMARY

Footer Any number of fields, web resources, or iFrames can be added


to the footer. Fields are read-only when displayed in the
footer. The header and footer share some properties with
sections.

Status Bar The status bar displays the status field for the record, a
notification area, and a save button.

Dynamics 365 for phones and tablets forms


Most system entities and custom entities are available for Dynamics 365 for phones and tablets. The main form
for these entities is transformed to a presentation optimized for phones or tablets.
Entities enabled for Dynamics 365 for phones and tablets
Only entities that are enabled for Dynamics 365 for phones and tablets use this presentation of the main form.
More information: Entities displayed in Dynamics 365 for phones and tablets
Form design
Dynamics 365 for phones and tablets takes many of the main form elements and presents them in a way
optimized for phones or tablets. The following diagrams show the reflow from the web app to the tablet and
phone apps.
Web app

Tablet app
Phone app

The form elements are transformed to a wide panorama layout in Dynamics 365 for tablets, where users swipe the
screen to change elements visible within a view port. In Dynamics 365 for phones, users swipe the screen to see a
different column, or pane of elements, and the process control appears over every column.
View port element
The following items are always visible within the view port in the context of a form:
Nav bar
The nav bar is a presentation of the sitemap that is optimized for touch. More information: Change navigation
options
Home
The home button takes users to the dashboard that is the starting page for Dynamics 365 for phones and tablets.
Process Control
If the entity has a business process enabled, it will appear in the top right corner next to the search control in
Dynamics 365 for tablets, and at the top of the screen in Dynamics 365 for phones.
Search
People can tap the search control to open the screen to search for records.
Command Bar
By default, some of the commands that appear in the app running in a web browser do not appear in the
Dynamics 365 for phones and tablets apps. Similar to the web application, the command bar is context-sensitive,
so the available commands change depending on what is currently viewed or selected. More information Change
commands
Form elements
The form elements displayed are taken from the main form and presented as a series of panels that users see
through the view port.
In Dynamics 365 for tablets, the first panel displays contact information about relationships that exist for the
record. In Dynamics 365 for phones, the first panel also displays header fields from the form above the
relationship tiles.
For Contact and User forms, the top item displays a communication card for the record. The communication card
provides buttons to initiate communication with the person. For other entities, a communication card is displayed
if there is a Contact quick view form embedded in the main form.
You can show additional tiles based on entity relationships, but you can’t customize the tiles for the following
entities:

ENTITY TILES

Account Owner

Contact Company Name, Owner

Lead Owner

Opportunity Account, Owner

You can customize the remaining tiles with the form editor. The order is fixed, but you can set which elements are
visible in the relationship panel.
In Dynamics 365 for tablets, the second panel begins with the name of the first tab on the form. Any fields that are
included within the header are included and then the contents of the first tab. In Dynamics 365 for phones,
headers appear in the first column.
If there is a process flow active for the form, the third tab displays tasks for the current stage of the process in
Dynamics 365 for tablets. In Dynamics 365 for phones, the process control floats above the panes, expands over
the user’s current pane when it’s selected, and is always visible and actionable.
The remaining panels of the form contain the contents of the tabs in the form. Any subgrids found display as a
separate panel.
The Dynamics 365 for phones and tablets form always displays the labels for tabs and sub-grids. The Display
Label on the Form setting is not applied.

NOTE
To optimize performance on mobile devices, the number of objects is limited to 5 tabs or 75 fields and 10 subgrids.

Forms for Dynamics 365 for phones and tablets don’t support the following:
Bing maps
Yammer
Activity feeds
Theming
In addition, entity images are visible in list views and contact cards, but not within the actual form.
Multiple forms
Dynamics 365 for phones and tablets supports multiple forms but doesn't provide a way for people to switch
between forms if they can access more than one. People will see the first form in the form order that they have
access to.
For example, if you have the following main forms for the opportunity entity and have assigned the following
security roles for each one, you’ll see the form order shown in the following table.

FORM ORDER FORM NAME SECURITY ROLES

1 Sales Form One Salesperson

2 Sales Form Two Salesperson and Sales Manager

3 Sales Form Three Sales Manager

4 Sales Form Four Vice President of Sales

People with the Salesperson role will always see Sales Form One.
People with the Sales Manager role will always see Sales Form Two.
People with the Vice President of Sales role will always see Sales Form Four.

Classic forms
The following diagram shows the main form components used in the classic presentation.
The forms for updated entities have inherited many components from the classic forms, but there are significant
differences.
Forms using the classic presentation don’t include the navigation bar and the ribbon is used instead of the
command bar. These forms don’t support entity images, the process control, quick view forms, auto-save, or Bing
Maps. Fields in the header aren’t editable.
The form assistant is exposed for certain entities, such as Article .

Next steps
Create and design forms
Control access to model-driven app forms
12/2/2019 • 4 minutes to read • Edit Online

There are two ways you can control access to main forms:
Make a main form inactive
You can set an active or inactive state to main forms. This feature was included primarily to manage new
forms included when Common Data Service environments upgrade but you can use it to prevent users
from being able to use any main form.
Assign security roles to the main form
Use this to make a main form available to specific groups.
Different people in your organization may interact with the same data in different ways. Managers may depend on
being able to quickly scan information in a record and service people may require a form that streamlines data
entry. You can accommodate different requirements by assigning forms to the security roles that different groups
of people belong to.
For step-by-step procedures, see Assign security roles to forms.
When you have more than one main or other form type defined for an entity, you can select which forms users
will be able to use based on their security roles. Because each entity must be able to display a form for any user, at
least one form must be designated as a ”fallback” form – a form visible to users whose security roles do not have
any forms explicitly assigned to them.

NOTE
Quick Create, Quick View, and Card forms can't be assigned to security roles.

Within the form editor or from the forms grid you can assign security roles to a main form. However, if there is
only one form for the entity, you will not be able to clear the Enabled for fallback option in the Assign Security
Roles dialog box. In this case, even though you have assigned security roles to the form, anyone associated with a
security role you did not include will still be able to view the form because it is enabled for fallback.
After you create a second main form for the entity, you will be able to clear the Enabled for fallback option for
one of them. The system will always make sure that at least one form is enabled for fallback.
When you have more than one main form, you can specify a form order that will control which of the forms a
person is allowed to see will be the one they see by default. If there is more than one form they can use, they can
change forms and the form they choose will be their default form until they choose a different one. This
preference is stored in their browser. If they use a different computer or browser they will see the original default
form.

Strategies to manage the fallback form


Strategies to manage the fallback form include the following:
All users view the same form
If you do not require multiple forms for an entity you do not need a fallback form.
Create a contingency form
If you are using role-based forms because you want to restrict the information people might view or edit, consider
creating a form that has a minimum of information displayed. Then, in the Assign Security Roles dialog box,
select Display only to these selected security roles, but do not select any roles except System Administrator,
and select Enabled for fallback. The result is that this form will never be seen by anyone except the System
Administrator and anyone whose security roles have not been associated with a specific form. You could include a
HTML web resource in the form with information about why little information is visible in the form and a link to
information about how to request being added to a security role that is associated with a from or to include a new
security role for a form.

NOTE
You can’t include a web resource in a form header or footer.

Create a generic form


If you use role-based forms to provide a customized experience based on a user’s role, you can set your least
specialized form as the fallback form and configure it to display for everyone. Then, create customized forms for
specific security roles and configure those forms to only display for security roles that require them. Do not enable
these forms for fallback. Finally, in the Forms list use the Form Order dialog to specify which forms to display
ranking them from most exclusive to least exclusive. Your fallback form will be at the bottom of the list. This
strategy will cause people seeing the form that has been customized for their role as the default form, yet they can
still use the form selector to select the most common form if they want. Whatever form they select will remain
their default form until they select a different form.

Use form scripting


The Client API form context (formContext) provides a reference to the form or to an item on the form, such as, a
quick view control or a row in an editable grid, against which the current code is executed. More information:
Client API form context

IMPORTANT
The Xrm.Page object is deprecated, and you should use the getFormContext method of the passed in execution context
object to return reference to the appropriate form or an item on the form.

See also
Assign security roles to forms
Add a field to a model-driven app form
3/26/2020 • 2 minutes to read • Edit Online

If a Power Apps form for a standard entity doesn't meet your organization's business requirements, you can
customize the form by changing existing fields or by adding new fields. While it might be simpler to edit the
existing fields on a form, sometimes it's better to add a field to address a specific business scenario.
In this topic, you add a field on to a form.
1. Sign in to Power Apps.
2. Expand Data, select Entities, select the entity that you want, and then select the Forms tab.
3. In the list, open a form with the type of Main to edit it.
4. In the form, click the section you want to add a field to, and then in the Fields pane, click the field you want
added to the form.

TIP
When you add an option set field on the form, the drop-down list that contains the option set values can only
display two values. Users must scroll to see more values in the list. If you want to show more than two values
without users having to scroll, add one or more Spacer controls below the option set field on the form. Each Spacer
control provides a space for one additional option set value. For example, if you want to display four values in the
drop-down list without scrolling, add two Spacer controls below the option set field on the form.

5. To publish customizations for the form that you're editing, with the form open, click Publish.
6. When you're done editing the form, click Save and Close.

NOTE
Publishing customizations can interfere with normal system operation. We recommend that you publish when it's least
disruptive to users.

Next steps
Create and design forms
Show or hide model-driven app form elements
2/5/2020 • 2 minutes to read • Edit Online

Several types of form elements have the option to be shown or hidden by default. Tabs, sections, fields, iFrames,
and web resources all provide this option. Using form scripts or business rules the visibility of these elements can
be controlled to create a dynamic form to provide a user interface that adapts to conditions in the form.

NOTE
Hiding form elements is not a recommended way to enforce security. There are several ways people can view all the
elements and data in the form when elements are hidden.

Rather than designing forms that depend on scripts to control visibility of options, consider whether a business
process flow, a dialog, or switching to a different form may be better suited to meet your requirements. If you do
use scripts, make sure that any element that might be hidden is hidden by default. Only show it with scripts when
your logic calls for it. This way it will not be displayed in presentations that do not support scripts.

NOTE
In the Unified Interface, for sections where fields don’t span more than one column, hiding a field in the section moves the
field below up on the form. If a field spans more than two columns in a section, hiding a field in the section that has a
control across from it will not move the field below it up on the form. You will see additional white space where the hidden
field is in the section.

Next steps
Overview of the form editor interface
Change navigation within a model-driven app form
12/2/2019 • 2 minutes to read • Edit Online

Navigation within a form allows app users to view lists of related records. Each entity relationship has properties
to control whether it should be shown. More information: Navigation pane item for primary entity
Any entity relationships that are configured to be displayed can be overridden within the form editor. You can also
include navigation links to display web resources or other web sites via form navigation.
For step-by-step instructions, see Create and edit entity relationships for Common Data Service
To enable editing navigation you must first select Navigation from the Select group on the Home tab of the
form designer.

In the right pane, from Relationship Explorer you can filter by 1:N (one-to-many) or N:N (many-to-many)
relationships, or view all available relationships. The Only show unused relationships checkbox is disabled and
selected. So you can only add each relationship one time.

To add a relationship from the Relationship Explorer just double-click the relationship and it will be added below
the currently selected relationship in the navigation area. Double-click a relationship in the navigation area and
you can change the label on the Display tab. On the Name tab you can see information about the relationship.
Use the Edit button to open the definition of the entity.
There are five groups in the navigation area. You can drag them to reposition them and double-click them to
change the label, but you can’t remove them. These groups will only display when there is something in them. So
if you don’t want a group to appear, just don’t add anything to it.
Use the Navigation Link button in the Control group of the Insert tab to add a link to a web resource or
external URL.

Navigation link properties


Navigation links have the following properties:

PROPERTY DESCRIPTION

Name Required: Text to display as a label.

Icon Use a 32x32 pixel web resource. Use a PNG image with a
transparent background is recommended.

Web Resource Specify a web resource to display in the main pane of the
form.

External URL Specify the URL of a page to display in the main pane of the
form.

Privacy notices
When you add the Website Preview Control to a form, on load, certain identifiable device information (the device
name – such as iPhone, the OS and the OS version, the browser and the browser version) will be sent to Bing (a
consumer service). Therefore, Consumer Data sent to Bing will be subject to Microsoft Privacy and Cookies. By
adding this control, you agree for this limited set of data to be sent to the Bing service. Note that you may remove
the control at any time to discontinue use of this functionality.
When you add the Multimedia Control to a form, certain identifiable device information (the device name – such
as iPhone, the OS and the OS version, the browser and the browser version) will be sent to the service that you
are calling (such as YouTube or Azure Media Services) and will be subject to the terms of that service’s privacy
statement. By adding this control, you agree for this limited set of data to be sent to the external service you are
calling. Note that you may remove the control at any time to discontinue use of this functionality.

Next steps
Overview of the form editor user interface
Add model-driven app form navigation for related
entities
3/26/2020 • 2 minutes to read • Edit Online

In this topic, you use the form navigation pane that is used to add links to related entities. When an app user clicks
one of these links in a record, the associated view for the entity is displayed.
1. Sign in to Power Apps.
2. Expand Data, select Entities, select the entity that you want, and then select the Forms tab.
3. In the list, open a form with the type of Main to edit it.
4. Select Switch to classic to edit the form in the classic form designer.
5. To add a link to a related entity, on Home tab, in the Select group, choose Navigation.
The Relationship Explorer pane displays on the right side of the form editor.
6. In the Relationship Explorer pane, in the Filter list, select one of the following options:
Available Relationships. Lists all the entities that can be related to the entity the form is associated
with.
1:N Relationships. Lists entities that can be related in a 1:N relationship to the entity the form is
associated with.
N:N Relationships. Lists entities that can be related in a N:N relationship to the entity the form is
associated with.

NOTE
If no related entities show up in the Relationship Explorer pane, you cannot create a link on this form to a related
entity.

7. Select the related entity you want to link to, drag it to the Navigation Pane, and then drop it where you want
it to be displayed.

TIP
You can also create a new relationship by choosing New 1:N or New N:N in the Relationship Explorer pane.

8. To edit the properties for this or any other related entity link, in the Navigation Pane, select the link, and
then on the Home tab, choose Change Properties.
9. In the Relationship Properties dialog box, on the Display tab, type a new display label.
10. On the Name tab, choose Edit to view or edit the details associated with the relationship record.
11. Choose OK.
12. Preview how the main form will appear and how events will function:
a. On the Home tab, choose Preview, and then select Create Form, Update Form, or Read-Only
Form.
b. To close the Preview form, on the File menu, choose Close.
13. When you finish editing the form, choose Save and Close to close the form.
14. When your customizations are complete, publish them:
To publish customizations for only the component that you are currently editing, in the Navigation
Pane, choose the entity you have been working on, and then choose Publish.
To publish customizations for all unpublished components at one time, in the Navigation Pane,
choose Entities, and then on the command bar, choose Publish All Customizations.

NOTE
Installing a solution or publishing customizations can interfere with normal system operation. We recommend that you
schedule a solution import when it's least disruptive to users.

Next steps
Create and edit entity relationships for Common Data Service
Use the model-driven app main form and its
components
12/3/2019 • 6 minutes to read • Edit Online

Forms in the Unified interface based apps provide improved user experience for optimum agent productivity and
help maintain context while working on related records. You can see the forms enlisted in the solution explorer.
The form type of the new forms is Main.
This topic explains how to edit a main form, and add or change various elements of the form.

Open the form editor


To edit a form or to add or change elements, use the form editor. The form editor lets you edit forms for all the
Unified interface based apps.
Follow the procedures given below to access the form editor.

NOTE
If you create any new solution components in the process of editing the form, the names of the components will use the
solution publisher customization prefix for the default solution and these components will only be included in the default
solution. If you want any new solution components to be included in a specific unmanaged solution, open the form editor
through that unmanaged solution.

Access the form editor through App designer in Power Apps


1. Sign in to Power Apps.
2. On the left navigation pane, select Apps, select the app you want, and then on the toolbar select Edit.
3. On the app designer canvas, select the down arrow next to an entity to see the forms available for that
entity.

4. Select the open designer button corresponding to the form to edit.

5. In the form designer, make your changes and then select Save to save the changes and select Publish to
publish them for use in the app.

NOTE
If you have made other changes to the app, publish them using the app level publish option. See Validate and publish an
app using the app designer for more information.
NOTE
The webclient main form is also compatible with the Customer Service Hub and is available to be edited using the app
designer.

Access the form editor through the default solution


1. Sign in to Power Apps.
2. Expand Data, select Entities, select the entity that you want, and then select the Forms tab.
3. In the list of forms, open the form of type Main.
Access the form editor for an unmanaged solution
1. Open solutions.
2. Double-click the unmanaged solution you want to work with. The solution type, managed or unmanaged, is
displayed in the Package Type column.
3. In the list of components, locate the entity with the form you want to edit. If the entity isn’t there, you’ll need
to add it.
Add an entity to an unmanaged solution
1. With the unmanaged solution opened in solution explorer, select the Entities node and, in the toolbar
above the list, select Add Existing.

2. In the Select Solution Components dialog box, with the Component Type selector set to Entity, select
the entity you want to add and select OK.
3. If the Missing Required Components dialog box appears, you can select No, do not include required
components if you don’t intend to export this unmanaged solution to another organization. If you don’t
want to include missing required components at this time, you can add them later. You’ll receive
notification again if you export this solution in the future.
4. In the solution explorer expand the entity with the form you want to edit and select Forms.
5. In the list of forms, open the form of type Main.
Publish the changes for use in the app
Certain customizations that make changes to the user interface require that they be published before people can
use them in the application. To publish your customization, on the solution explorer toolbar, select Publish All
Customizations.
Form editor user interface
To understand in detail about the form editor user interface, see Overview of the form editor user interface.

Form properties
To know in detail about the form properties, see Form properties.

Visibility options
Several types of form elements have the option to be shown or hidden by default. Tabs, sections, and fields all
provide this option. Using form scripts or business rules, the visibility of these elements can be controlled to
create a dynamic form to provide a user interface that adapts to conditions in the form.

NOTE
Hiding form elements is not a recommended way to enforce security. There are several ways people can view all the
elements and data in the form when elements are hidden. To learn more, see Show or hide form elements.

Tab properties
In the body of a form, tabs provide horizontal separation. Tabs have a label that can be displayed. If the label is
displayed, tabs can be expanded or collapsed to show or hide their content by choosing the label. To know in
detail about the tab properties, see Tab properties.

Section properties
A section in a form occupies the space available in a tab column. Sections have a label that can be displayed and
a line may be shown below the label. To know in detail about the section properties, see Section properties.

Timeline
The Timeline shows related activities for a specific entity.
The following types of activities are supported: Task, appointment, phone call, email, social activity, custom
activity.
The Timeline also shows notes and, system and user posts. It shows those activities that have Regarding field
set to the entity you’re viewing. For notes, the Regarding field isn’t shown to the user; It is implicit when created
from the Timeline.
Each activity that’s shown in the Timeline, will have the same quick actions that are available on the activity’s
command bar.

Common field properties


To know in detail about the common field properties, see Common field properties.

Special field properties


All fields have the properties listed in Common field properties, but certain fields have additional properties. To
know more, see Special Field Properties.

Sub-grid properties
You can configure a sub-grid on a form to display a list of records or a chart. To know in detail about the sub-grid
properties, see Sub-grid properties.

Quick view control properties


A quick view control on a form displays data from a record that is selected in a lookup on the form. To explore
the quick view control properties, see Quick view control properties.

Web resource properties


You can add or edit web resources on a form to make it more appealing or useful to app users. Form enabled
web resources are images, HTML files, or Silverlight controls. Know in detail about the Web resource properties.
Go to Web resource properties.

IFRAME properties
You can add iFrames to a form to integrate content from another website within a form. To know more about the
IFRAME properties, see IFRAME properties.

Edit navigation
Navigation within the form allows people to view lists of related records. Each entity relationship has properties
to control whether it should be shown. More information: Navigation Pane Item for Primary Entity
Any entity relationships that are configured to be displayed can be overridden within the form editor.
For step-by-step instructions, see Add form navigation for related entities.
To enable editing navigation you must first select Navigation from the Select group on the Home tab.
In the Relationship Explorer you can filter by 1:N (one-to-many) or N:N (many-to-many) relationships, or view
all available relationships. The Only show unused relationships checkbox is disabled and selected. So you
can only add each relationship one time.
To add a relationship from the Relationship Explorer just double-click it and it will be added below the
currently selected relationship in the navigation area. Double-click a relationship in the navigation area and you
can change the label on the Display tab. On the Name tab, you can see information about the relationship. Use
the Edit button to open the definition of the entity.
There are five groups in the navigation area. You can drag them to reposition them and double-click them to
change the label, but you can’t remove them. These groups are displayed only when there is something in them.
If you don’t want a group to appear, just don’t add anything to it.

Configure event handlers


An event handler consists of a reference to a JavaScript web resource and a function defined within that web
resource that will execute when the event occurs. To know more about configuring event handlers, see Configure
event handlers.

Next steps
Create and design forms
Create and edit quick create forms
Create and edit quick view forms
Open the model-driven app form editor
3/26/2020 • 2 minutes to read • Edit Online

The form editor is where you design forms by dropping components such as sections, tabs, fields, and controls
onto the form editor canvas. In this topic you learn how several different ways to access the form editor.
If you create any new solution components in the process of editing the form, for example web resources, the
names of the components will use the solution publisher customization prefix for the default solution and these
components will only be included in the default solution. If you want any new solution components to be included
in a specific unmanaged solution, you should open the form editor through that unmanaged solution.

Access the form editor from the Power Apps site


1. Sign in to Power Apps.
2. Select Data > Entities > and then select the entity you want, such as the account entity.
3. Select the Forms tab and then open the form you want, such as the Account main form.

Access the form editor from solution explorer


1. Open solution explorer.
2. Under Components, expand Entities, and then the entity you want, and click Forms.
3. In the list of forms, click the form you want to edit.

Access the form editor through the command bar within a model-
driven app
1. Open a record.
2. If there are multiple main forms for the entity, verify that the form is the one you want to edit. If it isn't, use
the form selector to choose the form you want to edit.
3. Select the More Commands button .
4. Select Form Editor.

Access the form editor from within app


You can access the form editor through the command bar or the ribbon, depending on the entity. Both of these
methods will open the form in the context of the default solution.

Access the form editor for an unmanaged solution


1. Open Solutions.
2. Select the unmanaged solution you want to work with.
3. Open the entity with the form you want to edit. If the entity isn't there, you'll need to add it. More
information: Add an entity to an unmanaged solution
4. Select the Forms tab, and then open the form you want to edit.
Add an entity to an unmanaged solution
1. Select the Entities node and, in the toolbar above the list, click Add Existing.
2. In the Select Solution Components dialog box, with the Component Type selector set to Entity, select
the entity you want to add and click OK.
3. If the Missing Required Components dialog box appears, you can click No, do not include required
components if you don't intend to export this unmanaged solution to another environment. If you choose
not to include missing required components at this time, you can add them later. You'll receive notification
again if you export this solution in the future.
4. In the solution explorer expand the entity with the form you want to edit and select Forms.
5. In the list of forms, double-click the form you want to edit.

Next steps
Create and design forms
iFrame properties for model-driven app main forms
3/26/2020 • 2 minutes to read • Edit Online

You can add iFrames to a form to integrate content from another website within a form.
To view IFrame properties, follow these steps.
1. Sign in to Power Apps.
2. Expand Data, select Entities, select the entity that you want, and then select the Forms tab.
3. In the list of forms, open a form of type Main.
4. Select Switch to classic to edit the form in the classic form designer.
5. On the Insert tab, select IFRAME to view IFRAME properties.

NOTE
Forms are not designed to be displayed within an iFrame.

TAB PROPERTY DESCRIPTION

General Name Required: A unique name for the


iFrame. The name can contain only
alphanumeric characters and
underscores.
TAB PROPERTY DESCRIPTION

URL Required: The URL for the page to


display in the iFrame.

Pass record object-type code and Data about the organization, user, and
unique identifiers as parameters the record can be passed to the iFrame.
More information: Pass parameters to
iFrames

Label Required: A label to display for the


iFrame.

Display label on the Form Whether the label should be displayed.

Restrict cross-frame scripting, where It is considered a security risk to allow


supported pages from a different web site to
interact with the Dynamics 365
application using scripts. Use this option
to restrict cross frame scripting for
pages you do not have control over.

Visible by default Showing the iFrame is optional and can


be controlled using scripts. More
information: Visibility options

Enable for mobile Select the checkbox to enable the


iFrame for mobile.

Formatting Select the number of columns the When the section containing the iFrame
control occupies has more than one column you can set
the field to occupy up to the number of
columns that the section has.

Select the number of rows the You can control the height of the
control occupies iFrame by specifying a number of rows
the control occupies.

Automatically expand to use Instead of setting the height by a


available space number of rows, you can allow the
iFrame height to expand to available
space.

Select the scrolling type for the You have three options:
iFrame
- As Necessary: Show scrollbars when
the size of the iFrame is larger than the
available space.
- Always: Always show scrollbars.
- Never: Never show scrollbars.

Display border Display a border around the iFrame.


TAB PROPERTY DESCRIPTION

Dependencies Dependent fields An iFrame may interact with fields in the


form using script. If a field is removed
from the form the script in the iFrame
may break. Add any fields referenced by
scripts in the iFrames to the
Dependent fields so that they cannot
be removed accidentally.

Pass parameters to iFrames


Information about the record can be passed by enabling the Pass record object-type code and unique
identifiers as parameters option. The values passed are:

PARAMETER DESCRIPTION

orglcid The Organization default language LCID.

orgname The name of the organization.

userlcid The user's preferred language LCID

type The entity type code. This value can be different for custom
entities in different organizations. Use typename instead.

typename The entity type name.

id The id value of the record. this parameter has no value until


the entity record is saved.

Next steps
Use the Main form and its components
Optimize model-driven app form performance
12/5/2019 • 2 minutes to read • Edit Online

Forms that load slowly can reduce productivity and user adoption. Follow these recommendations to maximize
how quickly your forms will load. Many of these recommendations are about how a developer may implement
form scripts for your organization. Be sure to discuss these recommendations with developers who create form
scripts for your forms.

Form design
Think about the interaction the user will have with the form and the amount of data that must be displayed within
it.
Keep the number of fields to a minimum
The more fields you have in a form, the more data that needs to be transferred over the Internet or intranet to view
each record.
Design for performance
When designing forms and pages, put what is most important at the top to make it most easily accessible for your
users. Move infrequently used components to other tabs on a form, use role-based forms instead of showing and
hiding components, and make sure that different workflows have dedicated dashboards and views. Feel free to use
sections to organize your controls – this won’t make your forms slower.

Form scripts
When you have customizations using form scripts make sure that the developer understands these strategies to
improve performance.
Avoid including unnecessary JavaScript web resource libraries
The more scripts you add to the form, the more time it will take to download them. Usually scripts are cached in
your browser after they are loaded the first time, but the performance the first time a form is viewed often creates
a significant impression.
Avoid loading all scripts in the Onload event
If you have code that only supports OnChange events for fields or the OnSave event, make sure to set the script
library with the event handler for those events instead of the OnLoad event. This way loading those libraries can be
deferred and increase performance when the form loads.
Use collapsed tabs to defer loading web resources
When web resources or IFRAMES are included in sections inside a collapsed tab they will not be loaded if the tab
is collapsed. They will be loaded when the tab is expanded. When the tab state changes the TabStateChange event
occurs. Any code that is required to support web resources or IFRAMEs within collapsed tabs can use event
handlers for the TabStateChange event and reduce code that might otherwise have to occur in the OnLoad event.
Set default visibility options
Avoid using form scripts in the OnLoad event that hide form elements. Instead set the default visibility options for
form elements that might be hidden to not be visible by default when the form loads. Then, use scripts in the
OnLoad event to show those form elements you want to display.

Command bar or ribbon


Keep these recommendations in mind as you edit the command bar or ribbon.
Keep the number of controls to a minimum
Within the command bar or the ribbon for the form, evaluate what controls are necessary and hide any that you
don’t need. Every control that is displayed increases resources that need to be downloaded to the browser.

Next steps
Create and design forms
Model-driven app form section properties
3/26/2020 • 3 minutes to read • Edit Online

A section in a form occupies the space available in a tab column. Sections have a label that can be displayed and a
line may be shown below the label.
Sections can have up to 4 columns and includes options for displaying how labels for fields in the section are
displayed.
Headers and footers are similar to sections but cannot be removed. If they don't contain anything they will not be
shown.

Section properties in form designer


1. Sign in to Power Apps.
2. Expand Data, select Entities, select the entity that you want, and then select the Forms tab.
3. In the list of forms, open a form of type Main. To open a form in another tab, select More commands ,
and then select Edit form > Edit form in new tab.
4. Select one of the sections to see the section properties.
PROPERTY DESCRIPTION

Section label Required: The localizable label for the section visible to users.

Name Required: The unique name for the section that is used when
referencing it in scripts. The name can contain only
alphanumeric characters and underscores.

Hide label Sections are frequently used without labels to control


formatting of the fields within them.

Lock section This will prevent the section from accidentally being removed
and prevents people from removing the contents.

Removing a section will not only remove the section, but also
any fields within it.

Someone wanting to remove this section would need to


change this setting before removing it.

Hide section Showing the section is optional and can be controlled using
scripts. More information: Visibility options

Hide on phone Choose if you want the tab to be available on the phone.

Formatting Specify up to four columns to be in the section.

Section properties in classic form designer


You can access Section properties in solution explorer from the Power Apps site .
1. Sign in to Power Apps.
2. Expand Data, select Entities, select the entity that you want, and then select the Forms tab.
3. In the list of forms, open the form of type Main.
4. Select Switch to classic to edit the form in the classic form designer.
5. Double-click inside one of the sections to see the section properties.
TAB PROPERTY DESCRIPTION

Display Name Required: The unique name for the


section that is used when referencing it
in scripts. The name can contain only
alphanumeric characters and
underscores.

Label Required: The localizable label for the


section visible to users.

Show the label of this section on the Sections are frequently used without
form labels to control formatting of the fields
within them.

Show a line at top of the section A line at the top of a section can help
break up the form layout.

Field Label Width Required: Set a value between 50 and


250 to specify the space allowed for
field labels.

Header and footer elements also have


this property.

Visibility Showing the section is optional and can


be controlled using scripts. More
information: Visibility options

Availability Choose if you want the tab to be


available on the phone.
TAB PROPERTY DESCRIPTION

Lock the section on the form This will prevent the section from
accidentally being removed and
prevents people from removing the
contents.

Removing a section will not only


remove the section, but also any fields
within it.

Someone wanting to remove this


section would need to change this
setting before removing it.

Formatting Layout Specify up to four columns to be in the


section.
Header and footer components also
have this property.

Field Label Alignment Labels for fields within the section can
be aligned left, right, or center.

Field Label Position Labels for fields within the section can
be positions on the side or on top of
the fields.

A new type of section called Reference panel can also be added. A Reference panel is a single column section.
You can insert sub-grids, quick view control, or a Knowledge Base Search control inside a reference panel section.
Each control that you added in the reference panel appears as a vertical tab within the panel at the runtime. You
can drag and drop the various controls within the Reference panel section. The default tab at runtime is the first
control added in the reference panel. The other tabs appear in the order in which they are added in the form editor.
To delete a tab, use the delete key on your keyboard.
When you insert a reference panel, by default it's added as a last section in the tab. You can add only one reference
panel per form.

IMPORTANT
By default, the reference panel section is locked in these standard forms: Cases, Accounts, and Contacts. To remove it or
change it, you must unlock it.

Next steps
Use the Main form and its components
Configure a map on a form
12/3/2019 • 2 minutes to read • Edit Online

By default, the Bing maps control is configured on the main form for both the account and contact entities, which
provides the ability to display a map on entity records. Although not configured by default, the Bing maps control
can be added to the system user entity. The Bing maps control can also be used with some entities included with
model-driven apps in Dynamics 365, such as Dynamics 365 Sales and Dynamics 365 Customer Service. For
example, the lead, quote, order, invoice, and competitor entities. The Bing maps control can't be used with custom
entities.
When enabled, the map displays the location specified in the address composite fields for the given record.
IMPORTANT
To use maps the system setting Show Bing Maps on forms must be enabled. More information: Enable maps for your
environment
You can remove the maps area in the form editor or add it back by using the Bing Maps button on the Insert tab
of the classic form editor.

Enable maps for your environment


1. Open a model driven app and then select Settings > Advanced Settings.
2. Select Settings > Administration > System Settings.
3. On the General tab, select Show Bing Maps on forms, and then select OK.

Configure a map
1. Sign in to Power Apps.
2. Go to Data > Entities, and then select the entity that you want to configure a map on the main form.
3. Select the Forms tab, and then select the main form, and then on the command bar select Switch to
classic.
4. On the classic form designer double-click the Map View control to view and edit the properties. More
information: View and edit map properties
To remove the map control from the form, select the Map View control, and then press the Delete key.

View and edit map properties


TAB PROPERTY DESCRIPTION

General Label Required: A label to display for the


Bing maps.

Display label on the form Whether the label should be displayed.

Select an address to use with the Choose which address should be used
Bing maps control to provide data for the map.

Visible by default Showing the Bing maps is optional and


can be controlled using business rules
or scripts. More information: Visibility
options

Formatting Select the number of columns the When the section containing the Bing
control occupies maps has more than one column you
can set the field to occupy up to the
number of columns that the section
has.

Select the number of rows the You can control the height of the Bing
control occupies maps by specifying a number of rows.

Automatically expand to use You can allow the Bing maps height to
available space expand to available space.

See also
Create and design model-driven app forms
Assign model-driven app form order
12/2/2019 • 2 minutes to read • Edit Online

When you have multiple main, quick create, quick view, or card forms for an entity, you can assign a form order.
The form order determines which of the available forms will be shown by default. The available main forms can be
further controlled by assigning security roles to the form. See Control access to forms for more information.
You can't assign security roles to quick create, quick view, or card forms, so the only form that will be used by
everyone is the one at the top of the form order.

To assign a form order


1. Open the solutions explorer, expand the entity that you want, and then select Forms.
2. In the form list toolbar select Form Order.

3. Choose either Main Form Set, Quick Create Form Set, Quick View Form Set, or Card Form Set
depending on the type of forms you want to work with. More information: Type of forms.
4. The Form Order dialog is a simple list where you can move a selected form up or down in the form order.
5. After you have set the order you want, click OK to close the dialog.

Next steps
Change navigation within a form
Configure model-driven app form event handlers
12/2/2019 • 3 minutes to read • Edit Online

Form event handlers for Power Apps forms can be configured for the following areas in a form:

ELEMENT EVENT DESCRIPTION

Form OnLoad Occurs when the form loads.

OnSave Occurs when data is saved.

Tab TabStateChange Occurs when the tab is expanded or


collapsed.

Field OnChange Occurs when data in the field changes


and the control loses focus.

IFRAME OnReadyStateComplete Occurs when the content of an IFRAME


loads.

An event handler consists of a reference to a JavaScript web resource and a function defined within that web
resource that will execute when the event occurs. Each element can have up to 50 separate event handlers
configured.

IMPORTANT
Configuring an event handler incorrectly can result in script errors that may cause the form to fail to load or function
correctly. If you are not the developer of the script, make sure you understand exactly what configuration options the script
requires.
Do not configure a script event handler using a library that does not come from a source you trust. Scripts can be used to
perform any action a user might perform and a poorly written script can significantly damage the performance of a form.
After you configure an event handler always test it to verify it is working correctly.

To configure an event handler


1. In the form editor, select the element with the event you want to configure a handler for.
2. On the Home tab, in the Edit group, select Change Properties or simply double-click the element.
3. In the element properties dialog, select the Events tab.
4. Expand the Form Libraries area. If the library containing the function you want to set as the event handler
is not already listed, add the library.
5. To add a form library to an event handler:
a. In the Form Libraries section of the Event List, select Add.
b. Locate the JavaScript web resource in the list of available web resources. Select it and then select
Add.
If the JavaScript web resource you need does not exist, select New to open a new web resource
form and create one.
c. To create a JavaScript web resource:
a. In the web resource form set the following properties:

PROPERTY VALUE

Name Required. Type the name of the web resource.

Display Name Required. Type the name to be displayed in the


list of web resources.

Description Optional. Type a description of the web resource.

Type Required. Select Script (JScript).

Language Optional. Choose one of the languages available


for your organization.

b. If you have been provided with a script, we highly recommend that you use the Browse
button to locate the file and upload it.
Alternatively, you can select the Text Editor button and paste or type the contents of the
script in the Edit Content dialog.

NOTE
Because this simple text editor does not provide any features to check the correctness of the script,
generally you should always try to use a separate application like Visual Studio to edit scripts and
then upload them.

c. Select Save and close the web resource dialog.


d. The web resource you created is now selected in the Look Up Record dialog. Select Add to
close the dialog.
6. In the Event Handlers section, select the event you want to set an event handler for.
7. Select Add to open the Handler Properties dialog.
8. On the Details tab choose the appropriate library and type the name of the function that should be
executed for the event.
9. By default the event handler is enabled. Clear the Enabled checkbox if you do not want to enable this
event.
Some functions require an execution context to be passed to the function. Select Pass execution context
as the first parameter if it is required.
Some functions can accept a set of parameters to control the behavior of a function. If these are required,
enter them in the Comma separated list of parameters that will be passed to the function.
10. On the Dependencies tab, add any fields that the script depends on into the Dependent Fields area.
11. Select OK to close the Handler Properties dialog.
12. When the event handler is entered you may adjust the order in which the function will be executed relative
to any other functions by using the green arrows to move it up or down.
13. Select OK to close the element properties dialog.
14. Select Save to save your changes. Select Publish to publish the form.

NOTE
While the user interface (UI) lets you adjust the order in which the scripts are loaded by using the up and down green
arrows, the scripts are actually not loaded sequentially.

Next steps
Use the Main form and its components
Disable auto-save in a model-driven app
3/26/2020 • 4 minutes to read • Edit Online

Auto-save helps app users focus on their work without having to manage saving data in the form. Most people will
appreciate not having to explicitly save data each time they update a record, but some organizations may have
customizations that were designed expecting an explicit save. For these organizations there are options to manage
how auto-save is applied.

How auto-save works


By default all main forms for Updated entities and classic entities will have auto-save enabled. After a record is
created (initially saved), any changes made to a form will automatically be saved thirty seconds after the change is
made. If no changes are made in the form, the automatic save won't occur while the form is open. After a change is
made the 30-second period before an auto-save begins again. The field that someone is currently editing isn't
included in an auto-save. If someone else has updated the same record while you're editing it, those changes will be
retrieved and displayed in the form when auto-save occurs.
With auto-save enabled, the save button only appears for the initial save of the record. After the record is created,
the save button in the command bar isn't shown, but you can see a button in the lower right corner that will show
if there are any unsaved changes. This control is also displayed if auto-save is disabled.
You can select this button to save the record and refresh data in the form immediately. When auto-save is enabled
the record will be saved whenever you navigate away from a record or close a separate window displaying a
record. There is no need for the Save & Close button that appears in forms for entities that aren't updated.

Should you disable auto-save?


If you have plug-ins, workflows, or form scripts that execute when a record is saved, they'll run each time auto-save
occurs. This might lead to undesirable behaviors if these extensions weren't designed to work with auto-save.
Whether auto-save is enabled or not, plug-ins, workflows, and form scripts should be designed to look for specific
changes, and shouldn't execute indiscriminately for each save event.
If you have auditing configured for an entity, each save is treated like a separate update. If someone lingers on a
form with unsaved changes for more than thirty seconds, you'll see an additional entry only if they add more data
after the auto-save is performed. If you have reports that depend on auditing data and treat each save as an
individual "touch" of a record, you might see an increase in the frequency of touches. If you are using this approach,
you should consider that individual user behaviors make it an unreliable metric with or without auto-save enabled.

Disable auto-save for the organization


If you determine that auto-save will cause problems with any extensions you are using, you can disable it for your
organization. There is no setting to disable auto-save for individual entities or forms.
1. Go to Settings > Administration.
2. Choose System Settings.
3. For the Enable auto-save for all forms option, select No.

Disable auto-save for a form


If you want to disable auto-save for specific entity forms, you can add code to the OnSave event in an entity.
NOTE
Auto-save will be disabled for the form, but data will still be saved when you select the button in the lower-right corner. If
you attempt to navigate away from a form or close a form where data has been changed they will get prompt to save their
changes before they are allowed to navigate away or close the form.

1. Sign in to Power Apps.


2. Expand Data, select Entities, select the entity that you want, and then select the Forms tab.
3. Open the form you want to edit.
4. Select Switch to classic to edit the form in the classic form designer.
5. Create a JavaScript web resource and add it to the form:
a. In the form editor, in the Form group, choose Form Properties.
b. On the Events tab, below Form Libraries choose Add.
c. In the Look Up Record dialog box, choose New.
d. Enter the following information in the web resource form:

Name preventAutoSave

Display Name Prevent Auto Save

Type Script (JScript)

e. Next to the Type field, choose Text Editor.


f. In the Source field, paste the following code:

function preventAutoSave(econtext) {
var eventArgs = econtext.getEventArgs();
if (eventArgs.getSaveMode() == 70 || eventArgs.getSaveMode() == 2) {
eventArgs.preventDefault();
}
}

g. Choose OK to close the text editor.


h. Choose Save to save the web resource and then close the web resource window.
i. In the Look Up Record dialog the new web resource you created will be selected. Choose Add to
close the dialog.
6. Configure the OnSave event:
a. In the Form Properties window, in the Event Handlers section, set Event to OnSave.
b. Select Add.
c. In the Handler Properties window, set Library to the web resource you added in the previous step.
d. Type ' preventAutoSave ' in the Function field. This is case sensitive. Do not include quotation marks.
e. Make sure that Enabled is checked.
f. Check Pass execution context as first parameter.

IMPORTANT
If you do not do this the script will not work.

The Handler Properties dialog should look like this. The customization prefix: "new_" may vary
based on the customization prefix set for the default publisher for your organization.

g. Select OK to close the Handler Properties dialog.


h. If there are any other event handlers for the OnSave event, use the green arrows to move this one to
the top.
7. Select OK to close the Form Properties dialog.
8. Select Save and Close to close the form.
9. In the solution explorer, select Publish All Customizations.
After you apply this script to the OnSave event, when people edit a record using this form the message unsaved
changes will appear in the bottom right corner of the form just as it would if auto-save was not disabled. But this
message will not go away until people select the button next to it.

Next steps
Create and design forms
Add or remove the SharePoint documents tab to the
main form for any entity
1/14/2020 • 3 minutes to read • Edit Online

[This topic is pre-release documentation and is subject to change.]


Adding a tab on an entity main form to display SharePoint documents helps users discover and use the SharePoint
integration features that are available in a model-driven app.

IMPORTANT
To use this feature you must enable document management. More information: Manage your documents using SharePoint

Add the documents tab in the FormXML


1. Create a new solution. Sign-in to Power Apps and go to Solutions, select New solution and then enter the
required and optional information. More information: Create a solution
2. Add the entity to the solution where you want to add the documents tab on the main form. All standard and
custom entities are supported. More information: Add an existing component to a solution
3. Include the form for the entity in the solution, such as the main form for the account entity. Next to the
entity, select ..., and then select Edit. Select the Forms tab. If the form you want is missing, add it.
4. Add a one-column tab to the main form. To do this, in the form designer select an area on the form canvas,
select Add Component, and then select 1 Column Tab.
5. In the form designer select the New Tab on the form designer canvas, select Add Field, and add a field
such as Address 1: City from the left pane. You can use any text or numeric field for the tab.

6. Rename the tab label. To do this, select New Tab, and in the right properties pane replace New Tab with
something more descriptive, such as Files.
7. Select Save, select Publish, and then close the form designer.
8. From the Power Apps maker home page, select Solutions, select the solution, and the select Export to
export the solution as an unmanaged solution. More information: Export solutions
9. Extract the solution and open the customization.xml file with an XML or text editor.
10. In the customization.xml search for label description="Files" (or whatever you named the tab label in the
previous step).
11. Scroll down to the control id="field name" element, such as control id="address1_city" and replace the
entire element with the XML sample in this topic.
12. Make these modifications to the XML sample.
a. Locate the RelationshipName element and replace it with the schema name that appears as
entityLogicalName_SharePointDocument. For example, for the accounts entity the schema name for the
relationship is Account_SharePointDocument, which is the schema name for the XML sample in this topic.
To find the name for a different entity, go to Settings > Customizations > Customize the System >
Entities > select the entity > select 1:N Relationships. Locate the Related Entity of type
SharePointDocument.

b. Create a globally unique identifier (guid) and replace the existing uniqueid guid located in the control
element you pasted in the previous step while preserving the curly braces {}.

c. Save your changes to customizations.xml.


13. Open the solution.xml file and increment the Version element value. For example, from 1.1.0.0 to 1.2.0.0.
14. Package all solution files into a compressed (zipped) folder and import in to your environment. If you
receive an error that you must delete the previous solution, do so. More information: Import, update, and
upgrade a solution

XML sample for adding the documents tab to a form


<control id="DocumentSubGrid" classid="{E7A81278-8635-4d9e-8D4D-59480B391C5B}" indicationOfSubgrid="true"
uniqueid="{9cd66b5c-8b7a-6433-c5a5-46a7245dd534}">
<parameters>
<ViewId>{0016F9F3-41CC-4276-9D11-04308D15858D}</ViewId>
<IsUserView>false</IsUserView>
<RelationshipName>Account_SharepointDocument</RelationshipName>
<TargetEntityType>sharepointdocument</TargetEntityType>
<AutoExpand>Fixed</AutoExpand>
<EnableQuickFind>false</EnableQuickFind>
<EnableViewPicker>true</EnableViewPicker>
<ViewIds />
<EnableJumpBar>false</EnableJumpBar>
<ChartGridMode>Grid</ChartGridMode>
<VisualizationId />
<IsUserChart>false</IsUserChart>
<EnableChartPicker>false</EnableChartPicker>
<RecordsPerPage>10</RecordsPerPage>
<HeaderColorCode>#F3F3F3</HeaderColorCode>
</parameters>
</control>

Remove the documents tab


1. Sign in to Power Apps, in the left pane expand Data, and then select Entities.
2. Select the entity you want, select the Forms tab, and then open the form where the file tab needs to be
removed.
3. Select the Files tab, and then on the form designer toolbar, select Delete.

4. On the form designer toolbar, select Publish.


See also
Manage your documents using SharePoint
Embed a canvas app on a model-driven form
12/3/2019 • 2 minutes to read • Edit Online

Canvas apps enable makers to easily design and create custom layouts using the low -code, WYSIWYG canvas
app designer. Canvas apps also enable makers to connect and display data from over 200 data sources on their
forms.
With embedded canvas apps, makers can bring the power of canvas apps to their model-driven forms. Using
embedded canvas apps, you can easily create rich visual areas on a form and display data from a variety of
sources right next to data from the Common Data Service.

Canvas apps are embedded in model-driven forms in the same way other custom controls are added. An
embedded canvas app includes rich data integration capabilities that bring in contextual data from the host
model-driven form to the embedded canvas app. More information: Add an embedded canvas app on a model-
driven form.
After you have added an embedded canvas app to your model-driven form, learn how to share your embedded
canvas app with other users. More information: Share an embedded canvas app.
For guidelines on working with embedded canvas apps as well as helpful tips to troubleshoot any issues you
might encounter, please refer to: Guidelines on working with embedded canvas apps.

See also
What are canvas apps in Power Apps?
Add and configure a canvas-app control in Power Apps
Overview of canvas-app connectors for Power Apps
Add an embedded canvas app on a model-driven form
Edit a canvas app embedded on a model-driven form
Customize the screen size and orientation of a canvas app embedded on a model-driven form
Perform predefined actions on the host form from within an embedded canvas app
ModelDrivenFormIntegration control's properties and actions
Share an embedded canvas app
Guidelines on working with embedded canvas apps
Migrating embedded canvas apps on model-driven forms created using the public preview release to latest
Add an embedded canvas app on a model-driven
form
12/3/2019 • 5 minutes to read • Edit Online

This topic explains how to embed a new canvas app on a model-driven form.
Imagine that you want to create a new canvas app and embed it on a main form for the Accounts entity. To do
this, follow these steps:
1. Sign in to Power Apps.
2. Create or edit the main form of an entity, Accounts entity in our example.
3. In the command bar, select Switch to classic to open the form in the classic form designer.
4. In the classic form designer, select the section on the form where you want the embedded canvas app to
appear.
5. Using the field pane, add a required field, such as Account Name.

IMPORTANT
Always use a required field that is guaranteed to have a value. If your field does not have a value, your embedded
canvas app will not refresh in response to any change in data on the host model-driven form.

6. With the field selected, on the Home tab in the Edit group, select Change Properties.
7. On the Field Properties dialog box, select the Controls tab.
8. On the Controls tab, select Add Control.
9. On the Add Control dialog box, in the list of available controls, select Canvas app and then select Add.
10. On the Field Properties dialog box, in the list of controls select Canvas app, and then select the Web option.
11. In the section below the controls list, the list of properties available to the canvas app control are displayed.
The Entity name property specifies the entity that will provide the data to your embedded canvas app.
It will be set to the entity that contains the field you added in an earlier step.
Notice that, even though this property appears changeable, changing it has no effect on the
embedded canvas app. It is meant only to serve as a reference for you.
The App ID property specifies the ID of the embedded canvas app. It will be automatically generated
and filled-in for you when the canvas app is created.
Notice that any change to the App ID value breaks the link from the model-driven form to the
embedded canvas app.
12. Select Customize to create or edit the canvas app. This opens Power Apps Studio in a new tab.

NOTE
If opening Power Apps Studio is blocked due to a web browser pop-up blocker you must enable the
make.powerapps.com site or temporarily disable the pop-up blocker and then select Customize again.

13. In Power Apps Studio notice that there is a special ModelDrivenFormIntegration control in the left pane.
This control is responsible for bringing contextual data from the host model-driven form to the embedded
canvas app.
14. Observe that a canvas app form control was automatically added to your embedded canvas app and displays
the data being passed to it from the host model-driven form via the ModelDrivenFormIntegration control.
15. Select the View tab, and then select Data sources. Notice that a data source for the parent entity of your host
model-driven form, Accounts in this case, was automatically added to your embedded canvas app.
16. Select the Form1 control and observe that the DataSource property is set to Accounts.
17. With the Form1 control still selected, observe that the Item property is set to
ModelDrivenFormIntegration.Item.

NOTE
The embedded canvas app has full access to record from the host model-driven form via
ModelDrivenFormIntegration.Item. As an example, to get the value of a field with the name accountnumber and
display name Account Number, you can use ModelDrivenFormIntegration.Item.accountnumber or
ModelDrivenFormIntegration.Item.'Account Number'.

18. In the property pane on the right, next to Fields, select Edit fields.
19. Select + Add field to add another field to the canvas app form or reorder existing fields using drag and drop.
Close the data pane when you are done adding and reordering fields.
20. Select the File tab, and then select Save.
21. Select the The cloud tab. Provide a unique name for the app and then select Save located on the lower right.
Note the following:
Saving an app for the first time automatically publishes the app.
On subsequent saves, select Publish and then select Publish this version to make your changes
available.
22. On the menu, select Back.
23. Select the browser tab that has the classic form designer open. Observe that the App ID property of the
canvas app control now has a value automatically filled in.

NOTE
The form designer has a direct link with Power Apps Studio that was opened in another browser tab in an earlier
step.
The form designer listens for the App ID to be sent to it.
The App ID is sent to the form designer when the app is saved.

24. On the Field Properties dialog box, select the Display tab.
25. Clear Display label on the form and then select OK.
If you already have a canvas app embedded on this form, a message is displayed that “Only one canvas
app can be enabled on a form.” To add the new canvas app you must first disable the current embedded
canvas app. Then, enable the new embedded canvas app.
26. On the Home tab, select Save, and then select Publish.
After you have added an embedded canvas app to your model-driven form, share your embedded canvas app
with other users. More information: Share an embedded canvas app.
When users open a model-driven app (Unified Interface only) that includes the form you have modified, they see
the embedded canvas app on the form. Changing the record displayed on the main form changes the data
context that is passed to the form, and the embedded app refreshes to show the relevant data.
This topic showed you how to get started with embedding a canvas app in a model-driven form. You can further
customize the embedded canvas app to connect and bring in data from a variety of data sources. Use the Filter,
Search, and LookUp functions and the context passed in from the host model-driven form to filter or find specific
records in those data sources. Use the WYSIWYG canvas app editor to easily design the interface to match your
requirements.
See also
Embed a canvas app on a model-driven form
Edit a canvas app embedded on a model-driven form
Customize the screen size and orientation of a canvas app embedded on a model-driven form
Perform predefined actions on the host form from within an embedded canvas app
ModelDrivenFormIntegration control's properties and actions
Share an embedded canvas app
Guidelines on working with embedded canvas apps
Migrating embedded canvas apps on model-driven forms created using the public preview release to latest
Edit a canvas app embedded on a model-driven
form
12/3/2019 • 2 minutes to read • Edit Online

This topic explains how to edit a canvas app embedded on a model-driven form.

Edit the canvas app directly


You can edit a canvas app embedded on a model-driven form just like any other canvas app. For steps on editing
a canvas app see: Edit a canvas app

Edit the canvas app via the host model-driven form


An alternate option is to edit the embedded canvas app via the host model-driven form.
Imagine that you want to edit a canvas app embedded on a form named Account Main Form for the Accounts
entity. To do this, follow these steps:
1. Sign in to Power Apps.
2. Edit the form named Account Main Form for the Accounts entity.
3. In the command bar, select Switch to classic to open the form in the classic form designer.
4. In the classic form designer, select the field that is customized to display the embedded canvas app.
5. With the field selected, on the Home tab in the Edit group, select Change Properties.
6. On the Field Properties dialog box, select the Controls tab.
7. In the Field Properties dialog box, in the list of controls select Canvas app.
8. In the section below the controls list, select Customize to edit the canvas app. This opens the canvas app for
editing, in Power Apps Studio, in a new tab.

NOTE
If opening Power Apps Studio is blocked due to a web browser pop-up blocker you must enable the
make.powerapps.com site or temporarily disable the pop-up blocker and then select Customize again.

9. When you are done making changes, select the File tab, and then select Save.
10. To make your changes available to end-users select Publish and then select Publish this version.

See also
Embed a canvas app on a model-driven form
Add an embedded canvas app on a model-driven form
Customize the screen size and orientation of a canvas app embedded on a model-driven form
Perform predefined actions on the host form from within an embedded canvas app
ModelDrivenFormIntegration control's properties and actions
Share an embedded canvas app
Guidelines on working with embedded canvas apps
Migrating embedded canvas apps on model-driven forms created using the public preview release to latest
Customize the screen size and orientation of a
canvas app embedded on a model-driven form
12/2/2019 • 2 minutes to read • Edit Online

This topic explains how to customize the screen size and orientation of a canvas app embedded on a model-
driven form.
1. Follow the steps to add or edit an embedded canvas app on a model-driven form.
Add an embedded canvas app on a model-driven form
Edit a canvas app embedded on a model-driven form
2. With the canvas app open in Power Apps Studio, select the File tab, and then select App settings.
3. Select the Screen size + orientiation tab. By default, the Size is set to Custom.
4. Select from the list of available Size and Orientation options or select Custom and provide desired values
for Width and Height.

NOTE
When Size is set to Custom, Orientation is disabled since it is determined based on the Width and Height you
specify.

5. When you are done making changes, select the File tab, and then select Save.
6. To make your changes available to end-users select Publish and then select Publish this version.

See also
Embed a canvas app on a model-driven form
Add an embedded canvas app on a model-driven form
Edit a canvas app embedded on a model-driven form
Perform predefined actions on the host form from within an embedded canvas app
ModelDrivenFormIntegration control's properties and actions
Share an embedded canvas app
Guidelines on working with embedded canvas apps
Migrating embedded canvas apps on model-driven forms created using the public preview release to latest
Perform predefined actions on the host model-
driven form from within an embedded canvas app
12/2/2019 • 3 minutes to read • Edit Online

Embedded canvas apps provide the ability to perform predefined actions on the host model-driven form. These
actions enable makers to navigate, refresh and save the host model-driven form. Using these actions, an
embedded canvas app can act as a more integral part of the model-driven form and the model-driven app.
The ModelDrivenFormIntegration object now includes the following new methods to enable makers to
perform actions on the host model-driven form.
NavigateToMainForm(entityName, mainFormName, recordId)
Navigates the host model-driven form to a main form and displays the specified record.
entityName - A required string parameter that specifies the parent entity of the main form.
formName - A required string parameter that specifies the name of the main form to navigate to.
recordId - A required string parameter, that specifies the ID of the record to display in the main form.
Calling the NavigateToMainForm method can show the following error messages.

ERROR MESSAGE TROUBLESHOOTING GUIDANCE

Entity not found: [EntityName] Please check the value of the entityName parameter and
ensure it is a valid entity name and that the user has access
to it.

Form not found: [FormName] Please check the value of the mainFormName parameter and
ensure it is a valid main form name and that the user has
access to it.

There was a problem loading the record. Please check the value of the recordId parameter and ensure
it is a valid record ID and that the user has access to it.

NavigateToView(entityName, viewName )
Navigates the host model-driven form to a view.
entityName - A required string parameter that specifies the parent entity of the view.
viewName - A required string parameter that specifies the name of the main form to navigate to.
Calling the NavigateToView method can show the following error messages.

ERROR MESSAGE TROUBLESHOOTING GUIDANCE

Entity not found: [EntityName] Please check the value of the entityName parameter and
ensure it is a valid entity name and that the user has access
to it.

View not found: [ViewName] Please check the value of the viewName parameter and
ensure it is a valid view name and that the user has access to
it.

OpenQuickCreateForm(entityName )
Opens the default quick create form for an entity.
entityName - A required string parameter that specifies the parent entity of the quick create form.
Calling the OpenQuickCreateForm method can show the following error messages.

ERROR MESSAGE TROUBLESHOOTING GUIDANCE

Entity not found: [EntityName] Please check the value of the entityName parameter and
ensure it is a valid entity name and that the user has access
to it.

RefreshForm(showPrompt)
Refreshes the data on the host model-driven form.
showPrompt - A required boolean parameter that indicates if a confirmation prompt should be displayed to
the user before saving any unsaved data on the host model-driven form. Values should be "true" or "false".
Calling the RefreshForm method can show the following error messages.

ERROR MESSAGE TROUBLESHOOTING GUIDANCE

Please use "true" or "false" as the parameter value. Please check the value of the showPrompt parameter and
ensure that it is either "true" or "false".

SaveForm()
Saves the data on the host model-driven form.

NOTE
If you do not see the IntelliSense for the methods to perform predefined actions in embedded canvas apps that were
created prior to the functionality being made available; save, close and re-open the app.

See also
Embed a canvas app on a model-driven form
Add an embedded canvas app on a model-driven form
Edit a canvas app embedded on a model-driven form
Customize the screen size and orientation of a canvas app embedded on a model-driven form
ModelDrivenFormIntegration control's properties and actions
Share an embedded canvas app
Guidelines on working with embedded canvas apps
Migrating embedded canvas apps on model-driven forms created using the public preview release to latest
ModelDrivenFormIntegration control properties and
actions
12/2/2019 • 2 minutes to read • Edit Online

Canvas apps embedded on model-driven forms contain a special control named


ModelDrivenFormIntegration. This control is responsible for bringing contextual data from the host model-
driven form to the embedded canvas app.
This topic explains the properties and actions available on the ModelDrivenFormIntegration control.

PROPERTY OR ACTION DESCRIPTION

DataSource Should be set to the data source connected to the parent


entity of the host model-driven form.
Automatically set when embedding a new canvas app.

Item Read-only property that enables the embedded canvas app


to access the record from the host model-driven form.
As an example, to get the value of a field with the name
accountnumber and display name Account Number, you can
use ModelDrivenFormIntegration.Item.accountnumber or
ModelDrivenFormIntegration.Item.'Account Number'.

OnDataRefresh The formula in this property is evaluated when the host


model-driven form saves data.
Use it to refresh the data source connected to the parent
entity of the host model-driven form and to perform other
actions like setting or updating variables.
As an example, setting it to the formula below will refresh the
Accounts data source and set a variable named
CurrentAccountNumber to the value of the Account Number
field of the current record.
Refresh(Accounts); Set(CurrentAccountNumber,
ModelDrivenFormIntegration.Item.'Account Number')

RefreshForm Refreshes the data on the host model-driven form.


See Perform predefined actions on the host form for details.

SaveForm Saves the data on the host model-driven form.


See Perform predefined actions on the host form for details.

NavigateToMainForm Navigates the host model-driven form to a main form and


displays the specified record.
See Perform predefined actions on the host form for details.

NavigateToView Navigates the host model-driven form to a view.


See Perform predefined actions on the host form for details.

OpenQuickCreateForm Opens the default quick create form for an entity.


See Perform predefined actions on the host form for details.
PROPERTY OR ACTION DESCRIPTION

Data Read-only property used by the framework to send some key


data from the host model-driven form to the embedded
canvas app.
Do not use this property. Use Item to access the record from
the host model-driven form.

See also
Embed a canvas app on a model-driven form
Add an embedded canvas app on a model-driven form
Edit a canvas app embedded on a model-driven form
Customize the screen size and orientation of a canvas app embedded on a model-driven form
Perform predefined actions on the host form from within an embedded canvas app
Share an embedded canvas app
Guidelines on working with embedded canvas apps
Migrating embedded canvas apps on model-driven forms created using the public preview release to latest
Share an embedded canvas app
12/3/2019 • 2 minutes to read • Edit Online

This topic explains how to share an embedded canvas app that you have already created.
After you have created and added an embedded canvas app to a model-driven form you will need to take steps
to ensure that all users that have access to the model-driven form also have access to the canvas app and the
data that it uses. Please refer to the following guidelines:
Share your embedded canvas app with Everyone in your organization or a security group or specific users.
More information: Share an app
Ensure that users have appropriate permissions for any Common Data Service entities that your embedded
canvas app uses. More information: Manage entity permissions
Ensure that users have appropriate permission for data on any cloud services that your embedded canvas
app uses, such as SharePoint or OneDrive. The steps to share are specific to each cloud service and beyond
the scope of Power Apps.

NOTE
Currently, you can’t use the Canvas App privilege in a security role to grant app users access to either an embedded or
standalone canvas app.

Embedded canvas apps are also solution aware. By default embedded canvas apps are created in the same
solution as the host model-driven form. To move the embedded canvas app from one environment to another
export and import embedded canvas apps as a part of a solution just like any other component.

See also
Embed a canvas app on a model-driven form
Add an embedded canvas app on a model-driven form
Edit a canvas app embedded on a model-driven form
Customize the screen size and orientation of a canvas app embedded on a model-driven form
Perform predefined actions on the host form from within an embedded canvas app
ModelDrivenFormIntegration control's properties and actions
Guidelines on working with embedded canvas apps
Migrating embedded canvas apps on model-driven forms created using the public preview release to latest
Guidelines on working with embedded canvas apps
2/12/2020 • 5 minutes to read • Edit Online

This topic provides guidelines on working with embedded canvas apps as well as helpful tips to troubleshoot any
issues you might encounter.
Embedded canvas apps are only supported with Unified Interface model-driven apps.
You can only enable one embedded canvas app per form.
You can have multiple embedded canvas apps added to the form but can only enable one at a time.
If you try to enable more than one embedded canvas app on a model-driven form you will get a
message that reads “Only one canvas app can be enabled on a form.”
To enable or disable an embedded canvas app see Enable an embedded canvas app and Disable an
embedded canvas app.
When adding an embedded canvas app to a model-driven form always use a required field that is guaranteed
to have a value. If your field does not have a value your embedded canvas app will not refresh in response to
any change in data on the host model-driven form.
Publishing a model-driven form does not also publish the embedded canvas app.
Embedded canvas apps need to be published independent of the host model-driven form. More
information: Publish an app.
If opening Power Apps Studio to create or edit an embedded canvas app via the Customize button in the
canvas app control properties is blocked due to a web browser pop-up blocker, you must enable the
make.powerapps.com site or temporarily disable the pop-up blocker and then select Customize again.
Embedded canvas apps are not displayed when creating a new record since they need a record context to be
passed to them.
The ModelDrivenFormIntegration.Item object is read-only.
To write back data you must use the Common Data Service connector. More information: Common
Data Service
Embedded canvas apps can only be created via the host model-driven form.
Adding existing canvas apps as embedded on model-driven forms is currently not supported.
Support to embed an existing canvas app in a model-driven form using App ID will be provided in a
future update.
When you view a model-driven form with an embedded canvas app, if you see an error message that reads
"Sorry we didn't find that app" make sure that the embedded canvas app is in the same solution as the
model-driven form.
When you view a model-driven form with an embedded canvas app, if you see an error message that reads
"It looks like you don’t have access to this app. Ask its owner to share it with you" make sure that the author
has shared the embedded canvas app with you. More information: Share an embedded canvas app.
Adding a canvas app on the sub-grid control is no longer available.
In the preview release, makers were able to add a canvas app on a sub-grid control. With canvas app
embedding on model-driven forms now generally available, adding an embedded canvas app on a
model-driven form is streamlined to the field.
This makes it easier for makers since they don't have to decide up front whether to pass the current
(main form) record as data context or a list of records related to the current (main form) record.
Makers always start with a field and can access both the current (main form) record or a list of records
related to the current (main form) record.
To access the list of related records in the canvas app, makers can use the Common Data Service
connector and Filter function with the Improve data sources experience and Common Data Service
views capability enabled in the canvas app.
For example, to access the Active Contacts view of the Contacts entity, makers can use: Filter (Contacts,
'Contacts (Views)'.'Active Contacts' ).
Existing canvas apps that use the sub-grid control will continue to work. However, we recommend that
you migrate these apps to use a field instead. More information: Migrating embedded canvas apps on
model-driven forms that use a list of records related to the current (main form) record for details.

Enable an embedded canvas app


1. Select the field that is customized to display as an embedded canvas app.
2. In the Field Properties dialog, select the Controls tab.
3. In the list of controls select Canvas app and then select the Web option.
4. Select OK.

Disable an embedded canvas app


1. Select the Field that is customized to display as an embedded canvas app.
2. In the Field Properties dialog, select the Controls tab.
3. In the list of controls select the default control and then select the Web option.
4. Select OK.

Known issues and limitations with embedded canvas apps


The canvas app custom control is only supported for use with the Web client type. Currently, the Phone and
Tablet client types aren't supported.
The ModelDrivenFormIntegration control does not provide a value for fields of a related entity.
For example, when the ModelDrivenFormIntegration control is connected to the Accounts entity, using
ModelDrivenFormIntegration.Item.’Primary Contact’’.Full Name’ will not return a value.
To access fields of a related entity makers can use either of the expressions listed here:
LookUp (Accounts, Account = GUID (First(ModelDrivenFormIntegration.Data ).ItemId )).'Primary
Contact'.'Full Name'
ItemId is empty at authoring time but will have a value at runtime.
LookUp (Accounts, Account = ModelDrivenFormIntegration.Item.Account).'Primary
Contact'.'Full Name' (This expression is easier to read, but the previous expression will perform
slightly better.)
You can’t use the Canvas App privilege in a security role to grant app users access to either an embedded or
standalone canvas app. For more information on sharing an embedded canvas app, please refer to: Share an
embedded canvas app.
If you write back the same data that is being displayed in the host model-driven form, the form will continue
to display old data until it is refreshed. An easy way to do that is to use the RefreshForm method.

See also
Embed a canvas app on a model-driven form
Add an embedded canvas app on a model-driven form
Edit a canvas app embedded on a model-driven form
Customize the screen size and orientation of a canvas app embedded on a model-driven form
Perform predefined actions on the host form from within an embedded canvas app
ModelDrivenFormIntegration control's properties and actions
Share an embedded canvas app
Migrating embedded canvas apps on model-driven forms created using the public preview release to latest
Migrate embedded canvas apps on model-driven
forms created using the public preview release
12/3/2019 • 4 minutes to read • Edit Online

IMPORTANT
With the latest release, embedded canvas apps on model-driven forms are generally available. Any embedded canvas apps
on model-driven forms created using the public preview release should be migrated to new embedded canvas apps
created using the latest release. Support for embedded canvas apps on model-driven forms created using the public
preview release will soon be deprecated.

To migrate an embedded canvas app on a model-driven form created using the public preview release to the
latest, makers first need to create a new embedded canvas app using the latest release. Makers can then copy
over the controls from the existing embedded canvas app to the new one, add required data sources and update
broken references, if any. Detailed steps are provided below.
1. Sign in to Power Apps.
2. Open the embedded canvas app created using the public preview release for editing in Power Apps Studio.
For steps on editing a canvas app see: Edit a canvas app.
3. In a new browser tab, follow the steps to add a new embedded canvas app on a model-driven form.
4. Copy the controls from the embedded canvas app created using the public preview release to the new
embedded canvas app, one screen at a time using the steps below.
a. Select the browser tab from Step 2, that has the embedded canvas app, created using the public
preview release, open in Power Apps Studio.
b. Select a screen to copy controls from.
c. Use Ctrl + A to select all controls on the screen.
d. Use Ctrl + C to copy all selected controls.
e. Select the browser tab from Step 3, that has the new embedded canvas app created using the latest
release.
f. Select a screen or add a new one.
g. Use Ctrl + V to paste the controls on the selected screen.
h. Repeat the steps to copy each screen.
5. When you are done copying all the screens, select the browser tab from Step 3, that has the new embedded
canvas app created using the latest release.
6. Update all the places where the record from the host model-driven form is being accessed. Replace
First(ModelDrivenFormIntegration.Data) with ModelDrivenFormIntegration.Item.
7. Add any missing datasources in the new embedded canvas app.
8. Update all broken references in the new embedded canvas app.
9. When you are done making changes, select the File tab, and then select Save.
10. To make your changes available to end-users select Publish and then select Publish this version.

Migrating embedded canvas apps on model-driven forms that use a


list of records related to the current (main form) record
In the preview release, to embed a canvas app on a model-driven form, makers had to decide up front if they
wanted to pass the current (main form) record as data context or a list of records related to the current (main
form) record. They then had to add the canvas app control to either the field or sub-grid control.
With the latest release, adding an embedded canvas app on a model-driven form is simplified and streamlined to
the field only. Makers can still easily access the list of related records directly in the canvas app using the
Common Data Service connector.
To migrate an embedded canvas app on a model-driven form that uses a list of records related to the current
(main form) record, please follow the steps below.
1. Follow the steps in the section above to migrate embedded canvas apps on model-driven forms created using
the public preview release to the latest.
2. Using the Common Data Service connector, add a datasource for the related entity to the app. To learn how
add a data source in a canvas app please refer to Add a data connection to a canvas app in Power Apps.
3. When using the datasource of the related entity for a control such as Gallery or Data table, use the Filter
function to filter the records to the ones that are related to the current (main form) record. The current (main
form) record is available via ModelDrivenFormIntegration.Item.

NOTE
The embedded canvas app has full access to record from the host model-driven form via
ModelDrivenFormIntegration.Item. As an example, to get the value of a field with the name accountnumber and
display name Account Number, you can use ModelDrivenFormIntegration.Item.accountnumber or
ModelDrivenFormIntegration.Item.'Account Number'.

4. With recent updates Common Data Service now also provides support to use entity views as a filter. See this
blog post for details: Improved data source selection and Common Data Service views.

See also
Embed a canvas app on a model-driven form
Add an embedded canvas app on a model-driven form
Edit a canvas app embedded on a model-driven form
Customize the screen size and orientation of a canvas app embedded on a model-driven form
Perform predefined actions on the host form from within an embedded canvas app
ModelDrivenFormIntegration control's properties and actions
Share an embedded canvas app
Guidelines on working with embedded canvas apps
Embed a Power BI report in a model-driven system
form
12/2/2019 • 5 minutes to read • Edit Online

You can use Power BI reports in Power Apps model-driven apps to bring rich reporting and analytics to your
system forms and empower your users to accomplish more. This unlocks the power to aggregate data across
systems, and tailor it down to the context of a single record.

Prerequisites
Embedding Power BI content is an optional feature and is disabled on all environments by default. You must enable
it before you can embed Power BI content. More information: Enable Power BI visualizations in the organization.
This feature requires exporting a solution, modifying it to add the xml snippet, and then importing back into the
environment. Be sure to import the changes on your target environment via a managed solution only. See Import,
update, and export solutions for guidance on installing an update to an existing managed solution.

Embed without contextual filtering


You can use your Power BI reports and tiles by simply embedding them, and get the exact same report. This does
not involve contextualizing them to the current model-driven form, and hence you get the same report or tile on all
records of the entity. For example, the following report shows the geographic location of all accounts at once, and is
useful to show summary information.

You can embed a section that hosts Power BI reports and tiles in your system forms by adding the following code
snippet inside the <sections> block of the form XML. Then, import the solution in the target environment.
<section id="{d411658c-7450-e1e3-bc80-07021a04bcc2}" locklevel="0" showlabel="true" IsUserDefined="0"
name="tab_4_section_1" labelwidth="115" columns="1" layout="varwidth" showbar="false">
<labels>
<label languagecode="1033" description="Unfiltered Power BI embedding demo"/>
</labels>
<rows>
<row>
<cell id="{7d18b61c-c588-136c-aee7-03e5e74a09a1}" showlabel="true" rowspan="20" colspan="1" auto="false">
<labels>
<label languagecode="1033" description="Accounts (Parent Account)"/>
</labels>
<control id="unfilteredreport" classid="{8C54228C-1B25-4909-A12A-F2B968BB0D62}">
<parameters>
<PowerBIGroupId>00000000-0000-0000-0000-000000000000</PowerBIGroupId>
<PowerBIReportId>544c4162-6773-4944-900c-abfd075f6081</PowerBIReportId>
<TileUrl>https://xyz.powerbi.com/reportEmbed?reportId=544c4162-6773-4944-900c-abfd075f6081</TileUrl>
</parameters>
</control>
</cell>
</row>
<row/>
</rows>
</section>

IMPORTANT
Be sure to use the control classid="{8C54228C-1B25-4909-A12A-F2B968BB0D62}" as indicated in the XML sample.

This table describes the properties in the previous example.

PROPERTY DESCRIPTION

PowerBIGroupId The Power BI workspace Id. The user's default workspace is


always 00000000-0000-0000-0000-000000000000. You can
check the Id of any workspace by looking at its URL. For
example, https://xyz.powerbi.com/groups/0ddbe381-256d-
44bc-93de-34e47f3d9ab4/.

PowerBIReportId The Power BI report Id. Replace this with the report that you
want to embed. You can check the Id of any report by looking
at its URL. For example,
https://xyz.powerbi.com/groups/me/reports/544c4162-6773-
4944-900c-abfd075f6081.

TileUrl The Power BI report or tile URL that you want to embed. Be
sure to use the correct Power BI instance name (replace
msit.powerbi.com with your own) and report Id (replace
reportId=544c4162-6773-4944-900c-abfd075f6081 with
your own). For example,
https://xyz.powerbi.com/reportEmbed?reportId=544c4162-
6773-4944-900c-abfd075f6081.

Embed with contextual filtering


You can make the Power BI reports and tiles more meaningful by applying contextual filters to the current model-
driven form, so that the report or tile is filtered based on attributes of the current record. For example, the following
report shows the geographic location of an account, by filtering the Power BI report using the account name. This
allows a single report to show contextualized information for all records of the entity.
The filtering is done by adding a <PowerBIFilter> element in the <parameter> block as shown here. You can use
any attribute of the form's entity to construct the filter expression. More information: Constructing Filters to
understand how to create your own filters.

<control id="filteredreport" classid="{8C54228C-1B25-4909-A12A-F2B968BB0D62}">


<parameters>
<PowerBIGroupId>00000000-0000-0000-0000-000000000000</PowerBIGroupId>
<PowerBIReportId>544c4162-6773-4944-900c-abfd075f6081</PowerBIReportId>
<TileUrl>https://xyz.powerbi.com/reportEmbed?reportId=544c4162-6773-4944-900c-abfd075f6081</TileUrl>
<PowerBIFilter>{"Filter": "[{\"$schema\":\"basic\",\"target\":{\"table\":\"My Active
Accounts\",\"column\":\"Account Name\"},\"operator\":\"In\",\"values\":[$a],\"filterType\":1}]", "Alias":
{"$a": "name"}}</PowerBIFilter>
</parameters>
</control>

Note that this uses the same control as the unfiltered report embedding, and hence the control class id remains
unchanged.
This table describes any additional properties used in the previous example.

PROPERTY DESCRIPTION

PowerBIFilter The filter expression that contextualizes the Power BI report by


passing the form attributes as parameters. To make it more
readable, the filter is constructed as shown here.
{
"Filter": "[{
\"$schema\":\"basic\",
\"target\":{
\"table\":\"My Active Accounts\",
\"column\":\"Account Name\"
},
\"operator\":\"In\",
\"values\":[$a, $b],
\"filterType\":1
}]",
"Alias": {
"$a": "firstname",
"$b":"lastname"
}
}

The target part of the previous expression identifies the table and the column to apply the filters on. The operator
identifies the logic and values identify the data passed from the Power Apps model-driven app. To parameterize in
a generic way, the values are constructed by aliasing. In the previous expression, the value of an account's
firstname and lastname are passed, and either of them is searched in the Account Name column in the Power
BI report. Note that firstname and lastname are the unique names of attributes of the account entity, whose value
will be passed here.
You can create more complex filter expressions by looking at examples from Constructing Filters and providing the
appropriate values for $schema and filterType. Be sure to escape every literal in the filter part using ", so that the
JSON is generated correctly.

Known issues and limitations


1. This integration is available only in the Unified Interface client, on supported web browsers and mobile
devices.
2. Opening this form in the Power Apps form designer will not show the control in a meaningful way. This is
because the control is customized outside of the form designer.
3. Users will be authenticated into Power BI automatically with their Power Apps username and password. If a
Power BI account with matching credentials doesn’t exist, a sign in prompt is displayed as illustrated here.

4. No data will display if an incorrect account is used to log into Power BI. To sign in with the correct
credentials, sign out, and then sign in again.
5. The view of the report data shown inside Power Apps is the same as that in Power BI, and Power Apps
security roles and privileges don't affect the data that is displayed. Hence, the data is essentially the same as
what the creator of the Power BI dataset would see. To apply data access restrictions similar to Power Apps
security roles and teams, use Row -level security (RLS ) with Power BI.
6. If the form doesn’t show the Power BI report after importing the solution and publishing customizations,
open it in the model-driven form editor and save it, so that the form JSON is regenerated.
See also
Embed a Power BI dashboard in a Power Apps model-driven personal dashboard
Use Power BI with Dynamics 365 apps
Import, update, and export solutions
Understand model-driven app views
3/26/2020 • 4 minutes to read • Edit Online

With Power Apps apps, use views to define how a list of records for a specific entity is displayed in the
application. A view defines:
The columns to display
How wide each column should be
How the list of records should be sorted by default
What default filters should be applied to restrict which records will appear in the list
A drop-down list of views is frequently displayed in the application so that people have options for different
views of entity data.
The records that are visible in individual views are displayed in a list, sometimes called a grid, which frequently
provides options so that people can change the default sorting, column widths, and filters to more easily see the
data that's important to them. Views also define the data source for charts that are used in the application.

Types of Views
There are three types of views: personal, system, and public.
This topic is about how system administrators and system customizers work with system and public views.
Personal views
You and anyone else who has at least User level access to actions for the Saved View entity can also create
personal views. As system administrator, you can modify the access level for each action in the security role to
control the depth to which people can create, read, write, delete, assign, or share personal views.
Personal views are owned by individuals and, because of their default User level access, they are visible only to
that person or anyone else they choose to share their personal views with. You can create personal views by
saving a query that you define by using Advanced Find or by using the Save Filters as New Views and Save
Filters to Current View options in the list of views. These views are typically included at the bottom in lists of
system or public views that are available in the application. While you can create a new personal view based on a
system or public view, you cannot create a system or public view based on a personal view.
System views
As a system administrator or system customizer, you can edit system views. System views are special views the
application depends on, which exist for system entities or are automatically created when you create custom
entities. These views have specific purposes and some additional capabilities.

SYSTEM VIEWS DESCRIPTION

Quick Find The default view used when searches are performed using
Quick Find. This view also defines which fields are searched
when using search capabilities of Quick Find and Lookup
views.

Advanced Find The default view used to display results when using Advanced
Find. This view also defines the columns used by default when
new custom public views or personal views are created
without defining a view to use as a template.
SYSTEM VIEWS DESCRIPTION

Associated The default view that lists the related entities for a record.

Lookup The view you see when you select a record to set for a lookup
field.

These views are not shown in the view selector and you can't use them in sublists in a form or as a list in a
dashboard. You cannot delete or deactivate these views. More information: Remove views
System views are owned by the organization so that everyone can see them. For example, everyone has
organization-level access to read records for the View (savedquery) entity. These views are associated with
specific entities and are visible within the solution explorer. You can include these views in solutions because they
are associated with the entity.
Public views
Public views are general purpose views that you can customize as you see fit. These views are available in the
view selector and you can use them in sub-grids in a form or as a list in a dashboard. Some public views exist by
default for system entities and for any custom entity. For example, when you create a new custom entity, it will
have the following combination of public and system views.

NAME TYPE

Active entity plural name Public

Inactive entity plural name Public

Quick Find Active entity plural name Quick Find

entity name Advanced Find View Advanced Find

entity name Associated View Associated

entity name Lookup View Lookup

You can create custom public views. You can delete any custom public views you create in an unmanaged
solution. You cannot delete any system-defined public views. Custom public views added by importing a
managed solution may have managed properties set that can prevent them from being deleted, except by
uninstalling the managed solution.

Places where you can access the view editor to create or edit views
Power Apps site: To access the view designer, select Data > Entities, select an entity, and then select the View
tab. Open an existing view or create a new one. More information: Create or edit a view
App Designer: If you're working in an app, you may want to use the App Designer, which provides a simple
and intuitive UI with drag-and-drop capabilities for created views. More information: Tutorial: Create and edit
public or system views by using the app designer
Solution explorer: If you're already experienced with Dynamics 365, you may want to use the solution explorer.
More information: Navigate to advanced app making and customization areas

Customize views
As a system customizer you can customize the views through controls by making grids (lists) editable and
compatible for Unified Interface. The following controls are used:
Editable Grid: Allows users to do rich in-line editing directly from grids and sub-grids whether they're using a
web app, tablet, or phone. More information: Make grids editable using the Editable Grid custom control
Read Only Grid: Provides users an optimal viewing and interaction experience for any screen size or
orientation such as mobiles and tablets by using responsive design principles. More information: Specify
properties for Unified Interface apps

Next steps
Create or edit views
Access a model-driven app view definition in Power
Apps
3/26/2020 • 2 minutes to read • Edit Online

In this topic you open a view definition to display properties and options to configure the view. There are several
ways you can access view definitions in Power Apps.

Open a view for editing in the latest view designer


IMPORTANT
The latest version of the view designer is currently in preview. Some features like advanced filtering, custom controls, and
column properties are not yet supported. To accomplish these tasks, Open a view for editing in solution explorer.

1. Sign in to Power Apps.


2. Expand Data, select Entities, and then select the entity that you want, such as the Account entity.
3. Select the Views tab.

4. Select the view you want to open, such as the account entity All Accounts view.
5. From the view editor you can perform several tasks:
Sort records in a view
Choose and configure columns in views

Open a view for editing from a legacy web app


On any list view for an entity in a legacy web app, on the command bar you will find the following commands after
you select the ellipsis (...) button:
View: Opens the definition of the current view in the default solution.
New System View: Opens a new window to create a new view for the current entity in the default solution.
Customize Entity: Takes you to the definition of the current entity in the default solution where you can
then select Views.
System Views: Opens the same window as Customize Entity, except with Views selected.

Open a view for editing in solution explorer


1. Open solution explorer.
2. Under Components, expand Entities, and then expand the entity you want.
3. Select Views.
4. Double-click the view you want to open. This will open the classic view designer.

This list of views has four filters you can use to find the views you want more easily:
All Active Views
Active Public Views
Inactive Public Views
Active System -Defined Views
If the entity that the view is associated with is part of an unmanaged solution, you can still create or edit views for
that entity in the default solution. System views are associated with an entity and are not available as separate
solution components. Unlike fields, views do not use a customization prefix in a unique name that should be
consistent in a solution, so you do not need to create views in the context of a solution.

Next steps
Understand views
Create and edit public or system model-driven app
views
3/26/2020 • 7 minutes to read • Edit Online

In this topic you perform several tasks required to work with views, such as create a public view, add an existing
view to an app, and change columns, filters, and sort order for a view.
In Power Apps, views define how records for a specific entity are displayed. A view defines the following:
The columns (attributes) to display
The width of the columns
How the records are sorted by default
Which filters are applied to determine which records appear in the list by default
Typically, views are classified into three types:
Personal: Individual users can create personal views according to their personal requirements. These views are
visible only to the user who created them and anyone they choose to share them with.
Public: As an app maker, you can create and edit public views to fit your organizational requirements. These
views are available in the view selector, and you can use them in subgrids in a form or as a list in a dashboard.
System: As an app maker, you can also modify system views to meet the requirements of your organization.
These are special views that the application depends on: they exist for system entities or are automatically
created when you create custom entities. These views are available to some or all users, depending on their
permissions.
More information: Understand views

Create a public view in Power Apps


As an app maker, you can create and edit public views by using Power Apps.
1. Sign in to Power Apps.
2. Expand Data, select Entities, select the entity that you want, and then select the Views tab.
3. On the toolbar, select Add view.
4. On the Create a view dialog box, enter a name and, optionally, a description, and then select Create.
5. In the view designer, select the plus button to add additional columns you want to display in the view. More
information: Add a column to your view in app designer
6. In the view designer, you can perform the follow tasks:
To change the column filtering select the header of the column you want to filter and then in the
dropdown select Filter by.
To change the column sorting select the header of the column you want to filter and then select Sort A -Z
or Sort Z -A.
Configure column width by clicking and dragging the column to the desired position.
Reorder columns by dragging a column to the position you want to move it to.

NOTE
You can also change column order by clicking on the column header and selecting Move Right or Move Left.

7. Select Publish to save the view and make it available for other users in your organization.

Work with views in app designer


The following sections describe how to create and edit views in app designer.
Open and add a view in the app designer
The following steps explain how to open and add a view in the app designer.
1. In Power Apps select Apps from the left navigation pane, select ... next to the app you want, and then select
Edit.
2. In the app designer Entity View section, select Views.
In this example, we have selected Views from the Account entity.
3. To add a view, select it by using view types such as Public, Advanced Find, Associated, and Lookup. The view
is automatically added to the Views list.

NOTE
Views are displayed based on the entity that you have selected. For example, when you select Account, views that
are related to the Account entity are displayed.

More information about the app designer: Design custom business apps by using the app designer
Add a column to your view in app designer
Views display records in a table that contains rows and columns. Each row is a record, and the fields you display
from the record are determined by the columns you add to the view.
1. In app designer, select the entity view that you want and then on the right pane next to the view that you
want select edit (pencil button).
2. On the Components tab, select the Column Attributes list for either the Primary Entity or Related
Entity.

3. From the list, select the attribute you want and drag it to the column heading. You can also add the attribute
by double-clicking it.
4. Repeat step 3 until you've added all the attributes you want to display in your view.
As you add attributes, you can drag them to any position among existing column headings. You can also move
columns around after you add them to your view.
Define filter criteria in app designer
You can set filter criteria so that only a subset of the records is displayed in a view. When a user opens the view,
only the records that meet the defined filter criteria are displayed. You can select fields from both the primary and
related entities to filter on.
1. In the app designer, expand the Filter Criteria section.

2. Select Add Filter.


3. Select an attribute from the drop-down list in the first column.
4. Select an operator from the drop-down list in the second column.

5. Enter a value to filter by in the third column.


You can filter data based on the attributes of related entities in addition to the primary entity.
1. On the Components tab, select the Column Attributes list for Related Entity, select the Choose an
Entity down arrow in the topmost field, and then choose the entity you want.
This will add a separate section.
2. Repeat steps 2 through 5 from the previous procedure.
More information: Create and edit relationships between entities
Group multiple filters in app designer
You can add multiple filters to your view if you want to filter records by using more than one field.
1. Select the filters that you want to group.

2. Select Group And or Group Or to group the filters.

When you select Group And, only records that meet both criteria are displayed in the view. When you select
Group Or, records that meet any of the filter criteria are displayed. For example, to show only records that have
priority of High or Normal, and status of Active, select Group And.
To remove the filter from a group, select the group, and then select Ungroup.
Set primary and secondary sort order for columns in app designer
When a view is opened, the records it displays are sorted in the order you set when you created the view. By
default, records will be sorted according to the first column in a view when no sort order is selected. You can
choose to sort on a single column, or you can choose two columns—one primary and one secondary—to sort by.
When the view is opened, the records will first be sorted by the column you want to use for primary sort order, and
then by the column you want to use for secondary sort order.

NOTE
You can only set primary and secondary sort order for column attributes you added from the primary entity.

1. Select the column you want to use for sorting.


2. Select the down arrow, and then choose Primary Sort or Secondary Sort.

If you remove the column you chose for the primary sort order, the column you chose for the secondary sort order
becomes the primary.
Define a web resource in app designer
Specify a web resource of script type, to associate with a column in your view. These scripts help to display icons
for columns.
1. Select the column you want to add a web resource to.
2. On the Properties tab, select Advanced.
3. In the Web Resource drop-down list, select the web resource you want to use.
4. In the Function Name box, enter a function name.
Edit a public or system view in app designer
You can change the way a public or system view is displayed by adding, configuring, or removing columns.

1. In the Views list for an entity, select the Show list of references down arrow .

2. Next to the view you want to edit, select Open the View Designer .
The view opens in the view designer.
When you edit a public or system view, you must save and publish your changes before they will be visible in the
application.

Community tools
View Layout Replicator and View Designer are tools that XrmToolbox community developed for Power Apps.
More information: Developer tools.

NOTE
These tools are provided by XrmToolBox and are not supported by Microsoft. If you have questions pertaining to the tool,
please contact the publisher. More information: XrmToolBox.

Next steps
Create 1:N (one-to-many) or N:1 (many-to-one) relationships
Choose and configure columns in model-driven app
views
12/3/2019 • 2 minutes to read • Edit Online

Along with the filter criteria, the columns visible in a Power Apps view are very important to the value provided by
the view. In this topic, you create or edit views by performing the following tasks:
Open the view editor
Add columns
Remove columns
Change column width
Move a column

IMPORTANT
The latest version of the view designer is currently in preview. Some features like enabling or disabling presence for a column
and adding a find column are not yet supported. To accomplish these tasks, open the view in the classic view designer.
Enable or disable presence for a column
Add find columns

Open the view editor


1. Sign in to Power Apps.
2. Expand Data, select Entities, select the entity that you want, and then select the Views tab.

3. Select an existing view to open it or on the toolbar select Add view.


Add columns
You can include columns from the current entity or any of the related entities that have a 1:N entity relationship
with the current entity.
For example, perhaps you want to display the owner of a user-owned entity in a column. You can choose the
Owner field of the current entity to display the name of the owner. This will appear as a link to open the User
record for the person who is the owner.
If you want to display the phone number for the owner of the record, you must select Owning User (User) from
the Record type drop-down and then select the Main Phone field.
Add columns to views
1. While creating and editing views, ensure that the Fields panel is open. If it is not, select Add fields on the
toolbar.

2. Select the fields you want to add to the view designer. This adds the field as a column on the right-hand of
the view.
3. Select the Related tab to see related entities and their corresponding fields.
As you add columns, you will increase the width of the view. If the width of the view exceeds the space available to
show it in the page, horizontal scrollbars will allow people to scroll and see the hidden columns.

TIP
If your view filters on data for a certain field so that only records with a certain value are shown, don’t include that column in
the view. For example, if you are only showing active records, don’t include the status column in the view. Instead, name the
view to indicate that all the records shown in the view are active.

NOTE
When you add columns to Lookup views for updated entities, only the first three columns will be displayed.
Remove columns
1. Select the header of the column you want to remove.
2. In the dropdown, select Remove.
Change column width
1. Hover over the area between columns in the view.
2. A line appears and your cursor becomes a double sided arrow.
3. Drag the column to the appropriate width.
Move a column
Click and drag the column header to the correct position.

TIP
You can also select the header of the column you want to move and from the dropdown select Move Right or Move Left.

Next steps
Create or edit views
Create or edit filters in model-driven app views
2/13/2020 • 2 minutes to read • Edit Online

The filters in a Power Apps view are important to the value provided by the view. The filters you apply determine
which records appear in the list by default. You can add or edit a filter for the columns that you include in a view by
selecting the column and selecting Filter by. You can also use the expression builder in the view designer. Use the
expression builder to add or edit filters for any fields of the entity in the current view or any fields in a related entity.
In this topic, you create or edit filters by performing the following tasks:
Edit or remove a filter condition
Open the expression builder
Add conditions to a filter
Add a group condition to a filter
Add a related entity to a condition
Group conditions of a filter

Edit or remove a filter condition


1. Sign in to Power Apps.
2. Expand Data, select Entities, select the entity that you want, and then select the Views tab.
3. Select a view to open it. The view properties panel lists existing filters.

4. On the view properties panel, select a filter condition.


5. Select the conditional operator that you want to use.
6. Type or select the comparison value for the condition.
7. Select Apply.
8. To remove a condition, select Close. The condition is removed without confirmation.
Open the expression builder
On the view properties panel, select Edit filters.

Add conditions to a filter


1. In the expression builder, select Add > Add row.
2. Select a field for the condition.
3. Select a conditional operator.
4. Select a comparison value.
Some filter conditions don't require a comparison value for the condition. For example, the operator
Contains data doesn't require a comparison value. With other filter conditions, you choose the comparison
value from an option set. For example, the Status field has an option set that contains the values Active and
Inactive.
5. Select OK.
Add a group condition to a filter
1. In the expression builder, select Add > Add group.
2. Select the relational operator Or for the group. And is the default relational operator.
3. Specify the first clause of the grouped condition. Select the field, conditional operator, and comparison value.
4. Select Add > Add group
5. Specify the second clause of the grouped condition.

You can select Collapse to display the group as a conditional expression.


Add a related entity to a condition
1. In the expression builder, select Add > Add related entity.
2. Select a field from the current entity that is related to another entity. The entity related to the field is shown
in parenthesis. You can select fields that have a many-to-one, one-to-many, or many-to-many relationship
with the related entity.
3. Select a field of the related entity for the condition.
4. Select a conditional operator.
5. Select or enter a comparison value.

Group conditions of a filter


1. In the expression builder, select the check box for the conditions that you want to group.
2. Select More commands (...) for one of the conditions, and then select Make group.
3. To ungroup a group, select More commands (...) for the group, and then select Ungroup

Next steps
Choose and configure columns
Edit filter criteria
Create 1:N (one-to-many) or N:1 (many-to-one) relationships
Make model-driven app grids (lists) editable using
the Editable Grid custom control
12/2/2019 • 4 minutes to read • Edit Online

In previous releases of Dynamics CRM, users couldn’t enter data directly in grids (sometimes called lists) or sub-
grids on forms. They had to select the record in the grid to open a form, edit the data, and then save, which
required multiple steps. With editable grids, users can do rich in-line editing directly from grids and sub-grids
whether they’re using a web app, tablet, or phone.

When editable grids are enabled through the Editable Grids custom control, users can edit most types of fields,
including basic Lookup fields and option sets.
Editable grids support:
In-line editing of records at the entity or sub-grid level (includes custom entities)
System views and personal views
Web and mobile clients
Navigation with a keyboard or mouse
Grouping and sorting (you can group by/sort by any column in the current view )
Filtering
Moving and resizing columns
Pagination
Saving changes from one session to another for grouping, sorting, filtering, pagination, and moving and
resizing columns
Lookup configuration
Calculated fields and rollup fields
Business rules (Show error message, Set field value, Set business required, Set default value, Lock or unlock
field)
JavaScript events
Enabling or disabling of cells based on security role
Users can continue to use search and charts, and can access the action bar as with read-only grids

Make main grids editable


1. Open solution explorer.
2. In the Entities list, open the appropriate entity, select the Controls tab, and then select Add Control.

3. In the Add Control dialog box, select Editable Grid, and then select Add.
4. In the Editable Grid row that’s added, select the form factor(s) you want to apply the grid to. This makes
the editable grid control the default control for the selected form factor(s).

NOTE
At runtime, users can toggle between editable grids and read-only grids.

5. To add a lookup, in the Editable Grid option group, select Add Lookup, and then in the Configure
Property “Add Lookup” dialog box:
a. In the Available Views list, select the view to add the lookup to (for example, select My Active
Accounts).
b. In the Available Columns list, select the lookup column to add (for example, select Primary
Contact).
c. In the Default View list, select the data source for the lookup field.
d. If you want to limit the records displayed, select the Only show records where check box, and then
select your criteria from the list, and then select OK.
6. If you have a nested grid, select the pencil button for Nested grid view, and then select the entity and view
for the nested grid. For the Nested grid parent ID select the relationship for the entities. For example, the
ParentAccountID field connects the Account and Contact entities.

NOTE
Nested grids are only available for phones and tablets, not the web.

7. If you don’t want to allow the user to group data by any column in the view (you want to save space, for
example), in the Group by Column row, select the pencil button, and then in the Configure Property
“Group by Column” dialog box, select Disabled, and then select OK.

TIP
This is mostly useful for sub-grids on forms.

8. If you want to add JavaScript events, select the Events tab, and then select the appropriate entities, fields,
and events. More information: Developer Documentation: Use editable grids

9. To save your work, select Save on the action bar.


10. When you’re ready to make changes available to your team, select Publish on the action bar.
11. To test your changes, go to the view you specified in step 5, and then make some in-line editing changes.

Make a sub-grid on a form editable


NOTE
To save an editable grid change within a sub-grid, the user must explicitly save before navigating out of the form.
If you are using legacy forms (versions prior to Dynamics CRM 2016) and enable an editable grid on a sub-grid, the
editable sub-grid will not be rendered. System administrators can turn off legacy forms in system settings, if needed.

1. Open solution explorer.


2. Open the form that contains the sub-grid.
3. Select the appropriate control, and then select Change Properties on the ribbon.
4. In the Set Properties dialog box, select Controls, select Add Control, and then follow the same steps
listed above.

Supported standard entities

Web/tablet/phone Tablet/phone only Web only

Account Activity Campaign

Appointment Attachment Campaign Activity

Bookable Resource Channel Access Profile Rule Item Campaign Response

Bookable Resource Booking Competitor Address Channel Access Profile

Bookable Resource Booking Header Connection Channel Access Profile Rule

Bookable Resource Category Connection Role Contract

Bookable Resource Category Assn Email Signature Entitlement Template

Bookable Resource Characteristic Email Template External Party

Bookable Resource Group Expired Process Fax

Booking Status Invoice Product Letter

Case Knowledge Article Incident Marketing List

Category Lead To Opportunity Sales Position

Characteristic Process Quick Campaign

Competitor Mailbox Recurring Appointment

Contact New Process Sales Literature

Email Note SLA

Entitlement Opportunity Product

Feedback Opportunity Sales Process

Invoice Order Product

Knowledge Article Organization

Knowledge Article Views Phone to Case Process


Knowledge Article Views Phone to Case Process

Knowledge Base Record Price List Item

Lead Queue Item

Opportunity Quote Product

Order Sharepoint Document

Phone Call Translation Process

Price List

Product

Queue

Quote

Rating Model

Rating Value

SLA KPI Instance

Social Activity

Social Profile

Sync Error

Task

Team

User

Data types that aren’t editable in an editable grid


The following data types aren’t editable in editable grids: Customer and Partylist Lookup fields; Composite
(address) fields; State/Status fields; Lookup entity-related fields (for example, the Account entity includes a contact
lookup, where the Contact field is editable but the EmailAddress(Contact) field is not editable).

Next steps
Use keyboard shortcuts in editable grids
Sort records in a model-driven app view
12/3/2019 • 2 minutes to read • Edit Online

When you create or edit a view you can configure the sort order for either ascending or descending.
1. Sign in to Power Apps.
2. Expand Data, select Entities, and then select the entity that you want, such as Accounts.
3. Select the Views tab, and if shown, select Remove filter, and then open the view you want, such as Active
Accounts.
4. In the view designer, select Configure Sorting.

5. In the Configure Sort Order dialog box, in the Sort By list, select the column you want to sort, then select
Ascending Order or Descending Order.
6. Select OK to close the Configure Sort Order dialog box.

Next steps
Create or edit a view
Edit filter criteria and change sort order in model-
driven app views
12/2/2019 • 2 minutes to read • Edit Online

Along with the columns displayed in a view, the filter criteria applied to a view is a critical part of the value
provided by the view.
1. When you create or edit the view in the view designer, in the right Common Tasks pane select Edit Filter
Criteria.
2. The dialog shows a user interface similar to Advanced Find. You can use AND and OR clauses to specify
and group criteria by selecting the filter claus and then selecting Group AND or Group OR.

3. Select OK to save and close the Edit Filter Criteria dialog box.
For more information about constructing filter clauses, see Create, edit, or save an Advanced Find search.

Next steps
Understand views
Model-driven app managed properties for views
12/2/2019 • 2 minutes to read • Edit Online

If you create a custom public view in Power Apps that you want to include in a managed solution that you will
distribute, you have the option to limit the ability of anyone who is installing your solution from customizing the
view.
By default, most views have their Customizable managed property set to true so that people can customize them.
Unless you have a very good reason to change this, we recommend you allow people to customize views in your
app.

Set managed properties for a view


1. Open solution explorer, expand Entities, select the entity that you want, and then select Views.
2. Select a custom public view.
3. On the menu bar, select More Actions > Managed properties.

4. Set the Customizable or Can Be Deleted options to True or False.


NOTE
The setting does not take effect until you export a solution that contains the view as a managed solution and install it in a
different environment.

Next steps
Understand views
Specify a model-driven app default view
12/2/2019 • 2 minutes to read • Edit Online

Unless someone has ‘pinned’ a different view in your app as their personal default, they will see the default view
that you specify as the app maker. You can set any of the public views as the default view for an entity.

Set the default view for an entity


1. Open solution explorer, expand Entities, select the entity that you want, and then select Views.
2. Select a public view.
3. On the menu bar, select More Actions > Set Default.

4. On the solution explorer toolbar, select Publish All Customizations.

Next steps
Understand views
Delete or deactivate a model-driven app view
12/2/2019 • 2 minutes to read • Edit Online

You may have a view that you don’t want people to see. Depending on the type of view, you can either delete it or
deactivate it.

Delete a view
You can delete any custom public view. Use the steps in Access view definitions to find the view you want to delete
and use the Delete command. Once you verify that you really want to delete it, the view will be permanently
deleted.
If you don’t want to delete the view permanently, you can deactivate it instead.

Deactivate or activate views


You cannot delete or deactivate any system views, including public views the system created. You can deactivate
any public view, including public views the system created.
Deactivate or activate a public view
1. Navigate to System Views as described in Access view definitions.
2. Select a public view. To see inactive views, use the Inactive Public Views view.
3. On the menu bar, select More Actions, and then select either Deactivate or Activate.
4. Select Publish All Customizations.

Next steps
Create or edit a view
Apply custom business logic with business rules and
flows in model-driven apps
11/9/2019 • 2 minutes to read • Edit Online

Defining and enforcing consistent business processes is one of the main reasons people use model-driven apps.
Consistent processes help make sure people using a model-driven app can focus on their work and not on
remembering to perform a set of manual steps.

Business rules
Business rules provide a simple interface to implement and maintain fast-changing and commonly used rules. The
scope of a business rule defines where the business rule will run:

If you select this item... The scope is set to...

Entity All forms and server

All Forms All forms

Specific form (Account form, for example) Just that form

For more information about defining business rules for a form in a model-driven app, see Create business rules to
apply logic in a model-driven app form

NOTE
To define a business rule for an entity so that it applies at the server level to both canvas apps and model-driven apps, see
Create a business rule for an entity.

Flows
Power Automate includes several types of processes, each designed for a different purpose:
Automated flows. Create a flow that performs one or more tasks automatically after it's triggered by an
event. More information: Create a flow
Button flows. Perform repetitive tasks simply by tapping a button on your mobile device. More information:
Introducing button flows
Scheduled flows. Create a flow that performs one or more tasks on a schedule such as once a day, on a
specific date, or after a certain time. More information: Run flows on a schedule
Business process flows. Ensure that people enter data consistently and follow the same steps every time
they work in an app by creating a business process flow. More information: Business process flows
overview
Workflows and actions. Dynamics 365 customizers may be familiar with the classic Common Data Service
processes, which are workflows and actions. More information: Use Workflow processes and Actions
overview
Next step
Create business rules to apply logic in a model-driven app form
See also
Apply business logic with Common Data Service
Create business rules and recommendations to apply
logic in a model-driven app form
12/2/2019 • 5 minutes to read • Edit Online

This topic shows you how to create business rules and recommendations to apply form logic in a model-driven
app without writing JavaScript code or creating plug-ins. Business rules provide a simple interface to implement
and maintain fast-changing and commonly used rules. They can be applied to Main and Quick Create forms, and
they work in model-driven apps, legacy web apps, Dynamics 365 for tablets, and Dynamics 365 for Outlook
(online or offline mode).

NOTE
To define a business rule for an entity so that it applies to all forms and server, see Create a business rule for an entity.

By combining conditions and actions, you can do any of the following with business rules:
Set field values
Clear field values
Set field requirement levels
Show or hide fields
Enable or disable fields
Validate data and show error messages
Create business recommendations based on business intelligence.

Create a business rule or business recommendation


1. Open solution explorer.
2. Open the entity you want to create the business rule for (for example, open the Account entity), and then
double-click Business Rules.

3. Select New.
The Business Rule designer window opens with a single condition already created for you. Every rule
starts with a condition. The business rule takes one or more actions based on that condition.

TIP
If you want to modify an existing business rule, you must deactivate it before you can modify it.

4. Add a description, if you want, in the description box in the upper-left corner of the window.
5. Set the scope, according to the following:

If you select this item... The scope is set to...

Entity All forms and server

All Forms All forms

Specific form (Account form, for example) Just that form

6. Add conditions. To add more conditions to your business rule:


a. Drag the Condition component from the Components tab to a plus sign in the designer.

b. To set properties for the condition, click the Condition component in the designer window, and
then set the properties in the Properties tab on the right side of the screen. As you set properties,
an expression is created at the bottom of the Properties tab.
c. To add an additional clause (an AND or OR ) to the condition, click New in the Properties tab to
create a new rule, and then set the properties for that rule. In the Rule Logic field, you can specify
whether to add the new rule as an AND or an OR.
d. When you're done setting properties for the condition, click Apply.
7. Add actions. To add an action:
a. Drag one of the action components from the Components tab to a plus sign next to Condition
component. Drag the action to a plus sign next to a check mark if you want the business rule to take
that action when the condition is met, or to a plus sign next to an x if you want the business rule to
take that action if the condition is not met.

b. To set properties for the action, click the Action component in the designer window, and then set
the properties in the Properties tab.
c. When you're done setting properties, click Apply.
8. Add a business recommendation. To add a business recommendation:
a. Drag the Recommendation component from the Components tab to a plus sign next to a
Condition component. Drag the Recommendation component to a plus sign next to a check
mark if you want the business rule to take that action when the condition is met, or to a plus sign
next to an x if you want the business rule to take that action if the condition is not met.
b. To set properties for the recommendation, click the Recommendation component in the designer
window, and then set the properties in the Properties tab.
c. To add more actions to the recommendation, drag them from the Components tab, and then set
properties for each action in the Properties tab.

NOTE
When you create a recommendation, a single action is added by default. To see all the actions in a
recommendation, click Details on the Recommendation component.

d. When you're done setting properties, click Apply.


9. To validate the business rule, click Validate on the action bar.
10. To save the business rule, click Save on the action bar.
11. To activate the business rule, select it in the Solution Explorer window, and then click Activate. You can't
activate the business rule from the designer window.

TIP
Here are a few tips to keep in mind as you work on business rules in the designer window:
To take a snapshot of everything in the Business Rule window, click Snapshot on the action bar. This is useful, for
example, if you want to share and get comments on the business rule from a team member.
Use the mini-map to navigate quickly to different parts of the process. This is useful when you have a complicated
process that scrolls off the screen.
As you add conditions, Actions, and business recommendations to your business rule, code for the business rule is built
and appears at the bottom of the designer window. This code is ready only.

Localize error messages used in business rules


If you have more than one language provisioned for your organization, you will want to localize any error
messages that you have set. Each time you set a message, a label is generated by the system. If you export the
translations in your organization, you can add localized versions of your messages and then import those labels
back into the system, so that people using languages other than your base language can view the translated
messages.

Common issues
This section describes common issues that may occur when you use business rules.
Full Name field not supported with unified interface apps
Actions or conditions that use a Full Name (fullname) field aren’t supported in apps based on the unified
interface. Alternatively, you can use actions or conditions with First Name (firstname) and Last Name
(lastname) fields.
Is your business rule not firing for a form?
A business rule may not execute because the field referenced in the business rule isn’t included with the form.
1. Open solution explorer. Expand the entity that you want and then select Forms.
2. Open the form that you want and then on the form designer ribbon select Business Rules.
3. In the form designer, open the business rule.
4. In the business rule designer select each condition and action to verify all the fields referenced in each
condition and action.
5. Verify that each field referenced in the business rule is also included on the form. If not, add the missing
field to the form.

Frequently asked questions (FAQ)


Can business rules unlock fields on a read -only form?
Yes, a business rule can unlock fields and edit actions on a read-only form.
How do I troubleshoot a business rule that isn't working?
See Is your business rule not firing for a form? in this topic.

See also
Create custom business logic through processes
Create a business process flow
Create a model-driven app system chart
12/3/2019 • 2 minutes to read • Edit Online

In this topic you learn how to create a system chart. System charts are organization-owned charts, which makes
them available to anyone with access to read the data running the app. System charts can’t be assigned or shared
with specific app users.
1. Sign in to Power Apps.

IMPORTANT
“If the Model-driven design mode isn't available, you may need to Create an environment.

2. Expand Data, select Entities, select the entity that you want, and then select the Charts tab.
3. On the toolbar, select Add chart.
4. Specify the type of chart, and how the data is displayed in the chart.
Enter the chart name, such as Number of employees by account.
In the Select Field dropdowns:
In the Select Field Series axis dropdown select a field such as Number of Employees.
In the Select Field Category axis dropdown select a field such as Account Name.
Add a description to identify the purpose of the chart, such as This column chart displays the number
of employees by account name.

5. Select Save and Close.

Known issues
In the chart designer, adding a order by on certain calculated fields are not supported and will cause an error. The
calculated fields causing this are using another calculated fields, a related entity field, or a local field on the entity.
Next steps
Create or edit dashboards
Create or edit model-driven app dashboards
12/3/2019 • 2 minutes to read • Edit Online

There are two types of dashboards, user dashboards and system dashboards. An app user can create a dashboard
visible only to them in the app areas that they have privileges to. An admin or customizer creates or customizes
system dashboards that, when published, are visible to all app users. A user can choose to set their user
dashboard as their default dashboard and override the system dashboard. This topic focuses on system
dashboards.

Create a new dashboard


1. Sign in to Power Apps.

IMPORTANT
“If the Model-driven design mode isn't available, you may need to Create an environment.

2. Expand Data, select Entities, select the entity that you want base the dashboard on, such as the Account
entity, and then select the Dashboards tab.
3. On the toolbar select Add a dashboard, and then choose a 2, 3, or 4 column layout.
4. In the Dashboard: New dialog box enter a name for the dashboard.
5. Select one of the component areas and then select the icon for a chart or a list.
You can have up to six components in the dashboard.
6. For example, to add a chart, in the Add Component dialog box, select values for Record Type, View, and
Chart, and then select Add to add the chart to the dashboard.
7. When you are finished adding components to your dashboard, select Save and then Publish.

Edit an existing dashboard


1. Sign in to Power Apps.

IMPORTANT
“If the Model-driven design mode isn't available, you may need to Create an environment.

2. Expand Data, select Entities, select the entity that you want base the dashboard on, such as the Account
entity, and then select the Dashboards tab.
3. Open a dashboard, select one of the component areas, and then on the toolbar select Edit Component.
4. In the Set Properties dialog box, you can make changes to a chart or list such as change the entity, default
view, add a chart selector, or make the dashboard available on the mobile apps. When you’re done, select
Set.
For more information about setting dashboard component properties, see Set properties for a chart or list
included in a dashboard.
5. When you’ve completed your changes be sure to save them, and then publish them.
Additional system dashboards tasks you can perform include:
Remove a list or chart from a dashboard
Add a list or chart to a dashboard
Set the default dashboard
Use security roles to make a dashboard visible to just certain roles

Next steps
Set properties for a chart or list included in a dashboard
Configure model-driven app interactive experience
dashboards
12/3/2019 • 10 minutes to read • Edit Online

Interactive experience dashboards can be a one-stop workplace for app users, such as service reps, to see
workload information and take action. They're fully configurable, security-role based, and deliver workload
information across multiple streams in real time. Interactive dashboard users don't need to page through the
application looking for a particular record; they can act on a it directly from the dashboard.
The interactive experience dashboards come in two forms: multi-stream and single-stream. In addition, multi-
stream dashboards can be home page or entity-specific dashboards. The entity-specific dashboards are configured
in a different part of the user interface and partially preloaded with the entity-specific configuration information.
The multi-stream dashboards display data in real time over multiple data streams. There’s no limit on how many
streams you can configure on the dashboard. The data in a stream can be based only on one entity, but, each
stream can be based on a different entity. In the entity-specific dashboards, all streams are based on the same
entity. The data flows from various views or queues, such as My Activities, My Cases, or Cases in the Banking
Queue.
The single-stream dashboards display real-time data over one stream based on an entity view or queue. The tiles
are positioned on the right side of the dashboards and are always shown. The single-stream dashboards are
typically helpful to Tier 2 service leads or managers, who monitor fewer, but more complex or escalated cases.
Multi-stream and single-stream dashboards contain interactive charts that provide a count of relevant records,
such as cases by priority or by status. These charts also act as visual filters. The visual filters (interactive charts) are
based on multiple entities and in the single-stream dashboards, the entity in the data stream defines the visual
filter entity.
Users can apply additional filtering with global filter and timeframe filter. The global filter works at a field level on
all charts, and also on streams and tiles that are based on the filter entity (you specify the filter entity when you
configure the visual filters).

NOTE
The interactive dashboards are solution aware and can be exported and then imported into a different environment as a
solution. However, the queues that the streams and tiles are based on aren’t solution aware. Before importing the
dashboard solution into the target system, the queues have to be manually created in the target system in Settings >
Service Management > Queues. After you create the queues, import the dashboard solution to the target system, and
then edit the streams or tiles that are based on the queues to assign the newly created queues appropriately.

The illustrations in this topic show multi-stream and single-stream dashboards with the header pane. Below the
header you see visual filters and streams. In the single-stream dashboard, you also see tiles. For each dashboard
type, you can choose from several different layouts that are also shown. The dashboard header contains the
following controls and select-able icons, from left to right: dashboard picker, refresh, visual filter icon, global filter
icon, and timeframe filter.
Multi-stream dashboard standard view
In the multi-stream dashboard, you see a row of visual filters at the top with the data streams below them.
Multi-stream dashboard tile view
The same dashboard, only in the tile view.

Multi-stream dashboard layouts


For multi-stream dashboards, you can choose from four different layouts.

Multi-stream entity-specific dashboard


The entity-specific dashboard for the case entity is shown here.
Single -stream dashboard
The single-stream dashboard contains the data stream on the left and visual filters and tiles on the right.

Single -stream dashboard layouts


For single-stream dashboards, you can choose from four different layouts.
Configure filter fields, and security roles for the interactive dashboards
When you configure interactive dashboards, your first task is to enable filter fields and security roles, so that
interactive dashboards can be configured for them. Notice that interactive dashboards are enabled for all entities
and custom entities by default.
Configure filter fields
For a field to appear in the global filter and be included in the data stream sort, you must set two flags:
Appears in global filter in interactive experience
Sortable in interactive experience dashboard
In this example there are two interactive dashboard options available in the Case entity for the IsEscalated field.

Configure the 'Appears in global filter in interactive experience' option


1. Open solution explorer.
2. Under Components, expand Entities, and then expand the entity you want.
3. In the navigation pane, select Fields and in the grid, double-click the field you want to enable.
4. In the General tab, select the Appears in global filter in interactive experience check box. Select Save and
Close.
5. Select Publish All Customizations for your changes to take effect.
The fields that you enable for Appears in global filter in interactive experience appear in the global filter
flyout window when the global filter icon is clicked on the dashboard header. In the flyout window, the service reps
can select the fields on which they want to filter globally, in charts, and also in streams and tiles that are based on
the filter entity.
The global filter flyout window is shown here:
TIP
When you configure a visual filter based on the fields like priority or status, a best practice is to also enable these fields
(priority, status) to appear in the global filter.

Configure the 'Sortable in interactive experience dashboard' option


1. Open solution explorer.
2. Under Components, expand Entities, and then expand the entity you want.
3. In the navigation pane, select Fields and in the grid, double-click the field you want to enable.
4. In the General tab, select the Sortable in interactive experience dashboard check box. Select Save and
Close.
5. Select Publish All Customizations for your changes to take effect.
The fields that you configure for sorting appear in the drop-down list on the stream header.
The following illustration shows the flyout dialog with the list of the available fields for sorting, in the drop-down
list. The default sort is always set on the Modified On field.
Enable security roles
Select and enable security roles that will be able to view the interactive dashboards.
Enable security roles for interactive dashboards
1. Open solution explorer.
2. Under Components, select Dashboards.
3. In the grid, select the interactive dashboard you want and select Enable Security Roles on the task bar.
4. In the Assign Security Roles dialog, select the Display only to these selected security roles option and
select the roles that you want to enable. Select OK.
5. Select Publish All Customizations for your changes to take effect.

Configure interactive experience dashboards


The following sections describe how to configure various types of the interactive dashboards.
Configure a multi-stream interactive dashboard using the 4-column layout
1. Sign in to Power Apps.
2. Select Data > Entities > select the entity you want.
3. Select the Dashboards tab, and then on the toolbar select Add dashboard.
4. Choose the layout, either 2, 3, or 4 column width.
5. When the dashboard form opens, fill in the filtering information at the top of form, as shown here.

Filter Entity: The visual filters and global filter attributes are based on this entity.
Entity View: The visual filters are based on this view.
Filter By: The field that the time frame filter applies to.
Time Frame: The default time frame filter value for the Filter By field.
After you have specified the filtering information, start adding components for the charts and the data streams. To
add a component, simply select the element in the center of the chart or stream, and when the dialog appears,
select the required information from the drop-down list, as shown in the following illustrations.
Add the Cases By Priority doughnut chart.

Some charts, such as bar charts or pie charts, render showing the data stored in the system. The doughnut charts
and tag charts load as static images and don’t show the preview of the actual data.

NOTE
The charts configured for the visual filters can use the fields of the Filter entity as well as related entities. When you use
charts based on related entity fields, the customer service representatives can filter charts using these related entity fields.
The fields that are based on the related entity usually have the following format in the chart configuration window: “field
name (entity name)”, such as the Modified By (Delegate) field. To create multi-entity charts, you must add fields of a
related entity to any of the views, and then use these fields while creating charts.
Next, configure the streams. Just like with adding components in the charts, select the element inside the stream
panel. When the dialog appears, select View or Queue depending on what element you want the stream to use.
Enter the required information, as shown in the following illustration.
Configure the stream for the Items available to work on as shown here:

NOTE
The Queue option is available in the dialog box only for queue-enabled entities. For entity dashboards, if the entity is not
queue enabled, you won't see the Queue option in the dialog box. You can only use the View option in the stream of
dashboards for entities that are not queue enabled.

The following illustration is an example of a fully configured chart panel and stream panel:
After you have completed configuring the dashboard, save it and publish the customizations for your changes to
take effect.
Edit or delete individual streams of an existing dashboard
1. Sign in to Power Apps.
2. Select Data > Entities > select the entity you want. Select the Dashboards tab.
-OR -
Open solution explorer, and then under Components select Dashboards.
3. In the grid, select the interactive dashboard that you want to edit to open it.
4. Select the stream that you want to edit to select it, and then select Edit Component.
5. Depending on whether you want to add a view or queue to the stream, select the view or queue details for
the stream, and then select Set.
6. Select Save.
You can also delete an individual stream from a dashboard. To do this, select the stream, and then on the command
bar, select Delete.
Configure an entity-specific dashboard
An entity-specific dashboard is a multi-stream dashboard. Configuring this dashboard is similar to configuring a
home page multi-stream dashboard, but you do it in the different place in the UI and there are other minor
differences.
For example, instead of selecting an entity, some fields in the entity-specific dashboard are preset to the entity for
which you are creating the dashboard.
1. Sign in to Power Apps.
2. Select Data > Entities > select the entity you want.
3. Select the Dashboards tab, and then on the toolbar select Add dashboard.
4. Choose the layout, either 2, 3, or 4 column width.
5. When the dashboard form opens, the Filter Entity is preset to the entity for which you are creating the
dashboard. The Entity View drop-down list contains the available views for the entity. Select the view and
fill in the rest of the required information on the page.
The rest of the setup is very similar to the home page multi-stream dashboard setup described in the previous
section.
Configure a single -stream dashboard
Configuring a single-stream dashboard is similar to the multi-stream dashboard. All UI navigation steps are the
same as for the multi-stream dashboard. You can choose a layout that includes tiles or the layout that doesn’t
include tiles. If the tiles are included, they are always displayed on the dashboard. To configure a tile, you select the
icon in the center of the tile. When the Add Tile window opens, fill in the required data. The following illustration
is an example of the tile setup.

Configure dashboard colors


For all Option Set and Two Options type fields, such as the Case Type, IsEscalated or Priority of the Case
entity, you can configure a particular color that will appear in the charts and streams for specific field values. For
example, high priority cases can be shown in red, medium priority cases in blue, and low priority cases in green in
the interactive charts. In the streams, there will be a thin vertical line in color next to the work item description.

NOTE
The color coding isn’t available for the tag charts and doughnut charts. These charts appear on the dashboard in white, gray,
and black shades.

1. Open solution explorer.


2. Under Components, expand Entities, and then expand the entity you want. If the entity you want isn't
displayed select Add Existing to add it.
3. In the navigation pane, select Fields. In the grid, double-click the field that you want to configure the color
for.
4. In the General tab, in the Type sub-area, select Yes and then select Edit.
5. When the Modify List Value dialog appears, set the new value in the Color text box. Select OK.
Select Save and Close.
6. Select Publish for your changes to take effect.
In the following example, we’re changing the color for the IsEscalated field. Use the Edit button to open the
Modify List Value dialog box:
When the Modify List Value dialog box opens, choose the color as shown here:

Similarly, if you go to the Priority field to modify the colors of the case priority options, choose the color in the
Options sub-area of the General tab, as shown below:
See also
Create or edit dashboards
Set properties for a model-driven app chart or list
included in a dashboard
12/2/2019 • 2 minutes to read • Edit Online

To edit a chart or list component from the dashboard designer, select the chart or list you want and then select Edit
Component on the dashboard designer toolbar.

This opens the Set Properties dialog box.


You can set the following chart properties from the Set Properties dialog box:
Name. Unique name for the chart. The system suggests a value, but you can change it.
Label. The label that appears at the top of the chart.
Display label on the Dashboard. Select or clear this check box to display or hide the chart label.
Entity. Select the entity (record type) to base the chart on. This setting determines the available values for
the Default View and Default Chart properties.
Default View. Select the view used to retrieve the data for the chart.
Default Chart. Select the default chart that you want to display when the dashboard is first opened. The
available values are determined by the value set for the Entity property. This property works together with
the Display Chart Selection property. A user can change the type of chart if the Display Chart Selection
option is turned on, but the chart will revert to Default Chart the next time the dashboard is opened.
Show Chart Only. Select this check box if you want to display just the chart. Clear this check box if you
want to display the chart and its associated data.
Display Chart Selection. Select this check box to enable users to change the type of chart (column, bar,
pie, etc.) when they use the dashboard. If the user changes the type of chart, the settings aren’t saved. The
chart type reverts to the Default Chart setting when the dashboard is closed.
You can set the following list properties from the Set Properties dialog box:
Name. Unique name for the list. The system suggests a value, but you can change it.
Label. The label that appears at the top of the list.
Display label on the Dashboard. Select or clear this check box to display or hide the list label.
Entity. Select the entity (record type) to base the list on. This setting determines the available values for the
Default View property.
Default View. Select the view used to retrieve the data in the list. A user can change the view, but the list
will revert to Default View the next time the dashboard is opened.
Display Search Box. Select this check box if you want to display a search box at the top of the list. If the
search box is included, you or other users can search for records in the list at runtime.
Display Index. Select this check box if you want to display the A to Z filters at the bottom of the list. When
the A to Z filters are displayed, you or other users can select a letter to jump to records that start with that
letter.
View Selector. Select from the following values:
Off. Don’t display the view selector. You or other users won’t be able to change views at runtime.
Show All Views. Provide a full list of views associated with the value set in the Entity property.
Show Selected Views. Select this setting to limit the list of views available at runtime. To select the
specific views to be displayed, hold down the Ctrl key and tap or select each view you want to
include.

Next steps
Create or customize dashboards
Set up the model-driven app notes control to access
information about posts
12/2/2019 • 2 minutes to read • Edit Online

In Power Apps forms for certain system entities using the Updated forms, the Notes control provides the ability to
access information about Posts, Activities, and Notes. For custom entities where you have enabled notes and
activities, you will only see Notes and Activities. To include Posts you must enable them for the custom entity.

Enable posts for a custom entity


1. Go to Settings > Activity Feeds Configuration.
2. Open the record for your custom entity.
3. Make sure that Enable walls for this type of record form is selected and save the record.
4. In the command bar, select Activate.
5. If you needed to enable walls, you need to publish the entity.
By default, for system entities the notes control is positioned in a social pane section in the center of a three column
tab at the top of the form. It can appear in a form just one time. You can move or remove the notes control. To add
it back, use the Notes button in the Control group of the Insert tab.
The following table describes the properties for the Notes control.

TAB PROPERTY DESCRIPTION

Display Label Required: Although the label is not


displayed by default, a label is required.

Display Label on the form You can choose to display the label.

Lock the field on the form This will prevent the notes from being
removed from the form accidentally.

Default tab Select which tab should be displayed by


default. The options are:

- Activities
- Posts
- Notes

Formatting Select the number of columns the When the section containing the notes
control occupies control has more than one column you
can set the field to occupy up to the
number of columns that the section
has.

Number of Rows Control the height of the notes control


by selecting the number of rows the
control occupies.
TAB PROPERTY DESCRIPTION

Automatically expand to use Instead of setting the height by a


available space number of rows, you can allow the
notes control height to expand to
available space.

Next steps
Open the form editor
Set up timeline section (control)
3/10/2020 • 13 minutes to read • Edit Online

The activities that you use in Timeline to keep track of all your communications with a customer or contact can be
customized according to your business or organization requirements.

1. Search Records
2. Take notes
3. Add info and activities
4. Filter
5. More commands
6. Activity status
7. Activity icons
8. Date and time
To learn more, see Add an appointment, email, phone call, note, or task activity to the timeline.
The customization is categorized into the following areas:
Module
Activity type
Field

Customize modules
The modules are Activities, Posts, and Notes. As a customizer, you can choose which modules you want to show to
the users as per your business requirements.
1. Sign in to your https://<YourOrgURL>.dynamics.com/apps environment.

2. Open a model-driven app, and then on the command bar, select Settings > Advanced Settings.
3. Go to Settings > Customization > Customize the System. The solution explorer page opens in a new
browser window.
4. Expand Entities under Components in the default solution pane.
5. Select an entity and select Forms. For example, select the Account entity.
6. Select the Account for Interactive experience record that is a Main form type. The Account for
Interactive experience form opens in a new browser window.

For Unified Interface, you need to use the form name that has <Entity> for Interactive experience . The form
names for other entities are as follows:

ENTITY NAME

Account Account for Interactive experience

Case Case for Interactive experience

Contact Contact for Interactive experience

7. Double-click the Conversation Tabs field in the Timeline section. The Activities Tab Properties dialog is
displayed.
8. Select the Show selected option for the Show these modules field in the Filter by container.
9. Select the modules you want to display to the users. Select only the modules that are required by your
organization.
10. Specify the following in the Additional Options container.

FIELD/OPTION DESCRIPTION VALUE

Default Module for Create Experience Select the module for which you Notes
want the default create experience in
the timeline.

The default value is Notes.

Show filter pane Select the checkbox if you want to


display the filter icon for the users. If
you leave the check box empty, there
will be no filters for the users.

Expand filter pane by default Select the checkbox, by default, if you


want to show the filter pane in the
expanded mode.

Note: When the timeline is displayed


on more than one column, the filter
pane is displayed as a column
alongside the timeline records. Even
though you've cleared Expand filter
pane by default check box in the
Timeline configurations, the filter
pane will always be displayed to your
agents.
FIELD/OPTION DESCRIPTION VALUE

Sort Select the sorting order based on Descending


which the records are displayed on
the timeline. The sorting is based on
the field you choose for Activities. If a
field doesn’t exist for the Post, Notes,
or Activity, then the sorting is done
based on the Last Updated field.

The default sort order is


Descending.

Note: changing the sort order will


not change the time property
visualized in the timeline control. To
customize the timeline card form see,
Customize the card form.

Number of results The maximum number of records 10


that are displayed on the timeline
before selecting the More option.
Each time you select the More
option, the timeline displays the
configured number of records. You
can configure a value ranging from 1
to 50.

The default value is 10.

11. Select OK, and then select Save.


12. Select Publish to publish the customizations.
Customize activity
As a customizer, you can choose which entities you want to show activities to users as per your business
requirements. For a better performance, select only the activities that are specific to business, and unselect the
activities that aren't used.
1. Sign in to your https://<YourOrgURL>.dynamics.com/apps environment.

2. Open a model-driven app, and then on the command bar select Settings > Advanced Settings.
3. Go to Settings > Customization > Customize the System. The solution explorer page opens in a new
browser window.
4. Expand Entities under Components in the default solution pane.
5. Select an entity and select Forms. For example, select the Account entity.
6. Select the Account for Interactive experience record that is a Main form type. The Account Account
for Interactive experience form opens in a new browser window.

For Unified Interface, you need to use the form name that has <Entity> for Interactive experience . The
form names for other entities are as follows:

ENTITY NAME

Account Account for Interactive experience

Case Case for Interactive experience

Contact Contact for Interactive experience

7. Double-click the Conversation Tabs field in the Timeline section. The Activities Tab Properties dialog is
displayed.
8. Select the Show selected option for the Show these activities field in the Filter by container.
9. Select the activities you want to display to the users.
10. Select an option from the list for the Sort timeline by option in the Data container. For example, select the
Last Updated option.
11. Specify the following in the Additional Options container.

FIELD/OPTION DESCRIPTION VALUE

Display activity header using Possible values are Default format Default format
and Field Labels.

Note:
If you select Default format,
then you should always select
Default Fields for the
Display activities using field.

If you select Field Labels,


then you can either select the
Default Fields or Card Form
for the Display activities
using field.

When you select Default


format and select Card
Form for the Display
activities using field, then
the system ignores the Card
Form value and uses the
Defaults Fields to display the
activities.

Create activities using Select on how you want the users to Quick Create Form
create activities. Possible values are
Quick Create Form and Main
Form.
FIELD/OPTION DESCRIPTION VALUE

Display activities using Select how you want to display the


activities. Possible values are Default
Fields and Card Form. If you select
Card Form, then you need to select
a card form for the activity.

Select activity Select an activity from the list. Email

Note: This field appears only when


you select Card Form for the
Display activities using field.

Select Card Form Select a card form from the list. Email Card form

Note: This field appears only when


you select Card Form for the
Display activities using field.

12. Select OK, and then select Save.


13. Select Publish to publish the customizations.
Since the example considered in this procedure is Account, let us see the Email activity in the Timeline control
of an account page.

FIELD VALUE

Display activity header using Default format

Display activities using Default fields


The default fields for an email activity in the collapsed mode contains the following:
1. Email from <Owner>
2. Subject
3. Description
4. Activity status
5. Date and time
After modifying the Email card form (from the Email entity) and updating the options in the Account for
Interactive experience form in the Account entity, you can view see the changes.

FIELD VALUE

Display activity header using Field labels

Display activities using Card form

Select activity Email

Select card form Email Card form

The default fields for an email activity in the collapsed mode contains the following:
1. Owner <Name>
2. Priority
3. Description
4. Activity status
Default string for the activities are as follows:

ACTIVITY DEFAULT FIELDS IMAGE

Appointment Appointment from <Owner Name>

Email Email from <Owner Name>


ACTIVITY DEFAULT FIELDS IMAGE

Phone Call Phone Call from <Owner Name>


When agent initiates a call.

Phone Call from <Contact>


When customer initiates a call.

Task Task modified by <Owner Name>

Note Note modified by <Owner Name>

Post Post by <Owner Name>

Customize field sections


In the timeline section, users see a card for each activity (based on the enabled activities). Each card displays
certain fields in the collapsed and expanded mode. For example, see Email activity card in collapsed mode, hover
mode, and expanded mode.
Email card collapsed mode: By default, the activity cards are in collapsed mode.

Email card hover mode: When you hover your cursor, you can see few commands that are specific to each of the
activity card types.

Timeline card expanded mode: When you select on card, it gets expanded with few commands that are specific
to each of the activity card types.
In the card, if you want to show any fields that are important to your business, you can customize the fields. Also,
you can move the fields from one section to another section, such as from the Header section to the Detail
section. To learn more, see Customize the card form.
Customize the card form
Any card form has the following sections:

SECTION ANNOTATION SECTION NAME DISPLAY COLUMNS

A ColorStrip ColorStrip section is never displayed to


the user.

B Header Fields 1 and 2 in are displayed to the


user.

C Details Fields 3, 4, and 5 are displayed to the


user where Fields 3 and 4 are displayed
in the collapsed mode and Field 5 is
displayed in the expanded mode.

D Footer Footer section is never displayed to the


user.

For example, see Email form.


Email configuration screen
Email card collapsed mode
Fields 1 and 2 from the Header section and Fields 3 and 4 from the Details section are displayed in the collapsed
mode. Fields 3 and 4 in the collapsed mode doesn't show contents in the rich text format.

Email card hover mode


Fields 1 and 2 from the Header section and Fields 3 and 4 from the Details section are displayed in the hover
mode.

Email card expanded mode


Field 5 from the Details section is displayed in the expanded mode. Field 3 in the expanded mode doesn't shown
contents in the rich text format, whereas field 4 in the expanded mode shows contents in the rich text format.
To customize the card form, follow these steps:
1. Sign in to your https://<YourOrgURL>.dynamics.com/apps environment.

2. Open a model-driven app, and then on the command bar select Settings > Advanced Settings.
3. Go to Settings > Customization > Customize the System. The solution explorer page opens in a new
browser window.
4. Expand Entities under Components in the default solution pane.
5. Select an entity and select Forms. For example, select the Email entity.
6. Select the Email Card form record from the list. The Email Card form opens in a new browser window.
7. Add, move, or delete the fields. To learn more, see Add, configure, move, or delete fields on a form.
In this procedure, we'll modify Email Card.
In the Header section, the Created on field is replaced with Priority.
Similarly, in the Details section, the Priority field is removed, and the Subject field is moved up.
8. Select OK, and then select Save.
9. Select Publish to publish the customizations.
Now, you can view the changes in the Timeline control. In the collapsed mode, you can view the changes made to
the card.

NOTE
If a field doesn't have any value, then in the card, the field value remains empty.

Enable custom activity in timeline


While you create a custom entity, you might want to show the custom entity as an activity for your users in the
timeline. To show the custom entity as an activity, you need to enable certain options during the creation of a
custom entity.

NOTE
Ensure to enable the custom entity as an activity before you create the entity. After you create the custom entity, you can't
enable the entity as an activity and display for your users in the Timeline control.

To enable a custom activity in timeline, follow these steps.


Step 1: Create an entity
Step 2: Add entity to the model-driven app
Step 1: Create an entity
You can create an entity either in classic mode or Power Apps.
Classic mode
1. Sign in to your https://<YourOrgURL>.dynamics.com/apps environment.

2. Open a model-driven app, and then on the command bar select Settings > Advanced Settings.
3. Go to Settings > Customization > Customize the System. The solution explorer page opens in a new
browser window.
4. Select Entities under Components in the default solution pane.
5. Select New to create an entity. A new browser window is displayed.
6. Enter the required fields as described in the Create an entity topic.

NOTE
The Create an entity topic is even applicable to the Dynamics 365 model-driven apps.
7. Select the areas where you want to display the custom entity.
8. Scroll down to the Communication & Collaboration section and select the required options.
9. Scroll down to the Data Services section and select Allow quick create check box. This option allows you
open the entity in a quick create form.
10. Scroll up to the Entity Definition, section and select the Define as an activity entity check box. This
option enables the entity as an activity.

NOTE
Only during the creation of the entity, you can enable this option. Once the entity is created, you can't update this
check box.

11. Ensure that the Display in Activity Menus check box is also selected.

NOTE
This option ensures that the activity is listed in the Timeline control menu.

12. Select Save.


13. Select Publish to publish the customizations.
PowerApps
Follow the Create a custom entity topic to create an entity using the PowerApps.
After Step 3 in the Create an entity, before saving creating the entity, ensure you perform the following:
1. Expand More settings > Entity type and ownership.
2. Select the Activity entity option from the Choose entity type drop-down list.
3. Ensure the Display in Activity menus check box is selected.
4. Expand Create and update settings.
5. Select the Enable quick create forms check box.

6. Select any other required option and then select Create.


Step 2: Add entity to the model-driven app
After you create the entity and enable it as an activity, you need to add the entity to the model-driven app.
1. Sign in to your https://<YourOrgURL>.dynamics.com/apps environment.
2. Select the ellipsis (...) on a model-driven app tile. For example, Customer Service Hub app tile.
3. Select OPEN IN APP DESIGNER. The App Designer opens in a new tab.
4. Look for the custom entity you created under Entity View in the canvas area.
5. Select Forms. The option is displayed in the components pane.
6. Select the check box under under Quick Create Forms area. This option uses the quick create form when
the user selects + button in the Timeline control.
7. Select Save.
8. Select Publish.

Enable custom activities in timeline for mobile client


When you’ve custom activities that you want to show for users using mobile, then you must enable it. Follow
these steps to enable.
Enable for mobile
1. Sign in to your https://<YourOrgURL>.dynamics.com/apps environment.

2. Open a model-driven app, and then on the command bar select Settings > Advanced Settings.
3. Go to Settings > Customization > Customize the System. The solution explorer page opens in a new
browser window.
4. Expand Entities under Components in the default solution pane.
5. Select an entity form the list. For example, Account.
6. Scroll down to Outlook & Mobile section, and select the check box for the following options:
Enable for mobile (according to your requirements)
Read-only in mobile (according to your requirements)
7. Select Save.
8. Select Publish to publish the customizations.
Select the modules to display
After you select Enable for mobile and Read-only in mobile options (as per your requirement) for an entity,
you need to select the module to display in the timeline. Select Show all if you want to show all the modules or
select Show selected if you want to show one or more modules as per your business requirement. If you select
Show selected, choose the modules you want to display. Follow the Steps 1-8 described in the Customize
modules section, and then save and publish the customizations.
Enable or disable rich-text editor for notes in timeline
Rich-text editor enables users to create rich and well-formatted content for the notes with emphasis. The editor
brings common word processor features. To learn more, see Take notes.
The feature is enabled by default. If you want to disable and enable later for your users, follow the steps:
1. Sign in to your https://<YourOrgURL>.dynamics.com/apps environment.

2. Open a model-driven app, and then on the command bar select Settings > Administration >
System Settings.
3. In the System Settings dialog, under the General tab, scroll down and select or unselect the check box for
the Use rich text to make it easier to format notes created in Timeline. field.
4. Select OK.
The rich-text editor is enabled or disabled for your users based on the check box selection.

See also
FAQs for timeline control
Timeline section in the Customer Service Hub app
Add an appointment, email, phone call, note, or task activity to the timeline
FAQs for timeline control
3/10/2020 • 2 minutes to read • Edit Online

Why do I receive the message "Records could not be loaded because


of unexpected error"?
The Timeline section retrieves data about and displays in the form cards. By default, the timeline retrieves data
for the 10 standard activity entities, which are:
Email
Task
Incident resolution
Fax
Opportunity close
Letter
Appointment
Phone call
When you perform the following procedures as an administrator, users will see an error at runtime:
Procedure
Create any additional custom activities
Enable custom activities for mobile
Select a Card Form for all the custom activities
Error: Records could not be loaded because of an unexpected error.

This error is caused because the number of activity entities for the data retrieval has exceeded the maximum limit
of 10.
Workaround
To work around the issue, you must reduce the number of entities to 10 or fewer. To do this, follow the steps
below.
1. Sign in to your https://<YourOrgURL>.dynamics.com/apps environment.

2. Open a model-driven app, and then on the command bar select Settings > Advanced Settings.
3. Go to Settings > Customization > Customize the System. The solution explorer page opens in a new
browser window.
4. Expand Entities under Components in the default solution pane.
5. Select an entity and select Forms. For example, select the Account entity.
6. Select the Account for Interactive experience record that is a Main form type. The Account for
Interactive experience form opens in a new browser window.

For Unified Interface, you need to use the form name that has <Entity> for Interactive experience .
7. Double-click the Conversation Tabs field in the Timeline section. The Activities Tab Properties dialog is
displayed.

8. Select the Show selected option for the Show these activities field in the Filter by container.
9. Select the activities you want to display to the users.
10. Select OK, and then select Save.
11. Select Publish to publish the customizations.

Why I can't assign or delete an activity from the timeline?


If you use the HideCustomActions rule to hide buttons, such as Assign and Delete in the ribbon command bar
definition, then those buttons that are present in the Timeline control will not work. The buttons in the command
bar are same as the buttons in the Timeline control; therefore, when a user selects the Assign or Delete button in
the Timeline control, an error message is displayed.
You do not have permission to perform this action. Please contact your system administrator.
To mitigate the issue, unhide the buttons in the command bar definitions.

Why my users see different activities and records in their My activities


stream in the dashboard?
My activities stream in the dashboard shows the records and activities that are owned by a particular user. For
example, user A see records and activities that are owned by A, and user B see records and activities that are
owned by B.

Why my agents see the filter pane even when the Expand filter pane
by default check box is cleared?
When the timeline is displayed on more than one column, the filter pane is displayed as a column alongside the
timeline records. Even though you've cleared Expand filter pane by default check box in the Timeline
configurations, the filter pane will always be displayed to your agents.

See also
Set up timeline control
Timeline section in the Customer Service Hub app
Add an appointment, email, phone call, note, or task activity to the timeline
Model-driven app quick view control properties
12/3/2019 • 2 minutes to read • Edit Online

A quick view control on a model-driven app form displays data from a record that is selected in a lookup on the
form. The data displayed in the control is defined using a quick view form. The data displayed is not editable, but
when the primary field is included in the quick view form, it becomes a link to open the related record. More
information: Create and edit quick view forms

You can access Quick view control properties from the Power Apps site.
1. Sign in to Power Apps.
2. Expand Data, select Entities, select the entity that you want, and then select the Forms tab.
3. In the list of forms, open the form of type Main. Then on the Insert tab, select Quick View Form to view
quick view control properties.
PROPERTY DESCRIPTION

Name Required: The unique name for the quick view form that is
used when referencing it in scripts.

Label Required: A label to display for the quick view form.

Display label on the Form Displays the label on the form.

Lookup Field Choose one of the lookup fields included in the form.

Related entity This value depends on the Lookup Field you choose. It is
usually the primary entity for the 1:N entity relationship for
the lookup.

If the entity includes a Potential Customer lookup that can


accept either an account or contact, in the Quick View Form
field you can choose a quick view form for both account and
contact by changing this value and then choosing another
quick view form.
PROPERTY DESCRIPTION

Quick View Form If the Related entity has any quick view forms you can select
them here. Otherwise, select New to create one.

Select Edit to change the selected quick view form.

Additional Properties You can specify the default rendering style by selecting the
check box.

Next steps
Use the Main form and its components
Additional controls for Dynamics 365 for phones and
tablets
12/2/2019 • 9 minutes to read • Edit Online

You can use a rich set of additional controls to create a more touch-friendly experience on Dynamics 365 for
phones and tablets. These include sliders, switches, multimedia player, input masks, calendar, and other controls.

NOTE
You can use these additional controls only with the mobile apps. They aren’t supported in the web app.

To use these controls in the form editor:


1. Double-click the field or list you want to add the control to.
2. Click the Controls tab.
3. Click Add control.
4. Select the control you want and then click Add.

NOTE
Different controls are available depending on the field or list type. For example, slider controls might only be available
for numerical or money fields, and the calendar control is only available for lists.

5. Select the devices you want the control to appear on (phone, tablet, or both). Controls aren’t available for
phone header fields.
6. Configure the values for each property.
7. Click OK when you’re done configuring the control.
Following are descriptions for each control you can use on forms for Dynamics 365 for phones and tablets.

Calendar control
Use this control to configure forms so they show up as a calendar view in Dynamics 365 for phones and tablets.
You can also use this control to replace dashboards, lists, or entity grids for phones and tablets.

PROPERTY DESCRIPTION

Start Date Define the start date and time of the item to visualize in the
calendar view. The available values are any of the columns in
this view of type date.

End Date Define the end date and time of the item to visualize in the
calendar view. The available values are any of the columns in
this view of type date.
PROPERTY DESCRIPTION

Duration The duration in minutes. If you specify a value for End Date,
Duration is ignored.

Description This is the caption you want to see for calendar items.

The minimum duration shown in the calendar is 30 minutes. Items with a duration less than 30 minutes will still
appear as 30 minutes long.
The calendar control supports all date behaviors (User Local, Date Only, and Time-Zone Independent).

Timeline control
Provide a timeline of recent, relevant news articles and Twitter tweets for an account.

PROPERTY DESCRIPTION

CC_Timeline_Title Property to map for the title of each timeline item.

CC_Timeline_Title_Desc Description for Title.

CC_Timeline_Label1 Field to be displayed below the title of timeline item.

CC_Timeline_Label1_Desc Description for Label 1.

CC_Timeline_Label2 Field to be displayed after Label 1.

CC_Timeline_Label2_Desc Description for Label 2.

CC_Timeline_Label3 Field to be displayed after Label 2.

CC_Timeline_Label3_Desc Description for Label 3.

CC_Timeline_Label4 Field to be displayed after Label 3.

CC_Timeline_Label4_Desc Description for Label 4.

CC_Timeline_Label5 Field to be displayed after Label 4.

CC_Timeline_Label5_Desc Description for Label 5.

CC_Timeline_Timestamp Field to use for sorting timeline in reverse chronological order.

CC_Timeline_Timestamp_Desc Description for Timestamp.

CC_Timeline_Group Field to map for grouping timeline.

CC_Timeline_Group_Desc Description for Group field.


PROPERTY DESCRIPTION

CC_Timeline_GroupOrder Order of the group the item belongs to relative to other


groups (assign values 1, 2, 3, and so on for groups to be
displayed). The group will be displayed in ascending value of
group values assigned.

CC_Timeline_GroupOrder_Desc Description for Group Order field.

CC_Timeline_URL URL field to map for displaying the URL of each timeline item.

CC_Timeline_URL_Desc Description for URL field.

CC_Timeline_ThumbnailURL Field to map for thumbnail of image/icon to display for each


item.

CC_Timeline_ThumbnailURL_Desc Description for the ThumbnailURL field.

CC_Timeline_Filter Field to map for timeline filter.

CC_Timeline_Filter_Desc Description for Filter.

CC_Timeline_Footer Web resource to display as the footer of the timeline.

CC_Timeline_Footer_Desc Description for Footer field.

Linear slider
The linear slider control lets your users input numerical values by dragging a slider and also provides an option for
typing in the quantity. The slider provides whole number input and display only. Use this control for any numerical
or money field.

PROPERTY DESCRIPTION

Max Set the maximum value to display on the slider.

Min Set the minimum value to display on the slider.

Value The value to display on the slider.

Step Set the amount to add or subtract from the current value
when entering data with this control.

Option sets
The option set control presents a set of choices for your users to choose from when entering data. Use this control
for option sets with two or three choices only.

PROPERTY DESCRIPTION

Field Shows the field that the control is mapped to.


Flip switch
The flip switch is like an on/off switch, providing a choice between two values.

PROPERTY DESCRIPTION

Field Shows the field that the control is mapped to.

Star rating
Use the star rating to provide a visual representation of a rating. The maximum number of stars you can set is five.
You can use this control for whole numbers only; it can’t accept decimal values.

NOTE
Be sure to select the Hide on web option for this control.

PROPERTY DESCRIPTION

Max Select the maximum number of stars for the control from the
dropdown list.

Radial knob
The radial knob provides a way for users to enter data by sliding the knob, and shows up on the screen as a circle.
The radial knob control provides whole number input and display only. Use this control for any numerical or
money fields. You can use touch to change the value, or you can use the keypad to focus on the number and edit it.

NOTE
This control isn’t supported on Android 4.2 and 4.3 devices. It impacts the scrolling experience on those versions.

PROPERTY DESCRIPTION

Max Set the maximum value to display on the gauge.

Min Set the minimum value to display on the gauge.

Value Get or set the value to display on the gauge.

Step Set the amount to add or subtract from the current value
when entering data with this control.

Website preview
Use the website preview control to map a URL field and show a preview of the website.
IMPORTANT
By enabling this control, you consent to allow your users to share certain identifiable device information with an external
system. Data imported from external systems into a Power Apps app or Dynamics 365 apps such as Dynamics 365 Sales or
Dynamics 365 Customer Service are subject to our privacy statement at Microsoft Privacy and Cookies.
Privacy notices

PROPERTY DESCRIPTION

Field Shows the field the control is mapped to.

Bullet graph
The bullet graph control displays a single key measure with a comparative measure and qualitative ranges to
instantly signal whether the measure is good, bad, or in another state. Use this control in dashboards for any
numerical or money field. For example, you can map the value to actual revenue and the target to estimated
revenue to visualize actual versus estimated revenue.

PROPERTY DESCRIPTION

Max Set the maximum value to display on the graph.

Min Set the minimum value to display on the graph.

Good Set a value that’s considered good for the measure (optional).

Bad Set a value that’s considered bad for the measure (optional).

Value Shows the field that the control is mapped to.

Target Map this to the field you want to compare the value with. For
example, if Value is mapped to Actual Revenue, you can map
Target to Estimated Revenue, or you can provide a static
value.

Pen control
Use the pen control to capture written input such as signatures.

NOTE
The minimum recommended Maximum Length specified for the field this control maps to is 15000.
Be sure to select the Hide on web option for this control.

PROPERTY DESCRIPTION

PenMode Specify PenMode!Draw, PenMode!Erase, or


PenMode!Select to determine what happens when a user
drags a pointing device in a pen control.
Auto-complete
The auto-complete control filters an item list as you type and lets you select a value from the drop-down list. For
example, you can use this control to let users choose from a dropdown list of states or countries/regions. This
control maps to a Single Line of Text type field.

PROPERTY DESCRIPTION

Field Shows the field the control is mapped to.

Source Set the source for the data (Grouped Options, Option Set, or
View).

Option Set Select the option set for this field.

View Select the entity and view for this field.

Field Select the field of the view’s primary entity to use as the data
source.

Multimedia
You can embed videos to provide a richer customer experience for sales and field people on the go. Use this control
to map to a URL field that contains the audio or video link to play in the control.

NOTE
This control is supported on Android versions 4.4 and later.
YouTube videos aren’t currently supported on Windows 8 and Windows 8.1 tablets and phones. On Windows 10, only HTTPS
videos (including YouTube) are supported.

Supported media types include:


Streaming MP4 files
YouTube videos
Azure media
Audio streams
Privacy notice

PROPERTY DESCRIPTION

Media Enter the URL of the media to play in this control.

Number input
Use the number input control to help users enter data quickly. Users only have to tap the plus and minus buttons to
change a numeric value in increments you set. Use this control for any numerical or money field. Users can also
type a number directly into the field. This field is only supported in edit mode.
PROPERTY DESCRIPTION

Step Set the amount to add or subtract from the current value
when entering data with this control.

Field Shows the field the control is mapped to.

Input mask
With the input mask control, you set the formatting for a field like phone number or credit card to prevent entering
invalid data. For example, if you want users to enter a United States phone number in the format +1-222-555-
1011, use the input mask +1-000-000-0000.

PROPERTY DESCRIPTION

Mask Enter the mask to use for validating data as users enter it. You
can use a combination of the following characters for the
mask:

0 – Digit

9 – Digit or space

# – Digit, sign, or space

L – Letter

I – Letter or space

A – Alphanumeric

A – Alphanumeric or space

< – Converts characters that follow to lower case

> – Converts characters that follow to upper case

| – Disables case conversion

\ – Escapes any character, turning it into a literal

All others – Literals

Field Shows the field the control is mapped to.

Linear gauge
The linear gauge lets your users input numerical values by dragging a slider instead of typing in the exact quantity.
The slider provides whole number input and display only. Use this control for any numerical and money fields.

PROPERTY DESCRIPTION

Max Set the maximum value to display on the gauge.

Min Set the minimum value to display on the gauge.

Value Get or set the value to display on the gauge.


PROPERTY DESCRIPTION

Step Set the amount to add or subtract from the current value
when entering data with this control.

Arc knob
The arc knob provides a way for users to enter data by sliding the knob, and shows up on the screen as an arc. The
arc knob control provides whole number input and display only. Use this control for any numerical and money
fields. You can use touch to change the value, you can also focus on the number and edit it using the keypad.

NOTE
This control isn’t supported on Android 4.2 and 4.3 devices. It impacts the scrolling experience on those versions.

PROPERTY DESCRIPTION

Max Set the maximum value to display on the gauge.

Min Set the minimum value to display on the gauge.

Value Get or set the value to display on the gauge.

Step Set the amount to add or subtract from the current value
when entering data with this control.

Next steps
Tutorial: Use custom controls for data visualizations
Model-driven app timer control overview
12/2/2019 • 2 minutes to read • Edit Online

Use a timer control with forms where records need to meet a specific time-based milestone. A timer control shows
people how much time is available to complete an action in the resolution of an active record or how much time
has passed since the time to complete the action has passed. At a minimum, timer controls must be configured to
show success or failure in completing the action. In addition, they can be configured to display warnings when the
conditions are approaching failure.
A timer control can be added to a form for any entity, but they are most frequently used for the case entity,
especially when linked to fields that track service level agreements. You can add multiple timer controls in the body
of a form. You can’t add them to the header or footer.
Timer control Data Source properties use fields for the entity.
The Failure Time Field uses a date-time field to set the time.
The three condition fields use one of the Option Set, Two Options, Status, or Status Reason fields for the
entity.
To create a timer control, in the form designer select the Insert tab, and then on the toolbar select Timer.

On the Timer Control properties page, enter or select the properties that you want, and then select OK.

Timer control properties


The following table describes the properties of a timer control.

GROUP NAME DESCRIPTION

Name Name Required. A unique name for the


control.

Label Required. The label to display for the


timer control.
GROUP NAME DESCRIPTION

Data Source Failure Time Field Required. Choose one of the date-time
fields for the entity to represent when a
milestone should be successfully
completed.

Success Condition Required. Select a field for the entity to


evaluate the success of the milestone,
then choose which option indicates
success.

Warning Condition Select a field for the entity to evaluate


whether the success of the milestone is
at risk so that a warning should be
displayed, then choose which option
indicates that a warning should be
displayed.

Cancel Condition Select a field for the entity to evaluate


whether the achievement of th
milestone should be cancelled, then
choose which option indicates that the
milestone is cancelled.

Next steps
Overview of the form editor user interface
Use custom controls for model-driven app data
visualizations
12/3/2019 • 4 minutes to read • Edit Online

In this topic you learn how to configure a custom control for a field.
Custom controls let you transform app user interface components, such as a field or view that traditionally contain
text, into visualizations. Custom controls can be configured on fields, forms, dashboards, views, and grids. For
example, a slider control can be configured on a number field.

Or the editable grid control can be configured on a view.

You can set one type of custom control to appear in the web browser client while having a different custom control
appear in your Dynamics 365 phone or tablet mobile apps. For example, you could use a number input custom
control for a field in web browser clients and a slider custom control for the phone app. After the customization is
published, users can fully interact with the control to change the value, such as by sliding the control when using
the linear slider custom control. Changes are automatically saved when the form is closed just as they are when
the user changes a traditional field on a form.

Use a custom control to add visualizations to a field


Following the steps in this procedure will change the default label and text box field of the Budget Amount field
to the slider custom control on the Opportunity entity. You can use similar steps to replace an existing field with a
custom control or configure a custom control for a custom field.
1. Sign in to Power Apps.
2. Expand Data, select Entities, select the entity that you want, and then select the Forms tab.
3. Open a form such as the Main form for the opportunity entity.
4. In the form editor, double-click the field where you want to add a custom control, such as the Budget
Amount field on the opportunity main form. Alternatively, you can create a custom field.
5. On the Field Properties page, select the Controls tab, and then select Add Control.
6. On the Add Control page, select the control that you want, such as the Linear Slider control shown here,
and then select Add.

6. Choose the client where you want the control to appear.


Web. To make the custom control available from any web browser, select the Web option next to the
control. Notice that setting the Web option includes rendering the control in web browsers on PCs,
Macs, and mobile devices.
Phone. To make the custom control available on phones running Dynamics 365 for phones, select
the Phone option next to the control.
Tablet. To make the custom control available on tablet devices running Dynamics 365 for tablets,
select the Tablet option next to the control.
7. Select the pencil icon next to Min, Max, and Step, set the property option described below, and then
select OK.
Min. Set the minimum accepted value. You can bind a static value that you enter or bind the value to an
existing field. In this example Bind to static value is Currency and the minimum value that can be entered
is zero.
Bind to a static value. Select the data type, such as a whole number (Whole.None), currency,
floating point (FP ), or decimal. Next, enter a number that represents the minimum accepted value for
the field.
Bind to values on a field. Select a field from the list that will be used as the minimum accepted
value.
Max. Set the maximum accepted value for the field. Similar to the Min value, you can bind a static value
that you enter or bind the value to an existing field as described earlier. In this example, Bind to static
value is Currency and the maximum value that can be entered is 1 billion.
Step. This represents the unit to increment or decrement when adding to or subtracting from the current
value. For example, for budget amount you can select 100 dollar increments\decrements.
Hide Default Control. Selecting this option hides the control so neither the control or the data is
displayed in any of the clients that don't support the custom control. Notice that the classic Dynamics 365
web client doesn't support most custom controls. By default, this option is not selected and the classic
Dynamics 365 web client displays the default, typically text based, control.
NOTE
The default control is identified with (default) following the control name.

8. Select OK, to close the Field Properties page.


9. To activate the customization, on the entity form select Save, and then select Publish.
10. Select Save and Close to close the form editor.
See the custom control in action
Open a record that includes the field with the custom control, such as the opportunity form from the previous
example, and view how the field is changed.

The field is now rendered as a slider control instead of the text field.

Use the editable grid control on a view or sub-grid


With editable grids, users can do rich in-line editing directly from views and sub-grids whether they’re using a
web app, tablet, or phone. More information: Make grids (lists) editable using the Editable Grid custom control

Next steps
Create and edit fields
Use Excel and Word templates
10/1/2019 • 2 minutes to read • Edit Online

You can use templates in a variety of ways to speed your work and improve consistency. With Excel templates, you
can easily create and share your customized analysis with others in your organization. You can use Word templates
to create standardized documents automatically populated with Common Data Service data.

Enable and work with Excel and Word templates


1. Go to https://admin.powerplatform.microsoft.com.
2. Select Environments, select an environment, and then select Open environment.
3. If you see published apps, select an app to open it. Otherwise, skip to Step 5.

4. In the upper-right corner, select the gear icon, and then select Advanced settings. If you don't see
Advanced settings, proceed to the next step.
5. Select Settings > Templates.

6. On the Templates page, select Document Template to work with Excel or Word templates.
For information on using templates, see the following documentation:
Word templates: Use Word templates to create standardized documents
Excel templates: Analyze and share your data with Excel templates
Create a theme
12/3/2019 • 3 minutes to read • Edit Online

You can create a custom look and feel (a theme), for your app by making changes to the default colors and visual
elements provided in the uncustomized system. For example, you can create your personal product branding by
adding a company logo and providing entity-specific coloring. A theme is created by using the customization tools
in the user interface, without requiring a developer to write code. You can create, change or delete themes that are
used in your organization. The theme customization is supported in the Web forms in Dynamics 365 for Outlook.
You can define multiple themes, but only one can be set and published as the default theme.

Use themes to enhance the user interface and create your product
branding
Theming is used to enhance the app user interface, not drastically alter it. The theme colors are applied globally
throughout the application. For example, you can enhance the following visual elements in the UI:
Change product logos and navigation colors to create product branding
Adjust accent colors, such as hover or selection colors
Provide entity-specific coloring
Logo
Logo tooltip
Navigation bar color
Navigation bar shelf color
Main command bar color on the Unified Interface
Header color
Global link color
Selected link effect
Hover link effect
Legacy accent color (primary background for process controls)
Default entity color
Default custom entity color
Control shade
Control border

Solution awareness
The theme is not solution aware. The changes made for an organization's theme aren’t included in solutions
exported from the organization. The data is stored in the theme entity that can be exported and re-imported in
other environment. The imported theme must be published to take effect.
Copy and alter the existing theme
The easiest and quickest way to create a new theme is to clone and alter an existing theme, then save it, preview
and publish.
1. Sign in to Power Apps.
2. Select Model-driven (lower left).

3. Select (upper right) > Advanced customizations.


4. Under Themes select All themes.
5. Select CRM Default Theme.
The following screenshot shows a portion of the default theme setup.

We cloned the default theme and changed the colors. The following screenshots show the new colors for
navigation and highlighting. You can also choose a new logo for product.
The following screenshot shows the new navigation color.

The following screenshot shows the account entity grid with the new highlight color.

Preview and publish a theme


To preview and publish a theme, do the following steps:
Create a new theme from scratch or clone an existing one.
Preview the new theme by choosing Preview on the command bar. To exit the Preview mode, choose Exit
Preview on the command bar, next to the Preview button.
Publish a theme. Choose Publish Theme on the command bar.
The following screenshot shows the buttons on the command bar for preview and publishing.

Best practices
Following are the recommendations for designing theme contrasts and choosing colors.
Theme contrast
We recommend the following approach to providing contrast colors:
Carefully choose the contrasting colors. The Common Data Service out-of-the-box default theme has the
correct contrast ratios to ensure optimal usability. Use similar rations for your new themes.
For high contrast mode, use the default color settings.
Theme colors
We recommend that you don’t use a large number of different colors. Although you can set a different color for
every entity, we recommend one of two patterns:
Make all entities in neutral colors and highlight the key entities.
Use the same color for similar entities or related entities, such as queue and queue item, or product catalog
entities. Keep the total number of groups low.

Custom theme considerations


You should consider the following when planning on using custom themes:
Most updated user interface (UI) areas will be displayed in the custom theme colors.
Even though the theme colors are applied globally throughout the application, some legacy UI areas, such as
gradient buttons, will retain the default colors.
Certain areas must use dark or light colors to contrast with the default icon colors. The icon color isn’t
customizable.
An entity can’t be displayed in different colors under different Sitemap nodes.
The Sitemap nodes colors aren’t customizable.

See also
Video: Themes Query and edit an organization theme
Create guided help for your Unified Interface app
2/29/2020 • 11 minutes to read • Edit Online

[This topic is pre-release documentation and is subject to change.]


Use custom help panes and guided tasks to give your Unified Interface application a custom in-product help
experience that is tailored to your organization. Use custom help panes to provide entity, form, and language-
specific help and guidance that includes rich text, content links, images, and video links.

IMPORTANT
Custom help panes replace the previous learning path guided learning feature used with legacy web client apps.

Custom help panes and learning path


The new guided help implementation of custom help panes differs from the previous learning path guided help
feature. Both features let you create custom help for your application. However, custom help panes are optimized
for the most common guided help scenarios.
Custom help panes provide the following key features that are not available with learning path:
Free-form rich text, including bullets and numbering.
Visibly linked coach marks and help balloons.
More options for video sources, including private sources.
Storage of help content in Common Data Service as part of your solution.
Custom help panes don't provide the following key features that are available with learning path:
Sequential help balloons.
Help pages per role.
Help pages for per-device form factor, such as smartphones.

Prerequisites
To author custom help panes, you need the following:
Version 9.1.0.10300 or later.
Global create, read, write, delete, append, and append to permissions on the Help Page privilege. By default,
System Administrator and System Customizer security roles both have this privilege.
Your environment must have custom help panes enabled.

Enable custom help panes for your environment


1. Open a model-driven app, and then on the command bar select Settings > Advanced Settings.
2. Go to Settings > System > Administration.
3. On the Administration page, select System Settings.
4. On the General tab, under Set custom Help URL, select Yes for Enable Custom Help Panes and
Guided Tasks, and then select OK.
IMPORTANT
You can enable custom help panes or customizable help, but not both at the same time. Confirm that Use custom Help for
customizable entities and Append parameters to URL are both set to No.

Context-sensitive custom help


Each help pane is unique for these contexts:
Application
Entity
Form
Language

Help pane navigation


By default, a help pane stays open and on the help content you first opened it with even when you navigate to a
different form. This allows for the help content to remain intact as you direct users to different parts of the app.
To author help pane content
1. To view the help pane, open a model-driven app, and then on the command bar select Help.

2. On the Help pane, select the vertical ellipsis, and then select Edit.
The help pane is now in edit mode and the cursor is positioned on the help pane title.
3. From the edit pane you can perform the following tasks:
Enter text by typing directly in the help pane area.
Format text by using the rich text commands, such as bold, italic, strikethrough, and create lists.
Select the Insert tab to add sections, video, images, links, coach marks, and balloon help.
4. To save your changes, select Save.
Free -form text
Text can be placed anywhere within the help pane. Enter free-form text before, in, or after sections. Text supports
bold, italic, underline, and strikeout font formats. Cut, copy, and paste can be used as well as multilevel undo.
Bullets and numbered lists
Selecting the bullet or number icon toggles the current line to become bulleted or numbered. If you have selected
multiple lines in a list, each line becomes bulleted or numbered. Tabbing and indenting subnumbers a line within
the list.
Sections
A section is a collapsible text box. You can put links or free-form text in it. Use a section to group similar items. A
section can be either open or collapsed by default.
Video and static images
You can insert videos and static images into your help pane. Videos and images are links to content on the internet.
Custom help panes do not store the video and image files in your help pane. When the help pane is opened,
custom help panes bring the content in from the link to display it. You can use a link to a Microsoft Stream video if
you want to reference corporate private content.

TIP
Remember to copy the link URL for the video or image you want so you can paste it into your help pane.

Custom help panes support the following video sources:


Microsoft Stream (use for private content)
YouTube
Facebook
Vimeo
Links
Links can be to websites and open in the same window (the default) or open in a separate window. The ability to
link to an existing help page is not yet enabled.
Balloons and coach marks
Balloons and coach marks can be used to point to specific UI elements. A balloon can have text in it. A coach mark
simply highlights an element with a coach pointer. A way to illustrate several UI elements sequentially is to simply
collect links in a list that the user can select. For instance:
1. Link to first UI element with instructions or comments.
2. Link to second UI element with instructions or comments.
3. Link to third UI element with instructions or comments.
A user can either select an element in order or go back to a specific one and highlight it.

Solutions and custom help pane content


All help content is stored in a help page component in Common Data Service as part of your solution. When you
move your solution from one environment to another, such as from test to production, you can define that your
help records are exported so that they are included in the solution. This enables you to keep your help content in
sync with features in your solution as it moves to different environments. As a part of your solution, custom help
panes support all standard solution application lifecycle management (ALM ) features.
Moving content via solutions
By default, all new help pages appear in the default solution. If you want to move your content to another
environment, first add your existing help pages into an unmanaged solution before you export them. To add a help
page to an unmanaged solution, follow these steps:
1. Navigate to your unmanaged solution.
2. Select Switch to classic from the ellipsis on the command bar.
3. Select Add Existing.
4. Select Help Page.
5. Select the help pages that you want to add, and then select Ok.

NOTE
Currently, you can't add existing help panes to an unmanaged solution in the modern solution explorer.

Help page documentation automation


You might want to back up or store your content in a source code control system. You might also like to use
documentation automation tools, such as translation tools or checkers, on help pane content. The custom help
pane data is stored directly in Common Data Service and can be exported and imported for this purpose.
Custom help panes support a custom XML format. This format is documented below. More information: Custom
help XML definition
When exported, each help page is exported as a separate file.

Frequently asked questions


This section discusses frequently asked questions about custom help pages.
Are custom help pages the same as customizable help?
Custom help panes and guided tasks are an option in the Set custom help URL section of system settings.
Custom help panes and guided tasks enable a customizable help pane that shows up right next to the user’s form.
The other options in this system settings set custom help section comprise the customizable help features. They
allow you to override the default apps help and point users in your organization to a different URL for help.
Alternatively, you can override the help for a highly customized entity so that you can better describe your
workflow.
For more information about customizable help, see Enable and use customizable help.
How do I migrate my data from learning path to custom help pages?
Learning path has two types of help: help panes and sequential help balloons. The sequential help balloon
locations are deeply integrated with the legacy web client UI and are not transferrable to the new custom help
panes.
Depending on how much text you have in your guided help it might be easiest to simply copy the information
directly from the learning path user interface to the new custom help pane user interface. However, you can also
export your learning path help content. The simplest way to do this is to export your content using the Learning
Path > Content Library > Localize > Export feature. Select the records you want and then export them. This
creates an XLIFF file for each help pane and guided task. Then, use a publicly available XLIFF editor or XLIFF to
HTML converter to retrieve your content.

Custom help XML definition


This section describes the custom help XML definition.
PPHML

<pphml>
<h1>FAQ</h1>
<collapsible title="What is PPHML?">
<p>PPHML is a domain specific language for help content. It is used to create help content that
includes elements such as images, videos, balloons, coach marks, etc.</p>
</collapsible>
<collapsible title="What does PPHML stand for?">
<p>PPHML stands for Power Platform Help Markup Language</p>
</collapsible>
</pphml>

Definition and usage


The <pphml> element tells the help browser that this is a PPHML document.
The <pphml> element represents the root of a PPHML document.
The <pphml> element is the container for all other PPHML elements.
Title
Presents a title in a help page.

<h1>This will be displayed at the top of the help page</h1>

Definition and Usage


The <h1> element defines the title of a help page.
<h1> This must be the first element inside <pphml> .
Image
Presents an image in a help page.
<img src="smiley.gif" alt="Smiley face" title="Smiley face"/>

Definition and usage


The <img> element embeds an image in a help page.
Attributes
src : Specifies the URL of an image. This attribute is required.
title : Specifies a title to show along with the image, typically as a hover tooltip.
alt : Specifies an alternate text for an image. This text is used by screen readers.
Video
Presents a video in a help page.

<video src="https://www.youtube.com/watch?v=WSWmn7WM3i4" />

Definition and usage


The <video> element embeds a video, such as a tutorial or training movie, in a help page.
Su p p o r t e d so u r c e s

Microsoft Stream
YouTube
Facebook
Vimeo
Attributes
src : Specifies the URL of the video. This attribute is required.
allowFullScreen : Specifies whether the user can switch the video to full screen. Possible values are "true" or
"false". This attribute is not supported for all video sources.
autoplay : Specifies that the video will start playing as soon as the help page loads. Possible values are
"true" or "false". This attribute is not supported for all video sources.
startTime : Specifies, in seconds, from which point to start playing the video.
Paragraph
Presents a paragraph in a help page.

<p>This is some text in a paragraph.</p>

Definition and usage


The <p> element defines a paragraph.
Text inside a paragraph can be decorated in the following ways:
Bold, with <strong> element
Italic, with <em> element
Strikethrough, with <del> element
Underline, with <u> element

These decorations can be combined. For example, make a fragment of text that is both bold and underlined.
Bulleted list
Presents a bulleted list in a help page.

<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>

Definition and usage


The <ul> element defines a bulleted list.
Use the <ul> element together with the <li> element to create bulleted lists.
Numbered list
Presents a numbered list in a help page.

<ol>
<li>First step</li>
<li>Second step</li>
<li>Third step</li>
</ol>

Definition and usage


The <ol> element defines an ordered (numbered) list. Use the <ol> tag together with the <li> element to create
numbered lists.
Collapsible
Presents a collapsible section in a help page.

<collapsible title="This is a Section">


<p>This is a paragraph inside a section</p>
<img src=smiley.gif" title="This is an image inside a section" />
</collapsible>

Definition and usage


The <collapsible> element defines a section of content that the user can view or hide on demand.
Attributes
collapsed: Specifies whether the section is collapsed or expanded initially. Possible values are "true" (collapsed)
or "false" (expanded).
Link
Presents a link in a help page.
Link to a website that opens in a new browser window:

<a href="https://www.microsoft.com" target="_blank">Microsoft Home Page</a>

Link to another help page:

<a href="./LearnMore">Learn More</a>

Definition and usage


The <a> tag defines a link, which allows the user to navigate from a help page to a website, or to another help
page.
Attributes
href : Specifies the URL of the website or help page to which to navigate. This attribute is required.
target : Specifies where to open the linked URL.
If not present or _self , the link is assumed to be to another help page and it's opened in the help
browser.
If _blank , the link is opened in a new browser window.
If _top , the link is opened in the current browser window.
If the value is the name of an iframe , the link is opened in that iframe.
Coach mark
Presents a coach mark in a help page.

<coachmark target="#my-html-button">Click to highlight the HTML element with id [my-html-button]</coachmark>

Definition and usage


A coach mark is an interactive element that can be used to draw the user's attention to a specific point in the UI of
the application hosting the help browser.
Attributes
target : CSS selector that specifies the HTML element over which the coach mark will be shown. This attribute
is required.
Balloon
Presents a balloon in a help page.

<balloon target="#my-html-button" title="This button submits the form" details="Please click this button to
continue and submit the form">Click to show a balloon over the HTML element with id [my-html-button]</balloon>

Definition and usage


A balloon is an interactive element that can be used to help the user perform an action in the UI of the application
hosting the help browser.
Attributes
target : CSS selector that specifies the HTML element over which the balloon link will appear. This attribute is
required.
title : Specifies the title of the balloon.
details : Specifies the content to show inside the balloon.
Add reporting features to your model-driven app
12/3/2019 • 3 minutes to read • Edit Online

Power Apps apps can include reports that provide useful business information to the user. These reports are based
on SQL Server Reporting Services and provide the same set of features that are available for typical SQL Server
Reporting Services reports.

System reports are available to all users. Individuals who create or otherwise own reports can share them with
specific colleagues or teams, or can make the reports available to the organization, so that all users can run them.
These reports use FetchXML queries that are proprietary to Common Data Service and retrieve data to build the
report. Reports that you create in a Power Apps app are Fetch-based reports.

NOTE
Report features don't work with canvas apps or model-driven apps running on mobile devices, such as tablets and phones.

Add reporting to a Unified Interface app


You can add fetch-based reporting functionality to your app so that users can run, share, create, and edit reports. To
do this, you add the report entity to your app's site map.
1. Sign in to Power Apps and open an existing app for editing.

2. In App Designer, select next to Site Map.


3. In the Sitemap Designer, select Add and then select Area.
4. In the Title box, enter a name for the area title, such as Reports.
5. Select the area that you named in the previous step, select Add, select Group, and then in the group Title
box enter a name for the group title, such as Reports.
6. Select the group that you named in the previous step, select Add, select Subarea and then include the
following properties:
Type. Select Entity.
Entity. From the list of entities, select the Report entity.
Title. Enter a descriptive title, such as Reports.

7. Select Save and Close to return to the app designer.


8. In App Designer select Save, and then select Publish.
Now the app displays a Reports area where users can view, run, assign, share, and edit the reports they have
permission to as well as create new reports using the report wizard.

Options for creating new reports


You can create a new report in one of two ways:
Use the Report Wizard. Open a model-driven app that has been enabled for reporting and run the Report
Wizard to create a new report. The Report Wizard can create table and chart reports, including drill-through
reports and top N reports. More information: Create a report using the Report Wizard
Use the Report Authoring Extension. You can write new or customize existing fetch-based Reporting Services
reports with Visual Studio, SQL Server Data Tools, and the Report Authoring Extension. More information:
Create a new report using SQL Server Data Tools

Report visibility
Standard entity reports, such as the Accounts Summary report for the account entity, are available to all app users.
Users who own reports can share them with specific colleagues or teams. System administrators and system
customizers can make reports available with organization-wide visibility, so that all users can use them. For
information about how to share a report, see Share a report with other users and teams.

Reports in solutions
Reports are solution aware. Adding a report as a component to a solution makes it become a single unit of
software that extends Power Apps functionality and the user interface. Only reports that are visible to the
organization can be added to solutions.
To find if a report is viewable to the organization: In the list of reports, open a model-driven app, select a report,
and then select Edit. On the Administration tab, see if Viewable By is set to Organization.

You can add, import, or export snapshots of reports as part of a solution. In model-driven apps, reports, sub
reports, report category, report display area, and report-related record type are considered as components of a
report set. When you import a solution update in non-overwrite mode, any updates by the solution to a report will
be ignored if any component of the report set has been customized.

Related topics
Work with reports
Create a report using the Report Wizard
Add a report from outside Power Apps
Edit the default filter of a report
Troubleshoot reports
Reporting considerations
12/3/2019 • 4 minutes to read • Edit Online

Model-driven apps have a number of capabilities that allow customers to surface business data that helps them
drive decisions and interact with their customers more effectively. Capabilities that are available include views,
charts, dashboards, and SQL Server Reporting Services reports. Also included is Microsoft Excel integration that
allows users to easily build self-service reports using the Power BI features PowerView, PowerPivot, and
PowerQuery. As the volume of data held in the app's database continues to grow it becomes more important than
ever to think about your BI strategy and determine the most effective mechanisms for reporting and visualizing
large datasets.
In an environment, the reporting infrastructure is shared and separate from the database. In this architecture,
although customers share the resources required to run the report, each report runs against the customers’
individual database instances. Additionally, users can run as many reports as they need whenever they want to run
them to meet business goals. We do not place time restrictions on reports.
The reporting capabilities built in to Common Data Service are designed to let users run reports on datasets that
span shorter periods of time. Considering this, note the following fixed settings:
Reports and queries can execute for up to five minutes. When the maximum period is reached, the report
will time out and a message is returned to the user. Within the five-minute duration, reports and queries are
allowed to span large datasets that are beyond 50,000 records, which provides significant flexibility to satisfy
most operational reporting needs.
To improve query response, we recommend that detailed reports minimize the display of large numbers of
records. To do this, apply suitable filtering to reduce the number of records that are returned. When you
create aggregated or summarized reports, queries should push the aggregation to the query rather than
fetch detailed records to perform aggregation in the report. This can be done by using Fetch XML
aggregation.
For charts and grids displayed in dashboards, your apps allow users to run queries that have a dataset that
has fewer than 50,000 rows. Should a user run a dashboard query that spans a dataset of 50,000 or more
rows, the message "The maximum record limit is exceeded. Reduce the number of records" is returned. The
dataset practical setting helps to ensure optimal performance of the app.

Tips and solutions for reporting


Typically, for most organizations' reporting needs, these settings are adequate. To make sure that your users do not
exceed these settings and to improve report querying performance in general, consider the following best
practices.
When you create custom reports or dashboards, design them to query smaller datasets over shorter periods
of time by adding a time-based filter in the report, such as the current month or quarter, to limit the results.
We recommend that you limit the number of entities that are needed to return the result. This helps reduce
the time required to run the query and return the result set.
We recommend that you reduce the number of records shown in detailed reports. Suitable filtering can be
used to reduce the number of records returned by the query to reduce timeouts.
For aggregated or summarized reports, queries must be used to push the aggregation to the database and
not fetch detailed records and perform aggregation in the SQL Server Reporting Services report.
When appropriate for your business, users should run the default (out-of-the-box) reports and dashboards.
These reports and dashboards are typically designed to query per user datasets, so in most cases will not
exceed the dataset limit.
If users must run reports that exceed these settings, we recommend that you review the following options
for assistance with complex reporting needs. Both options effectively offload reporting workloads from
Common Data Service to another datastore by using a data integration solution.
Adapters are used in conjunction with SQL Server Integration Services (SSIS ) to extend the capabilities for
integration with your apps data.
Extract transform load (ETL ) tools provide a new tool set for creating analysis of data by combining multiple
data sources or extracting data to the data warehouse solution if SSIS is not in use. ETL tools provide
comprehensive solutions for connecting with common data service to move data.

IMPORTANT
When you use these tools, we recommend you move or synchronize data during nonbusiness hours.

If needed, there are many Microsoft partners who can help provide a solution for your specific reporting needs,
such as creating an offline copy of the data specifically used for running large reports. These partners are
knowledgeable with the data integration tools available. More information: Find a Dynamics 365 partner

Third-party adapters for SSIS


CozyRoc SSIS+ component for Dynamics 365/CRM
KingswaySoft SSIS Integration Toolkit for Dynamics 365
CData SSIS components for Dynamics 365
Team4 SSIS Connector for Dynamics 365

ETL tools
TIBCO Dynamics 365 integration
See also
Report Authoring Extension (with SQL Server Data Tools support)
Introduction to Microsoft Power Query for Excel
Dynamics 365 for Customer Engagement OData Feeds and Power Query: What’s the [Record]?
RDL sandboxing
3/10/2020 • 2 minutes to read • Edit Online

In Common Data Service, reports run in the sandbox mode. This is done by enabling Report Definition Language
(RDL ) Sandboxing in SQL Server Reporting Services. The RDL Sandboxing lets you detect and restrict the usage
of specific types of resources. As a result, certain features in Power Apps model-driven apps may not be available.
For more information, see MSDN: Enabling and Disabling RDL Sandboxing.
The current RDL Sandboxing configuration settings in Common Data Service are described in the following
sections in this topic.

Limits of the array result length and string result length


The maximum number of items allowed in an array return value for an RDL expression is increased from 250 to
102400. The maximum number of items allowed in a string return value for an RDL expression is also increased
from 250 to 102400. This enables you to include images and logos with sizes up to 75 KB, which will be stored in a
database with Base64 encoding.
The MaxResourceSize is set to 2000. This lets you include external images in a report up to 1500 KB in size. More
information: TechNet: Add an External Image (Report Builder and SSRS )

Allowed types and denied members


The RDL Sandboxing feature enables you to create a list of approved types and a list of denied members. The list
of approved types is called an allow list. The list of denied members that are not permitted in the RDL expressions
is called a block list.
The following table contains a list of allowed types and denied members available in sandbox mode in Common
Data Service.

ALLOWED TYPES DENIED MEMBERS

System.Array CreateInstance

Finalize

GetType

MemberwiseClone

Resize

System.DateTime FromBinary

GetDateTimeFormats

GreaterThan

GreaterThanOrEqual
ALLOWED TYPES DENIED MEMBERS

System.Object GetType

MemberwiseClone

ReferenceEquals

System.DbNull Finalize

MemberwiseClone

GetObjectData

GetTypeCode

System.Math BigMul

DivRem

IEEERemainder

PI

Pow

System.String

System.TimeSpan Hours

TicksPerDay

TicksPerHour

TicksPerMillisecond

TicksPerMinute

TicksPerSecond

Zero

TryParse

TryParseExact
ALLOWED TYPES DENIED MEMBERS

System.Convert ChangeType

IConvertible.ToBoolean

IConvertible.ToByte

IConvertible.ToChar

IConvertible.ToDateTime

IConvertible.ToDecimal

IConvertible.ToDouble

IConvertible.ToInt16

IConvertible.ToInt32

IConvertible.ToInt64

IConvertible.ToSByte

IConvertible.ToSingle

IConvertible.ToType

IConvertible.ToUInt16

IConvertible.ToUInt32

IConvertible.ToUInt64

System.StringComparer Create

Finalize

System.TimeZone Finalize

GetType

MemberwiseClone

System.Uri Unescape

Parse

Escape
ALLOWED TYPES DENIED MEMBERS

Finalize

System.UriBuilder Finalize

System.Globalization.CultureInfo ClearCachedData

System.Text.RegularExpressions.Match Empty

NextMatch

Result

Synchronized

System.Text.RegularExpressions.Regex CacheSize

CompileToAssembly

GetGroupNames

GetGroupNumbers

GetHashCode

Unescape

UseOptionC

UseOptionR

capnames

caps

capsize

capslist

roptions

pattern

factory
ALLOWED TYPES DENIED MEMBERS

IsMatch

Matches

Iserializable.GetObjectData

InitializeReferences

RightToLeft

Options

Microsoft.VisualBasic.Constants vbAbort

vbAbortRetryIgnore

vbApplicationModal

vbArchive

vbBinaryCompare

vbCancel

vbCritical

vbDefaultButton1

vbDefaultButton2

vbDefaultButton3

vbExclamation

vbFormFeed

vbGet

vbHidden

vbHide

vbHiragana

vbIgnore

vbInformation
ALLOWED TYPES DENIED MEMBERS

vbKatakana

vbLet

vbLinguisticCasing

vbMaximizedFocus

vbMinimizedFocus

vbMinimizedNoFocus

vbMsgBoxHelp

vbMsgBoxRight

vbMsgBoxRtlReading

vbMsgBoxSetForeground

vbNo

vbNormal

vbNormalFocus

vbNormalNoFocus

vbObjectError

vbOK

vbOKCancel

vbOKOnly

vbQuestion

vbReadOnly

vbRetry

vbRetryCancel

vbSet

vbSystem

vbSystemModal
ALLOWED TYPES DENIED MEMBERS

VbTypeName

vbVolume

Zero

Microsoft.VisualBasic.ControlChars Finalize

GetType

MemberwiseClone

Microsoft.VisualBasic.Conversion Err

ErrorToString

Fix

Microsoft.VisualBasic.DateInterval Finalize

GetType

MemberwiseClone

Microsoft.VisualBasic.Financial Finalize

GetType

MemberwiseClone

IRR

NPV

MIRR

Microsoft.VisualBasic.Interaction AppActivate

Beep

CallByName

Command
ALLOWED TYPES DENIED MEMBERS

CreateObject

Environ

Finalize

GetAllSettings

GetObject

GetSetting

GetType

InputBox

MemberwiseClone

MsgBox

SaveSetting

Shell

Choose

Switch

Microsoft.VisualBasic.Information Erl

Err

IsError

IsDBNull

Lbound

Ubound

SystemTypeName

Microsoft.VisualBasic.Strings Finalize

GetType
ALLOWED TYPES DENIED MEMBERS

MemberwiseClone

Lset

Rset

Microsoft.Crm.Reporting.RdlHelper

Common denied members


The following table contains a list of denied members common in allowed types:

DateString

Duration

Equality

Equals

Erl

Filter

GetChar

GroupNameFromNumber

GroupNumberFromName

Int

MaxValue

MinValue

Negate

Timer

TimeString

ToBinary

Finalize

GetType
MemberwiseClone
Use Power BI
11/4/2019 • 4 minutes to read • Edit Online

The Power BI cloud service works with Common Data Service apps to provide a self-service analytics solution.
Power BI automatically refreshes the app's data displayed. With Power BI Desktop or Microsoft Excel, Power Query
for authoring reports and Power BI for sharing dashboards and refreshing data from model-driven apps, your
users have a powerful way to work with your app's data.

Get started using Power BI with model-driven apps


The Dynamics 365 apps content packs for Power BI allow you to easily access and analyze your data in model-
driven apps in Dynamics 365 (Dynamics 365 Sales, Dynamics 365 Customer Service, Dynamics 365 Field Service,
Dynamics 365 Marketing, Dynamics 365 Project Service Automation).
To create a Power BI dashboard using a content pack, follow these instructions.
1. If you haven't already done so, register with Power BI.
2. After you have signed in to Power BI, in the Datasets area select Get Data, under Services select Get, and
then select from the following content packs.
Sales Analytics for Dynamics 365
Customer Service Analytics for Dynamics 365
Microsoft Dynamics 365 - Social Engagement
3. For the Sales Analytics and Service Analytics content packs, enter the URL of your instance, such as
https://OrganizationName.crm.dynamics.com, where OrganizationName is the organization name of your
instance, and select Next.

NOTE
If your data center is outside of North America the crm.dynamics.com domain name may be different, such as
crm2.dynamics.com, crm3.dynamics.com, crm4.dynamics.com, etc. To find the domain name, in the apps web app go
to Settings > Customizations > Developer Resources. The URLs listed will indicate the correct domain name.

For the Marketing content pack, enter the URL as


https://OrganizationName.marketing.dynamics.com/analytics, where OrganizationName is the
organization name of your instance of Dynamics 365, and select Next
4. Under Authentication method, select oAuth2.
5. Your instance data is imported and several visualizations become available.

TIP
If the content pack you select does not open in your web browser, in the left pane of your Power BI workspace click the
content pack under Dashboards.

Content packs available for download.


The Dynamics 365 content packs support the app's default out-of-box entities. However, you can customize the
following content packs by downloading the .PBIX file and then using Power BI Desktop to customize the content
pack before uploading it to the Power BI service.
Download the Dynamics CRM Online Sales Manager .PBIX
Download the Dynamics 365 for Customer Engagement apps (online) Service Manager .PBIX
The Power BI Report Template for Connected Field Service enables users to publish a Power BI report that
displays the live heart beat of connected devices.
Download the Power BI Report Template for Connected Field Service for Dynamics 365 for Customer
Engagement
For information about how to customize the content packs, see Customize Power BI content packs.

Embed Power BI visualizations on personal dashboards


Before users can embed Power BI visualizations on personal dashboards, the organization-wide setting must be
enabled.

NOTE
By default, Power BI visualization embedding is disabled and must be enabled before users can embed them in personal
dashboards.

Enable Power BI visualizations in the organization


1. Sign-in to Dynamics 365 as a user with the system administrator security role.
2. Go to Settings > Administration > System Settings.
3. On the Reporting tab in the Allow Power BI visualization embedding option, select Yes to enable or
No to disable.
4. Select OK.
To learn more about how to add Power BI tiles to personal dashboards, see Embed Power BI tiles on your personal
dashboard.
To learn more about how to add Power BI dashboards to personal dashboards, see Add or edit Power BI
visualizations on your dashboard.

Use Power BI Desktop to connect directly to your instance


You can connect to your instance with Power BI Desktop to create custom reports and dashboards for use with the
Power BI service.
Requirements
Power BI service registration
Power BI Desktop
Dynamics 365 instance
Connect
1. Start Power BI Desktop.
2. From the Home tab, select Get Data, and then select More.
3. In the Get Data list, select Dynamics 365 Online.
4. Enter the Dynamics 365 OData endpoint URL. It should look similar to this URL, where OrganizationName
is the name of your organization, and v9.0 is the version. Select OK.
https://OrganizationName.api.crm.dynamics.com/api/data/v9.0

IMPORTANT
For more information about the different endpoint versions, see Web API URL and versions.

TIP
You can find your OData endpoint URL. Go to Settings > Customizations > Developer Resources and locate the URL
under Instance Web API.

5. In the Access an OData feed dialog select Organizational account, and then select Connect.

NOTE
If you aren't signed in to your instance, select Sign-in on the Access OData feed dialog before you select Connect.

6. The organization database entity tables appear in the Power BI Desktop Navigator window. You can select
both default and custom entities. For more information about creating reports with Power BI Desktop, see
Power BI Support: Report View in Power BI Desktop.
TIP
You can use similar steps to connect to Dynamics 365 using Excel Power Query by selecting From Other Sources on
the Power Query tab in Excel.
Customize Dynamics 365 apps Power BI content
packs
3/10/2020 • 12 minutes to read • Edit Online

Power BI is a comprehensive collection of services and tools that you use to visualize your business data. Content
packs are available that make it easy to visualize and analyze the Dynamics 365 Sales, Service, and Marketing apps
data with Power BI based on a standard data model. The content packs are built with a set of entities and fields that
are useful for most sales, service, or marketing reporting scenarios.
Dynamics 365 apps are often extended with custom fields. These custom fields don’t automatically show up in the
Power BI model. This topic describes the different ways that you can edit or extend the reports included in a
content pack to include custom fields in the Power BI model.

Do this before you customize a content pack for Power BI reports


Before you customize a content pack, read the information here and perform each task as necessary.
Meet the requirements
Power BI service registration.
Power BI Desktop application for editing Power BI reports.
PBIX file for the content pack that you want to customize.
Download the Dynamics CRM Online Sales Manager PBIX
Download the Dynamics CRM Online Service Manager PBIX
Download the Microsoft Dynamics 365 Process Analyzer PBIX
Dynamics 365 content packs are currently only supported in the U.S. English language.
Prepare a content pack for customization

IMPORTANT
To connect the OData feed to your instance you must follow the steps described here before you customize the content
pack.
Currently, the Power BI service isn’t compatible with the Dynamics 365 version 9.0 OData endpoint. When you try to use the
version 9.0 OData endpoint with the Power BI service the error message “The feed's metadata document appears to be
invalid” is displayed. To work around this incompatibility, use the Dynamics 365 version 8.2 OData endpoint.For more
information about the different endpoint versions, see Compose HTTP requests and handle errors.

1. Start Power BI Desktop.


Select File > Open, open a content pack, such as Sales Manager.bpix, and then select Open.
Several pages of reports within the content pack are loaded and displayed in Power BI Desktop.
2. On the Power BI Desktop ribbon, select Edit Queries.
3. In the left navigation pane of the Edit Queries window, under Queries, select the CRMServiceUrl query,
and then on the ribbon, select Advanced Editor. In the source definition, replace base.crm.dynamics.com
with your apps instance URL. For example, if the organization name is Contoso, the URL looks like this:
Source = "https://contoso.crm.dynamics.com/api/data/v8.0/"
4. Select Done, and then select Close & Apply in the Query Editor.
5. When the Access an OData feed dialog appears, select Organizational account, and then select Sign-in.

6. When the sign-in page appears, enter your credentials to authenticate to your instance.
7. In the Access an Odata feed dialog, select Connect.
The content pack queries are updated. This may take several minutes.

Customize aDynamics 365 content pack


Change the date format that is displayed in a report
Add a custom field to a report for any entity except Account
Add a custom field to a report for the Account entity
Add an option set field to a report
Increase the number of rows queried
Convert a DateTime field to a Date field for reporting
In Dynamics 365 apps, some dates are saved in a Date/Time/Timezone format, which may not be the preferred
format for aggregating data in a report. You can convert the date displayed in reports for an entity field. For
example, the Opportunity Created On field can be converted to a date to report the Opportunities created by day.
1. In Power BI Desktop, select Edit Queries.
2. In the left navigation pane of the Query Editor, under Queries, select the query that has the date field that
you want to change, such the Estimated Close Date in the Opportunity entity query.
3. Right-click the column heading, such as Estimated Close Date, point to Change Type, and then select
another date type, such as Date.
4. Select Close & Apply to close the Query Editor.
5. On the main Power BI page, select Apply Changes to update the associated reports.
Add a custom field to a report
The following procedure describes how to add a custom field that is a date, string, or number to a report for all
available entities except the account entity.

NOTE
To add a field to the Account entity, see Add a custom field to a report for the Account entity. To add a field that is an option
set type, see Add an option set field to a report.

1. In Power BI Desktop, select Edit Queries.


2. In the left navigation pane of the Query Editor, under Queries, select the query that has the custom field
that you want to make available for reports, such as the Opportunity entity query.
3. In the right pane, under APPLIED STEPS, select the settings button next to Removed Other
Columns.
4. The Choose Columns list shows all fields for the entity, including custom fields. Select the custom field that
you want, and then select OK.
The entity query is updated and a column is added in the entity table for the custom field that you selected.
5. In the right pane, under APPLIED STEPS, select Lang – Renamed Columns and then select Advanced
Editor to add the mapping for the field to the entity query. For example, if the custom field name for the
opportunity entity is int_forecast and the display name is Forecast, the entry should appear like this.

{"int_forecast","Forecast"}
6. After you add your field mapping, make sure there are no syntax errors displayed at the bottom of the
Advanced Editor. Also, make sure the field name appears exactly as it appears in the column heading,
including the correct letter case. If no syntax or table errors are detected, select Done.
7. Click Close & Apply in the Query Editor.
The custom field is now available in the right pane under Fields for the entity, and can be added to new or
existing reports.

Add a custom field to a report for the Account entity


Because the Account query uses Fetch XML to filter the query, the steps to add a field are different than for other
entity queries that use OData. To add a custom field to the OData queried entities, see Add a custom field to a
report.
1. Copy the encoded Fetch XML query for the account entity. To do this, follow these steps:
a. In Power BI Desktop, select Edit Queries.
b. In the left navigation pane of the Query Editor, under Queries, select the Account entity query, and
then on the ribbon, select Advanced Editor.
c. From the first line, beginning with %3Cfetch and ending with fetch%3E, copy the entire encoded
Fetch XML.
d. The encoded Fetch XML that you copy should look similar to this:
%3Cfetch%20version%3D%221.0%22%20output-format%3D%22xml-
platform%22%20mapping%3D%22logical%22%20distinct%3D%22true%22%3E%3Centity%20nam
e%3D%22account%22%3E%3Cattribute%20name%3D%22territorycode%22%20%2F%3E%3Cattrib
ute%20name%3D%22customersizecode%22%20%2F%3E%3Cattribute%20name%3D%22owningb
usinessunit%22%20%2F%3E%3Cattribute%20name%3D%22ownerid%22%20%2F%3E%3Cattribut
e%20name%3D%22originatingleadid%22%20%2F%3E%3Cattribute%20name%3D%22revenue%22
%20%2F%3E%3Cattribute%20name%3D%22sic%22%20%2F%3E%3Cattribute%20name%3D%22
marketcap%22%20%2F%3E%20%3Cattribute%20name%3D%22parentaccountid%22%20%2F%3E
%3Cattribute%20name%3D%22owninguser%22%20%2F%3E%3Cattribute%20name%3D%22accou
ntcategorycode%22%20%2F%3E%3Cattribute%20name%3D%22marketcap_base%22%20%2F%3E
%3Cattribute%20name%3D%22customertypecode%22%20%2F%3E%3Cattribute%20name%3D%2
2address1_postalcode%22%20%2F%3E%3Cattribute%20name%3D%22numberofemployees%22%
20%2F%3E%3Cattribute%20name%3D%22accountratingcode%22%20%2F%3E%3Cattribute%20na
me%3D%22address1_longitude%22%20%2F%3E%3Cattribute%20name%3D%22revenue_base%22
%20%2F%3E%3Cattribute%20name%3D%22createdon%22%20%2F%3E%3Cattribute%20name%3
D%22name%22%20%2F%3E%3Cattribute%20name%3D%22address1_stateorprovince%22%20%2
F%3E%3Cattribute%20name%3D%22territoryid%22%20%2F%3E%3Cattribute%20name%3D%22a
ccountclassificationcode%22%20%2F%3E%3Cattribute%20name%3D%22businesstypecode%22%2
0%2F%3E%3Cattribute%20name%3D%22address1_country%22%20%2F%3E%3Cattribute%20nam
e%3D%22accountid%22%20%2F%3E%3Cattribute%20name%3D%22address1_latitude%22%20%2
F%3E%3Cattribute%20name%3D%22modifiedon%22%20%2F%3E%3Cattribute%20name%3D%22
industrycode%22%20%2F%3E%3Clink-
entity%20name%3D%22opportunity%22%20from%3D%22parentaccountid%22%20to%3D%22acco
untid%22%20alias%3D%22ab%22%3E%3Cfilter%20type%3D%22and%22%3E%3Ccondition%20att
ribute%3D%22opportunityid%22%20operator%3D%22not-
null%22%20%2F%3E%3Ccondition%20attribute%3D%22modifiedon%22%20operator%3D%22last-
x-days%22%20value%3D%22365%22%20%2F%3E%3C%2Ffilter%3E%3C%2Flink-
entity%3E%3C%2Fentity%3E%3C%2Ffetch%3E
2. Decode the encoded Fetch XML. It must be valid encoded Fetch XML and, once encoded, should look
similar to this:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true"> <entity
name="account"> <attribute name="territorycode" /> <attribute name="customersizecode" /> <attribute
name="owningbusinessunit" /> <attribute name="ownerid" /> <attribute name="originatingleadid" />
<attribute name="revenue" /> <attribute name="sic" /> <attribute name="marketcap" /> <attribute
name="parentaccountid" /> <attribute name="owninguser" /> <attribute name="accountcategorycode" />
<attribute name="marketcap_base" /> <attribute name="customertypecode" /> <attribute
name="address1_postalcode" /> <attribute name="numberofemployees" /> <attribute
name="accountratingcode" /> <attribute name="address1_longitude" /> <attribute name="revenue_base"
/> <attribute name="createdon" /> <attribute name="name" /> <attribute
name="address1_stateorprovince" /> <attribute name="territoryid" /> <attribute
name="accountclassificationcode" /> <attribute name="businesstypecode" /> <attribute
name="address1_country" /> <attribute name="accountid" /> <attribute name="address1_latitude" />
<attribute name="modifiedon" /> <attribute name="industrycode" /> <link-entity name="opportunity"
from="parentaccountid" to="accountid" alias="ab"> <filter type="and"> <condition
attribute="opportunityid" operator="not-null" /> <condition attribute="modifiedon" operator="last-x-days"
value="365" /> </filter> </link-entity> </entity> </fetch>
TIP
Many URL encoder and decoder tools are freely available on the web.

3. In the Fetch XML, add your custom entity as an attribute node between the <entity> nodes. For example, to
add a custom field named customclassificationcode, add the node after another attribute node, such as
industrycode.

<attribute name="industrycode" />


<attribute name=" customclassificationcode "/>
<link-entity name="opportunity" from="parentaccountid" to="accountid" alias="ab">

4. URL encode the updated Fetch XML. The Fetch XML that includes the new custom attribute must be
encoded and then used to replace the existing OData feed query that comes with the content pack. To do
this, copy the updated FetchXML to the clipboard and paste it into a URL encoder.
5. Paste the encoded Fetch XML URL into the OData feed. To do this, paste the encoded URL between the
quotation marks after the Query=[fetchXml= text, replacing the existing encoded FetchXML, and then
select Done.
The screen shot below indicates where the left-most quotation is located.

6. In the right pane, under APPLIED STEPS, select the settings button next to Removed Other
Columns.
7. The Choose Columns list shows all fields for the entity, including custom fields. Select the custom field, such
as customclassificationcode, that you added to the Fetch XML query earlier, and then select OK.

NOTE
The field name that you select in the Column Chooser and the field name that you add to the FetchXML query must
match.

The entity query is updated and a column is added in the entity table for the custom field that you selected.
8. Select Close & Apply in the Query Editor.
The custom field is now available in the right pane under Fields for the entity and can be added to new or
existing reports.

Add a custom option set field to a report


Option set fields allow you to choose from multiple values. Examples of out-of-box option set fields are the Rating
and Sales Stage fields for an opportunity. Imagine you have a custom option set field on the main opportunity
form that has the following values and labels.
To add the custom option set field to a report, follow these steps.
1. Add the custom field column.
In the left navigation pane of the Query Editor, under Queries, select the entity that has the
associated custom option set, such as the Opportunity entity.
In the right pane, under APPLIED STEPS, select the settings button next to Removed Other
Columns.
The Choose Columns list shows all fields for the entity, including custom fields. Select the custom
field, such as new_customoptionset, and then select OK.
Select Save, and then when prompted, select Apply.
The column for the custom field appears in the entity table.
2. Create the option set query.
a. In Power BI Desktop, select Edit Queries.
b. In the left navigation pane of the Query Editor, under Queries, select the query under the Make
Tables group that has the option set field that is the most similar to the option set you want to add to
a report. For this example, the SalesStageOptionSet query has four options so is a good choice.
c. Select Advanced Editor.
The option set query is displayed.
d. Copy the entire query to the clipboard. You can paste it in to a text editor, such as Notepad, for later
reference.
e. In the Query Editor, right-click the Make Tables group, select New Query, and then select Blank
Query.
f. In the right pane, under Name enter a name, such as CustomOptionSet, and then press Enter.
g. Select Advanced Editor.
h. In the Advanced Editor, paste in the query you copied earlier.
i. Replace the existing values and options with your custom values and options. In this example, you
change this.

let
Source = #table({"Value","Option"},{{0,"Qualify"},{1,"Develop"},{2,"Propose"},{3,"Close"}})
in
Source

To this.

let
Source = #table({"Value","Option"},{{0,"A"},{1,"B"},{2,"C"},{3,"D"},{4,"E"}})
in
Source

j. Make sure there are no syntax errors, and then select Done to close the Advanced Editor. The table
of values and options appears in the Query Editor.
k. Select Save, and then when prompted, select Apply.
3. Insert a merge query for the entity and custom option set tables.
a. In the left pane of the Query Editor, under Entities, slect the entity that includes the custom option
set. For this example, the Opportunity entity query is selected.
b. On the ribbon select Merge Queries and, when you are prompted to insert a step, select Insert.
c. In the Merge dialog, select the column heading for the custom option set, such as new_optionset. In
the drop-down list, select the corresponding option set query that you created earlier. When the
option set table appears, select the Value column heading to select it.

d. Leave the join kind as Left Outer (all from first, matching from second), and then select OK.
TIP
Rename the merge query. Under APPLIED STEPS, right-click the merge query that you created, select
Rename, and enter a descriptive name, such as Merge CustomOptionSet.

4. Define the column so that only the labels display.


a. In the left pane of the Query Editor, under Entities, select the entity that includes the custom option
set. For this example, the Opportunity entity query is selected.
b. In the right pane, under APPLIED STEPS, select one of the expanded queries to reveal the merged
columns, such as Expanded SalesStage.
c. Locate and select the column heading for the new column that was created as part of the earlier
merge query step.
d. On the Transform tab, select Expand.
e. In the Expand new column dialog, clear the column that corresponds to the values (because only the
labels should appear in the column). Select Done.

f. Select Save, and then when prompted, select Apply.


5. Change the column name for report building.
a. In the left pane of the Query Editor, under Entities, select the entity that includes the custom option
set. For this example, the Opportunity entity query is selected.
b. Select Advanced Editor.
c. Add a renamed column line item, make sure there are no syntax errors, and then select Done. In this
example, the custom option set column name that you created earlier is NewColumn that is being
renamed to Custom Option Set.
d. Select Save, and then when prompted, select Apply.
6. Select Close & Apply to close the Query Editor.
The custom option set can now be used to build Power BI reports.

Increase the number of rows queried


By default, all Power BI entity queries in the content packs cannot exceed 100,000 rows. To increase the number of
rows that can be queried, follow these steps.

IMPORTANT
Increasing the row count limit can significantly impact the time it takes for a report to refresh. Additionally, the Power BI
service has a 30-minute limit for running queries. Use caution when increasing the row count limit.

1. In Power BI Desktop, select Edit Queries.


2. In the left navigation pane of the Query Editor, under Queries, select the entity query that you want to
increase the row count limit, such as the Lead entity.
3. In the right pane, under APPLIED STEPS, select Kept First Rows.
4. Increase the filtered row number. For example to increase to 150,000, change Table.FirstN (#"Filtered
Rows",100001) to Table.FirstN (#"Filtered Rows",150000)
5. In the right pane, under APPLIED STEPS, select Check Row Count.
6. Locate the >100,000 part of the step.
7. Increase the value to a larger number, such as 150,000.
8. Select Close & Apply in the Query Editor.

Publish your report to the Power BI service


Publish your report for organizational sharing and access from anywhere on most any device.
1. On the Power BI Desktop main page Home tab ribbon, select Publish.
2. If you are prompted to sign in to the Power BI service, select Sign in.
3. If multiple destinations are available, select the one you want, and then select Publish.
See also
Use Power BI with Dynamics 365 Customer Engagement (on-premises)
Validate and publish a model-driven app using the
app designer
12/3/2019 • 2 minutes to read • Edit Online

Validate an app to check for asset dependencies that are required for the app to work, but haven't yet been added
to the app. After a successful validation, you publish the app.
For example, you've added a Customer Service Performance dashboard to the app, which uses charts like Case
Mix (By Priority) or Case Resolution Trend (By Day) that you haven't added. When you validate this app, you'll get
a list of all missing, required assets.
When you validate the app, the app designer canvas shows you details about the assets that are missing.
1. In the app designer, select Validate.
A notification bar appears and shows you whether the app has any errors or warnings. The notification bar
shows warnings in cases where, for example, an entity has no forms or views, or the app doesn’t contain
any components. An error might appear if a site map isn't configured for the app. You can publish an app
without addressing warnings, but errors must be fixed before you can publish.

The app designer also shows a warning symbol with the number of dependencies on each artifact or asset
tile that is missing a required asset.

2. To add the required assets, select the Required tab on the right side of the canvas. The Required tab is
visible when at least one required asset is missing from the app.
The tab shows a list of required components.
3. Select the assets that you want to add, and then select Add Dependencies. When you add a required
asset, the count on the tile to which you've added the asset decreases.

NOTE
If a common asset is required across various app components-for example, a form is required for a dashboard and
an entity-and you add that asset only once from the dashboard dependency tree, the dependency count will
decrease only on the dashboard tile, but not on the entity tile. However, the dependency will be resolved for both.

Select Get Latest Dependencies or select Validate again to get the latest set of dependencies. You'll only see
these buttons after you save your app.

Select Hide Dependencies if you don't want to add the suggested required components. Any unresolved
warnings will appear again when you open the app in the app designer and select Validate or Get Latest
Dependencies .

NOTE
If you hide dependencies now and want to export this app later, all of these dependencies will appear again.

Publish an app using the app designer


Publish an app to make it available to users.
After you've added components, validated, and saved the app, on the command bar, select Publish. You can also
publish the app from the app tile on the My Apps page. In the Apps Being Edited view, in the lower right corner
of the app tile you want to publish, select the More options button (...), and then select Publish.
The app status changes to Published. You can see this in the top-right corner of the app designer. The app moves
from the Apps Being Edited view to the Published Apps view, and the published date is shown on the app tile.
NOTE
If your app has a validation error, you'll see the error on a notification bar. You won't be able to publish the app until you
resolve the error.
You can't publish an app until you save it.

Next steps
Share a model-driven app with Power Apps
Run a model-driven app on a mobile device
Share a model-driven app with Power Apps
3/5/2020 • 6 minutes to read • Edit Online

PowerApps apps use role-based security for sharing. The fundamental concept in role-based security is that a
security role contains privileges that define a set of actions that can be performed within the app. All app users
must be assigned to one or more predefined or custom roles. Or, roles can also be assigned to teams. When a user
or team is assigned to one of these roles, the person or team members are granted the set of privileges associated
with that role.

Prerequisites
Ensure you have a security role with equal or greater permissions than the role you're assigning to the app and to
other users.

Create a security role for your app


Generally model-driven apps contain custom entities and other custom configuration. It's important to first create
a security role with permission for all the components used in your app.

NOTE
This step can be skipped if existing roles grant access to the data in your app.

Preview: Share a model-driven app


Sharing a model-driven app involves two primary steps. First, associate a one or more security role(s) with the app
then assign the security role(s) to users.
1. Visit https://make.powerapps.com
2. Select a model-driven app and click Share.
3. Select the app then choose a security role from the list.
4. Search for a user
5. Select the user then select a role from the list.

6. Click Share.
Share the link to your app
Unlike sharing canvas apps, sharing model-driven apps does not currently send an email with a link to the app.
To get the direct link to an app:
1. Edit the app and click the Properties tab
2. Copy the Unified Interface URL.
3. Paste the app URL in a location so that your users can access it, such as by posting it on a SharePoint site or
send via email.

Create or configure a security role


The PowerApps environment includes predefined security roles that reflect common user tasks with access levels
defined to match the security best-practice goal of providing access to the minimum amount of business data
required to use the app. For example, if your app is based on a custom entity, the entity privileges must be
explicitly specified before users may work in it. To do this, you can choose to do one of the following.
Expand an existing predefined security role, so that it includes privileges on records based on the custom entity.
Create a custom security role for the purpose of managing privileges for users of the app.
For more information about access and scope privileges, see Security roles.
Create a custom security role
1. On the PowerApps site select Apps, next to the app you want to share select …, and then select Share.
2. Select the app then expand the list of security roles.
3. On the All Roles page, select New.
4. From the security role designer, you select the actions, such as read, write, or delete, and the scope for
performing that action. Scope determines how deep or high within the environments hierarchy the user can
perform a particular action. In the Role Name box enter Pet Grooming Technicians.
5. Select the Custom Entities tab, and then locate the custom entity that you want. For this example, the
custom entity named Pet is used.
6. On the Pet row, select each of the following privileges four times until organization scope global has
been selected: Read, Write, Append

7. Because the pet grooming app also has a relationship with the account entity, select the Core Records tab,
and on the Account row select Read four times until organization scope global has been selected.
8. Select the Customization tab, and then in the privileges list select the Read privilege next to Model-
driven App so that organization scope is selected.

9. Select Save and Close.


10. On the security role designer, in the Role Name box enter Pet Grooming Schedulers.
11. Select the Custom Entities tab, and then locate the Pet entity.
12. On the Pet row, select each of the following privileges four times until organization scope global has
been selected: Create, Read, Write, Delete, Append, Append To, Assign, Share
13. Because the pet grooming app also has a relationship with the account entity and schedulers must be able
to create and modify account records, select the Core Records tab, and on the Account row select each of
the following privileges four times until organization scope global has been selected. Create, Read,
Write, Delete, Append, Append To, Assign, Share
14. Select Save and Close.
Assign security roles to users
Security roles control a user’s access to data through a set of access levels and permissions. The combination of
access levels and permissions that are included in a specific security role sets limits on the user’s view of data and
on the user’s interactions with that data.
Assign a security role to Pet Grooming Technicians
1. From the Share this app dialog, under Assign users to the security role select Security Users.
2. In the list that is displayed, select the users who are pet groomers, and then on the command bar select
Manage Roles.
3. Click Manage security roles.

4. On the All Roles page, select Common data service user then click Actions then Copy Role.

TIP
You may also create a new blank role instead of copying an existing role.

6. In the Role Name box provide a descriptive role such as My custom app access. Click Ok.
7. From the security role designer, you select the actions, such as read, write, or delete, and the access levels.
Access levels determine how deep or high within the environments hierarchy the user can perform a
particular action.
8. Select the Custom Entities tab, and then locate the custom entity used in your app.
9. On the row for your custom entity, set access levels for each permission.
10. Repeat for other entities used in your app.
11. Select the Customization tab, and ensure Read privilege is set for Model-driven App so that
organization access level is selected.
IMPORTANT
Users granted Read, Create, and Write to the Model-driven App privilege have access to all apps in the
environment, even when they're not part of any role that has access to the app.

12. Select Save and Close.

About predefined security roles


These predefined roles are available with a PowerApps environment.

SECURITY ROLE *PRIVILEGES DESCRIPTION

Environment Maker None Can create new resources associated


with an environment including apps,
connections, custom APIs, gateways,
and flows using Power Automate.
However, does not have any privileges
to access data within an environment.
More information: Environments
overview

System Administrator Create, Read, Write, Delete, Has full permission to customize or
Customizations, Security Roles administer the environment, including
creating, modifying, and assigning
security roles. Can view all data in the
environment. More information:
Privileges required for customization

System Customizer Create (self), Read (self), Write (self), Has full permission to customize the
Delete (self), Customizations environment. However, can only view
records for environment entities that
they create. More information:
Privileges required for customization
SECURITY ROLE *PRIVILEGES DESCRIPTION

Common Data Service User Read, Create (self), write (self), delete Can run an app within the environment
(self) and perform common tasks for the
records that they own.

Delegate Act on behalf of another user Allows code to run as another user or
impersonate. Typically used with
another security role to allow access to
records. More information: Impersonate
another user

*Privilege is global scope unless specified otherwise.

Use Azure Active Directory groups to manage access


Administrators can use their organization’s Azure Active Directory (Azure AD ) groups to manage access rights for
licensed Common Data Service users. Both types of Azure AD groups—Office and Security—can be used to
secure user-access rights to an app. More information: About group teams
See also
Run a model-driven app on a mobile device
Create users and assign security roles
Manage model-driven app properties in the app
designer
12/2/2019 • 2 minutes to read • Edit Online

App properties define important details about the app, like its title or URL. You define app properties when you
create an app. If you want to change those properties later, you can do that in the app designer.
1. In the app designer, on the right side, select the Properties tab.

2. Change the information, as required:

PROPERTY DESCRIPTION

Name Enter a unique and meaningful name for the app.


PROPERTY DESCRIPTION

Description Type a short description of what the app is.

Icon By default, the Use Default App check box is selected. To


select a different web resource as an icon for the app, clear
the check box, and then select an icon from the drop-
down list. This icon is displayed on the app's preview tile.

Unique Name You cannot change the unique name. Using the unique
name, you can query tables to get data from the
database.

App URL Suffix1 The URL you chose while creating the app is shown here
by default. You can change the app URL in the Manage
App dialog box. Notice that you can't export or import
the app URL suffix through a solution at this time.

Choose a welcome page for the app This option allows you to select from the web resources
available in your environment. The welcome pages you
create can contain useful information to users such as links
to videos, upgrade instructions, or getting started
information. For more information about how to create a
web resource, such as an HTML file that you can use as a
welcome page, see Create and edit web resources to
extend the web application.

Enable Mobile Offline This option enables the app to be available offline on
mobiles to the profiles that are selected using Mobile
Offline Profiles drop down list.

1The Client and App URL Suffix properties are no longer available when you create a new app.
3. Save the app.

Next steps
Create or edit an app
Specify properties for model-driven unified interface
apps
12/2/2019 • 2 minutes to read • Edit Online

The Unified Interface framework uses responsive design principles to provide an optimal viewing and interaction
experience for any screen size or orientation. With model-driven apps that use the Unified Interface framework,
the grid (view ) control is responsive. As the size of the container decreases—for example, on phones and smaller
viewports—the grid is transformed into a list.
The Read Only Grid control specifies how a grid should reflow to different screen sizes. As an app maker, if you’re
working with a Unified Interface app, you can configure the Read Only Grid control and its properties for custom
grids and lists.
Card Form property: Use a card form for lists instead of the default list template. Card forms provide more
information for list items than the default list template.
Reflow behavior property: Use this parameter to specify a grid to reflow in to a list or not.

Allow grid to reflow into list


Adding the Read Only Grid control to your controls list allows you to configure the following features:
Allow a grid to reflow into a list on small displays such as mobile.
Specify the rendering mode as grid-only or list-only.
1. Open solution explorer.
2. In navigation pane expand Entities, select the appropriate entity (such as Account or Contact), and then
on the Controls tab, select Add Control.

3. Select Read Only Grid from the list of controls, and then choose Add.
The control is added to the list of available controls.
4. Select the devices (Web, Phone, or Tablet) for which you want to make the grid read-only.

5. Configure the Card Form property.


You can use the Card Form property to show list items instead of the default list template. Card forms
provide more information for list items than the default list template does.
a. Choose the pencil icon next to Card Form.

b. Select the Entity and Card Form types.


c. Choose OK.
6. Configure the Reflow behavior property.
a. Choose the pencil icon next to Reflow behavior.

b. Select the grid flow type from Bind to static options drop down.

FLOW TYPE DESCRIPTION

Reflow Allows the grid to render into list mode depending when
there is no enough display space.

Grid Only Restricts the grid to reflow into list even when there is no
enough display space.

List Only Displays only as a list even when there is enough space to
display as grid.
c. Choose OK.
7. Save and publish the changes.

Conditional image
You can display a custom icon instead of a value in a list and establish the logic used to select them based on a
column’s values by using JavaScript. For more information about conditional images, see Display custom icons
instead of values in list views.

Next steps
Create or edit a view
Delete a model-driven app
2/18/2020 • 2 minutes to read • Edit Online

Delete or remove apps that are obsolete in your environment.

IMPORTANT
If the model-driven app was installed in the default solution as part of a managed solution, see Delete a model-driven app
that was installed as part of a managed solution.
First party model-driven apps, such as Dynamics 365 Sales, Dynamics 365 Customer Service, and Dynamics 365 Field
Service can’t be deleted. You can hide these apps from users by removing the security roles that are assigned to the app.
Notice that these apps will still be visible to users with environment maker, system administrator, and system customizer
roles or any user with create privileges on the Model-driven App entity.

1. Sign in to Power Apps.


2. On the left navigation, select Apps.
3. Select the app that you want to delete, and then select Delete on the command bar.
4. In the confirmation message that appears, select Delete.
The app is deleted from your environment.
If the component has dependencies, such as relationships, you must remove the dependencies before you can
delete the app. To see the dependencies of an app, select the app and then select Show Dependencies on the
command bar.

NOTE
When you delete the app, we recommend that you delete its associated site map. If you do not delete the associated site
map, the site map designer displays an error the first time you try to create another app with the same name. However, you
can ignore the error, and the error will not appear when you try to create the app again.

Delete a model-driven app that was installed as part of a managed


solution
To delete a model-driven app that was installed in the environment as part of a managed solution, delete the
managed solution.
Delete a managed solution
All the components of a managed solution are deleted by deleting the solution.
1. Sign in to Power Apps.
2. On the left navigation, select Solutions.
3. In the Solutions list, select the managed solution you want to delete and then on the toolbar select Delete.
Navigate to advanced model-driven app making and
customization areas
12/3/2019 • 2 minutes to read • Edit Online

This topic describes how to access advanced customization and administration areas that are available within a
Power Apps environment.

Solutions
The solutions area is where you can view, edit, create, import, export, and delete managed and unmanaged
solutions.
1. Sign in to Power Apps.
2. On the left navigation pane select Solutions.

Solution explorer
Use solution explorer to perform app making and customization tasks that can’t be completed from the Power
Apps home page.
1. Sign in to Power Apps.
2. On the left navigation pane select Solutions.
3. Select Switch to classic on the toolbar to open the All Solutions view. Notice that the Switch to classic
command isn't available when you select a solution in the list.
4. In the list of available solutions select the solution you want in the Display Name column to open solution
explorer.

Apps
The Apps area lists all model-driven and canvas apps that you have privileges to in your environment. In addition
to launching an app, from the Apps area you can also assign security roles to it.
To share an app:
1. Sign in to Power Apps.
2. Select Apps.
3. Select … > Share.
4. Then follow these steps: Add security roles to the app

Settings
Use the settings area to configure environment settings, activate or deactivate processes, and more.

First, see if the setting you need is in the > Advanced customizations menu.
To find settings not available from Advanced customizations:

1. From a Power Apps model-driven app, select Settings on the app toolbar, and then select Advanced
Settings.
2. Select Settings, and then select the settings area that you want.

See also
Create or edit a model-driven app by using the app designer Create or edit apps in Power Apps Studio for web
Privileges required for model-driven app
customization
3/5/2019 • 2 minutes to read • Edit Online

App users can personalize the system and even share some of their customizations with others, but only users with
the correct privileges can apply changes for everyone.

NOTE
This section assumes you know how to work with security roles. For more information about working with security roles, see
Create users and assign security roles.

System Administrator and System Customizer security roles


Anyone who customizes will have the System Administrator or System Customizer security role associated with
their account. These security roles give you the permissions you need to customize the app.

SYSTEM ADMINISTRATOR SYSTEM CUSTOMIZER

Has full permission to customize the system Has full permission to customize the system

Can view all data in the system Can only view records for system entities that they create

The difference between the System Administrator and System Customizer security roles is that a system
administrator has read privileges on most records in the system and can see everything. Assign the System
Customizer role to someone who needs to perform customization tasks but shouldn’t see any data in the system
entities. However, testing is an important part of customizing the system. If system customizers can’t see any data,
they will need to create records to test their customizations. By default, system customizers have full access to
custom entities. If you want to have the same limitations that exist for system entities, you’ll need to adjust the
system customizer security role so that the access level is User rather than Organization for custom entities.

Delegate customization tasks


You might want to delegate some tasks to trusted people so that they can apply changes they need. Keep in mind
that anyone can have multiple security roles associated with their user account and that privileges and access rights
granted by security roles is based on the least restrictive level of permissions.
This means that you can give the System Customizer security role to someone who already has another security
role, perhaps a sales manager. This lets them customize the system in addition to other privileges they already
have. You don’t need to edit the security role they already have, and you can remove the System Customizer
security role from the person’s user account when you want.

Test customizations without customization privileges


You should always test any customizations you make with a user account that doesn’t have customization
privileges. This way you can make sure that people without the System Administrator or System Customizer
security roles will be able to use your customizations. To do this effectively, you need access to two user accounts:
One account with the System Administrator security role and another that has the security roles that represent the
people who will be using the customizations.
IMPORTANT
Don’t attempt to remove your System Administrator security role if you have only one user account. The system will warn
you if you try, but if you proceed you could find that you won’t be able to get it back. Most security roles don’t allow editing
of a user’s security roles.

Next steps
Understand model-driven app components
Create or edit model-driven app web resources to
extend an app
12/2/2019 • 6 minutes to read • Edit Online

Web resources are typically used by developers to extend an app using files that are used in web development.
App users may need to manage web resources provided by a developer or designer.

TIP
For an in-depth discussion of web resources, see Developer Documentation: Web resources for model-driven apps.
For information on web resource dependencies added in Power Apps, see Developer Documentation: Web resource
dependencies.

What are web resources?


Web resources are virtual files stored in the system. Each web resource has a unique name that can be used in a
URL to retrieve the file. Think of them this way: If you had access to the actual web server running the web app,
you could copy files over to that website. But with most online services, you can’t do this. Instead, you can use web
resources to upload files to the system and then reference them by name just as though you had copied them as
files to the web server.
For example, if you create an HTML page as a web resource named “new_myWebResource.htm”, you could open
that page in a browser using a URL like this:
<base URL>/WebResources/new_myWebResource.htm

where <base URL> is the part of the URL you use to view apps that ends in dynamics.com . Because the web
resource is data in the system, only licensed users for your organization can access them this way. Normally, web
resources are included in forms rather than referenced directly. The most common usage is to provide JavaScript
libraries for form scripts.
Because web resources are data in the system and are solution aware, you can move them to different
organizations by exporting them as part of a solution and importing the solution into a different organization. You
must use solution explorer to work with web resources.

Open solution explorer


Part of the name of any web resource you create is the customization prefix. This is set based on the solution
publisher for the solution you’re working in. If you care about the customization prefix, make sure that you are
working in an unmanaged solution where the customization prefix is the one you want for this web resource.
More information: Change the solution publisher prefix
Navigate to an unmanaged solution
1. From the Power Apps portal select Solutions, and then on the toolbar, select Switch to classic.
2. In the All Solutions list select the unmanaged solution you want.

View web resources


With solution explorer open, under Components select Web Resources.
Create or edit web resources
While viewing web resources, select New to create a new web resource or double-click an existing web resource
to edit it.

Complete the form to create or edit the web resource:

FIELD DESCRIPTION

Name Required. This is the unique name for this web resource. You
can’t change this after you save the web resource.
• This name can only include letters, numbers, periods, and
nonconsecutive forward slash (“/”) characters.
• The solution publisher customization prefix will be
prepended to the name of the web resource.

Display Name The name displayed if you view a list of web resources.
FIELD DESCRIPTION

Description A description of the web resource.

Type Required. This is the type of web resource. You can’t change
this after you save the web resource.

Text Editor When the type of web resource represents a kind of text file,
select this button to open a page to edit the content using
the text editor.
More information: Use the text editor appropriately

Language Allows for a selection of a language. This option just tags the
record that stores the web resource data. It doesn’t change
the behavior of the web resource.

Upload File Select the Browse… button to choose a file to upload as a


web resource.
• You can upload a file when creating a new web resource or
to overwrite an existing web resource.
• The file name extension of the file must match allowed
extensions.
• By default the maximum size file that can be uploaded as a
web resource is 5MB. This value can be modified by using the
System Settings > Email tab > Set file size limit for
attachments setting. More information: System Settings
dialog box - Email tab

URL After you save the web resource, the URL to the web resource
will be displayed here. Select this link to view the web resource
in your browser.

After you have added your changes, choose Save and then Publish.

NOTE
Changes to a web resource will not be visible in the application until you publish it.

Use the text editor appropriately


The text editor provided in the application for web resources should only be used for simple edits of text files. You
can use it to create and edit HTML web resources, but you should only edit HTML web resources that were
created using the text editor. The text editor is designed for very simple HTML content.

IMPORTANT
If the content of an HTML web resource wasn’t created using the text editor, don’t use the text editor to edit it.
The text editor uses a control that modifies the HTML source in a way that allows it to be edited. These changes can make
the page behave differently in the browser and cause more sophisticated code to stop working. Opening an HTML web
resource with the text editor and saving it without making any changes can break some HTML web resources. More
information: Developer Documentation: Use the text editor for HTML web resources

We recommend that you use an external editor to edit text files and then save them locally before uploading them
with the Upload File button. This way you can preserve a copy of the web resource if you need to return to an
earlier version. You can use a simple editor like Notepad, but a text editor with more advanced capabilities is
highly recommended. Visual Studio Community and Visual Studio Code are free and provide powerful
capabilities for editing the text-based files used by web resources.

Create and edit a web resource on a form


You can add or edit web resources on a form to make it more appealing or useful to users.

NOTE
You can’t include a web resource in a form header or footer.

Navigate to an unmanaged solution


1. From the Power Apps portal select Solutions, and then on the toolbar, select Switch to classic.
2. In the All Solutions list select the unmanaged solution you want.
Navigate to a form
With solution explorer open, under Components, expand Entities, and then expand the entity you want to work
with.
Choose Forms, in the list locate a form of type Main, and then double-click or tap the entry to open and edit the
form.
Add or edit web resource in a form
See Web resource properties for information about the properties you can set for web resources in a form.
Preview
To preview how the main form will appear and how events will function:
On the Home tab, select Preview, and then select Create Form, Update Form, or Read-Only Form.
To close the Preview form, on the File menu, select Close.
Save
When you finish editing the form, on the Home tab, select Save and Close to close the form.
Publish
When your customizations are complete, publish them:
To publish customizations for only the component that you are currently editing, in the navigation pane, select
the entity you have been working on, and then select Publish.
To publish customizations for all unpublished components at one time, in the navigation pane, select Entities,
and then on the Actions toolbar, select Publish All Customizations.
See also
Web resource properties
Create and design forms
Understand model-driven app components
Developer Documentation: Web resources in model-driven apps
Web resource properties for model-driven app forms
12/2/2019 • 4 minutes to read • Edit Online

You can add or edit web resources on a form to make it more appealing or useful to app users. Form enabled web
resources are images or HTML files controls.

NOTE
Silverlight web resources are deprecated and will not work in the Unified Interface client.

Access web resource properties


While viewing a form:
When adding a web resource:: Select the tab (for example, General or Notes) you would like to insert it on,
and then on the Insert tab, select Web Resource.

When editing a web resource: Select a form tab and the web resource that you want to edit, and then on the
Home tab, select Change Properties.

This will open the Add Web Resource or Web Resource Properties dialog box.
IMPORTANT
You must select the Visible by default option for the web resource to appear on the form and be available to users.

Web resource properties


The Add Web Resource or Web Resource Properties dialog box will have two, sometimes three tabs
depending on the type of web resource.
General tab
These properties define the web resource to use and how it should behave.

FIELD DESCRIPTION

Web resource Required. Look up an existing web resource or create a new


one. Use the Form Enabled Web Resource view to include
only HTML and image web resources that can be added as
visual elements in a form.

Name Required. Specify a name for the web resource control that
will be added to the form. This value uniquely identifies the
control in the form.
FIELD DESCRIPTION

Label Required. Automatically generated based on the Name field


value. Specify localizable text for the web resource control that
will be added to the form. Select Display label on the form if
you want to make this visible.

Visible by default While this is enabled the web resource will be visible when the
form loads. If you have a business rule or form script that will
show the web resource as needed, uncheck this field. More
information: Show or hide form elements

Enable for mobile Select this option to allow this web resource to be visible in
mobile apps.

Depending on the type of web resource you select, set additional properties.
For HTML web resources you will see these:

FIELD DESCRIPTION

Custom Parameter(data) Usually configuration data that will be passed to the HTML
web resource as a data query string parameter. Scripts
associated with the HTML page can access this data and use it
to change the behavior of the page.

Restrict cross-frame scripting where supported Use this option if you don't fully trust the content in the
HTML web resource. More information: Developer
Documentation: Select whether to restrict cross-frame
scripting

Pass record object-type code and unique identifier as Data about the current record visible in the form can be
parameters passed to the HTML web resource page so that script running
in the page can access data about the record. More
information:
Pass parameters to web resources
Developer Documentation: Pass contextual information about
the record

For Image web resources you have the option to specify Alternative Text that is important for assistive
technologies that make the page accessible to everyone.
Formatting tab
On the Formatting tab, the options that display vary based on the type of web resource inserted and the context
where it is inserted. These options include specifying the number of columns and rows display, whether a border
displays, and the scrolling behavior.
PROPERTY DESCRIPTION

Select the number of columns the control occupies When the section containing the web resource has more than
one column you can set the field to occupy up to the number
of columns that the section has.

Select the number of rows the control occupies You can control the height of the web resource by specifying
a number of rows or select Automatically expand to use
available space to allow the web resource height to expand
to available space.

Select the scrolling type for the IFRAME An HTML web resource is added to the form using an
IFRAME.

- As Necessary: Show scrollbars when the size of the web


resource is larger than the available.
- Always: Always show scrollbars.
- Never: Never show scrollbars.

Display border Display a border around the web resource.

Dependencies tab
A web resource may interact with fields in the form using script. If a field is removed from the form the script in
the web resource may break. Add any fields referenced by scripts in the web resource to the Dependent fields
so that they cannot be removed accidentally.
Pass parameters to web resources
An HTML web resource can accept parameters to be passed as query string parameters.
Information about the record can be passed by enabling the Pass record object-type code and unique
identifiers as parameters option. If information is typed into the Custom Parameter(data) field it will be
passed using the data parameter. The values passed are:

PARAMETER DESCRIPTION

data This parameter is only passed when text is provided for


Custom Parameter(data).

orglcid The Organization default language LCID.

orgname The name of the organization.

userlcid The user’s preferred language LCID

type Don't use this. The entity type code. This numeric value can
be different for custom entities in different organizations. Use
entity type name instead.

typename The entity type name.

id The id value of the record. This parameter has no value until


the entity record is saved.

Any other parameters are not allowed and the web resource will not open if other parameters are used. If you
need to pass multiple values, the data parameter can be overloaded to include more parameters within it.
More information: Developer Documentation: Pass contextual information about the record
See also
Create or edit web resources to extend an app
Use the main form and its components
Change model-driven app custom entity icons
12/2/2019 • 2 minutes to read • Edit Online

When you create a custom entity, it is automatically assigned a default icon. All custom entities use the same icon
by default. Use custom icons to differentiate how your custom entities look. You can’t modify the icons assigned to
system entities.
You can upload three types of entity icons for each custom entity.

ICON TYPE DESCRIPTION

Unified Interface Icon Must be a scalable vector graphic (.svg) icon

Icon in Web application An .svg, .gif, .png, or .jpg format image, 16x16 pixels in size.

Icon for entity forms An .svg, .gif, .png, or .jpg format image, 32x32 pixels in size.

NOTE
All image files must be no more than 10 kilobytes in size.
When you use a scalable vector graphic (.svg) image as the Icon in Web application or Icon for entity forms, it must have
the default size set. Since SVG is an XML document, you can edit the svg element width and height values with a text editor
to define the default size for the image.

Each type of icon is stored as a Web Resource. You can create the web resources first and then set the icons to use
them, or you can create the new web resource within the Lookup Record dialog by selecting New while setting
the value. More information: Create or edit web resources to extend an app

Set the icons for a custom entity.


You must use solution explorer to set entity icons.
Navigate to an unmanaged solution
1. From the Power Apps portal select Solutions, and then on the toolbar, select Switch to classic.
2. In the All Solutions list select the unmanaged solution you want.
Set entity icons
1. On the command bar, select Update Icons.
2. In the Select New Icons dialog box, in the Web Client tab, under Icon in Web application or Icon for
Entity Forms, to the right of New Icon, select the Browse button .
3. Select or create the appropriate web resource, and then select OK.
4. In the Unified Interface tab, do the same for the New Icon field.
5. Select OK to close the Select New Icons dialog
6. On the command bar, on the File menu, select Save.
7. When your changes are complete, publish them. Select Publish in the command bar while the entity is
selected in solution explorer.

Community tools
Iconator is a tool that XrmToolbox community developed for Power Apps. See the Developer tools for Common
Data Service topic for community developed tools.

NOTE
The community tools are not a product of Microsoft and does not extend support to the community tools. If you have
questions pertaining to the tool, please contact the publisher. More Information: XrmToolBox.

Next steps
Create an entity
Edit an entity
Distribute a model-driven app using a solution
12/3/2019 • 2 minutes to read • Edit Online

Model-driven apps are distributed as solution components. After you have created a model-driven app, you can
make it available for other environments to use by packaging the app into a solution and then exporting it into a
zip file. After the solution (.zip file) is successfully imported in the target environment, the packaged app is available
for use.

Add an app to a solution


In order to distribute your app, you create a solution so the app can be packaged for export.
1. Sign in to Power Apps.
2. Select Solutions and then select New solution.
3. Complete the fields on the New Solution page, and then select Save. More information: Create a solution
4. The Solution page appears. Select Add Existing, select App, select the app that you want to add to the
solution, and then select OK.

5. If a Missing Required Components page appears we recommend that you select Yes, include required
components to add necessary components such as entities, views, forms, charts, and site map that are part
of the app. Select OK.
6. On the Solution page select Save and Close.

Export a solution
To distribute your app so it can be imported into other environment or made available on Microsoft AppSource,
you export the solution to a zip file. Then, the zip file that contains the app and components can be imported into
other environments.
1. Open the Solutions page.
2. Select the solution you want to export, and then on the toolbar select Export.
3. On the Publish Customizations page, select Next.
4. If the Missing Required Components page appears, select Next.
5. On the Export System Settings page, select the optional features that you want to include, and then select
Next.
6. On the Package Type page, select Unmanaged or Managed, and the select Export. For more
information about solution package types, see Solutions overview.
7. Depending on your browser and settings, a .zip package file is built and copied to the default downloads
folder. The file name of the package is based on the unique name of the solution appended with underscores
and the solution version number.

NOTE
When you export an app by using a solution, the app URL is not exported.

Import a solution
When you receive a solution zip file which contains the app that you want to import, open the solutions component
page and import the solution. When the solution has been successfully imported, the app will be available in your
environment.
1. Sign in to Power Apps.
2. Select Solutions and then on the toolbar select Import.
3. Browse to the file you want to import, and then choose Next.
4. Select Import.

See also
Change the solution publisher prefix
Enable and use customizable help
11/6/2019 • 2 minutes to read • Edit Online

Customizable help lets you provide your own contextual information to model-driven app users filling in forms.

NOTE
Instead of creating and maintaining your own Help system, custom help panes and guided tasks are available that you can
use to author Help that gives your Unified Interface application a custom in-product help experience that is tailored to your
organization. More information: Create guided help for your Unified Interface app

With model-driven apps, you can replace the default Help with the custom Help of your choice, at the global
(environment) level or entity level. Custom Help makes the content exposed through the Help links more relevant
for your custom or customizable entities. With a single, global URL you can override the out-of-the-box Help links
for all customizable entities. Per-entity URLs override the out-of-the-box Help links on grids and forms for a
specific customizable entity. You can include additional parameters in the URL, such as language code and entity
name. These parameters allow a developer to add functionality to redirect the user to a page that’s relevant to their
language or the entity context within the application. The entity level custom Help settings are solution aware,
therefore you can package them as a part of a solution and transport them between environments or distribute
them in solutions.

Set up customizable Help


Customizable Help can be set at the global and entity levels.
Set customizable Help at the global level
People with the system administrator security role can use the settings to override default Help at the global level.

1. Open a model-driven app, and then on the command bar select Settings > Advanced Settings.
2. Go to Settings > Administration.
3. Select System Settings, and then select the General tab.
4. Under Set custom Help URL, select and define the following customizable Help global settings:
Use custom Help for customizable entities. Select to enable.
Global custom Help URL. Enter the URL to your custom Help.
Append Parameters to URL. Select Yes to allow for parameters such as language code or entity name
to be appended to the Help URL that you specify in the entity definition. More information: Append
parameters to URL
5. Select OK.
Set customizable Help for a specific entity
After you enable custom Help at the global level, system customizers can override the global Help URL for an
entity in the entity definition.
1. Open solution explorer.
2. Expand Entities, and then select the entity you want.
3. On the General tab under the Help section of the entity definition, in the Help URL box enter the URL of
your custom Help page.

Append parameters to URL


As described previously, to allow for the appending of parameters to the Help URL for the entity definition, set
Append Parameters to URL in the System Settings > General tab to Yes.
Examples of the parameters that can be appended to the URL:
User Language Code: userlcid
Entity Name: entity
Entry Point: hierarchy chart or form
Form Id: formid
Create guided help (Learning Path) for your app
12/3/2019 • 32 minutes to read • Edit Online

Use Learning Path to give your users a custom, in-app Help experience that is tailored to your environment and the
specific usage and workflow of your organization.

IMPORTANT
Learning Path is only available with legacy web client apps. Use custom help pages for Unified Interface apps. More
information: Create guided help for your Unified Interface app

Learning Path facilitates learning and adoption of your apps and organizational processes, ensures that data is
entered and interpreted consistently, and reduces errors and support calls generated by users. Watch a short video
(1:50) about Learning Path.

How is Learning Path different from customizable Help?


Customizable Help allows you to override the default Dynamics 365 apps Help and point users in your
organization to a different URL for Help. Or you can override the Help for a highly customized entity so that you
can better describe your workflow.
Learning Path lets you add customizable Help that users see in the app when they open a page, perform an action,
or select the Help button (?).
For more information about customizable Help, see Customize the Help experience.

Prerequisites
To create Learning Path content, you must:
Be using Power Apps or Dynamics 365 (online).
Have opted in for Learning Path. This setting is on by default, but it might have been turned off.
To ensure that Learning Path is on: On the nav bar, go to Settings > Opt in for Learning Path.
More information: On-off switch for Learning Path (guided help)
Have the System Customizer or System Administrator Role, or another role that has the Learning Path
Authoring privilege.
Enable Learning Path authoring. This creates the Office 365 Learning Path Authors security group.
Be a member of the Office 365 Learning Path Authors security group.
You can author Learning Path content for web app modules and Unified Interface app modules. This
includes Dynamics 365 for tablets.

Turn on Learning Path for your organization


Learning Path is an optional feature that can be turned on or off for your organization. You can display Learning
Path content included with Dynamics 365, create your own Learning Path content for your users, or both.
1. Sign in to Power Apps or Dynamics 365 with an admin account.
2. Go to Settings, and then select Administration under System. More information: Settings
3. On the Administration page, select System Settings.
4. On the General tab, under Set custom Help URL, select Yes for Enable Learning Path and Enable
Learning Path Authoring.
You can enable Learning Path or customizable Help, but not both at the same time. Confirm that Use
custom Help for customizable entities and Append parameters to URL are set to No.

5. Select OK.

Add a user to the Office 365 Learning Path Authors security group
If you're not a member of the Office 365 Learning Path Authors security group, you'll see the following error
message when you open the Learning Path Content Library.

Add a user
1. Go to the admin portal for your Office 365 tenant by selecting the Navigate to other applications button
in the upper-left corner of the page when you're signed in to Dynamics 365, and then select Admin.
You might be asked to reenter your password.
2. In the Admin center, select Groups.
3. On the Groups page, select the Learning Path Authors security group.
4. In the Members row, select Edit to add users to the group.
5. Select + Add members, and then specify or search for the user(s) you want to add to the group.
6. Select Save when you're finished adding users.

NOTE
Another way to assign the group to a user account is by selecting Users > Active Users, selecting the user you want to add,
and then selecting Edit next to Group memberships to select the group(s) to add the user to.
How does Learning Path work with multiple organizations?
When you publish Learning Path content, you can use Publishing Environments to control which organizations
associated with the tenant your content is published to. To publish different content to different organizations,
create multiple publishing environments and add each organization to one or more of them.

Learning Path and Common Data Service security roles


Common Data Service uses security roles to determine what Learning Path content is displayed when a user
selects the Help button, navigates to a page, or performs a defined action in Common Data Service.
The roles used in Learning Path are the same roles used in your Common Data Service organization for security
and data access, but you can create Learning Path content for any or all of the Common Data Service security roles.
Typically, you want the security roles in the Learning Path designer to match your Common Data Service
environment. However, you can simplify the user interface in the designer by hiding some Common Data Service
security roles from the designer. If you later decide that you want to use a security role that you deleted from
Learning Path, you can synchronize the roles between Learning Path and Common Data Service.
If your organization has multiple business units, security roles can have parent/child relationships. Only the
security roles in the root business unit are synchronized.
More information about security roles: Security roles and privileges
Learning Path role precedence
If a user in your organization is assigned more than one security role, precedence is used to determine which
assigned security role is used for displaying Learning Path content. If Learning Path content is associated with a
security role, any user assigned that role will see the Learning Path content, even if they are assigned a security role
with higher precedence that is not associated with the Learning Path content.
Each role included in Learning Path has a numeric value. The first role in the list has the highest precedence, and
subsequent roles have lower precedence. When a user is assigned a role that triggers the display of Learning Path
content, the user will see that content even if that user has been assigned a role with lower precedence that is not
associated with the content. For example, if a user is assigned a role with precedence 1 and a role with precedence
20, the user will see Learning Path content defined only for the role with precedence 1.
If you create different content for different roles on the same model-driven app page or screen, users will see the
content associated with the role with higher precedence.
Manage security roles and precedence
You can control which security roles are available in the Learning Path designer, and set the order of roles for
determining precedence when Learning Path runs. If a user has two roles, and there is different content published
for a given context for each of these roles, the user will see the content for the role that appears higher in the list.
Configure security roles
1. Sign in to Power Apps with an account that has Learning Path authoring permissions.
2. Open the Content Library.
3. Select Configuration at the top of the screen.
4. To synchronize the security roles with your Common Data Service security roles, select Sync Roles.
5. To set the order of precedence for the roles used with Learning Path, use the up or down arrows to move a
role higher or lower in the list.
Precedence is determined by the order of the roles listed on this page.
6. To delete a role from being used with Learning Path, select Delete next to the role.
NOTE
This does not delete the role from Dynamics 365. It deletes the role in the Learning Path designer to define how
content is displayed to users. You can always restore a hidden role by selecting Sync Roles.

7. When you are finished making changes, select Save.


8. Select Back to return to the Content Library.

Create Learning Path controls for Dynamics 365 for tablets


You can create Learning Path controls for Dynamics 365 for tablets the same way you create controls for the web
client. To do this you must use the mobile app simulator in a web browser so that you have access to the mobile UI
for pinning your Learning Path controls. This simulator is to be used only for this purpose.
Display the mobile app interface simulator in a web browser
1. Sign in to Dynamics 365.
2. Copy the server name for your Common Data Service organization from the URL displayed in your
browser, for example https://contososales.crm.dynamics.com/.
Make sure to include the slash (/) after .com.
3. Determine the unique name for the org (also called instance) you want to create Learning Path controls for.
To get the unique name, on the site map, select Settings > Customizations, and then on the
Customization page, select Developer Resources. Copy the value for the Unique Name field displayed
in the Instance Reference section.

4. Append the following to the first part of the URL for your org, replacing <org name> with the unique name
for your org determined in the previous step:
nga/main.htm?org=<org name>
Your URL should look similar to the following: https://contososales.crm.dynamics.com/nga/main.htm?
org=orgb557e46a
5. Append the following to the URL from the previous step, replacing <server name> with the server name
from the first step in this procedure:
&server=<server name>
Your URL should look similar to the following: https://contososales.crm.dynamics.com/nga/main.htm?
org=orgb557e46a&server=https://contososales.crm.dynamics.com/.
6. Open a new tab or browser window and copy the full URL you created, paste it into the new tab or browser
window, and then select Enter.
The first time you connect to the mobile app interface, a welcome screen is displayed while the system
processes metadata and downloads customizations. After this is completed, your workspace is displayed.
NOTE
When you connect to the mobile app version of the interface, the credentials from your sign-in to the web interface
are used to authenticate you. You'll need to leave the web interface open to avoid getting access denied errors when
opening the mobile app interface.

7. Close your workspace to display the Home page for the mobile app interface in your browser. You can then
open the Content Library to create or edit Learning Path controls. More information: Content Library

Content Library
The Content Library displays all of the content created and available to your organization, in addition to the
commands to create, manage, and interact with controls. To create or edit Learning Path controls, first connect to
the client interface for which you want to create controls, and then open the Content Library.
To open the Content Library from the default web client interface, do one of the following:
On a sidebar, select the Content Library button.

Select the training tile on the site map, and then select Content Library.

To open the Content Library from the mobile app interface simulator:
1. Select the ellipsis button inside a circle (...) on the lower-right corner of the screen.

2. Select Learning Path Content Library.

NOTE
If you do not see all of these columns in the Content Library, it might be because your browser's View zoom is set to higher
than 100%. To see all of the columns, set the zoom setting to 100% or lower.

The Content Library includes the columns described in the following table:
COLUMN DESCRIPTION

Name The name you used when you created the Guided Task or
Sidebar. A red lock symbol next to the name indicates that the
content is currently checked out. You can hover over the icon
to see which user has the content checked out.

A red asterisk next to the name indicates newly checked-in


content.

Title The title you provided when you added content to the Guided
Task or Sidebar. Titles for Sidebars and Guided Tasks are
displayed on Sidebars when they are added as links, or when
they are returned as search results.

Type A symbol that indicates the type of content: Sidebar or Guided


Task

Form Factor Symbols that represent the form factor selected for this
content when it was created, either Desktop or Tablet.

The Form Factor column is not displayed when you are using
the Content Library when connected to the mobile app
interface simulator or the Interactive Service Hub.

Tags Displays any tags applied to this content. You can add tags in
the Advanced Options dialog box. Use tags to filter content
displayed in the library.

App Version The version of the application that the control was created on.

Author The name of the person who created the control.

Languages A numeric value that represents the number of languages to


which the control has been localized.

This col

Status Displays Published if the content is currently published;


otherwise the status is Draft.

Enabled Displays whether the content is enabled or disabled. Only


enabled content is displayed to your users.

Last Published The most recent date when the content was published.
Learning Path content types: Guided Tasks and Sidebars
You can create two types of content in Learning Path: Guided Tasks and Sidebars.
Guided Tasks
A Guided Task is typically a series of steps, although it can also be a single step. A user can launch a Guided Task by
selecting a link on a Sidebar, by navigating to a page, or by selecting a link on a page for which you have created
content. In each step, the user selects the Next button or completes a defined action to proceed to the next step, or
to complete the Guided Task.
Guided Tasks are useful for guiding your users through common or new tasks. They can also be used to ensure
that tasks are performed consistently in your organization, or that data is entered a specific way to support your
organization's processes or workflow. You can include links, videos, and other information in Guided Tasks to help
your users become familiar with and learn more about the part of the user interface that the step references.
Sidebars
A Sidebar is displayed when a user selects the Help button, navigates to a page, or selects a link or button on a
page for which you have created content. You can also create Home Sidebars that are displayed when the user
opens the page or screen, or selects the Home icon on a Sidebar.

You can also define Error Sidebars that appear when there is a problem displaying the intended sidebar. You can
include links, videos, and other information in sidebars to help your users become familiar with and learn more
about the page or form displayed, or actions they can take on the page or form.

Create a Guided Task


There are two steps for creating a Guided Task:
1. Define how the task is triggered, and assign the roles to which the content applies.
2. Use the Flow Editor to add the steps that users will see as they step through the Guided Task.
Define the triggers and roles
1. Go to the page for which you want to create a Guided Task.
2. Open the Content Library. See Content Library to learn how.
3. In the Content Library, select Guided Task.

4. Enter a name, and select the other settings for the Guided Task. Use this table for reference.

SETTING DESCRIPTION

Disable this guided task Select this check box to disable the Guided Task. When
disabled, it will not be displayed to users.
SETTING DESCRIPTION

Make this an error guided task Select this check box if you want to show this Guided Task
only when there is an error with other Guided Tasks, such
as a lack of privileges or any issue that prevents other
Guided Tasks associated with the page from being
displayed.

Name The name for the Guided Task that is displayed in the
Content Library.

Client The client value is set automatically for the platform on


which you're creating content. Warning: If you edit an
existing control when connected to a different interface
than the one on which the control was created, the Client
setting will be updated to the current client type. This will
cause the control to break and not work on the client for
which you originally created the control.

If you are creating controls for the web interface, Web


client is displayed.

If you are connected to the mobile app interface simulator,


Mobile apps is displayed.

If you are connected to the Interactive Service Hub,


Interactive Service Hub is displayed.

Form factor The form factor displayed depends on which interface you
are creating content for. If you are using the web client
interface, Desktop and Tablet are displayed. When
selected for the web client, Tablet refers to browsers
running on tablet devices, not the mobile app.

If you are creating controls for the mobile app interface,


Tablet is displayed. This refers to devices running the
Dynamics 365 mobile app, but is supported only on
tablets.

If you are using the Interactive Service Hub, Desktop is


displayed. Important: Learning Path is not supported in
Dynamics 365 for phones.

Guided task opens when Select whether you want the Guided Task to be displayed
when the Page Loads or when a Link Is Clicked on a
Sidebar.

Lifecycle stage This setting is for internal use only.

Common Data Service security role Select the security role(s) for which you want the Guided
Task to be displayed. You can select as many roles as you
want. If a user is assigned more than one role, the Guided
Task will appear only for the role with the highest
precedence, as described earlier in this topic.

Status Shows the status of the Guided Task. The status will be
Draft until you publish it.
SETTING DESCRIPTION

Advanced Options This option is available after you save the Guided Task. The
following settings are available under Advanced Options:
Make this error guided task: Select this check
box if you want to show this Guided Task only
when there is an error with other Guided Tasks.
Supported Languages: Select the languages for
this Guided Task, and for import and export.
Author: Change the author defined for this Guided
Task.
Tags: Add or remove tags applied to this Guided
Task. Use tags to make it easier to search content
in the Content Library, or to categorize your
content.

You can also set the following under Publish Info:


App Version: Set the Dynamics 365 version
associated with the content.
Version: Set the version of the content you create.
Authoring Group: Set the Authoring Group for
the content you create.
Publishing Groups: Select the publishing group(s)
for this content.

5. When you're finished, select Save to start using the Flow Editor.
Add steps with the Flow Editor
1. Add your title where Guided Task Title is displayed. This is the title that users will see.
2. Select whether to show fixed ID controls only. Registered controls are outlined in green and unregistered
controls are outlined in blue when you drag the tile to pin it to the UI. If you pin a step to a control that does
not have a fixed ID, it might be affected by a future update to Dynamics 365. Updates will not affect fixed ID
controls.
3. Select Add New Step, and then select the type of step you want to use for the first step of your Guided
Task.

BUTTON TYPE DESCRIPTION

Step with Next button This step has a Next button that can be used to navigate
to the next step in the flow. If this is the last step in the
flow, the Next button will not be shown. Drag the tile to
pin the step where you want it to appear in the app.

Step with User action This step does not have a Next button. The user is
prompted to select the UI element on which the step is
pinned. If page redirection or any change in UI state
occurs as a result of this selection, make sure to pin the
next step on the changed UI state. Drag the tile to pin the
step where you want it to appear in the app.

Pin this type of step to a selectable control in the UI, such


as a button or link.
BUTTON TYPE DESCRIPTION

User action with Next button This step does have a Next button. Selecting the Next
button has the same effect as selecting the UI element on
which the step is pinned. If page redirection or any change
in UI state occurs as a result of this selection, make sure to
pin the next step on the changed UI state. Drag the tile to
pin the step where you want it to appear in the app.

Learning Step This step has a customizable button as the end action. This
step can only be located at the end of a guided task flow.
You can use it to link to a Learning Path sidebar. Drag the
tile to pin the step where you want it to appear in the app.

NOTE
If you've already planned out your Guided Task and know which steps you want to add, you can add them all now.
Each step you add will appear in the Flow Editor in the order you add it. You can reorder steps after adding them by
dragging them up or down in the list.

4. Select the type of step you want to add, and then drag the tile to the UI to pin it to a control. It may take a
few tries to get used to placing the step where you want it.

NOTE
You can hold the tile for up to 15 seconds. If you don't pin it within 15 seconds, the tile will remain unpinned and the
mouse pointer will change back to a normal cursor.

5. When you've positioned the step where you want it, release the mouse button to pin it to the control. The
step will appear in the location you selected. To move the step, use the Drag me button on the panel next to
the step.
6. Add content to the step by using the controls displayed next to it. The following settings are available:
Content Type: Add text or a video to the step. Select Edit to see more settings. You can change font
size, color, and style for text, and add a thumbnail for video.
Placement: Specify the location of the step on the control you pinned it to. Selections include: Auto
position (Selected by default), Top left, Top right, Bottom left, Bottom right, Left-top, Left-bottom,
Right-top, and Right-bottom.
Copy: Create a copy of the step with identical content pinned to the same location, and insert it in the
Guided Task flow directly after the original step.
7. Select Save when you are finished positioning and adding content to the step, and then either close the step
by using the Close button in the upper-right corner of the step, or select the arrow in the upper-left corner of
the screen to return to the Flow Editor.

NOTE
You can always edit the step later, so don't worry if you accidentally close it before you have it just how you want it.

8. To add or edit the next step in your Guided Task, select the right arrow in the upper-left corner of the
screen to display the Flow Editor.
9. Add any additional steps you want to include in your Guided Task, making sure to save each step when
you're finished adding content.

NOTE
If you reposition a step or copy it by using the Copy button on the toolbar, any unsaved changes on that step will be
lost. Be sure to save your changes often.

10. When you've finished adding steps to your Guided Task, select Save.
11. Select Preview to test your Guided Task and see it how it will appear to users.

NOTE
To publish your Guided Task, you'll need to preview it first. When you close a step or use the arrow at the upper-left
corner of the screen during Preview mode, you'll see the Check-in and Publish buttons in the Learning Path designer.

12. If you're happy with your changes, check them in and publish the Guided Task, or publish it later from the
Content Library.

Create a Sidebar
There are two steps for creating a Sidebar:
1. Set the Sidebar properties and assign the roles to which it applies.
2. Add content to the Sidebar (text, images, links, and buttons).
Set the Sidebar properties and roles
1. Go to the page for which you want to create a Sidebar.
2. Open the Content Library. See Content Library to learn how.
3. In the Content Library, select Sidebar.

4. Enter a name, and then select the other settings for the Sidebar. Use this table for reference.

SETTING DESCRIPTION

Disable Select this check box to disable the Sidebar.

Make this an error sidebar Select this check box if you want this Sidebar to be
displayed only when there is an error with another Sidebar,
such as a lack of privileges or other issues that prevent
other Sidebars associated with the page from being
displayed.

Make this home sidebar The Home Sidebar is shown when a user selects the Home
button, or if there is no Sidebar on the page and the user
selects Help. Each page can have only one Home Sidebar.

Name The name that is displayed in the Content Library.

Client The client value is set automatically for the platform on


which you're creating content. Warning: If you edit an
existing control when connected to a different interface
than the one on which the control was created, the Client
setting will be updated to the current client type. This will
cause the control to break and not work on the client for
which you originally created the control.

If you are creating controls for the web interface, Web


client is displayed.

If you are connected to the mobile app interface simulator,


Mobile apps is displayed.

If you are connected to the Interactive Service Hub,


Interactive Service Hub is displayed.
SETTING DESCRIPTION

Form factor The form factor displayed depends on which interface you
are creating content for. If you are using the web client
interface, Desktop and Tablet are displayed. When
selected for the web client, Tablet refers to browsers
running on tablet devices, not the mobile app.

If you are creating controls for the mobile app interface,


Tablet is displayed. This refers to devices running the
Dynamics 365 mobile app, but is supported only on
tablets.

If you are using the Interactive Service Hub, Desktop is


displayed.

Sidebar opens when Select whether you want the Sidebar to be displayed when
the page loads, or when a user selects a link or button on
the page.

Lifecycle stage This is for internal use only.

Common Data Service security role Select the role or roles for which you want the Sidebar to
be displayed to users. You can select as many roles as you
want. If a user is assigned more than one role, the Sidebar
will be displayed only for the role with the highest
precedence, as described earlier in this topic.

Template Select the template to use for the new Sidebar, either
Single Column or Two Column. The default template is a
single-column Sidebar.

Status Displays the status of the Sidebar. The status will be Draft
until you publish the Sidebar.

Advanced Options This option is unavailable until you save the Sidebar. The
following Advanced Options settings are available:
Disable Sidebar Header
Disable Sidebar Title
Disable Sidebar Footer
Author: Change the author defined for the Sidebar.
Tags: Add or remove tags applied to the Sidebar.
Using tags can make it easier to search content in
the Content Library, or to categorize your content.
Supported Languages: Select the languages for
this Sidebar, and for import and export.

5. When you're finished, select Save to start adding content to your Sidebar in the designer.
Add content to your Sidebar
1. After you save your Sidebar name and properties in the Content Library, the designer opens.
2. Enter a title for the Sidebar.
3. Add the content you want to display to your users when the Sidebar is displayed.
4. To add a new section, select Add Section.
5. To remove a section from the template, select the section you want to delete, and then select Delete.
6. When you are finished modifying the content in the sidebar, select Save to save your changes, and then
close the sidebar by selecting Close in the upper-right corner to return to the Content Library.
7. Select Manage at the top of the page, and then select Check in to save your changes and make them
available to other users who are creating content.
Add links to your Sidebar
When you create a Sidebar, there are several options for adding links to it. You can create a link to another
Learning Path Guided Task or Sidebar, to another page in Dynamics 365, or to a webpage. You can even search for
help and training topics to link to while creating a Sidebar. After you set the sidebar properties and roles and are
ready to add content, follow these steps to add links to a section of the sidebar you created.
1. In the section you want to add links to, select the List Of Links icon.

2. Add a section title, and then select + Add Link.

3. Select the type of link you want to add, and then select Next. You can choose from the following options:
Guided Task: Creates a link to an existing Learning Path Guided Task. This can be useful for
providing information about a task in the Sidebar, and then linking to a Guided Task that steps a user
through the task in the Dynamics 365 interface.
Sidebar: Create a link to an existing Learning Path Sidebar. You can use a link to a Sidebar to
Page in app
Webpage

Use videos in your Learning Path controls


Only videos hosted on YouTube are supported in Learning Path controls. If you plan to use videos in your Learning
Path controls, you'll need to have a YouTube account and channel to upload videos to. You cannot link to videos on
a channel that is set to Private, but you can link to videos if your channel is set to Public or Unlisted. You can also
set up your channel so that multiple people can manage the video content for your organization.
When you add videos to your controls, you can embed the video within the control. If you want your users to view
your videos in a new tab or browser window you can add a text section to your sidebar and then add a link to your
video in the text section.
When you embed videos that are displayed within a Sidebar or Guided Task, you'll use the link that you get from
YouTube. Learning Path will automatically update the link to embed the video and size it to fit in Sidebar or Guided
Task tile. A user can select Full screen to view the video in full screen mode. If a user pauses the playback, or when
the playback is finished, YouTube might automatically display links to other videos the user may be interested in.
You can prevent this from happening by modifying the link in your control to include ?rel=0 at the end.
For example, after you create and upload a video to your channel, you copy the video URL provided by YouTube,
which is https://youtu.be/4TrYMB4pjyw. To embed this video in a control, you enter that URL into the Enter
video URL field for your control.
When you save the control, Learning Path changes the URL to
https://www.youtube.com/embed/4TrYMB4pjyw. To turn off the display of links to other videos when the
video is paused or finished playing, edit the URL to append ?rel=0 to the end so that your URL looks similar to the
following: https://www.youtube.com/embed/4TrYMB4pjyw?rel=0.
More information about using YouTube: YouTube Help Center

Publish Learning Path content


Users will only see Learning Path content you create after you publish it. Only content that is checked in can be
published.
1. Open the Content Library.
2. Select the check box next to each Guided Task and Sidebar that you want to publish. Make sure the control
you want to publish is checked in.
3. Select Publish at the top of the page, and then select Publish.
4. On the Publish Controls page, select the publishing environments you want to publish the content to, and
then select Publish.
About Publishing Groups
Learning Path content is published to a publishing group. When you turn on Learning Path for your organization, a
publishing group is created with the same name as the organization name. You can create additional publishing
groups as needed. You can add multiple organizations to a publishing group, and an organization can be a member
of multiple publishing groups so that you can customize content and easily publish it to different organizations.
Create a publishing group
1. Open the Content Library.
2. Select Configuration at the top of the screen.
3. Select Publishing Configuration.
4. On the Publishing Configuration page, select New PG.
5. Enter a name and optional description.
6. Select the organizations you want to include in the publishing group. You'll see only the organizations for
which you have permissions.
7. Select Save, and then select OK.

Export and import Learning Path content


You can export content that you create, perhaps to share with an author of another organization or to make backup
copies. The export feature creates a compressed .zip file that contains the .json files used for your content in
Learning Path. There will be one folder in the .zip file for each selected Learning Path Sidebar or Guided Task.
Export your Learning Path content
1. In the Content Library, select the check box next to the content you want to export.
You can export content without checking it in.
2. Select Manage at the top of the page, and then select Export.
3. Select the option you want to use for saving the generated .zip file, and then select a file name and location.

NOTE
The default file name for the .zip file is the same each time you export, so be sure to use a unique name to avoid
overwriting files that you previously exported.

Import your Learning Path content


1. In the Content Library, select Manage, and then select Import.
2. Select Browse to select the previously exported file that you want to import, or drag the file to the Drag
controls here box in the dialog box.
Cau t i on

When you import a control, it will overwrite and replace any version of the same control that is already in
the library, even if the existing control is newer.
3. Confirm that the file name displayed is the file you want to import, and then select Import.
4. In the confirmation dialog box, select OK.

Localize Learning Path controls


You can localize the content in the controls you create in Learning Path so that they are displayed to users in the
language they have selected for Dynamics 365. To localize your controls, you can simply export them, localize the
strings that are displayed to users, and then import the control that includes the localized content. You can import
the control into the same organization or into any organization you want. You can localize the same control into
multiple languages, and then just import the specific languages into specific organizations that support users who
have that language selected. Localization support in Learning Path follows the OASIS XML Localisation
Interchange File Format (XLIFF ) 2.0 standard. There are tools and tutorials freely available for working with this
common format. More information: XLIFF Version 2.0
More information about user language settings in Dynamics 365: Set personal options
1. Select the control you want to localize in the Content Library.
2. Select Localize, and then select Export.

3. Select the option you want to use for saving the generated .zip file, and then select a file name and location.

NOTE
The default file name for the .zip file is the same each time you export, so be sure to use a unique name to avoid
overwriting files that you previously exported.

4. After you've localized the content, in the Content Library, select Localize and then select Import.
5. Select Browse to select the previously exported file that you want to import, or drag the file to the Drag
controls here box in the dialog box.
Cau t i on

When you import a control, it will overwrite and replace any version of the same control that is already in
the library, even if the existing control is newer.
6. Confirm that the file name displayed is the file you want to import, and then select Import.
7. In the confirmation dialog box, select OK.
8. Publish the localized control to the publishing environments you want to make the localized control
available to your users. The localized content will automatically be displayed to users who have selected the
same language for their user interface.

Dynamics 365 apps data center mapping to Azure regions


The following table lists the Dynamics 365 apps datacenter regions and corresponding Azure regions from where
Learning Path will be available.

DYNAMICS 365 DATACENTER AZURE REGION

Asia-Pacific (APAC) East Asia

Canada (CAN) Canada Central

Europe, Middle East, Africa, and Great Britain (EMEA, GBR) West Europe

India (IND) Central India

Japan (JPN) Japan East

North America (NAM) East US

Oceania (OCE) Australia East

South America (SAM) Brazil South

Privacy notice
By enabling Learning Path Authoring for a Dynamics 365 organization, Learning Path content (published or draft)
created by users (with the right security privileges) will be stored in Azure SQL Database. In addition, enabling the
feature allows Azure Cloud Services to capture the following data associated with a Dynamics 365 organization:
List of organizations in the Tenant
End users’ Dynamics 365 client and applicable browser / OS configuration
Usage data of end users – such as time spent on Learning Paths or clicks recorded
Aggregated end-user data – Location, security role, user language
Aggregated end-user data – Location, security role, user language
Verbatim feedback from end users
An administrator can enable (and can subsequently disable) Learning Path Authoring through a setting on the
General tab of the System Settings dialog box.
Azure components and services that are involved with Learning Path Authoring functionality are detailed in the
following sections.
Note: For more information about additional Azure service offerings, see the Microsoft Azure Trust Center.
Cloud Services
Web Service
Web Service serves the controls that are rendered on the client by Learning Path Runtime. Web Service also
supports Designer API, which is used by Learning Path Authoring. The controls are stored by the service on Azure
SQL Database.
Compiler (Worker Role)
Compiler role manages the publish of a control to a publishing group. Compiler uses the queue to store messages
about the Publish job. The results are stored in Azure SQL Database.
Azure SQL Database
Learning Path uses Azure SQL Database to store:
Controls that are created by using Learning Path.
Configuration-related Learning Path Authoring.
Azure Active Directory
Learning Path uses Azure Active Directory to authenticate Web Service.
Azure Traffic Manager
Learning Path uses Azure Traffic Manager to load balance the Web Service for availability and performance.
Azure Storage Queue
Azure Storage queue is used to coordinate communication between the Web Service and Compiler roles.
Azure Blob Storage
Learning Path uses Azure Blob Storage to store the static content (client-side JavaScript, images, CSS content).
Azure Content Delivery Network (CDN )
CDN is used to cache the client side static content (JavaScript, images, and CSS files), to serve them from global
CDN network.
See also
On-off switch for Learning Path (guided help)
Quick start for transitioning your legacy web client
application to Unified Interface
2/6/2020 • 4 minutes to read • Edit Online

The Unified Interface framework uses responsive web design principles to provide an optimal viewing and
interaction experience for any screen size, device, or orientation. This quick start topic explains how to transition
your legacy web client application to Unified Interface by using a new non-production environment.

To use an existing non-production environment to transition your Web Client application, see Quick start for using
an existing environment to validate your legacy web client app with the Unified Interface.

Prerequisites
A legacy web client application.
Although not required, we recommend a non-production environment to test your application and ensure it
does not impact your current deployment or development cycles. More information: Manage sandbox instances

Prepare the environment


First, select a non-production environment and enable Use Unified Interface only mode, which will use the
Unified Interface for all model-driven apps in the environment. This also includes any Dynamics 365 application
modules originally configured for the legacy web client.
1. Sign in to Power Apps, select Environment, and then select a sandbox environment.
2. Select Settings > Behavior and then turn on Use Unified Interface only.
NOTE
If you need to switch the environment back to its previous state, you can toggle the Unified Interface setting to revert to the
original interface. More information: Enable Unified Interface Only

Run and validate your application in the Unified Interface


Run your applications that were originally web client applications. Notice that, after you turn on Use Unified
Interface only, all available apps in the environment use the Unified Interface even if the application was
originally configured for the web client.
To run your app, sign in to Power Apps, select Apps, and then select the application you want to run. Alternatively,
you can go directly to the My Apps page, such as https://contoso.crm.dynamics.com/apps/.
Validate your app, processes, and customizations
We recommend that you test all use cases. You can start with the most critical use cases or group them into logical
patterns of design. Since the Unified Interface is based on responsive design, we recommend that you perform
tests with different devices that have different screen resolutions. As you test the application you will be able to
verify that your customizations are compatible with the Unified Interface and whether there are any features that
require a redesign or have missing functionality. Build a plan for reviewing these elements and post your questions
and feedback on our community forum.

IMPORTANT
The current version of Common Data Service and model-driven apps in Dynamics 365 still includes several deprecated
features. You should review your application for any deprecated features and replace as necessary with new capabilities.
More information: Important changes (deprecations) coming

Dynamics 365 apps


If you use the Dynamics 365 Field Service or Dynamics 365 Project Service Automation apps and want to test the
Unified Interface, you must set up a new sandbox environment and make a copy of your production environment
to upgrade to the latest Field Service version and Project Service Automation version before validating these
applications in the Unified Interface. To do this, follow these steps:
1. Create a new sandbox environment from the Power Platform Admin center or Dynamics 365 admin center.
More information: Add an instance to your subscription
2. Copy your production environment that has the Dynamics 365 Field Service or Dynamics 365 Project
Service Automation apps into the new sandbox environment. To do this, on the Power Platform Admin
center open your production environment, and then select Copy.
3. On the Copy environment page, select Everything, select your new sandbox environment from the
Select environment to overwrite list, and then select Copy.

4. The Overwrite environment dialog box appears. Make sure you have selected the correct environment
and that you have the right options selected, and then select Confirm.
5. When the copy is successful, a confirmation notice appears.
6. On the menu bar, select Manage Solutions to open the Solutions area.

IMPORTANT
If administration mode is enabled, you must disable it so you can view the Solutions area. More information:
Administration mode
7. Find the Field Service or Project Service Automation solution and select it. The option to Upgrade should
be available. Select it to upgrade the solution.

NOTE
The latest versions of Field Service and Project Service Automation on the Unified Interface are available by default for newly
created instances. If you want to upgrade an existing environment with installed earlier versions, you must request the
upgrade by contacting Microsoft Customer Support.

More information: Dynamics 365 for Field Service latest versions and Dynamics 365 for Project Service
Automation upgrade home page

Next steps
Based on your findings, your implementation team or partner can estimate the amount of effort needed to
transition your application into the Unified Interface and also identify potential usability improvements. With
multiple new features and capabilities available in the Unified Interface, there is opportunity to increase value for
your application users.
Transitioning to the Unified Interface is a great opportunity for you to make a modern user interface and revisit
your existing processes to verify that they're still valid or need improvement. This is also a good time to consider
whether your application reflects your business requirements and whether the existing application could be spread
across multiple apps for various teams and roles. More information: Design model-driven apps by using the app
designer
See also
Unified Interface Playbook
Approaching a user experience and Unified Interface transition
About Unified Interface
What are model-driven apps in Power Apps?
Update your apps to Unified Interface
Configure model-driven app interactive experience dashboards
Use custom controls for model-driven app data visualizations
Power Apps component framework overview
Unified Interface for everybody
Quick start for using an existing environment to
validate your legacy web client app with the Unified
Interface
2/1/2020 • 9 minutes to read • Edit Online

This quick start topic shows you how to use an existing environment to create a Unified Interface application based
upon your current configuration or default solution. This allows you to explore and test the Unified Interface while
running your existing legacy web client applications in parallel. A user can then switch between environments for a
side-by-side view.

For similar instructions that show you how to create a new sandbox environment to isolate the testing and view
only the Unified Interface experience, see Quick start for transitioning your Dynamics 365 legacy web client
application to Unified Interface.

IMPORTANT
For environments with Dynamics 365 Field Service or Dynamics 365 Project Service Automation apps, see Dynamics 365
apps.

Prerequisites
An existing Dynamics 365 Sales or Service legacy web client application.
Although not required, we recommend using a non-production environment to test your application. More
information: Manage sandbox instances

Overview
This topic is for existing customers who are currently using legacy web client applications who need to plan and
execute their transition to the Unified Interface. To set up a parallel environment, you create a new application
based on your default solution as it stands today. This can be done in your current development sandbox
environment without impact to your existing work.
After completing the steps in this article, users with the appropriate role can see your new app in the app list on
both the Dynamics 365 drop-down app list or on the Dynamics 365 Home page (https://home.dynamics.com).

Once you complete the tasks described in this topic in your development environment using a solution, you can
import the solution into your testing environment, which allows a wider group of business users to test and
compare the app in a familiar environment.
Follow your application lifecycle management (ALM ) and development operations processes. We recommend
performing all the steps described inside of a solution context. Once you test and validate the app in the
development environment, you can further test the app by launching it as a pilot program to more users, such as in
a production environment. Having the model-driven app and site map inside of a solution enables your app to be
exported from the environment where you created this new app following your existing processes onward in your
environment pipeline.

Process for validating your legacy web client app in an existing


environment
The process for validating your legacy web client app in an existing environment includes three steps:
1. Create a new solution that's based on the default solution
2. Create a new model-driven app
3. Configure app properties
If you’ve recently switched the Use Unified Interface only mode to On in your development environment, such
as instructed by following the Quick start for transitioning your Dynamics 365 legacy web client application to
Unified Interface topic, you must turn the setting back to Off so you can run the existing legacy web client apps.
Create a new solution that's based on the default solution
1. Sign in to the Power Apps maker portal.
2. From the list of environments, select the environment you want.
3. On the left navigation pane, select Solutions.
4. On the menu bar, select New solution.
5. On the New solution pane, enter the following properties:
Name. Enter a name for the solution. For example, Unified Interface App.
Publisher. Select the publisher that your organization uses. Be sure to follow your customization
governance for your existing customizations. This will ensure the schema names for the model-driven
app and its site map are consistent with your existing standards.
Version. This should be set following your existing standards and governance for solutions.
6. Select Create.
7. The new solution is created in the list of solutions. Select it to open the solution and go to the next section.
Create a new model-driven app in the new solution
In this step you will create a new app that leverages your existing customizations so that you can experience them
in the Unified Interface. You create the app within the container of the new solution, which you created in the
previous section.
1. On the menu bar select New, point to App, and then select Model-driven app.
2. On the Create a New App page, enter the following properties:
Name. Enter a name for the application as you see fit. For example, Your Application Name + New or
Unified Interface Test.
Unique Name. This begins with your solution prefix and the simplified version of the app name you
specified. You can make changes or leave it as it appears.
Description. Add a description for the app, such as For testing purposes of the new Unified Interface of
our solution.
3. Select Use existing solution to create the App, and then select Next.
4. In the Select Solution list select Default Solution, in the Select Sitemap list select Site Map, and then
select Done.

5. The App Designer opens, displaying all the app components that were in the default solution. Select
Publish.
6. After the publishing process completes, select Play.
A new window opens in the browser with your new model-driven app that contains all of the entities, sitemap, and
sitemap customizations that were in your default Dynamics 365 application.

Notice that when you go back to the browser tab with the Power Apps maker portal Solutions area, your new
model-driven app and a similarly named sitemap client extension are both part of the solution you created.
In this step you created a new model-driven app inside of a solution, which you can import into your testing or
evaluation environments. You could start to experience the new app now, but before doing so, in the next step
you’ll configure a couple of settings for the new app. Doing this will make it possible to share with other users.
Configure app properties
The tasks required to configure the model-driven app properties include:
Assigning user roles to the new app to enable non-administrators access to use the app.
Customizing a friendly URL so that a shortcut to the new app can be easily shared, bookmarked, or
remembered by users.
1. Navigate to environment URL/apps. The URL will look similar to this:
https://YourEnvironment.crm.dynamics.com/apps. Doing so opens a list of all the apps in your environment.
2. Locate the new model-driven app you created.
3. On the app tile, select the ellipsis, and then select Manage Roles.

4. The available roles area is listed on the right pane. Select the roles as needed to give non-administrator
users access to the app.

IMPORTANT
Make sure that all users are granted at least one security role that contains Read access to the Model-driven App
privilege. This privilege can be found on the Customization tab within the security role. Users without this privilege
receive an error upon opening any model-driven app. Notice that System Administrator and System Customizer
security roles already have this privilege enabled.
5. Optionally, in the Manage Roles pane you can expand the App URL Suffix to customize the friendly URL
for the model-driven app. Notice that you can specify most anything. For example, enter new so that the
preview displays the URL https://YourEnvironment.crm.dynamics.com/apps/new.
This becomes the friendly URL to use and share so that users can directly launch into the experience of the
Unified Interface. Users can bookmark this link for their convenience.
6. Select Save.
Now, users with the appropriate role can see your new app in the app list on both the Dynamics 365 drop-down
app list or on the Dynamics 365 Home page (https://home.dynamics.com).

Because the Use Unified Interface only mode is set to Off, when users navigate to the root URL of your
environment, they will still land on the default Dynamics 365 – Custom application as before. This is expected if
you want to continue supporting your existing legacy web client apps while testing and working on the Unified
Interface apps.

Compare your new app to the default Dynamics 365 app


Now you are ready to launch the app. You can compare the new Unified Interface app to the Dynamics 365 –
Custom app using the same data, user roles, business rules, workflows, plug-ins, and so on, because they are in the
same environment. This allows you to educate your organization that all the core fundamentals are still there, and,
at the same time, start to explore the new Unified Interface enhancements.

TIP
If you want to show the apps side by side on one monitor, you can press the Windows and left arrow keys (or right arrow
key) together to split your browser windows on the same monitor.

NOTE
If you continue to make customizations in your default site map, such as changes in the navigation or deeper ribbon
customizations for buttons and actions, you will need to repeat the process by creating another model-driven app or
perform the same customizations in the new site map related to your model-driven app.

Validate your new app


With your application showcasing the Unified Interface, you can start validating your app, processes, and
customizations to identify how the transition will look. We recommend that you test all use cases, but you can start
with the most critical ones or group into logical patterns of design. Since the Unified Interface is based on
responsive design, we recommend that you always perform tests with different devices that have different screen
resolutions. As you test the application you will be able to verify that your customizations are compatible with the
Unified Interface and whether there are any features that require a redesign or have missing functionality.

IMPORTANT
The current version of Common Data Service and model-driven apps in Dynamics 365 still include several deprecated
features. You should review your application for any deprecated features and replace as necessary with new capabilities. More
information: Important changes (deprecations) coming

TIP
The Power Apps Checker tool assists in quality checking of your solution's components. More information: Use solution
checker to validate your model-driven apps in Power Apps

Next steps
Based on your findings, your implementation team or partner can estimate the amount of effort needed to
transition your application into the Unified Interface and also identify potential usability improvements. With
multiple new features and capabilities available in Unified Interface there is opportunity to increase value for your
application users.
Transitioning to the Unified Interface is a great opportunity for you to make a modern user interface and revisit
your existing processes to verify that they're still valid or need improvement. This is also a good time to consider
whether your application reflects your business requirements and whether the existing application could be spread
across multiple apps for various teams and roles. More information: Design model-driven apps by using the app
designer
See also
Unified Interface Playbook
Approaching a user experience and Unified Interface transition
About Unified Interface
What are model-driven apps in Power Apps?
Update your apps to Unified Interface
Configure model-driven app interactive experience dashboards
Use custom controls for model-driven app data visualizations
Power Apps component framework overview
Unified Interface for everybody
Unified Interface Playbook
3/14/2020 • 2 minutes to read • Edit Online

This playbook is intended to help customers, partners and Microsoft field roles plan and execute transitions from
the legacy web client to the Unified Interface.
In summary, the Unified Interface Playbook documents will help you:
Understand the Unified Interface.
Understand the transitioning process.
Develop a strategy for discussions and the transition.
Ensure a smooth transition.
Manage user inquiries and potential objections effectively.
Find the resources that will support the process.

DOWNLOAD LINK DOC TYPE

Unified Interface Playbook Overview PDF

Chapter 1: Initiate PowerPoint

Chapter 2: Explore PowerPoint

Chapter 3: Transition PowerPoint

Chapter 4: Optimize PowerPoint

See also
Dynamics 365 Project Service Automation Upgrade playbook
Approaching a user experience and Unified Interface
transition
2/1/2020 • 2 minutes to read • Edit Online

This business-oriented white paper outlines the planning, governance, and management principles to consider
when approaching a user experience change within a model-driven application on the Power Apps platform. This
white paper focuses specifically on Dynamics 365 applications such as Dynamics 365 Sales and Dynamics 365
Customer Service, and adopting the Unified Interface, but many topics are applicable to any user experience
update.
In summary, this guide will help you:
Position the Unified Interface.
Design approach best practice.
Governance and guidelines.
UX usage recommendations.
Download the white paper
Checklist: Unified Interface transition
12/2/2019 • 8 minutes to read • Edit Online

Follow the steps in this article to ensure that you're prepared for transition to the Unified Interface. Readiness for
transitioning to Unified Interface will depend on whether you are aiming for basic compatibility or redesigning to
take full advantage of new capabilities. For more detailed information, see the Unified Interface playbook and user
experience white paper.
The instructions apply to the following model-driven apps in Dynamics 365:
Dynamics 365 Sales
Dynamics 365 Customer Service
Dynamics 365 Field Service
Dynamics 365 Project Service Automation

Run the Power Apps Solution Checker on your solutions


The Power Apps solution checker performs a rich static analysis check on your solutions against a set of best
practice rules to quickly identify problematic patterns. After the check completes, you receive a detailed report that
lists the issues identified, the components and code affected, and links to documentation that describes how to
resolve each issue.
The solution checker analyzes these solution components:
Common Data Service plug-ins
Common Data Service custom workflow activities
Common Data Service web resources (HTML and JavaScript)
Common Data Service configurations, such as SDK message steps
Things to consider
Potential issues detected by the solution checker may not exclusively apply to the Unified Interface, be
mindful of what will impact transition when reviewing results.
As in any automated code review, some issues can be false alarms and don’t mean that your application
won’t run in Unified Interface.
Logic executed on the server side, such as plug-ins, custom workflow activities, and the configuration of
SDK message steps shouldn’t impact the user interface and hence shouldn’t impact the transition to Unified
Interface.
Even if the all issues aren’t directly associated with the Unified Interface, we recommend that you spend
time reviewing them to improve the overall health of your application.

Check third-party solutions compatibility with Unified Interface


Prior to transitioning to the Unified Interface, it’s important that you make sure that any third-party solution that
you use in your application works in Unified Interface.
If you have installed ISV (Independent Software Vendor) add-ins through AppSource, check if upgrades are
available in the Power Platform Admin center by selecting Environments > [environment_name] >
Manage Solutions.
If you are using third-party solutions that were provided outside of AppSource, contact the provider
(Partner or ISV ) to get a new version that updates the apps to Unified Interface.

NOTE
If there are no plans for your third-party solutions to be updated to a version compatible with Unified Interface, it is
important to identify a path to replace these features with either native platform capabilities or alternative solutions that are
compatible.

Identify replacements for deprecated client API code and features


Based on the outputs of the Power Apps Solution Checker and the information contained in Important changes
(deprecations) coming on deprecated client APIs and features, you should have a good understanding of the
customizations and features that either need to be corrected or replaced in your Unified Interface project.
Here are some of the most common areas needing attention:
Client API: Recommended replacement methods are documented here.
Process dialogs: Recommended replacements for dialogs are documented here.
Task flows: Consider using Business Process Flows to replace task flows.
Service scheduling: Consider using Universal Resource Scheduling to replace legacy service scheduling.

NOTE
You might also consider replacing the Dynamics 365 for Outlook (COM Add-in) with the lightweight Dynamics 365 App for
Outlook.

Test your application in Unified Interface


One of the easiest ways to test your application in Unified Interface is to turn on the Enable Unified Interface
Only option on a copy of your production environment. After the Unified Interface is enabled, you should be able
to access your application using the Dynamics 365 – Custom app and test the use cases relevant to your context.
Test your business and technical scenarios
Focus on what could potentially be impacted:
Business processes such as business process flows, business rules
Customizations such as forms, views, command bar buttons, web resources, and charts

TIP
Challenge the user experience at the same time as doing these early tests: is everything meaningful and adding value? What
should be removed/improved/added? For example, are the current list of views relevant? Or are my users forced to create
their own views?

Identify gaps
Any potential regressions that weren’t already spotted by the solution checker and third-party solution
updates.
User pain points that could lead to optimizations (such as new form rendering by reorganizing sections and
tabs) or specific training.
Any other dependencies on the legacy web client such as the use of the legacy Outlook COM Add-in instead
of the lightweight Dynamics 365 App for Outlook.

Define your app strategy and settings


Instead of using the Dynamics 365 – Custom app, which isn‘t optimized for Unified Interface but rather runs in
compatibility mode, we suggest that you leverage either first-party apps made by Microsoft or create your owns
apps.
The Dynamics 365 first-party apps that have already been optimized for Unified Interface are the following:
Dynamics 365 Sales Hub
Dynamics 365 Customer Service Hub
Dynamics 365 Marketing
Dynamics 365 Field Service (version 8.x and later)
Dynamics 365 Project Service Automation (version 3.x and later)
What are model-driven apps?
Model-driven apps are a type of app you can create using Power Apps that helps you provide tailored experience
to your users depending on their role in the organization. For example, a salesperson can have a completely
different experience than a customer service representative through different model-driven apps even though they
are using data from the same environment. Multiple model-driven apps can be created in a Common Data Service
environment. More information: What are model-driven apps?
The Dynamics 365 first-party apps listed earlier are examples of model-driven apps.
How to define your app strategy?
Ask yourself the following questions:
1. Can you split your users into multiple groups with specific business processes?
2. Do these groups have different requirements for what they should see and do?
3. Are you finding it difficult to have different user experiences without using apps?
If you have answered "Yes" to these questions then consider having multiple apps.
This is the opportunity to rethink the experience in the context of business processes for each group or role.
Out-of-the -box apps (for example, Sales Hub) or customized apps?
It depends how tailored you’d like the experience to be.
If you have few customizations or want to benefit from first-party app updates, then consider using native
apps.
If you want more control over the experience and updates of standard apps and customizations, then create
your own app.
Once you have defined your app strategy, what should be the next steps?
1. Customize your target apps and only include what users will need. Less is better. Reduce the clutter to
enable users to work efficiently.
2. Dissociate security roles from unused apps.
Review your apps settings and user experience fundamentals
App settings
Include all required entities in your app, even if they are not in the sitemap.
Provide the Read privilege for Model-driven app in the Customization tab in the Security Role dialog
box.
Enable the Unified Interface only mode if your users don’t need to use the legacy web client. You can still
access administration features by selecting Settings > Advanced Settings.
Create a simpler app URL. For example: https://*.crm.dynamics.com/apps/MyApp*
Try to limit the number of apps a user can access.

TIP
When Use Unified Interface only is set to Yes and when users only have access to one app, they are automatically
redirected to the app when they access the root URL (https://*.crm.dynamics.com)*

Optimize navigation (sitemap)


Define one main area with the most used sub-areas (dashboard, entities, etc.) organized in groups
Create one or more additional areas for less used features (configuration, settings, etc.). The idea is to help
your users focus only on what’s important to do their work.
Update icons
Transitioning to the Unified Interface is a good opportunity to refresh icons.
We recommend SVG format as they render well regardless of screen resolution.

TIP
Example of SVG icon format:
Width and height: 16px; Padding: 0px; Background: transparent; Icon color: #FF000000
To avoid rendering issues, open the SVG file with an editor (for example, Notepad) and remove fill="#000000"

Enrich your app with Unified Interface exclusive features


Create a Welcome Page that users see when they access each of your app. This is a great opportunity to
guide users in their first steps.
Use existing Custom Controls to improve the usability of most field types, especially on mobile. For
example, replace a 0 to 5 field rating with stars, replace a view of appointments with a calendar view, replace
a sub-grid view with card forms.
Leverage Reference Panels on forms to bundle multiple views, quick views, and KB search feature in a
single place.
Leverage the Power Apps Component Framework to add even more custom controls. You can get some
from the community or from partners and ISVs.
Embed canvas apps in your forms to easily extend your application. No-code or low -code extension of your
app without the need to develop custom HTML/JS web resources.
Embed Power BI reports and tiles in forms: consolidate data across multiple systems in a single view.
Consider leveraging Interactive Dashboards to configure a one-stop workplace that allows global filtering
across dashboard components.
Configure Custom Help Panes and Guided Tasks so that users quickly get help and guidance.

Conduct user acceptance testing


It is very important that your applications, business scenarios, and technical scenarios are tested by your business
users in Unified Interface in conditions that are similar to your production environment. These users can act as
business champions to help scale knowledge across the business.
Testing will help identify remaining items to be addressed before transitioning all of your users to Unified Interface.

Update user training materials


Conduct a review of your existing and planned training materials to ensure they have the latest screenshots and
reflect any changes you have made to the user flow.

Check your transition date


On October 1, 2020, the legacy web client will no longer be available. Be sure to migrate well in advance to ensure
there’s time for any issues to be addressed.
FAQs: Transition to Unified Interface
3/24/2020 • 11 minutes to read • Edit Online

This topic provides answers to the most common questions about Unified Interface and about transitioning from
the legacy web client to Unified Interface.

FAQs: Unified Interface and legacy web client


Why should I move to Unified Interface?
Microsoft's vision of a productive workplace requires a modern interface that includes the features and
improvements contained in Unified Interface, which provides a more consistent user experience, improved
performance and increased user efficiency. For more information, see Unified Interface playbook.
Are my ISVs compatible?
ISVs have been notified to take action on the transition to Unified Interface. Contact your ISV directly regarding
their timeline for Unified Interface compatibility.
What is the retraining effort?
From a technology standpoint the retraining should be minimal as your business logic and schema remain
unchanged. Retraining should focus on what's new within the navigation and the overall look and feel. Further
training may be required if you have made a business decision to alter the design to optimize for the new
capabilities and features.
Will I need to re -create my solution customizations?
No, you should not have to recreate any customizations, provided you have followed the Common Data Service
Developer Guide and kept up to date with any changes. However, there may be new opportunities to take on our
latest investments that could lead to customization alterations.
How long will it take to transition/what is the work effort?
The work effort here will vary based upon the complexity of your environment. We recommend getting started
with a pilot/POC model-driven app to begin testing. From there, you can work with the business to plan a full
Unified Interface rollout. See the Unified Interface Playbook and planning checklist for additional guidance on
getting started and our white paper.
Where can I find public information about the Unified Interface direction?
The strategic direction of Unified Interface is already in the public domain through events such as:
MBAS: BRK2073 Microsoft Power Apps: Run one UI – the future of canvas, model-driven, and Unified Interface
in Power Apps
BRK3031 Implementation Best Practices for Dynamics 365: Making the move to modern Unified Interface
As an on-premises customer looking to move to the cloud, what is the best approach to adopt Unified
Interface?
It is highly recommended to plan your move to Unified Interface at the same time as you migrate to the cloud.
Begin testing of your legacy web client within Unified Interface and once migrated, confirmed Unified Interface
compatibility before you release to your user community. This will reduce the training effort and allow users to
adopt some of the new features and capabilities Unified Interface has to offer. For more information, please speak
with your Microsoft representative.
When will ISVs be notified of the need to move to Unified Interface?
ISVs have been notified to take action on the transition to Unified Interface. Contact your ISV directly regarding
their timeline for Unified Interface compatibility.
How are language translations handled?
The process for language translation is primarily unchanged, with the exception of the sitemap. Sitemap areas,
groups, and subareas are localized within the sitemap editor.
I don't have budget or resources to do a project. Is the deadline a fixed date?
We're locked to move away from the legacy web client by December 1, 2020. We recommend conducting some
testing as soon as possible to understand the complexity of the project for your organization to get compatible. In
most cases, extensive redesign should not be required to move forward quickly and start seeing user benefit.
Contact Microsoft to provide any feedback that could stop your transition by creating a support case.
We're working on transitioning to Unified Interface, but have hit some issues; how can we report to Microsoft?
Review our resources to help with guidance and log a support case following your standard procedure. You can
also notify your partner, Microsoft representative, or FastTrack team (if applicable).
When should I start moving to Unified Interface?
You can move right away; we already have many customers transitioned in production to Unified Interface. Start
your testing as soon as possible. Access our Community site: https://community.dynamics.com/365/unified-
interface/ for helpful content. Use the Standard Support procedure to log any issues.
What are the risks associated with moving to Unified Interface?
We see a risk in staying on legacy web client because our investment and strategic direction is on Unified Interface.
If you are now planning to start the transition, review our community site and quick start guides. This will help you
identify gaps (if any) and have a plan to fix those before you do a full deployment.
I have a new feature idea for Unified Interface; where do I log it?
Visit our ideas portal ( https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas), select
Suggest an idea, and label the item with the 'Unified Interface' category.
Is there any supporting content to help me plan and execute my transition to Unified Interface?
Yes, we have a new community group (https://community.dynamics.com/365/unified-interface/) that provides
useful content, interactive forum, and blog to see all the latest updates and information about Unified Interface.
How does this move impact on-premises customer and what will happen when the web client is deprecated (do
web client forms become unsupported)?
This announcement is only in effect for online customers at present. We will continue to support the legacy web
client for on-premises deployments.
Is the timeline applicable for customers using Government Community Cloud (GCC ) and other data centers such
as China?
We plan to release Unified Interface updates to these data centers as part of the standard release program.
What action should I take as a Unified Service Desk customer who is still on the web client?
The Unified Service Desk customers, who are still on the web client, need to migrate their configurations from web
client to unified interface. This will necessitate upgrade to the latest versions of the Unified Service Desk (both
client and server components). We have a migration assistant to help with this effort.
Are there any other deprecations that I should plan for?
Review our deprecation notification page to identify if there are any other areas that also require planning.
Where can I find further information on the transition service?
To help accelerate momentum for transition, we are providing a suggested target date for environments to be
switched from the legacy web client to Unified Interface via our transition service. Customers will need to approve
the date prior to any action and then will receive a series of communication reminder messages as the date draws
closer. Dates can also be rescheduled if they are not suitable for the business up until the December 1, 2020
deadline. For more information, see the next section.

FAQs: Transitioning to Unified Interface


Where can I go to see the transition dates that have been suggested for my environments?
Use the transition portal to manage your environment transition date: https://runone.powerappsportals.com.
How do I gain access to the portal?
Do the following:
1. Visit https://runone.powerappsportals.com.
2. Sign in with the admin credentials of the tenant you want to manage.
3. Select My Environments, and review all environments that have a suggested date applied.
I see my environment has a date suggested for transition. Can I change this date?
Yes, this is possible if you have the global admin, Dynamics 365 service administrator, or Power Platform
administrator role for the tenant.
The dates associated to your environment is a suggestion that requires approval to go ahead. Approve if the date
works for your organization.
To change the date, select the drop-down icon next to the environment and view the record. Tenant admin roles will
then be able to reschedule the transition date to an earlier or later date.
To reschedule to an earlier date, update the existing date to your preferred option in the list. You can also switch
manuallyif our dates are not suitable.
To schedule to a later date, select the reschedule transition date button. Suggested dates will be available in the
drop-down. Once approved, the date will be updated in the portal accordingly. Accept the updated date if you
would like your environment to be transitioned.
Date changes will be reviewed and granted if the date is before December 1, 2020. The date will be updated within
the portal once confirmed.

NOTE
If you have an approved transition and the scheduled date is within 48 hours, you'll not be able to change the date. Likewise,
you can't request a date after December 1, 2020 as the legacy web client will no longer be available then.

What will happen if I don't opt in and approve a suggested transition date for my environment?
There won't be any change to your environment if you haven't approved the suggested date within the portal.
When the suggested date passes, we'll look to provide another date in the future for you to consider.

NOTE
After December 1, 2020, all environments will be updated to Unified Interface.

My transition date is within 48 hours and I can't change the date within the portal. How can I stop the transition
from taking place?
The ability to change the transition date for an environment is available only until 48 hours prior to transition. To
stop the process after this period, raise a support case.
NOTE
We can't guarantee the transition can be stopped if the request is made after the date has been locked on the portal (48 hrs
or less).

I have environments without a scheduled date. Can I update these to include a date?
Yes, if you have a global admin, Dynamics 365 service administrator, or Power Platform administrator role
for the tenant, select the environment, and select a date by clicking on the reschedule transition date button.
We will update the portal with the date to confirm. Notification e-mails will also be sent to the global tenant admins
as you get close to the transition date. This will follow the standard reminder procedure detailed within this
document.
Is there a recommended checklist I should run through before transition?
Check out the supporting content available on the community site. We also have a transition checklist to help you
plan effectively. Review it carefully to ensure that you are comfortable with the transition to Unified Interface.
My environment has been transitioned, but I am finding blocking issues for my users and want to move back to
the legacy web client. Is this possible?
Yes, you will still be able to switch back to the legacy web client for up to 10 days post transition. You can make the
switch manually for the first 10 days or raise a standard support request and set the problem type to be "Transition
from legacy web client to Unified Interface" as the manual switch will be disabled.

NOTE
The 10 days need to be prior to December 1, 2020 as the legacy web client will no longer be available after that date.

I want to transition after December 1, 2020. Is that possible?


The legacy web client won't be available after December 1, 2020. We don't have the ability to defer the date beyond
that period.
If you encounter any blocking items, log them using your standard support process as soon as possible.
What is the standard reminder procedure throughout this process?
Communication will be in waves, at least 30 days prior to the suggested time frame, but you can sign in to the
portal (https://runone.powerappsportals.com) at any time to view the status. Microsoft will send the following
communication:
Initial message for each environment that has a suggested transition date.
If you have approved the date, you will receive a reminder message two days before the dates are locked within
the portal.
Final reminder will be sent two days before the transition. This will state the transition date is locked and will go
ahead with the transition.
Post transition, there will be a closing message to confirm success (or if an issue occurred)
Messages can be seen using the following channels:
Message Center within the Microsoft 365 Tenant. This is typically visible to roles such as Global Admin, Service
Admin, Service Message Reader.
Direct e-mail. Emails are sent only to the system administrator role for the specific environment in question, or
email addresses that have been added to the "Notification" tab in the environment admin portal.
NOTE
You will receive an e-mail for each environment where your user account has the system administrator role.

I have requested a date to postpone but still receiving e -mails and Message Center posts that my environment is
set to transition. Should I be concerned?
Our first recommendation is to check the transition portal ( https://runone.powerappsportals.com/) as it will be the
single source of truth for all of your environments. If the date is updated, then it is highly likely that our
communication system sent the message before we updated the communications list.
If the date in the portal isn't updated to your new date, raise a support request following your standard procedure.
Only admin-approved dates will be transitioned.
If I already have an environment transitioned to Unified Interface, will I still be able to switch back to the legacy
web client manually?
If your environment has been transitioned for at least 10 days, we will look to disable the manual switch back to the
legacy web client.
If you find this has been disabled and have a requirement to switch back, raise a standard support request and set
the problem type to be "Transition from legacy web client to Unified Interface."
Is there a specific day and time when approved transitions will take place?
We don't anticipate any downtime when making this transition. However, we will only make a transition on a
Friday, following the same maintenance timelines outlined within our standard policies and communications. More
information: Maintenance timeline
Are environments from all data centers included within this transition service?
At present, environments from specific data centers, such as Government Community Cloud (GCC ), have not been
included within the portal. We'll provide suggested transition dates for these environments by June 2020.
Customers who want to make the move to Unified Interface can always switch manually at any time before
December 1, 2020.
Accessibility in Power Apps app designer, site map
designer, and My Apps page
12/3/2019 • 3 minutes to read • Edit Online

Microsoft is committed to making its products and services easier for everyone. More information: Microsoft
accessibility
This topic describes the accessibility features available with model-driven apps.

Keyboard shortcuts
Power Apps offers keyboard shortcuts to address issues faced by people with limited dexterity or motion
disabilities.

MY APPS PAGE

To Shortcut Keys (Windows) Shortcut Keys (Mac)

Create a New App. Alt + N Opt + N

Open the More Actions menu on the Alt + M Opt + N


selected tile.

APP DESIGNER AND SITE MAP DESIGNER

To Shortcut Keys (Windows) Shortcut Keys (Mac)

Go to the next section or major Ctrl + F6 Cmd + F6


component.

Go to the previous section or major Shift + Ctrl + F6 Shift + Cmd + F6


component.

Save command. Ctrl + S Cmd + S

Save and Close command. Ctrl + Alt + S Cmd + Opt + S

Validate command. Ctrl + Alt + V Cmd + Op t+ V

Publish command. Ctrl + Alt + P Cmd + Opt + P

Close command. Ctrl + Q Cmd + Q

Add. Shift + N Shift +

Edit. Shift + E Shift + E

Remove. Shift + R Shift + R


APP DESIGNER AND SITE MAP DESIGNER

Search Canvas. Ctrl + Shift + F Cmd + Shift + F

Add Components. Alt + Shift + C Opt + Shift + C

Add Properties. Alt + Shift + P Opt + Shift + P

Go to the Required tab. Alt + Shift + R Opt + Shift + R

Add Menu. Ctrl +Alt +N Cmd + Opt +N

Clone an app designer component. Ctrl + C Cmd + C

Delete. Delete key Delete key

Save. Ctrl + S Cmd + S

Save and Close. Ctrl + Alt + S Cmd + Opt + S

Copy a site map component to the Ctrl + C Cmd + C


clipboard.

Copy the site map component to the Ctrl + X Cmd + X


clipboard to paste somewhere else on
the site map.

When you paste the component, the


original instance of the component is
removed from the site map.

Paste the clipboard contents to the site Ctrl + V Cmd + V


map.

Expand and move the focus to the Alt + Shift + N Opt + Shift + N
notification area in App Designer.

Collapse the expanded notification area Esc esc


in App Designer.

Keyboard navigation
We also support moving around the app designer, site map designer, and My Apps page by using the keyboard, so
people who don’t use a mouse can use a keyboard to get around and complete actions.

TO PRESS

Go to the next tab stop in the defined tab order (which is left Tab
to right for LTR languages and right to left for RTL languages).

Move to the previous tab stop in the tab order . Shift + Tab
TO PRESS

Move to the next item in a list or a menu, or user interface Down Arrow keys
feature that has multiple options.

-OR-

Move vertically to the next tile .

Move to the next item in a list or a menu, or user interface Up Arrow


feature that has multiple options.

-OR-

Move vertically to the previous tile.

Move horizontally to the next tile. Right Arrow

Move horizontally to the previous tile. Left Arrow

Expand a collapsible control. Right Arrow or Enter or Spacebar

Collapse an expanded collapsible control. Left Arrow or Enter or Spacebar

Perform an action such as selecting an option from radio Spacebar


buttons, clicking a link, or selecting a check box.

Activate a command bar action, or confirm a component add. Enter

Close an alert, dialog box, or menu, or cancel. Esc

Screen reader support


People with disabilities may rely on the use of assistive technology (AT) such as screen readers or a variety of
alternative input devices to interact with the app designer, site map designer, and My Apps page.
Here's the support matrix.

BROWSER JAWS NARRATOR VOICE OVER

Internet Explorer 11 Yes Yes No

Google Chrome Yes No No

Firefox Yes No No

Safari No No Yes

Accessibility info for browsers


For accessibility information about your browser, visit the following websites:
Windows accessibility features
Firefox accessibility features
Safari accessibility features
Google Chrome accessibility technical documentation

See also
Use keyboard shortcuts in Power Apps
Customize Dynamics 365 App for Outlook
6/19/2019 • 2 minutes to read • Edit Online

Customize the Dynamics 365 App for Outlook to best suit your organization needs.
For detailed information on how to customize the App for Outlook, see Customizing App for Outlook

NOTE
Before you can customize the App for Outlook, you must install the solution and then deploy it in your environment.

1. To install the solution, to go Install Microsoft Dynamics 365 App for Outlook, then choose GET IT NOW
and follow the steps to select the environment to install it on.

2. To deploy the app, see, Deploy Dynamics 365 App for Outlook.
See also
Use Dynamics 365 App for Outlook
Model-driven apps Developer Guide
3/10/2020 • 2 minutes to read • Edit Online

Model-driven apps are primarily a no-code or low -code component focused approach to app development. The
value developers can provide is by extending the application. Before you start writing code, begin with learning
how to build Model-driven apps and what options can be applied without code.

NOTE
Model-driven apps connect to Common Data Service. For information about how developers can add value at the service
level, see Common Data Service Developer Overview.
Content in this section will refer only to extensions developers can do that apply to the experience for users of model-driven
apps.

If you are new to the Common Data Service applications, the topics in this section provides a high-level overview
of the important concepts to help developers get started working with model-driven apps.
Get started
Related topics
Understand Model-driven apps components
Create your first model-driven app
See also
Power Apps for developers
What is Power Apps portals?
1/24/2020 • 2 minutes to read • Edit Online

Power Apps makers can now create a powerful new type of experience: external-facing websites that allow users
outside their organizations to sign in with a wide variety of identities, create and view data in Common Data
Service, or even browse content anonymously. The full capabilities of Dynamics 365 Portals, previously offered
only as an add-on to model-driven apps in Dynamics 365, are now available completely standalone inside of
Power Apps.
These capabilities feature a revamped end-to-end experience for makers to quickly create a website and customize
it with pages, layout, and content. Makers can reuse page designs through templates, add forms and views to
display key data from Common Data Service, and publish to users.

NOTE
Power Apps portals are based on Bootstrap 3.3.x with the exception of Event portal. Portal developers should not replace
Bootstrap 3 with other CSS libraries as some of the scenarios in Power Apps portals are dependent on Bootstrap 3.3.x.
Certain experiences might have known issues. These issues are mentioned in the Known issues section later in this
document.

Next steps
Creating a starter portal
See also
Advanced portal administration
Portal admin center
Advanced portal customization
Portal management app
Portal site settings
Release updates
1/23/2020 • 12 minutes to read • Edit Online

This topic provides resources where you can learn about the new features that have recently released and new
features that will be releasing over the next few months.

Power Apps portals updates


For information about new features releasing over the next few months that you can use for planning, see:
2019 release wave 2 plan

Previous portal updates


Here's a list of features added for Dynamics 365 Portals. For more information updates for Dynamics 365 Portals
to date, see portal capabilities for Microsoft Dynamics 365 Releases.

NOTE
Power Apps portals were earlier known as Dynamics 365 Portals.

Dynamics 365 Portals version 9.1.4 for the model-driven apps in Dynamics 365
Dynamics 365 Portals version 9.1.4 for the model-driven apps in Dynamics 365 brings these new updates and
features:
Maintenance mode for portal: As a portal administrator, you can now configure your portal to display a
proper message to the customers whenever a maintenance activity is going on—for example, solution
packages are being upgraded. More information: Maintenance mode for a portal
Enable Power BI Embedded service: As a portal customizer, you can now embed dashboards and reports
created in the new workspace of Power BI by enabling Power BI Embedded service. The dashboards and
reports are embedded on web pages in a portal by using the powerbi Liquid tag. More information: Set up
Power BI integration
Enable content moderation on ideas: As a portal administrator, you can now create a content
moderation policy to moderate the ideas that are submitted on your portal.
OAuth 2.0 implicit grant flow: As a portal developer, you can now make client-side API calls to external
APIs and get them secured by using OAuth 2.0 implicit grant flow. More information: OAuth 2.0 implicit
grant flow
Common Data Service starter portal (preview): As a portal administrator, you can now configure your
portal to connect to the Common Data Service environment and allow your users to interact with it. This
feature brings in the ability to connect a portal to a Common Data Service environment that does not have
any model-driven apps in Dynamics 365 (Dynamics 365 Sales,Dynamics 365 Service, or Dynamics 365
Marketing) preinstalled.
Dynamics 365 Portals version 9.1.1 for the model-driven apps in Dynamics 365
Dynamics 365 Portals version 9.1.1 for the model-driven apps in Dynamics 365 brings these new updates and
features:
Portal checker: You can now use portal checker to identify issues with your portal by looking at various
configuration parameters and provide suggestions on how to fix them. More information: Portal checker
Dynamics 365 Portals version 9.0.10 for the model-driven apps in Dynamics 365
Dynamics 365 Portals version 9.0.10 for the model-driven apps in Dynamics 365 brings these new updates and
features:
Migrate Dynamics 365 Portals configuration: You can now migrate your Dynamics 365 Portals
configuration from development to testing or the production environments. Migration involves exporting
the existing configuration from the source Dynamics 365 instance, and then importing it into the target
Dynamics 365 instance. To migrate configuration data, you need to use the Configuration Migration tool
and a portal-specific configuration schema file. More information: Migrate Dynamics 365 Portals
configuration
Add Power BI visualization: As a portal customizer, you can now embed Power BI visualizations
(dashboard, reports, and tiles) on web pages in a portal by using the powerbi Liquid tag. More information:
Set up Power BI integration
Restrict portal access by IP address: As a portal administrator, you can now define a list of IP addresses
that are allowed to access your portal. When a request to the portal is generated from any user, their IP
address is evaluated against the allow list. If the IP address is not on the list, the portal displays a web page
with an HTTP 403 status code. More information: Restrict portal access by IP address
Manage SharePoint documents: Dynamics 365 Portals now supports uploading and displaying
documents to and from SharePoint directly on an entity form or web form in a portal. This allows portal
users to view, download, add, and delete documents from a portal. Portal users can also create folders to
organize their documents. More information: Manage SharePoint documents
New portal content editor (preview): In this preview, a new and simplified portal editor is available for
Dynamics 365 Portals customizers to reduce the learning curve on Dynamics 365 Portals customization and
increase a customizer's productivity.
Enable voting for status reasons: By default, an idea is enabled for voting only when the Status Reason is
set to New. You can now enable the voting on an idea for different status reasons. To enable voting for
different status reasons, you must create the Ideas/EnableVotingForStatusReasons site setting and set its
value to the required status reason values.
Dynamics 365 Portals version 9.0.6 for the model-driven apps in Dynamics 365
Dynamics 365 Portals version 9.0.6 for the model-driven apps in Dynamics 365 has brought the following latest
updates and features:
Dynamics 365 Portals app: The Dynamics 365 Portals app provides a new experience to configure and
manage your online platform to communicate and collaborate with customers. When you install Dynamics
365 Portals version 9.0 and higher, the Dynamics 365 Portals app, built on the Unified Interface framework,
is created out-of-the-box.
Reset a portal: You can now reset a portal if you plan to move to another geolocation or to another tenant,
and don't want to use the portal anymore. When you reset a portal, the hosted resources of the portal are
deleted, and the portal URL will not be accessible. More information: Reset a portal
Change the base URL of a portal: You can now change the base URL of a portal after it is provisioned.
For example, if you choose contosocommunity.microsoftcrmportals.com as the base URL while provision
the portal, you can later change it to contosocommunityportal.microsoftcrmportals.com as per your
requirement. More information: Change base URL
Dynamics 365 Portals version 8.4.1 for the model-driven apps in Dynamics 365
Dynamics 365 Portals version 8.4.1 for the model-driven apps in Dynamics 365 brings in a bunch of bug fixes, as
well as performance improvements, along with the following features:
Search within attachment content of knowledge articles and web files: Attachment content of knowledge
articles and web files are now searchable to increase the likelihood of relevant search results. More information:
Search within file attachment content
Accessibility: The out-of-the-box portals (Community portal, Partner portal, Customer portal, Employee self-
service portal) are now accessible. However, customizer should ensure that the portal remains accessible after
any customization or changes.
Dynamics 365 Portals version 8.4 for the model-driven apps in Dynamics 365
Dynamics 365 Portals version 8.4 for the model-driven apps in Dynamics 365 brings in a bunch of bug fixes, as
well as performance improvements, along with the following features:
Access portal error logs: As a portal developer, you can now access detailed error logs for any issues on your
portal. This helps you to debug the issues while developing the portal. Once your portal is live, you can
configure the portal to send all application errors to an Azure Blob storage account owned by you. This will help
you to debug the issues reported by your customers. More information: Access portal error logs
Renew portal authentication key: A portal connects to Common Data Service environment using Azure
active directory application. To do this, it requires an authentication key connected to Azure Active Directory
application. This key is added when you provision your portal and it must be renewed every two years. This
version of portal brings in the capability for administrators to be notified about key expiration and renew this
key from Power Apps Portals admin center. More information: Renew portal authentication key
Implement General Data Protection Regulation in portals: As a portal administrator, you can now
configure your portal to meet the GDPR standards. You can also provide certain terms and conditions that must
be agreed by the portal users to use a portal. You can also setup checks such as, if a portal is accessed by a
minor user, the user must have parental consent to access the portal. Implementing GDPR allows obtaining
consent from portal users regarding use of their personal data, identifying minor users, and obtaining parental
consent for minor users. More information: Implement GDPR in portals
Dynamics 365 Portals version 8.3 for the model-driven apps in Dynamics 365
Dynamics 365 Portals version 8.3 for the model-driven apps in Dynamics 365 has many new updates and features:
Ability to include attachments with knowledge articles: You can display note attachments along with
knowledge articles. To enable this feature, you create the site setting KnowledgeManagement/DisplayNotes
and set the value to true. Portal users can also search for these attachments. More information: Display
attachments with knowledge articles

NOTE
Search for attachments can only be performed on the note's description and file attachment name. The content of the
attached file is not searchable.

Administrative wizard to add an entity to the portal: This feature introduces a new administrative
wizard to easily expose data on the portal. The entity created through the wizard takes the data from your
organization and makes a subset of it available to your portal customers, based on the security and
permission model you choose.
Import metadata translation: Use this feature to import the metadata translation of newly activated
languages after you install a portal. More information: Import metadata translation
Source code availability for portals: A one-time release of Dynamics 365 Portals code is released to the
Microsoft Download Center under MIT license for developers to download. This feature enables portals to
be deployed to Dynamics 365 on-premises or online environments, and allows developers to customize the
code to suit their specific business needs.
NOTE
Source code is offered as a working sample and on an as-needed basis. No direct support will be provided for any
modifications to the code.

Single sign-on (SSO ) configuration improvements and support for Azure Active Directory B2C
(Azure AD B2C ): For portals that require a consumer-based sign-in, this feature now supports the ability
to:
Configure your portal authentication to use SSO.
Support Azure AD B2C for customer authentication.
Manage your portal security in Azure.
More information: Azure AD B2C provider settings for portals
Support time zone–independent date formats in portals forms: This feature adds support for Date
Only and Timezone Independent behaviors for date/time fields. More information: Behavior and format
of the date and time field
Allowing non-global administrators to provision a portal: You can now provision a portal if you are
assigned to the System Administrator role of the CRM organization selected for the portal. You can now
also manage an existing portal, if you have any of the following roles:
Dynamics 365 Service Administrator
System Administrator of the CRM organization selected for the portal
Store the custom domain name for a portal: This feature stores the primary domain name of a portal on
the website record. If the domain name is changed in the future, the latest primary domain name will be
stored.
Tracking cookie for portals: A persistent cookie, Dynamics365PortalAnalytics, will be set whenever a user
goes to a portal. This cookie has an expiration of 90 days. This cookie does not store any of the user's
personal data and is used by Microsoft to collect analytics about portal service. Please read the Microsoft
online services privacy statement here.
Performance improvement of header and footer on a portal: Two new site settings,
Header/OutputCache/Enabled and Footer/OutputCache/Enabled, are added to enable header/footer output
caching when these settings are set to true. For new users, these site settings are set to true by default,
thereby enabling header and footer output caching. For existing users who upgrade to a newer version of
Dynamics 365 Portals, output caching is disabled by default. It means that the Header and Footer web
templates are parsed and rendered on every page load. To enable output caching, they must update the
appropriate web templates and create the required site settings. More information: Enable header and footer
output caching
December 2016 updates
The December 2016 update has brought many new features to Dynamics 365 Portals. These updates allow for
better interactions among companies, partners, and customers, and make the experience of navigating the portal
faster and easier. Some of the major updates include:
Multiple language support: Support customers from multiple regions by using a single portal. More
information: Enable multiple-language support
East Asian language support: Multiple-byte languages such as Japanese, Chinese, and Korean are now
supported.
Faceted search: New filters improve how quickly customers can find the content they are looking for while
granting more control over visibility of content. More information: Faceted search
Product filtering: Portal users can trim access to knowledge articles related to their product ownership to
avoid information overload.
Content access levels: A new level of ownership associated with a portal contact, account, or web role can be
used to control access to knowledge articles, to help target the right article at the right audience and prevent
irrelevant articles from surfacing. More information: Content access levels
Knowledge article reporting enhancement: The portal tracks where a knowledge article was used in the
portal.
Project Service Automation integration: Provide access and visibility for active and closed projects across
all stages of a project lifecycle to partners and customers. Team members, reviewers, and customers can view
project status, quotes, order forums, and bookable resources on the portal with this solution. More information:
Integrate Project Service Automation
Field Service integration: Expose information about active agreements, assets, work orders, invoices, and
support cases to partners and customers on the portal with this solution. More information: Integrate Field
Service
Partner onboarding: Recruit new partners for better customer sales and service experiences. Potential
partners can apply for partner status through the portal.
Privacy notice
By enabling the portal capabilities for Dynamics 365, Dynamics 365 data, such as customer name, product name,
case number, or any custom entity data, can be exposed through an external-facing Dynamics 365 portal. Any data
exposed through the portal is stored in memory in Microsoft Azure Web Apps for caching and also as files on the
local hard drive to enable portal search functionality.
A tenant administrator enables Dynamics 365 portals by configuring it through the Dynamics 365 admin center,
which also installs a package (with solutions and data) in the selected Dynamics 365 instance. A tenant
administrator or a Dynamics 365 user set up as a Portal Administrator can then specify the data that will be
exposed through the portal. To subsequently disable the portal capabilities, a tenant administrator can cancel the
Portal Add-on subscription with Office 365.
Important Azure components and services that are involved with the portal capabilities are:
Azure Web Apps: Azure Web Apps are used to host the portal in Azure.
Azure Traffic Manager: Azure Traffic Manager is used to ensure the high availability of the service by routing the
user to the Web Apps that are up and running.
Azure Service Bus: Azure Service Bus (Topics/Subscriptions) is used for cache invalidation of the portals. Azure
Service Bus temporarily stores the messages, which are triggered when any portal-related record is changed in
Dynamics 365, and are passed along to Web Apps to do the cache invalidation.
Azure Key Vault: All services store configuration data in Azure Key Vault.
Azure Storage: Data related to the organization, tenant, and portal is stored in Azure Storage.
Azure Active Directory: All the web services use Azure Active Directory to authenticate.
For more information about additional Azure service offerings, see the Microsoft Azure Trust Center.
Portal templates
1/23/2020 • 2 minutes to read • Edit Online

Based on the selected environment in Power Apps, you can create a Common Data Service starter portal or a
portal in an environment containing model-driven apps in Dynamics 365.

Environment with Common Data Service


If you select an environment that contains Common Data Service, you can create a Common Data Service starter
portal. The Common Data Service starter portal comes with the sample data for you to quickly get started. It also
has the following built-in sample pages:
Default studio template
Page with title
Page with child links

Environment with model-driven apps in Dynamics 365


If you select an environment that contains model-driven apps in Dynamics 365 (Dynamics 365 Sales, Dynamics
365 Customer Service, Dynamics 365 Field Service, Dynamics 365 Marketing, or Dynamics 365 Project Service
Automation), you can create the following portals:
Customer self-service portal: A customer self-service portal enables customers to access self-service
knowledge, support resources, view the progress of their cases, and provide feedback.
Partner portal: A partner portal allows every organization with resellers, distributors, suppliers, or partners
to have real-time access to every stage of shared activities.

NOTE
Field Service and Project Service packages must be installed in your Dynamics 365 organization to enable respective
options. For more information, see Integrate Project Service Automation and Integrate Field Service.

Employee self-service portal: An employee self-service portal creates an efficient and well-informed
workforce by streamlining common tasks and empowering every employee with a definitive source of
knowledge
Community portal: A community portal leverages peer-to-peer interactions between customers and
experts to organically grow the catalog of available knowledge from knowledge base articles, forums, and
blogs as well as providing feedback through comments and ratings
Portal from blank: Create a website to share data with external and internal users. This template comes
with sample pages to get you quickly started.

Portal templates features


The table below summarizes the features associated with each portal template:
COMMON
CUSTOMER EMPLOYEE DATA SERVICE
SELF-SERVICE PARTNER SELF-SERVICE COMMUNITY PORTAL FROM STARTER
FEATURE PORTAL PORTAL PORTAL PORTAL BLANK PORTAL

World Ready • • • • • •

Multi- • • • • • •
Language
Support

Portal • • • • • •
Administratio
n

Customization • • • • • •
and
Extensibility

Theming • • • • • •

Content • • •
Management

Knowledge • • • •
Management

Support/Case • • •
Management

Forums • • •

Faceted • •
Search

Profile • •
Management

Subscribe to • •
Forum Thread

Comments • • •

Azure AD •
Authenticatio
n

Ideas •

Blogs •

Project Service •
Automation
Integration
COMMON
CUSTOMER EMPLOYEE DATA SERVICE
SELF-SERVICE PARTNER SELF-SERVICE COMMUNITY PORTAL FROM STARTER
FEATURE PORTAL PORTAL PORTAL PORTAL BLANK PORTAL

Field Service •
Integration

Partner •
Onboarding

Portal Base • • • • • •

Portal • • • • • •
Workflows

Web • • • • • •
Notifications

Microsoft • • • • • •
Identity

Identity • • • • • •
Workflows

Web Forms • • • • • •

Feedback • • • • • •
Create a Common Data Service starter portal
2/7/2020 • 6 minutes to read • Edit Online

With the capability to build a portal in Power Apps, you can create a website for external and internal users
enabling them to interact with data stored in Common Data Service.
These are some benefits of creating a portal:
Because the data is stored in Common Data Service, you don't need to create a connection from Power
Apps as you do with data sources such as SharePoint, model-driven apps in Dynamics 365, or Salesforce.
You need only to specify the entities that you want to show or manage in the portal.
You can design the portal through the WYSIWYG Power Apps portals Studio by adding and configuring
components on the webpages.
You can create a portal either in a new environment or in your existing environment.
If you choose to create your portal in a new environment using the Create new environment link, the required
portal pre-requisites such as entities, data, and a starter portal template are installed when the environment is
created. In this method, the portal is provisioned in a few minutes.
If you choose to create your portal in an existing environment without portal pre-requisites, the pre-requisites are
installed first and then the portal is created. In this method, the portal provisioning can take some time and you’ll
be notified when the portal is provisioned.
Based on the selected environment in Power Apps, you can create a Common Data Service starter portal or a
portal in an environment containing model-driven apps in Dynamics 365.

NOTE
When you create a portal, a few solutions are installed and sample data is imported.

More information on working with environments: Working with environments and Microsoft Power Apps
More information on available portal templates: Portal templates
To create a portal:
1. Sign in to Power Apps.
2. Under Make your own app, select Portal from blank.
3. If the selected environment does not contain portal pre-requisites, a message is displayed in the Portal
from blank window suggesting you select another environment or create a new one.
4. If you choose to proceed with the current environment, enter the required information in the window as
mentioned in the following steps. If you choose to create a new environment, see Create new environment.
5. In the Portal from blank window, enter a name for the portal and address for the website, and select a
language from the drop-down list. When you're done, select Create.

TIP
To create a portal using a different language, you must first enable the language in the environment so that it
becomes available in the language drop-down list.

After you select Create, the portal will begin provisioning and the provisioning status is displayed through
notifications.
If you have created your portal in the environment that doesn't have portal pre-requisites installed, the
provisioning status is also displayed in the grid:

After the portal is provisioned successfully, the status is updated and the portal is displayed in the grid:

To edit the portal in Power Apps portals Studio, see Edit a portal.

NOTE
There can be only one portal of each type and for a language created in an environment.
If you don't have sufficient privileges to provision a portal, an error is displayed. You must have the System Administrator
role in Common Data Service to create a portal. You must also have the Access Mode set to Read-Write under Client
Access License (CAL) Information in the user record.
If you have purchased an older portal add-on, and want to provision a portal using the add-on, you must go to the
Dynamics 365 Administration Center page. More information: Provision a portal using the older portal add-on
If you have provisioned a portal using the older portal add-on, you can still customize and manage it from
make.powerapps.com.
Provisioning portals from make.powerapps.com does not consume the older portal add-ons. Also, these portals are not
listed under the Applications tab on the Dynamics 365 Administration Center page.
A Common Data Service starter portal cannot be created from the Dynamics 365 Administration Center page.
Power Apps portals is not available in the France region.

Create new environment


Follow these steps when you create an environment using the option provided in the Portal from blank window.
1. In the New environment pane, enter a name for the environment, and then select a region and
environment type from the drop-down lists. You cannot change the region once the environment is created.
When you're done, select Create environment.
2. Once the environment is created, you'll receive a confirmation message in the dialog box, and you'll be
prompted to create a database. Select Create database to enable access to Common Data Service.

NOTE
The prompt to create a database might not be displayed automatically. In this case, you must go to the new
environment and select the Portal from blank tile again.

3. Select the currency and language for the data stored in the database. You cannot change the currency or
language once the database is created. When you're done, select Create my database. The database is
created with the starter portal that enables you to quickly get started with sample content once the portal is
provisioned.
NOTE
The Include starter portal option is available only when you create an environment using the option provided in
the Portal from blank window. This option is not available when you create an environment from Power Apps
admin center.

It might take several minutes to create the database on Common Data Service. Once the database is
created, the new environment is selected in the list of environments on the Power Apps home page and the
Portal Management app is created. This app is not the actual portal but a model-driven companion app that
allows you to perform advance configuration activities. You can now proceed with creating the portal for
designing the external-facing website.

4. After creating the environment and database, under Make your own app, select Portal from blank.

NOTE
If the database is created and you are still getting the create database prompt, you must refresh the Power Apps
home page before selecting the Portal from blank tile.

Portal provisioning notifications


After you select Create, the portal will begin provisioning and the provisioning status is displayed through
notifications.
Notification as a toast
The following notification is displayed when you select Create to provision the portal.

Notifications in the Notifications pane


Once the provisioning request is successfully placed, the following notifications are displayed in the Notification
pane.
Notification shown for provisioning in progress

Notification shown for provisioning successfully completed

If the portal provisioning fails, the notifications are displayed similarly.


Notifications via emails
Once the provisioning request is successfully placed, a confirmation email notification is sent to the user creating
the portal. Also, an email is sent to the user after the portal provisioning is completed.

Disable portal creation in a tenant


As a global administrator, if you want to disable portal creation in a tenant by non-administrators, you can do it by
enabling the disablePortalsCreationByNonAdminUsers tenant level setting through PowerShell. To run PowerShell
cmdlets, you must first install the required modules. For information on installing the required PowerShell
modules, see Installation.
After installing the modules, run the following command in a PowerShell window (run PowerShell as an
administrator).

Set-TenantSettings -RequestBody @{ "disablePortalsCreationByNonAdminUsers" = $true }

Administrator are the users having one of the following Azure roles:
Global Administrator
Dynamics 365 Service Administrator
Power Platform Service Administrator
Users not having the any of the above mentioned Azure roles are considered as non-administrators.
When the portal creation is disabled in a tenant, non-administrators will see an error as follows:
Create a portal in an environment containing model-
driven apps in Dynamics 365
1/23/2020 • 2 minutes to read • Edit Online

If you select an environment that contains model-driven apps in Dynamics 365 (such as Dynamics 365 Sales and
Dynamics 365 Customer Service), you can create the portals mentioned in Portal templates.
1. Sign in to Power Apps.
2. Select Create on the left pane and enter portal in the Search templates field to display all Dynamics 365
portal templates.

3. Select the required portal template.


4. In the create portal window, enter a name for the portal and address for the website, and select a language
from the drop-down list. When you're done, select Create. The creation process is same as described in the
Create a Common Data Service starter portal section.

NOTE
If you have purchased an older portal add-on, and want to provision a portal using the add-on, you must go to the
Dynamics 365 Administration Center page. More information: Provision a portal using the older portal add-on
If you have provisioned a portal using the older portal add-on, you can still customize and manage it from
make.powerapps.com.
Provisioning portals from make.powerapps.com does not consume the older portal add-ons. Also, these portals are not
listed under the Applications tab on the Dynamics 365 Administration Center page.
A Common Data Service starter portal cannot be created from the Dynamics 365 Administration Center page.
To disable portal creation in a tenant, see Disable portal creation in a tenant.
When you create a portal, a few solutions are installed and sample data is imported.
Provision a portal using the older portal add-on
1/23/2020 • 5 minutes to read • Edit Online

If you have purchased an older portal add-on, and want to provision a portal using the add-on, you must go to the
Dynamics 365 Administration Center page and provision the portal.

NOTE
To provision a portal, you must be assigned either System Administrator or System Customizer role of the Common Data
Service environment selected for the portal. You must also have the required permissions to create and register an
application in Azure AD. If you don't have the required permissions, contact the Global Administrator to update your
permissions or ask the Global Administrator to provision the portal.

To provision a portal:
1. Sign in to Microsoft 365 admin center.
2. In the navigation column on the left, select Show all.
3. If you are working with the new admin center, select All admin centers. From the list of all admin centers,
select Dynamics 365.

4. If you are working with the old admin center, expand Admin centers in the left navigation column, and
then select Dynamics 365.
5. On the Dynamics 365 Administration Center page, select the Applications tab.
6. Select the application row titled Portal Add-On, and then select Manage.
7. In the General Settings section, enter a Name for your portal. The Name will help to identify the portal
and can be changed later.
8. The Type field represents the type of portal subscription (Trial or Production). This is a system field, so it
cannot be changed by the user. The value changes based on whether it is trial subscription or paid
subscription.
9. Optionally, in the Portal development status drop-down list, select one of the following development
statuses for your portal:
Prototype
Development
Test
UAT
Live

NOTE
For existing provisioned portals, this drop-down list is available on the Portal Details tab and no status is
selected by default.
This drop-down list is available only for the portals of type production.
This field is used by Microsoft to understand the usage pattern of this portal and does not affect any
functionality. If you use different names for development lifecycle, please select the one which is closer in purpose.
This can be changed at a later point of time once portal is provisioned.

10. In the Portal URL field, enter the subdomain name you want for your portal. You can only use
alphanumeric characters or hyphens (-); other characters are not permitted.

NOTE
To change the URL of a portal after it is provisioned, see change the base URL of a portal.
To link your portal to a custom domain, see link your portal to a custom domain.

11. In the Dynamics 365 Instance drop-down list, select the instance you want to link the portal to. This
requires System Administrator or System Customizer role in the instance you pick to select it.
12. In the Select Portal Language drop-down list, select the default language for your portal. The available
languages will depend on the languages that are installed in your instance.

NOTE
Sample data is only provided in one language, so choosing a default language will also decide how the sample data
is translated. Arabic and Hebrew are not supported and will not appear in the list.

13. In the Select Portal Administrator drop-down list, select the user who will configure, customize, and
maintain the portal. All users who have the System Administrator role in the organization will appear as
options.
14. In the Portal Audience section, choose the type of audience who will visit the new portal. This will
determine what options of portals you will be given. You can choose:
Partner
Customer Self Service Portal
Custom Portal
Partner Portal
Partner Project Service (Optional, requires solutions installed)
Partner Field Service (Optional, requires solutions installed)
Community Portal
Customer
Customer Self Service Portal
Custom Portal
Community Portal
Employee
Employee Self Service Portal
15. In the Select portal to be deployed section, choose what type of portal you want to create. The options
you see are based on the audience you selected.
16. Select Submit, and accept the Terms of Service.
After you accept the Terms of Service, the portal will begin provisioning. Provisioning usually takes 30 minutes
but can take a few hours depending on the system load. The Name of the portal on the Application tab will
change to Name-Configuring while it is provisioning. Navigate back to the portal management page to check
whether provisioning has succeeded.
After the portal is provisioned, the Portal Details page is displayed with the required details.
NOTE
When a portal user signs in to the portal for the first time by using an Azure AD credential, a consent page is displayed to
all users irrespective of the user or portal type.

The table below summarizes the features associated with each portal option:

CUSTOMER SELF- EMPLOYEE SELF- COMMUNITY


FEATURE SERVICE PORTAL PARTNER PORTAL SERVICE PORTAL PORTAL CUSTOM PORTAL

World Ready • • • • •

Multi-Language • • • • •
Support
CUSTOMER SELF- EMPLOYEE SELF- COMMUNITY
FEATURE SERVICE PORTAL PARTNER PORTAL SERVICE PORTAL PORTAL CUSTOM PORTAL

Portal • • • • •
Administration

Customization • • • • •
and Extensibility

Theming • • • • •

Content • • •
Management

Knowledge • • • •
Management

Support/Case • • •
Management

Forums • • •

Faceted Search • •

Profile • •
Management

Subscribe to • •
Forum Thread

Comments • • •

Azure AD •
Authentication

Ideas •

Blogs •

Project Service •
Automation
Integration

Field Service •
Integration

Partner •
Onboarding

Portal Base • • • • •

Portal Workflows • • • • •

Web • • • • •
Notifications
CUSTOMER SELF- EMPLOYEE SELF- COMMUNITY
FEATURE SERVICE PORTAL PARTNER PORTAL SERVICE PORTAL PORTAL CUSTOM PORTAL

Microsoft • • • • •
Identity

Identity • • • • •
Workflows

Web Forms • • • • •

Feedback • • • • •

Troubleshoot provisioning
Sometimes the package installation process or URL creation process can error out. In these cases, the processes
can be restarted.
If Name-Configuring changes to Name-Provisioning Failed, you need to restart the provisioning process.
1. Go to the Applications page, and select the portal.
2. Select the blue pencil button labeled Manage.
3. Choose one of the following options:
Restart Provisioning: Restarts the installation process with the configuration that was previously
defined.
Change Values and Restart Provisioning: Lets you change some of the values before restarting
the provisioning process.
If the package installation has failed, the portal administrator page will open without any issues, but navigating to
the actual portal URL will show a message Getting set up. To confirm this:
1. Go to the Solution Management page of the Dynamics 365 Administration Center page and check that
the package status is Install Failed.
2. If the package status is Install Failed, try retrying the installation from the solution page. Also, be sure to
check that a system administrator is installing the solution with the default language in Common Data
Service set to the language the portal should be installed in.

NOTE
Some solutions have prerequisites for their installation, so an installation will fail if the prerequisites are not met. For
example, to install the Partner Field Service for a partner portal, the Partner Portal and Field Service solutions must have
already been installed. If you attempt to install the Partner Field Service first, the installation will fail and give you an error
message.
Power Apps portals Studio anatomy
1/23/2020 • 2 minutes to read • Edit Online

You can use Power Apps portals Studio to create and customize your website. It contains various options to add
and configure webpages, components, forms, and lists. The anatomy of Power Apps portals Studio is as follows:

ANNOTATION NAME DESCRIPTION

1 Command bar Allows you to create a webpage, delete


a component, and browse the website
you are creating.

2 Toolbelt Allows you to:


View and manage webpages
Add components
Edit templates

3 Canvas Contains components that build a


webpage.

4 Footer Displays auto-save status and allows


you to open source code editor.

5 Properties pane Displays properties of webpage and


selected components and allows you
edit them as required.

NOTE
Editing a portal through Power Apps portals Studio will temporarily cause poor portal performance due to multiple
background processes. For example, the clear cache process runs and reloads data from Common Data Service.
Supported web browsers for Power Apps portals
Studio
1/23/2020 • 2 minutes to read • Edit Online

The supported browsers for Power Apps portals Studio are listed below.

BROWSER OPERATING SYSTEM

Google Chrome (latest version) Windows 7 SP1, 8.1, and 10


(recommended) macOS

Microsoft Edge (latest version) Windows 10


(recommended)
Create and manage webpages
1/23/2020 • 2 minutes to read • Edit Online

A webpage is a document that is identified by a unique URL in a website. It is one of the core objects of the website
and builds a hierarchy of the website through parent and child relationships to other webpages.

NOTE
If you customize your portal using Power Apps portals Studio, the website users would notice a performance impact. We
recommended you to do the changes during non-peak hours on a live portal.

Create webpage
1. Edit the portal to open it in Power Apps portals Studio.
2. From the command bar, select New page and either choose a page from Layouts or Fixed layouts.

NOTE
Creating a page using Layouts gives you the flexibility to edit the complete page. Fixed layouts contains the
page templates that are installed as part of portal provisioning and the custom page templates created using the
Portal Management app.
For the pages to be created using the Layouts option, a new Default studio template page template is installed.

3. In the properties pane on the right side of the screen, enter the following information:
Name: Name of the page. This value is also used as the title of the page.
Partial URL: The URL path segment used to build the portal URL of this page.
Template: Page template used to render this page on the portal. If required, you can choose another
template from the list.
The webpages you create are added and their hierarchy are displayed in the Pages pane. To view the Pages pane,
select Pages from the toolbelt on the left side of the screen.
Let's say you have created a few webpages for your portal. The page hierarchy looks as follows:

The primary menu on the website is created automatically based on the hierarchy of the webpages. It is called the
Default menu. You can also create a custom menu to display on the website. More information: Add a custom
menu

If you are working with a portal created in an environment containing model-driven apps in Dynamics 365, and
you want the menu to be the same as page hierarchy, you must select Default from the Navigation Menu list.
Manage webpage
1. Edit the portal to open it in Power Apps portals Studio.
2. Select Pages from the toolbelt on the left side of the screen.
3. Hover over the page you want to manage and select the Ellipsis button (…) for the webpage you want to
manage. Alternately. you can right-click the page you want to manage.
4. Select the required action from the context menu:
Hide in default menu: Hide the page from being displayed in the sitemap through default menu.
Show in default menu: Show the page in the sitemap through default menu.
Add a child page: Add a child page to the selected page. The child page inherits the page template
of its parent page.
Set as home page: Set the page as the home page. The URL of the new home page is set to the root
of the website and URL of the old page is updated accordingly.
Move up: Move the page up in hierarchy.
Move down: Move the page down in hierarchy.

NOTE
Moving a page up or down is supported among the pages at the same level.

Promote subpage: Decrease the indent and make the child page at the level of the previous page in
the hierarchy.
Make subpage: Increase the indent and make the page a child page of the previous page in the
hierarchy.
Delete: Delete the page.
Compose a page
1/23/2020 • 9 minutes to read • Edit Online

After adding the required webpages and managing their hierarchy in the sitemap, you can add various
components. The WYSIWYG editor allows you to add and edit the required components on the canvas easily. You
can add and edit the following components on the canvas:
Sections
One column section
Two columns section
Three columns section
Portal components
Text
Image
IFrame
Form
List
Breadcrumb

NOTE
If you customize your portal using Power Apps portals Studio, the website users would notice a performance impact. We
recommended you to do the changes during non-peak hours on a live portal.

Use the WYSIWYG editor


1. Edit the portal to open it in Power Apps portals Studio.
2. Select the page on which you want to add the component.
3. Select an editable element on the canvas.

NOTE
The editable elements are demarcated by a boundary.

4. Select Components from the toolbelt on the left side of the screen.
5. Select the component to be added.
The selected component is added to the canvas inside the editable element.
6. To delete a component, select the component on the canvas and then select Delete on the command bar at
the top of the page.

Add sections
Sections allow you to define a structure for your page and arrange portal components accordingly. Once you add
sections to your page, you can add portal components inside the sections as per the requirement.
1. Edit the portal to open it in Power Apps portals Studio.
2. Select the page on which you want to add a section.
3. Select an editable element on the canvas.
4. Select Components from the toolbelt on the left side of the screen.
5. Under Section layout, select the section type to be inserted.
6. In the properties pane on the right side of the screen, enter or select the following information:
Min Height: Enter the minimum height of the section. If you add a component that occupies more
space than the specified height, the section expands to accommodate the component. By default, the
minimum height is 100px. You can also enter the height in points (pt) and percentage (%).
Alignment: Select whether the component in the section must be left, center, or right aligned.

Background: Select if would like to have color or an image as the section background.
Fill: Select a color for the background.
Image: Select an image from the list. If you would like to upload a new image, select Upload
image.

7. Add the required portal component in the section.


Add portal components
You can add the following components on a webpage:
Text
Image
IFrame
Form
List
Breadcrumb
Add text box
1. Edit the portal to open it in Power Apps portals Studio.
2. Select the page on which you want to add the component.
3. Select an editable element on the canvas.
4. Select Components from the toolbelt on the left side of the screen.
5. Under Portal components, select Text.
6. Enter the required text in the text box.
7. To format the text, select the text to display the format options. Modify the font size and style as required.

8. In the properties pane on the right side of the screen, select the following information:
Alignment: Select whether the text must be left, center, or right aligned.
Font color: Select a color for the text.
Add image
1. Edit the portal to open it in Power Apps portals Studio.
2. Select the page on which you want to add the component.
3. Select an editable element on the canvas.
4. Select Components from the toolbelt on the left side of the screen.
5. Under Portal components, select Image. The image placeholder is added to the canvas.
6. In the properties pane on the right side of the screen, enter the following information:
Image: Select this option if you would like to select an existing image or upload a new one. If you
want to select a previously uploaded image, choose an image from the Select image list. To upload a
new image, select Upload image. All the uploaded images are included in the image library, which
can be selected again through the Select image list.
NOTE
You can upload only the images of type png, svg, jpg, and jpeg with the maximum size of 5 MB.
You can't upload an image with the same name. You need to modify the name of the image to upload it
again.

External url: Select this option if you would like to upload an image from an external URL. Enter the
URL in the External url field. Only secured links are accepted—that is, https:// is mandatory. If you
have images stored in your content delivery network, you can provide the link in this field.

Formatting options
Width: Enter width of the image.
Height: Enter height of the image.

NOTE
You can also select the image on the canvas and drag the handles to resize it.

Add IFrame
1. Edit the portal to open it in Power Apps portals Studio.
2. Select the page on which you want to add the component.
3. Select an editable element on the canvas.
4. Select Components from the toolbelt on the left side of the screen.
5. Under Portal components, select IFrame. The IFrame placeholder is added to the canvas.
6. In the properties pane on the right side of the screen, enter the following information:
Width: Enter the width of the IFrame.
Height: Enter the height of the IFrame.

NOTE
You can also select the IFrame on the canvas and drag the handles to resize it.

Link: Enter the URL of the website to be displayed in the IFrame. Only secured links are accepted—
that is, https:// is mandatory. By default, https://www.bing.com is available as the value.

NOTE
You can also add Power Virtual Agent bot to the IFrame similarly using steps described in add bot to your web site.

Add form
Form is a data-driven configuration that you use to add a form to collect data in the portal without the need for a
developer to surface the form in the portal. Forms are created in Common Data Service and you can use them into
webpages in the portal or in conjunction with lists to build out complete web applications.
1. Edit the portal to open it in Power Apps portals Studio.
2. Select the page on which you want to add the component.
3. Select an editable element on the canvas.
4. Select Components from the toolbelt on the left side of the screen.
5. Under Portal components, select Form.
6. In the properties pane on the right side of the screen, select one of the following options:
Create new: Create a new form.
Use existing: Use an existing form.
7. Enter information or make selection for the following:
Name: Name of the form.
Entity: The name of the entity from which the form will be loaded.
Form layout: The name of the form on the target entity in Common Data Service that is to be
rendered.
Mode: Select one of the following options:
Insert: Indicates the form should insert a new record upon submission.
Edit: Indicates the form should edit an existing record.
Read only: Indicates the form should display an existing record’s non-editable form.

NOTE
The default option for Edit and ReadOnly modes is set as Query String Parameter Name passed as ID in URL.
To change these values, you need to open Portal Management app and update the form properties.

On success: Select one of the following options:


Show success message: Requires a message to be displayed to the user on successful
submission of the form. You can also select Hide form on success to hide the form upon
successful submission.
Redirect to webpage: Redirects the user to the selected webpage in the portal. You must
select a webpage from the Redirect to webpage list.
Redirect to URL: Redirects the user to the specified URL. You must enter a URL in the
Redirect to URL field.
Show captcha for anonymous users: Displays captcha to anonymous users.
Show captcha for authenticated users: Displays captcha to authenticated users.
Enable entity permissions: Entity permissions to be considered for the form. By default, it is not
selected. If selected, explicit permissions are required for any user to access the form. More
information: Entity permission
Add list
List is a data-driven configuration that you use to add a webpage that will render a list of records without the need
for a developer to surface the grid in the portal. Lists use Common Data Service views to display records on the
portal.
1. Edit the portal to open it in Power Apps portals Studio.
2. Select the page on which you want to add the component.
3. Select an editable element on the canvas.
4. Select Components from the toolbelt on the left side of the screen.
5. Under Portal components, select List.
6. In the properties pane on the right side of the screen, select one of the following options:
Create new: Create a new list.
Use existing: Use an existing list.
7. Enter information or make selection for the following:
Name: Name of the list.
Entity: The name of the entity from which the views will be loaded.
Views: The list of views of the target entity that is to be rendered. You can select multiple views to
display records in the list. The view selected first will be the default view.
Create new record: Allows a user to create a record. Select a webpage that contains a form to create
a new record.
View details: Allows a user to view details. Select a webpage that contains a form to display details.
Edit record: Allows a user to edit a record. Select a webpage that contains a form to edit the record.
Delete record: Allows a user to delete a record.
Empty list message: Message to be displayed when there are no records to be displayed.
Number of records per page: An integer value to specify the number of the records to display on a
page.
Enable search in entity list: Allows a user to search records in the list.
Enable entity permissions: Entity permissions to be considered for the list. By default, it is not
selected. If selected, explicit permissions are required for any user to access the form. More
information: Entity permission
Add breadcrumb
1. Edit the portal to open it in Power Apps portals Studio.
2. Select the page on which you want to add the component.
3. Select an editable element on the canvas.
4. Select Components from the toolbelt on the left side of the screen.
5. Under Portal components, select Breadcrumb.

Add a custom menu


By default, the menu on the website is created automatically based on the hierarchy of the webpages. It is called the
default menu. To create a custom menu, you must create the web link set in the Portal Management app. More
information: Manage web links
After you create the web link set:
1. Edit the portal to open it in Power Apps portals Studio.
2. Select the header component.
3. In the properties on the right side of the screen, select the web link set name from the Navigation Menu
list.

Use code editor


To view the source of a component on the canvas, select the component, and then select the source code editor icon
</> in the footer.

The source code is displayed in the Code Editor pane at the bottom of the screen. The changes you made earlier
are updated in the source code. To make changes, update the source code and select Save. The changes are
reflected on the canvas.
NOTE
You can also add Liquid tags in source code editor for advanced configuration. More information: Work with Liquid templates
Work with templates
1/23/2020 • 2 minutes to read • Edit Online

The built-in templates are available according to the portal you provision. You can edit the templates by using the
code editor. For example, the following built-in templates are available when you provision a Common Data
Service starter portal:
Default studio template
Page with title
Page with child links

NOTE
It is recommended not to edit Default studio template, Profile, and Search templates.

To open a template in code editor:


1. Edit the portal to open it in Power Apps portals Studio.
2. Select Templates from the toolbelt on the left side of the screen. The available templates are displayed.

3. Select the required template to open it in the code editor.


4. Edit the code and save the changes.

NOTE
You can also add Liquid tags in source code editor for advanced configuration. More information: Work with Liquid
templates
The page templates you create using the Portal Management app are also displayed in the Templates pane.
Edit CSS
1/23/2020 • 2 minutes to read • Edit Online

Cascading Style Sheets (CSS ) allows you to control the formatting of your website. By default, bootstrap.min.css
and theme.css files are available. You can edit the existing CSS files and upload new CSS files. When you upload a
new CSS file, it will be available as a web file in the Portal Management app.

NOTE
Power Apps portals are based on Bootstrap 3.3.x with the exception of Event portal. Portal developers should not replace
Bootstrap 3 with other CSS libraries as some of the scenarios in Power Apps portals are dependent on Bootstrap 3.3.x.

To open a CSS in code editor:


1. Edit the portal to open it in Power Apps portals Studio.
2. Select Theme from the toolbelt on the left side of the screen. The available themes are displayed.

3. Select the required CSS to open it in the code editor.


4. Edit the code and save the changes.
To upload a new CSS file:
1. Edit the portal to open it in Power Apps portals Studio.
2. Select Theme from the toolbelt on the left side of the screen. The available themes are displayed.
3. Select Upload custom CSS.

4. Browse and select the CSS file to upload.


Manage existing portals in Power Apps
1/23/2020 • 3 minutes to read • Edit Online

Once you've created a portal, it is visible under the Recent apps section on the Power Apps home page.

To manage an app, select More Commands (… ) for the portal and choose an action from the context menu.

Edit
Opens the Power Apps portals Studio to edit the content and components of the portal.

Browse
Opens the portal to browse the website. This helps you to see the portal as it will look to your customers.
Alternately, you can also open the portal to browse the website by selecting Browse website in the Power Apps
portals Studio to view the changes you have made to the website. The website opens in a new tab with URL of the
website.

Share
Share your portal with internal or external users. Follow the steps mentioned in the Share this portal pane.

Share with internal users


To share the portal with internal users you must first create a security role and then assign users to the security role
so they can use the portal.
NOTE
As a user in Common Data Service, if you do not have appropriate privileges on portal entities, you might see errors such as
“You do not have access to view solutions in this environment.” or “You do not have access to view Website in this
environment”. It is recommended that you are in a System Administrator security role in the corresponding Common Data
Service database.

Step 1: Create a security role


1. In the Share this portal pane, under Create a security role, select Security Roles. A list of all the
configured security roles is displayed.
2. On the Actions toolbar, select New.
3. In the New Security Role window, enter the role name.
4. Set the privileges for all the entities used in your portal.
5. When you have finished configuring the security role, on the toolbar, select Save and Close.
For information on security roles and privileges, see Security roles and privileges.
Step 2: Assign users to the security role
1. In the Share this portal pane, under Assign users to the security role, select Users. A list of all users is
displayed.
2. Select the user that you want to assign a security role to.
3. Select Manage Roles.

NOTE
If you are unable to see the Manage Roles button on the command bar, you must change the client by setting
forceUCI to 0 in the URL. For example, https://<org_url>/main.aspx?
pagetype=entitylist&etn=systemuser&forceUCI=0

4. In the Manage User Roles dialog box, select the security role that you created earlier, and then select OK.
Share with external users
Your portal should work anonymously and should be accessible by the external users. If you want to try advanced
capabilities for managing roles and permissions for external users, see Configure a contact for use on a portal,
Invite contacts to your portals, Create web roles for portals, Assign entity permissions.

Settings
Displays the portal settings and allows you to change the name of the portal. You can also perform advanced
actions such as administering the portal though the Power Apps Portals admin center and working with site
settings. Settings provides links to the Power Apps Portals admin center and Site settings. More information:
Advanced portal administration and Configure site settings.
Delete
Deletes the portal and hosted resources. When you delete a portal, its URL becomes inaccessible. Deleting a portal
does not affect any portal configurations or solutions present in your environment, and they will remain as-is. You
must delete the portal configurations manually to completely remove portal configurations from your
environment. To do this, use the Portal Management app, and delete the corresponding website record for the
portal.

NOTE
If you don't have sufficient privileges to delete a portal, an error is displayed. You must have the System Administrator role to
delete a portal. Also, you must be the owner of the portal application in Azure Active Directory. The user who creates the
portal is by default the owner and can delete a portal. For information on adding yourself as an owner, see Add yourself as an
owner of the Azure AD application.

Details
Displays details such as owner of the portal, date and time when it was created and last modified, and the URL of
the portal.
Power Apps Portals admin center
1/23/2020 • 2 minutes to read • Edit Online

The Power Apps Portals admin center allows you perform advanced administrative actions on portals. The
admin center is available when a portal is provisioned successfully.

Open Power Apps Portals admin center


1. Go to the Recent apps section on the Power Apps home page and locate your portal.

2. Select More Commands (...) > Settings.

3. In the Portal settings pane, select Administration.


Add yourself as an owner of the Azure AD application
If you are not a global administrator and you try to manage a portal that has already been provisioned, or you
resubmit the provisioning if it failed, you must be the owner of the Azure Active Directory (Azure AD )
application connected to your portal.
1. Go to the Power Apps Portals admin center and open the Portal Details tab.
2. Copy the value from the Application ID field.
3. Go to Azure AD associated with your tenant. More information: Take over an unmanaged directory as
administrator in Azure Active Directory
4. In Azure AD, search for the app registration by using the application ID you copied. You might need to
switch from My apps to All apps.
5. Add users or groups as owners of this app registration. More information: Managing access to apps

NOTE
This task can be performed either by a global administrator of your organization or the existing owner of this
application.

6. After you've added yourself as an owner, reopen the Power Apps Portals admin center page.
Portal details
1/23/2020 • 2 minutes to read • Edit Online

After you create a portal, it will begin provisioning and you are notified about the status through notifications.
Once the portal is provisioned, you are redirected to Power Apps portals Studio. You can use Power Apps portals
Studio to create and customize your website.
If you need to see more details about the provisioned portal such as, portal type, application ID, owner of the
portal, and so on, you can open Power Apps Portals admin center and navigate to the Portal Details tab. The user
who has created the portal is the owner of the portal.
Download public key of portal
1/23/2020 • 2 minutes to read • Edit Online

The public key of a portal is used to configure Live Assist for model-driven apps in Dynamics 365 to work with
authenticated visitors for a portal. Live Assist, by CafeX, provides a chat solution through which users can embed
live chat assistance in their portal. More information on how to use the public key to embed a chat on a portal:
Authenticated Visitors in the Dynamics Customer Portal
1. Open Power Apps Portals admin center.
2. Go to Portal Actions > Get Public Key. The key is displayed.

3. Select Download as Text to download the key in a text file.


Alternately, you can also get the public key by going to the URL: <portal_base_URL>/_ services/auth/publickey

NOTE
If the portal is currently being provisioned or the package install is not finished in the organization, an error is displayed if you
try to download the public key. You must wait until portal provisioning is complete and the portal is up and running.
View portal error logs
1/23/2020 • 6 minutes to read • Edit Online

As a portal administrator or developer, you can use Power Apps portals to create a website for your customers.
One common task for a developer is to debug issues while developing the portal. To help debug, you can access
detailed error logs for any issues on your portal. There are multiple ways that you can get error logs for your
portals.

Custom error
If any server-side exception occurs in your portal, a customized error page with a user-friendly error message is
shown by default. To configure the error message, see Display a custom error message.
However, it is better to see the ASP.NET detailed error page, also known as Yellow Screen of Death (YSOD ), for
debugging purposes. The detailed error page helps you to get the full stack of server errors.

To enable YSOD, you need to disable custom errors on your portal.

NOTE
It is advisable to only disable custom errors when you are in the development phase and enable custom errors once you go
live.

More information on custom error: Displaying a Custom Error Page


Disable custom error
You can disable custom errors on portals to display the detailed exception message if any server-side exception
occurs in your portal.
1. Open Power Apps Portals admin center.
2. Go to Portal Actions > Disable custom errors.
3. Select Disable in the confirmation message. While custom errors are being disabled, the portal restarts and
will be unavailable. A message appears when custom errors are disabled.
Enable custom error
You can enable custom errors on portals to display a professional-looking page instead of YSOD. This page
provides meaningful information if any exception occurs in the application.
1. Open Power Apps Portals admin center.
2. Go to Portal Actions > Enable custom errors.
3. Select Enable in the confirmation message. While custom errors are being enabled, the portal restarts and
will be unavailable. A message appears when custom errors are enabled.

NOTE
If you change the instance that your portal is connected to, the custom errors setting is set to enabled. You must disable
the custom errors again, if required.
You must not enable or disable custom errors when the instance that your portal is connected to is being changed;
otherwise an error message appears.

Display a custom error message


You can configure your portal to display a professional-looking custom error instead of a generic error.
To define a custom error, use the content snippet Portal Generic Error . The content defined in this snippet is
shown on the error page. This content snippet is not available out-of-the-box and you must create it. The content
snippet Type can be Text or HTML. To create or edit the content snippet, see Customize content by using content
snippets.

NOTE
If liquid code is written in the content snippet, it will be skipped and not rendered.

When you enable custom errors, the message appears in the following structure on the error page:
Below is an example of a custom error message, using a content snippet of type HTML:
This is a custom error, please file a support ticket with screenshot of error by clicking here
NOTE
If the portal cannot retrieve a content snippet because it can't connect to Common Data Service or if the snippet is not
available in Common Data Service, an error message appears.

Access portal error logs


After developing and publishing the portal, you still need to be able to access portal logs to debug issues reported
by your customers. To access the logs, you can configure your portal to send all application errors to an Azure Blob
storage account that you own. By accessing portal error logs, you can respond to customer queries efficiently
because you have details of the issue. To get portal error logs into your Azure Blob storage, you must enable
diagnostic logging from the Power Apps Portals admin center.

NOTE
If you change the Common Data Service instance that your portal is connected to, diagnostic logging is disabled. You must
enable diagnostic logging again.

Enable diagnostic logging


1. Open Power Apps Portals admin center.
2. Go to Portal Actions > Enable diagnostic logging.
3. In the Enable diagnostic logging window, enter the following values:
Connection String of Azure Blob Storage service: URL of the Azure Blob Storage service to store
the portal error logs. The maximum length of the URL is 2048 characters. If the URL is longer than 2048
characters, an error message appears. More information on connection string: Configure Azure Storage
connection strings
Select retention period: Duration to keep the portal error logs in blob storage. The error logs are
deleted after the selected duration. You can select one of the following values:
1 day
7 days
30 days
60 days
90 days
180 days
Always
By default, the retention period is 30 days.
4. Click Configure.
Once diagnostic logging is configured, a new telemetry-logs blob container is created in your Azure storage
account and the logs are written into the blob files stored in the container. The following screenshot shows the
telemetry-logs blob container in Azure storage explorer:

When diagnostic logging is enabled successfully, the following action becomes available:
Update diagnostic logging configuration: Allows you to update or remove diagnostic logging
configuration for the portal.
Disable diagnostic logging: Allows you to disable diagnostic logging configuration for the portal.
Update diagnostic logging
1. Open Power Apps Portals admin center.
2. Go to Portal Actions > Update diagnostic logging configuration.
3. In the Update diagnostic logging configuration window, enter the following values:
Do you want to update the Connection string of the Azure Blob Storage service?: Allows you to
specify whether to update the connection string of the Azure Blob Storage service. By default, it is
selected.
Connection String of Azure Blob Storage service: URL of the Azure Blob Storage service to store
the portal error logs. The maximum length of the URL can be 2048 characters. If the URL is longer than
2048 characters, an error message appears. This field is displayed only if the Do you want to update
the Connection string of the Azure Blob Storage service? check box is selected. More information
on connection string: Configure Azure Storage connection strings
Select retention period: Duration to keep the portal error logs in blob storage. The error logs are
deleted after the selected duration. You can select one of the following values:
1 day
7 days
30 days
60 days
90 days
180 days
Always
By default, the retention period is 30 days.
4. Click Update.
Disable diagnostic logging
1. Open Power Apps Portals admin center.
2. Go to Portal Actions > Disable diagnostic logging.

3. Click Disable in the confirmation message.

Display plugin error


Another scenario that often occurs while developing a portal is an error generated by custom plug-ins and
business logic written in your Common Data Service environment. These errors can generally be accessed by
disabling custom errors or enabling diagnostic logging. However, in some cases, it is faster to display these errors
directly on the portal to diagnose the issue faster. To do this, you can configure your portal to display custom
plugin errors from Common Data Service on your portal screen.
To display custom plugin errors, create the site setting Site/EnableCustomPluginError and set its value to True. The
custom plugin errors will be displayed on the screen instead of a generic error. The error will display only the
message part of the plugin error and not the complete stack trace.
Following are the screens where custom plugin errors will appear:
Entity list
Retrieval of records
Entity form
Retrieve
Create/Update and so on
Web forms
Retrieve
Create/Update and so on
If the site setting is not present, then it will be treated as false by default and plugin errors will not render.
Reset a portal
2/15/2020 • 2 minutes to read • Edit Online

Once a portal is provisioned, you might need to delete resources from your portal under certain circumstances,
such as if you move your organization to another tenant or another datacenter or if you want to remove the portal
from your organization.
To do this, you can reset your portal, which will delete all the hosted resources associated with it. Then you can
provision the portal again. Once the reset operation is finished, your portal URL will not be accessible anymore.
It is important to note that resetting your portal doesn’t remove portal configuration or solutions present in your
instance and they will remain as is.
You can reset a completely configured portal, or a portal for which provisioning or updating of an instance has
failed.
To reset a configured portal:
1. Open Power Apps Portals admin center.
2. Go to Portal Actions > Reset Portal.

3. Select Reset in the confirmation window.


NOTE
If you don't have appropriate permissions on an associated Azure Active Directory application, an error is displayed. You
must contact the global administrator for the appropriate permissions.
If you have provisioned a portal using the older portal add-on and the portal is reset successfully, the portal name and
its status on the Applications tab on the Dynamics 365 Administration Center page does not change. For example, if
your portal name and status were Portal 1 and Configured respectively, then after resetting the portal, these values do
not change. If you want to change the portal name, you can change it on the Portal Details tab in the Power Apps
Portals admin center. However, the status value cannot be reverted to Not Configured.
It is important to note that the portal's status on the Applications tab does not represent its provisioning status and
does not affect the functioning of your portal. It just shows whether you have ever accessed the Power Apps Portals
admin center for that corresponding portal or not.
If you have provisioned a portal using the older portal add-on, you can reset the portal to not configured state and
create a new portal.

If your portal is not provisioned correctly, it goes into an error state and the following screen is displayed. In this
case, you can also reset the portal by selecting Reset Portal on the error screen.

Troubleshooting
This section provides information about troubleshooting issues while resetting a portal.
Reset request could not be submitted
If a portal reset request could not be submitted, an error is displayed as shown in the following image. In this case,
you must close and reopen the Power Apps Portals admin center, and try to reset the portal again. If the issue
persists, contact Microsoft support.
Reset portal job fails
If a reset portal job fails, an error message is displayed along with the Reset Portal action.

Typically, these are transient errors and you must select Reset Portal to restart the job. If the issue persists,
contact Microsoft support.
Change the base URL of a portal
1/23/2020 • 2 minutes to read • Edit Online

You can change the base URL of a portal after it is provisioned. For example, if you choose
contosocommunity.microsoftcrmportals.com as the base URL when provisioning the portal, you can later change it
to contosocommunityportal.microsoftcrmportals.com to meet your requirements.

NOTE
Once you change the base URL of your portal, the older URL will no longer be accessible and it will become available for
other customers to use for their portals.

1. Open Power Apps Portals admin center.


2. Go to Portal Actions > Change base URL.

3. In the Change base URL window, enter the new base URL for the portal.
4. Select Change URL in the confirmation window.

Troubleshooting
This section provides information about troubleshooting issues while changing the base URL of a portal.
Changing the base URL fails
If changing the base URL of a portal fails, an error is displayed as shown in the following image:

Typically, these are transient errors and you must select Change base URL to retry changing the base URL. If the
issue persists, contact Microsoft support.
Maintenance mode for a portal
1/23/2020 • 2 minutes to read • Edit Online

There might be times when your website is under scheduled maintenance or is down due to temporary outage.
When a customer accesses the website during maintenance, unpredictable behavior and intermittent unavailability
might be experienced.
As a portal administrator, you can configure your portal to display a proper message to customers whenever a
maintenance activity is going on (for example, "Solution packages are being upgraded.") You can leverage this
capability by enabling the maintenance mode on your portal. When the maintenance mode is enabled, a message
is displayed, and the customers are restricted from browsing any webpages except the
<portal URL>/_services/about page.

Enable maintenance mode


You can enable maintenance mode on your portal to provide a consistent message, instead of dealing with
unpredictable behavior when your website is under scheduled maintenance. This will provide a better experience
for your portal users.
1. Open Power Apps Portals admin center.
2. Go to Portal Actions > Enable maintenance mode.
3. In the Enable maintenance mode window, enter the following values:
Select page to be used when maintenance mode is enabled: Select one of the following values:
Default page: Select this value if you want the default page to be displayed when
maintenance mode is enabled. By default, this option is selected.
Custom page: Select this value if you want a custom HTML page to be displayed when
maintenance mode is enabled.
Custom page URL: This field is enabled only when you select the option to display a custom HTML
page. You must ensure that the page URL you provide is publicly accessible. If the specified HTML
page can't be reached, the default page is displayed with a note to the administrators.

NOTE
The custom maintenance page uses IFrame to display the page. Hence, the page should not contain the
x-frame-options:SAMEORIGIN response header, else the page will not load.

4. Select Enable. While maintenance mode is being enabled, the portal restarts and is unavailable for a few
minutes.
Configure or disable maintenance mode
After enabling maintenance mode for your portal, you can update the maintenance mode settings and choose a
different page.
You can also choose to disable maintenance mode on your portal when the scheduled maintenance of your
website is complete. Your portal users can now browse and access all web pages as usual.
1. Open Power Apps Portals admin center.
2. Go to Portal Actions > Configure or disable maintenance mode.

3. Modify the settings as required, and select Update. For example, you might choose to display the default
page if you've selected to display the custom page earlier.
4. To disable maintenance mode, select Disable. While maintenance mode is being updated or disabled, the
portal restarts and is unavailable for a few minutes.
Add a custom domain name
2/15/2020 • 2 minutes to read • Edit Online

A custom domain can help your customers find your support resources more easily and enhance your brand. Only
one custom domain name can be added to a portal. After you've provisioned your portal and acquired your
domain name, you'll need an SSL certificate to set up a custom host name. You can use the purchased SSL
certificate for your domain to link your portal to a custom domain by using a wizard.
1. Open Power Apps Portals admin center.
2. Go to Portal Actions > Add a Custom Domain Name. A wizard opens to choose the SSL certificate.
3. On the Choose a SSL certificate page, select one of the following options:
Upload a new certificate: Select this option to upload the .pfx file if you have not yet uploaded it to
the organization. Select the upload button underneath File to select the .pfx file. After selecting the
file, enter the password for your SSL certificate in the Password field.
Use an existing certificate: Select this option to choose the correct certificate from the drop-down
list.

NOTE
The SSL certificate must meet all the following requirements:
Signed by a trusted certificate authority
Exported as a password-protected PFX file
Contains private key at least 2048 bits long
Contains all intermediate certificates in the certificate chain
Must be SHA2 enabled; SHA1 support is being removed from popular browsers
The steps to export SSL certificate as a password-protected PFX file may vary depending on your certificate
provider. Check with your certificate provider for recommendation. For example, certain providers may
suggest to use OpenSSL 3rd party tool from OpenSSL or OpenSSL Binaries sites.

4. Select Next.
5. On the Choose a host name page, select one of the following options:
Add a new host name: Select this option to create a new custom domain. Enter the domain name you
want in the Domain Name field.
Use an existing host name: Select this option to choose a host name from the drop-down list.

NOTE
You can only have one custom domain name for a portal.
To create a custom host name, you will need to create a CNAME with your domain provider that points your
domain to the URL of your portal. If you have just added a CNAME with your domain provider, it will take some
time to propagate to all DNS servers. If the name is not propagated and you add it here, the following error
message will appear: Please add a CNAME record to this domain name. Retry after some time passes.

6. Review the information you have entered, and then select Next to begin creating the SSL Binding. You
should see the message Custom Domain name has been successfully configured for this Portal. You can
now go to {Custom Domain Name} to access this portal. {Custom Domain Name} will be a hyperlink to the
Custom Portal URL that was just configured.
7. Select Finish to close the wizard.

NOTE
If you want to change your existing custom domain name, you must upload a new SSL certificate and follow the
steps as mentioned in this section.
Import metadata translation
1/23/2020 • 2 minutes to read • Edit Online

When you provision a portal, the portal-related solutions are installed on the organization. During the installation
of solutions, the solution metadata translations (for example, field name, form name, and view name) are installed
only for the languages currently activated in the organization. If you activate a new language in the future, the
metadata will not be installed automatically for the newly activated language. To get the metadata translation for
the newly activated language, you must import the metadata translation from the Power Apps Portals admin
center.

To import metadata translation


1. Open Power Apps Portals admin center.
2. Go to Portal Actions > Get latest metadata translations. A confirmation window is displayed asking
whether to update the portal solutions.
3. Select Update. The portal solutions will be updated with the latest metadata translation.

NOTE
If the latest version of a portal package is available, it isn't updated. The portal solutions are updated in the same version.
To upgrade your portal solutions based on the latest available packages, you need to access the Solution Admin center.
If a user has modified any data in Common Data Service, the existing data will not be overwritten during the update.
If the portal solutions are being installed, the solution update cannot be triggered.
Set up Power BI integration
1/23/2020 • 6 minutes to read • Edit Online

Power BI is one of the best tools to deliver insights with simple and interactive visualization. To view dashboards
and reports from Power BI on web pages in a portal, you must enable Power BI visualization from the Power Apps
Portals admin center. You can also embed dashboards and reports created in the new workspace of Power BI by
enabling the Power BI Embedded service integration.

NOTE
You must have an appropriate Power BI license.
To use Power BI Embedded service, you must have an appropriate Power BI Embedded license. For more information, see
Licensing.

Enable Power BI visualization


Enabling Power BI visualization allows you to embed dashboards and reports on web pages in a portal by using
the powerbi Liquid tag.
1. Open Power Apps Portals admin center.
2. Go to Set up Power BI integration > Enable Power BI visualization.

3. Select Enable in the confirmation message. While Power BI visualization is being enabled, the portal
restarts and will be unavailable for a few minutes. A message appears when Power BI visualization is
enabled.
Customizers can use the powerbi Liquid tag to embed Power BI dashboards and reports on web pages in a portal.
While embedding the Power BI content, customizers can use filter parameters to create personalized views. More
information: powerbi Liquid tag
Disable Power BI visualization
1. Open Power Apps Portals admin center.
2. Go to Set up Power BI integration > Disable Power BI visualization.

3. Select Disable in the confirmation message. While Power BI visualization is being disabled, the portal
restarts and will be unavailable for a few minutes. A message appears when Power BI visualization is
disabled.

Enable Power BI Embedded service


Enabling the Power BI Embedded service allows you to embed dashboards and reports created in the new
workspace of Power BI. The dashboards and reports are embedded on webpages in a portal by using the powerbi
Liquid tag.
Prerequisites: Before enabling the Power BI Embedded service, ensure that you have created your dashboards
and reports in the new workspace in Power BI. After creating the workspace, provide admin access to the global
administrator so the workspaces are displayed in the Power Apps Portals admin center. For more information on
creating new workspaces and adding access to them, see Create the new workspaces in Power BI.
Power BI Embedded service limitations: For information on limitations, see Considerations and limitations.

NOTE
Ensure that Power BI visualization is enabled for the powerbi Liquid tag to work.

1. Open Power Apps Portals admin center.


2. Go to Set up Power BI integration > Enable Power BI Embedded service.
3. In the Enable Power BI Embedded service integration window, select and move the Power BI
workspaces from which dashboards and reports need to be displayed in your portal to the Selected
workspaces list.

NOTE
After you add workspaces to the Selected workspaces list, the databases and reports are rendered after a few
minutes.

4. Select Enable. While Power BI Embedded service is being enabled, the portal restarts and is unavailable
for a few minutes. A message appears when Power BI Embedded service is enabled.
You must now create a security group, and add it to your Power BI account. For more information, see Create
security group and add to Power BI account.
Create security group and add to Power BI account
After enabling the Power BI Embedded service integration, you must create a security group in Azure Active
Directory, add a member to it, and then add the security group in Power BI through the Power BI admin portal.
This allows the dashboards and reports created in new Power BI workspaces to be displayed in the portal.

NOTE
You must sign in with the same Global administrator account that you used to enable the Power BI Embedded service.

Step 1: Create a security group


1. Sign in to the Azure portal using a Global administrator account for the directory.
2. Select Azure Active Directory, Groups, and then select New group.
3. On the Group page, enter the following information:
Group type: Security.
Group name: Portal Power BI Embedded service.
Group description: This security group is used for Portal and Power BI Embedded service
integration.
Membership type: Assigned.

4. Select Create.
Step 2: Add a group member
Prerequisite: Before adding a member to the security group, you must have the portal's application ID with you.
The portal's application ID is available on the Portal Details tab in Power Apps Portals admin center.
1. Sign in to the Azure portal using a Global administrator account for the directory.
2. Select Azure Active Directory, and then select Groups.
3. From the Groups - All groups page, search for the Portal Power BI Embedded service group, and select
it.
4. From the Portal Power BI Embedded service Overview page, select Members from the Manage area.
5. Select Add members, and enter the portal's application ID in the text box.
6. Select the member from the search result, and then choose Select.

Step 3: Power BI setup


1. Sign in to Power BI using a Global administrator account for the directory.
2. Select Settings in the top right of the Power BI service, and choose Admin portal.

3. Select Tenant settings.


4. Under the Developer settings section, select Allow service principals to use Power BI APIs.
5. In the Specific security groups field, search for the Portal Power BI Embedded service group, and
select it.

6. Select Apply.
Customizers can now use the powerbi Liquid tag to embed Power BI dashboards and reports from new Power BI
workspaces on webpages in a portal. To use Power BI Embedded service, the authentication type must be specified
as powerbiembedded. While embedding the Power BI content, customizers can use filter parameters to create
personalized views. More information: powerbi Liquid tag.
Manage the Power BI Embedded service
1. Open Power Apps Portals admin center.
2. Go to Set up Power BI integration > Manage Power BI Embedded service.
3. In the Manage Power BI Embedded service integration window, remove or move the Power BI
workspaces from which dashboards and reports need to be displayed in your portal to the Selected
Workspaces list.

NOTE
After removing the workspaces from the Selected Workspaces list, it can take up to 1 hour to reflect the changes.
Until then, the databases and reports are rendered on the portal without any issues.

4. Select Save.
Disable the Power BI Embedded service
1. Open Power Apps Portals admin center.
2. Go to Set up Power BI integration > Manage Power BI Embedded service.

3. In the Manage Power BI Embedded service integration window, select Disable Power BI Embedded
service integration.

4. Select Save.
5. Select OK in the confirmation message. While Power BI Embedded service is being disabled, the portal
restarts and is unavailable for a few minutes. A message appears when Power BI Embedded service is
disabled.

Privacy notice
By enabling the embedding of Power BI tiles and dashboards, when a user embeds a Power BI tile or dashboard,
that user’s Azure Active Directory authorization token for Common Data Service is used to authenticate with the
Power BI service with an implicit grant, providing a seamless “single-sign on” experience for the end user.
An administrator can disable embedding of Power BI tiles and dashboards at any time to stop use of the Dynamics
365 authorization token for authenticating with Power BI service. Any existing tiles or dashboards will stop
rendering for the end user.
The Azure component or service that is involved with embedding of Power BI tiles is detailed in the following
section.
Note: For more information about additional Azure service offerings, see the Microsoft Azure Trust Center.
Azure Active Directory
This service provides the authentication token exchanged with Power BI service for API and UI authentication.
See also
powerbi Liquid tag
Add a Power BI report or dashboard to a webpage in portal
Add a Power BI report or dashboard to a web page
in portal
1/23/2020 • 2 minutes to read • Edit Online

You can add a Power BI report or dashboard to a web page in portal by using the powerbi Liquid tag. You can add
the tag in the Copy field on a web page or in the Source field on a web template. If you adding a Power BI report
or dashboard created in the new workspace in Power BI, you must specify the authentication type as
powerbiembedded in the powerbi Liquid tag.
For example:

{% powerbi authentication_type:"powerbiembedded" path:"https://app.powerbi.com/groups/00000000-0000-0000-0000-


000000000000/reports/00000000-0000-0000-0000-000000000001/ReportSection01" %}

NOTE
If you have specified AAD as the authentication type in powerbi Liquid tag, you must share it with the required users before
adding the secure Power BI report or dashboard to a web page in portal. More information: Share Power BI workspace and
Share Power BI dashboard and report.

Get the path of a dashboard or report


1. Sign in to Power BI.
2. Open the dashboard or report you want to embed in your portal.
3. Copy URL from the address bar.

Get the ID of a dashboard tile


1. Sign in to Power BI.
2. Open the dashboard from which you want to embed a tile in your portal.
3. Point to the tile, select More options, and then select Open in focus mode.

4. Copy the tile ID from the URL in the address bar. The tile ID is the value after /tiles/.

See also
powerbi Liquid tag
Set up Power BI integration
Portal checker
1/23/2020 • 2 minutes to read • Edit Online

Portal checker is a self-service diagnostic tool that can be used by portal administrators to identify common issues
in their portal. Portal checker helps to identify issues with your portal by looking at various configuration
parameters and provides suggestions on how to fix them.
When you run portal checker, the results are displayed in the Diagnostic results section in a grid format. The
results grid has the following columns:
Issue: Displays the top-level issue faced by a customer; for example, performance issue.
Category: Displays the top-level area where issues can be categorized; for example, provisioning, solution
upgrade, and so on.
Result: Displays the status of issue; for example, error, warning, and so on.
By default, information in the grid is sorted by the Result column in this order: error, warning, and pass.

You can expand an issue to view detailed information and mitigation steps. If the mitigation requires any action,
you'll see a button that will perform the action. You can also provide feedback on whether the mitigation was
useful.

If required, you can rerun the diagnostic checks, which will refresh the results with updated data.

NOTE
If portal is turned off or IP address filtering is enabled, certain diagnostic checks will not be run on your portal.

For a list of common issues diagnosed by the portal checker tool, see Common portal issues diagnosed by portal
checker and their best practices.
To run portal checker:
1. Open Power Apps Portals admin center.
2. Go to Run Portal Checker.

3. Select Run Portal Checker. The diagnostic session will start and gather data about the customer issues.
The results are displayed in the Diagnostic results section.

4. To rerun the diagnostic checks, select Refresh results.


Connect to a Common Data Service environment
using a portal
1/23/2020 • 3 minutes to read • Edit Online

A portal connects to a Common Data Service environment using an Azure Active Directory application. The
application is created in the same tenant where the portal is provisioned. The application is registered with the
Common Data Service environment during the portal provisioning process.

Each portal has a separate Azure Active Directory application associated with it, whether it is connected to the
same Common Data Service environment or not. The default Azure Active Directory authentication provider
created for a portal uses the same Azure Active Directory application to authenticate the portal. Authorization is
enforced by web roles assigned to the user accessing the portal.
You can see the associated portal application in Azure Active Directory. The name of this application will be
Microsoft CRM Portals, and the portal ID is in the App ID URI field in the Azure Active Directory application. The
person who provisions the portal owns this application. You should not delete or modify this application, or you
might break the portal functionality. You must be the application owner to manage a portal from the Power Apps
Portals admin center.

Authentication key
For a portal to connect to Common Data Service using an Azure Active Directory application, it requires an
authentication key connected to the Azure Active Directory application. This key is generated when you provision a
portal and the public part of this key is automatically uploaded to the Azure Active Directory application.

IMPORTANT
The authentication key will expire in two years. It must be renewed every two years to ensure that your portal will continue
to connect to the Common Data Service environment. If you do not update the key, the portal will stop working.

Authentication key details


The details of an authentication key is displayed on Power Apps Portals admin center and portal.
Power Apps Portals admin center
1. Open Power Apps Portals admin center.
2. Select Manage portal authentication key. The authentication key is displayed along with its expiration
date and thumbprint.

Portal
1. Sign in to the portal as administrator.
2. Navigate to the URL <portal_path>/_services/about. The authentication key expiration date is displayed.

NOTE
To view authentication key information, you must sign in to the portal in the same browser session and you must have all
website access permission.

Authentication key expiration notification


Before the authentication key expires, you will be notified by emails, Power Apps Portals admin center, and portal.
Email
Email will be sent to people who have signed up for email notification for the organization connected to their
portal. More information about signing up for email notification: Manage email notifications to admins
Email notifications are sent at the following intervals:
90 days
60 days
30 days
15 days
7 days
6 days
5 days
4 days
3 days
2 days
1 day
12 hours
6 hours
3 hours
You will also be notified after the key expires every day until 1 week after key expiration.

NOTE
Intervals are calculated in UTC from the key expiration date.
Email is not guaranteed to be exactly at the intervals as listed above. Email notification can be delayed or missed. Be sure
to check for the key expiration date online as well.

Power Apps Portals admin center


A message about key expiration is displayed at the top of the page.
Portal
When you navigate to the URL <portal_path>/_services/about, a notification about key expiration is displayed at
the bottom of the page.

NOTE
You must sign in to your portal in the same browser session, and you must be assigned all website access permission.

Renew portal authentication key


You must renew the key every two years to ensure that your portal can connect to Common Data Service
environment.

NOTE
To renew the key, you must have permissions to manage your portal.

1. Open Power Apps Portals admin center.


2. Select Manage portal authentication key. The authentication key is displayed along with its expiration
date and thumbprint.
3. Select Update key.
4. Select Update in the message. The update process starts, and a message is displayed.

NOTE
While this process runs in the background, the portal will restart once.
When you update a key, it is updated for two years.
This process will take five to seven minutes.

Troubleshooting
If the key update fails, an error message is displayed along with the following action:
Retry Authentication Key Update. This action allows you to restart the portal authentication key update
process. If the update fails multiple times, contact Microsoft support.
Restrict portal access by IP address
1/23/2020 • 2 minutes to read • Edit Online

The portal is public when provisioned and accessible by anyone from any computer. Now you can restrict access to
your portal from a list of IP addresses. For example, a government organization might want to surface their
content only within their corporate network. A commercial organization might want to display the portal only
when it is published and not while it is in development to avoid any data leak.
When a request to the portal is generated from any user, their IP address is evaluated against the allow list. If the
IP address is not on the list, the portal displays a web page with an HTTP 403 status code.
To add or remove IP addresses, you must be assigned any one of the following roles:
Office 365 Global Administrator
Service Administrator. More information: Use the service admin role to manage your tenant
System Administrator of the Common Data Service environment selected for the portal

Add an IP address
To allow access to a portal from an IP address or a set of IP addresses, you can add the IP addresses to the list. This
allows the portal to be accessed only from the list of added IP addresses. If you do not add any IP address, the
portal will be accessible from all IP addresses.
Once you add an IP address to the restriction list, the portal will be accessible to the specified IP address only. If
you try to access the portal from any other IP addresses, access will be denied and a web page with an HTTP 403
status code is displayed. The content of this web page is static and cannot be modified.
NOTE
You must specify a public IP address that can be accessed by the portal. Private IP address can't be accessed by the portal.

1. Open Power Apps Portals admin center.


2. Go to Set up IP address restriction. A list of IP addresses and their type is displayed.

3. On the Set up IP address restriction page, select Add new.


4. In the Add an IP address window, enter the following values:
Select type of IP address: Select whether the IP address is IPv4 or IPv6.
Specify IP address in CIDR notation: Specify the IP address in CIDR notation. More information:
Classless Inter-Domain Routing

5. Select Configure.

Remove an IP address
To remove access to a portal from a previously allowed IP address, you can remove the IP address from the list. If
you remove all IP addresses, the portal will be accessible from all IP addresses.
1. Open Power Apps Portals admin center.
2. Go to Set up IP address restriction. A list of IP addresses and their type is displayed.

3. Select Remove an IP address (x) next to the IP address to be removed.


4. Select Remove in the confirmation message.
Update to Power Apps portals domain
1/23/2020 • 2 minutes to read • Edit Online

If you provision a portal using the older portal add-on, the domain of your portal will be microsoftcrmportals.com .
With the release of Power Apps portals, you can now update your Dynamics 365 domain microsoftcrmportals.com
to the Power Apps portals domain powerappsportals.com .

NOTE
The microsoftcrmportals.com domain is deprecated and is limited only to the portals provisioned using the older portal
add-on. In deprecation period, this feature will continue to work and is fully supported until it is officially removed. This
deprecation notification can span a few years.

1. Open Power Apps Portals admin center.


2. Go to Portal Actions > Update to Power Apps portal domain.

3. In Portal URL, enter the address of the website and select OK.
If you are already using the Power Apps portals domain and would like to revert to the old domain, you can use
the Update to Power Apps portal domain action to revert to the old domain. In this case, the message is
displayed as follows:
Clear the server-side cache for a portal
1/23/2020 • 2 minutes to read • Edit Online

As a portal administrator, you can clear the server-side cache for the entire portal so that updated data from
Common Data Service is immediately reflected on the portal. Updates from Common Data Service are
communicated to the portal in asynchronous mode, so there might be a lag between the time data is updated in
Common Data Service and the time that updated data appears on the portal. To eliminate this delay—for example,
when it interferes with portal configuration—you can force the portal to refresh its cache immediately.

NOTE
The SLA for cache refresh (data transfer between Common Data Service and portal) is 15 minutes.

To clear the server-side cache


1. Sign in to the portal as an administrator.
2. Navigate to the URL as follows: <portal_path>/_services/about

3. Select Clear Cache.


The server-side cache is deleted, and data is reloaded from Common Data Service. Note that clearing the portal
server-side cache will temporarily cause poor portal performance while data is being reloaded from Common Data
Service .
Migrate portal configuration
1/23/2020 • 4 minutes to read • Edit Online

Portal development involves several configurations and customizations to achieve a desired experience for portal
end users.
After you have completed development or configuration of your portal instance, you might want to migrate your
latest portal configuration from development to testing or the production environments. Migration involves
exporting the existing configuration from the source Common Data Service environment, and then importing it
into the target Common Data Service environment.
To export configuration data, you would need to use the Configuration Migration tool and a portal-specific
configuration schema file. For more information about this tool, see Manage configuration data.

NOTE
We recommend you to use the latest version of the Configuration Migration tool. The Configuration Migration tool can
be downloaded from NuGet. More information for downloading the tool: Download tools from NuGet.
The minimum solution version of portals supported by schema files for configuration migration is 8.4.0.275. However, we
recommend that you use the latest solution version.

Schema files are available for the following portal types:


Portals created in an environment with Common Data Service
Custom portal (Blank portal)
Portals created in an environment containing model-driven apps in Dynamics 365
Custom portal (Blank portal)
Community portal
Customer Self-Service portal
Partner portal
Employee Self-Service portal
The default schema files contain information about portal entities, relationships, and uniqueness definitions for
each entity. More information: Export portal configuration data
After exporting the configuration data, you must import it into the target environment. More information: Import
portal configuration data

NOTE
The Configuration Migration tool uses schema to export and import configuration data. The tool does not migrate entities or
entity schema. Migration may fail with missing elements such as entities and fields when configuration data has mismatch
with selected schema.
During export, ensure the source environment contains portal entities as specified in Configuration Migration tool schema
file. You can still alter the schema files to add, remove, and modify entities, attributes, and so on to migrate subset of
configuration data.
During import, ensure the destination environment contains the same portal type already installed with any additional
customizations such as entities, fields, forms or views imported separately as solutions.
Export portal configuration data
You can export portal configuration data from a source system by using portal-specific configuration schema files.
1. Download the Configuration Migration tool and extract to the desired folder.
2. Download a portal configuration schema file using links provided above for your portal type.
3. Double-click the DataMigrationUtility.exe file in the <your_folder>\Tools\ConfigurationMigration folder
to run the Configuration Migration tool, choose Export data in the main screen, and then select Continue.

4. On the Login screen, provide authentication details to connect to your Common Data Service environment
from where you want to export data. If you have multiple organizations on the Common Data Service
environment from where to export the data, select the Display list of available organizations check box,
and then select Login.

5. If you have multiple organizations, and you had selected the Display list of available organizations
check box in the previous step, the next screen allows you to choose the organization that you want to
connect to. Select a Common Data Service environment to connect to.
NOTE
If you do not have multiple organizations, this screen is not displayed.

6. In Schema file, browse and select the portal-specific configuration schema file to be used for the data
export.
7. In Save to data file, specify the name and location of the data file to be exported.

8. Select Export Data. The screen displays the export progress status and the location of the exported file at
the bottom of the screen once the export is complete.

9. Select Exit to close the tool.


Import portal configuration data
1. Run the Configuration Migration tool and choose Import data in the main screen, and then select
Continue.

2. On the Login screen, provide authentication details to connect to your Common Data Service environment
from where you want to export data. If you have multiple organizations on the Common Data Service
environment from where to export the data, select the Display list of available organizations check box,
and then select Login.
3. If you have multiple organizations, and you had selected the Display list of available organizations
check box in the previous step, the next screen allows you to choose the organization that you want to
connect to. Select a Common Data Service environment to connect to.

NOTE
If you do not have multiple organizations, this screen is not displayed.
Ensure that the portal solution is already installed for the organization where you plan to import the
configurations.

4. The next screen prompts you to provide the data file (.zip) to be imported. Browse to the data file, select it,
and then select Import Data.
5. The next screen displays the import status of your records. The data import is done in multiple passes to
first import the foundation data while queuing up the dependent data, and then import the dependent data
in the subsequent passes to handle any data dependencies or linkages. This ensures clean and consistent
data import.
6. Select Exit to close the tool.
About portal lifecycle
1/23/2020 • 3 minutes to read • Edit Online

A portal is always created as a trial. A trial portal, which expires after 30 days, is useful for trying out its capabilities
at no cost. After expiration, a portal is suspended and shut down. Seven days after suspension, the trial portal is
deleted. On every change of portal lifecycle stage, such as nearing to suspension, suspended, deleted, and
converted from trial to production, you will receive notifications as a toast and through email.
As an administrator, you can convert a trial or suspended portal to a production portal. While converting a trial
portal to production, ensure that the environment is also a production environment. You can’t convert a trial portal
to production in a trial environment. If you delete the environment in which a trial portal is created, the portal is
also deleted.
The first portal is free to be created in an environment in a tenant. If you need to create more than one portal, you
must have 1 GB of unused storage space in the tenant.

Stages in portal lifecycle


Trial portal
A portal is always created as a trial portal. You can convert it to production from the Power Apps Portals admin
center if you have the required licenses. For information on converting a trial portal to production, see Convert a
trial portal to production.
To convert a trial portal to production, the environment should have required add-ons for external users, or a
license for internal users. For more information on licensing, see Power Apps and Power Automate licensing FAQs
and Power Apps portals licensing.
Suspended portal
You will continue to see notifications in the Power Apps Portals admin center about the expiration of your trial
portal. Trial portals expire after 30 days. If you don't convert your portal to production within the trial period, the
portal is shut down and placed on the suspended status. You won't be able to access your portal after its expiration.
However, the suspended portal can still be converted to production within seven days of suspension.
Deleted portal
If you don't convert your portal to production within the seven-day suspension period, the portal is deleted. The
portal data is not deleted from the environment, but the space used by the portal in an environment will be
released, and you can create a new portal.

Convert a trial portal to production


You can convert a trial portal to production from the notifications displayed in the Power Apps Portals admin
center.

NOTE
You must be assigned one of the following roles to convert a trial portal to production:
Global administrator
System administrator
When you open the Power Apps Portals admin center and navigate to the Portal Details tab, you'll see the
notification about the trial expiration displayed below the Type field.

On other pages in the admin center, the notification is displayed at the top of the page.

To convert your trial portal to production:


1. In the notification, select Convert.
2. Select Confirm.

Considerations for add-on portals


Following conditions apply to portals provisioned using portal add-on plan purchased earlier:
Trial add-on portal
Trial add-on portal expires after 30 days. Expired portal is suspended for 7 days. The portal is deleted after
suspension period ends. Trial add-on portal can still be converted to production during configured or suspended
period.
Production add-on portal
Production add-on portal expires at the end of purchased license period. Suspension period for a production add-
on portal may vary depending on the purchased license plan. The portal is deleted after suspension period ends.
You can extend the license of a production add-on portal while the portal is in configured or suspended state. If
suspended, the portal can be converted to configured state after extending the license period.

IMPORTANT
Suspension or deletion of a portal may cause functionality loss. Ensure timely license period extension of add-on portal
nearing expiry to avoid suspension or deletion.

Reset add-on portal


Follow the steps to reset the portal provisioned using a previously purchased older portal add-on plan.

See also
Power Apps portals FAQ
Upgrade a portal
1/23/2020 • 2 minutes to read • Edit Online

This section helps you understand the Dynamics 365 Portals release process to prepare for any new release
properly and to reduce any impact on your customers. It also talks about various components which are part of
your portal.
A portal consists of the following components:

COMPONENT DESCRIPTION UPDATE PROCESS

Portal solutions Solutions which are installed in Updated by customers themselves from
Common Data Service environment and the Dynamics 365 Administration
contains the metadata entities for any Center page.
portal.

Portal website host Portal website host is the Portal code Portal website host is updated
which forms the actual website. automatically for all portals.
Note: A new version of Portal website
host is backwards compatible with all
supported versions of Portal solutions.
However, once a solution version
becomes unsupported, it is not certified
to run with the new version of Portal
website host.

Impact of new releases on a Portal solution


As part of any Portal release, Portal website hosts are updated automatically to the latest versions while Portal
solutions are updated by customers. It is important to understand the impact of each component update on your
live Portal, so you can plan accordingly.
Portal website host update
If you are running a production version of Portal (you can see it on Power Apps Portals admin center), there will
not be any downtime to your live Portal when your Portal is updated. However, if you are running a trial version of
Portal, there will be around 6-10 minutes of downtime and you will not be able to access your Portal.
Portal solution update
While installing or updating any solution in your instance, you can see some instability in your instance. Portal
solution update process updates solutions available in your instance and will impact your instance which will in
turn have an impact of your Portal as well. Hence, it is always advised to do solution updates in your instance
during dark hours.

Get notified about new releases


Every customer is notified about new Portal release through Office 365 message center (in Microsoft 365 admin
center). Ensure that you either have access to Office 365 message center (Global administrator and service
administrator have access) or have discussed with your global administrator or service administrator to inform you
about any new Portal release.
Notifications are sent around 2-5 business days ahead of the release. Notifications are sent to only those
customers whose portals are planned to be updated. Each notification provides details of the type of update and
the date/time it will be rolled out along with the link to release notes.

Enable a portal for new release


You can enable development or test portal to receive an early upgrade ahead of all customers, so you can test all
core scenarios on your test portal before upgrades are rolled out to your live portal. Early upgrades are rolled out
at least one week before the global rollout of any release. Also, notifications for early upgrades are sent as
described in the Get notified about new releases section.
To enable a portal for early upgrade:
1. Open Power Apps Portals admin center.
2. On the Portal Actions tab, select Enable portal for early upgrade.
NOTE
You can enable or disable a portal for early upgrade anytime. However, a snapshot is taken for all portals marked for early
access two days before any release, and any portal marked for early access after that is not guaranteed to get an early
upgrade.

If you encounter any issue during the early upgrade phase, you can report it through Microsoft support.
Cookies in Power Apps portals
3/17/2020 • 2 minutes to read • Edit Online

A cookie is a small file sent from the web site to visitor's device by the browser. A single web session may use
multiple cookies.
Power Apps portals also use cookies to store information for various purposes. The following section lists and
describes the cookies that Power Apps portals uses:

Names and descriptions of cookies used by portals


ARRAffinity
Added automatically by Azure websites and ensures that requests are load balanced between different sites.
Doesn't store any of user information.
ASP.Net Session Id
Used to maintain the session of a logged in user to avoid repeated sign-in. The cookie isn't persistent and is deleted
after session closes.
Dynamics 365 Portal Analytics
Critical service cookie to analyze service usage anonymously and aggregated for statistical purpose.
ContextLanguageCode
Stores the default language of the user accessing portal within a session and across webpages. The cookie is
deleted after session closes.
.AspNet.ApplicationCookie
Used to identify user sessions. A user session starts when a user browses portal for the first time. And ends when
the session is closed. Authentication site settings can be used to change session expiry time span.
__RequestVerificationToken
Used by the antiforgery system.
adxPreviewUnpublishedEntities
Holds preview ON/OFF mode used in classic CMS system for portal administrators.
adx-notification
Used in entity form actions to store alert message to be shown on redirection.
timezoneCode
Holds the timezonecode field value of CRM timezonedefinition entity for the current timezone.
timezoneoffset
Holds the timezone difference between UTC and Local browser time.
isDSTSupport
Indicates whether a specified date and time falls in the range of daylight saving time.
isDSTObserved
Stores a value to indicate if the current moment is in daylight saving time.
See also
Cookie authentication site settings
Portal Management app
1/23/2020 • 2 minutes to read • Edit Online

The Portal Management app allows you perform advanced configuration actions on your portal. The app
is available after the database on Common Data Service is created successfully.
To open the Portal Management app, go to the Your apps section on the Power Apps home page, locate
the Portal Management app, and select it.

The Portal Management app is opened in the Unified Interface. You can configure your portal as per your
requirement.
Configure site settings for portals
1/23/2020 • 3 minutes to read • Edit Online

A site setting is a configurable, named value that is used by website code to modify the behavior or visual style of
the portal. Typically when a developer creates the website code, they will reference site settings for various
components to enable an end user to modify the setting values to alter the website without having to change the
code, recompile, and redeploy the website.
The sample portals that are provided with the installation of Power Apps portals contain several configurable site
settings for various styles used to modify many visual elements within the site such as background style, text color,
and layout width. You can manage the following types of site settings:
Global Portal settings: These settings apply to all portals associated with the Common Data Service
environment in which they are being added.
Portal site settings: These settings apply to specific portals (website records) that are associated with the
Common Data Service environment in which they are being added.

Manage portal site settings


1. Go to portal settings and select Site settings.
2. To create a new setting, select New.
3. To edit an existing setting, select the Site Setting listed in the grid.
4. Specify values for the fields provided:
Name: A label referenced by website code to retrieve the appropriate setting. The name should be
unique for the associated website, because the code retrieving the setting will take the first record
found with the matching name.
Website: The associated website.
Value: The setting
Description: The purpose of the setting or special instructions.
5. Select Save & Close.

NOTE
Bing Maps integration is not supported in the German Sovereign Cloud. If you try to create the Bingmaps/credentials
setting in this environment, an error message will be displayed.

Portal site settings


NAME VALUE DESCRIPTION

Authentication/Registration/RequiresCo FALSE A boolean value of true enables email


nfirmation confirmation and disables open
registration. Default: False
NAME VALUE DESCRIPTION

Authentication/Registration/RequiresInv FALSE A boolean value of true enables


itation invitation code feature and disables
open registration. Default: False

conference-name Portals Conference The name of an adx_conference record


that represents the conference for a
given portal.

HelpDesk/CaseEntitlementEnabled TRUE A Boolean value indicating if the Help


Desk Case Entitlement is enabled.
Default: false

HelpDesk/Deflection/DefaultSelectedPro The name of a Product record that is


ductName the default selected product in
dropdown displayed on the Help Desk
Case Deflection if there are more than
one product where the
producttypecode equals 100000001.

Profile/ForceSignUp FALSE A Boolean value when set to "True" will


force the user to update their profile
information before they will be given
access to the website contents. Default:
False

Profile/ShowMarketingOptionsPanel TRUE A Boolean value that indicates whether


to show the panel that lists the fields to
specify the marketing communication
preferences on the profile. Default: False

Search/Enabled TRUE A Boolean value that indicates if search


is enabled or not.

search/filters Content:adx_webpage;Events:adx_event A collection of search logical name filter


,adx_eventschedule; options. Defining a value here will add
Blogs:adx_blog,adx_blogpost,adx_blogp dropdown filter options to site-wide
ostcomment; search. This value should be in the form
Forums:adx_communityforum,adx_com of name/value pairs, with name and
munityforumthread,adx_communityforu value separated by a colon, and pairs
mpost; separated by a semicolon.
Ideas:adx_ideaforum,adx_idea,adx_ideac For example:
omment; "Forums:adx_communityforum,adx_com
Issues:adx_issueforum,adx_issue,adx_iss munityforumthread,adx_communityforu
uecomment;Help Desk:incident mpost;Blogs:adx_blog,adx_blogpost,adx
_blogpostcomment".

Search/IndexQueryName Portal Search The name of the system view used by


the portal search query. Default: Portal
Search

search/query +(@Query) _title:(@Query) Override query for site search, to apply


_logicalname:adx_webpage~0.9^0.2 additional weights and filters. @Query
-_logicalname:adx_webfile~0.9 is the query text entered by a user.
adx_partialurl:(@Query) Lucene query syntax reference:
_logicalname:adx_blogpost~0.9^0.1 - https://lucene.apache.org/core/old_versi
_logicalname:adx_communityforumthre oned_docs/versions/2_9_1/queryparser
ad~0.9 syntax.html
NAME VALUE DESCRIPTION

Search/Stemmer English The language used by the portal


search's stemming algorithm. Default:
English

CustomerSupport/DisplayAllUserActiviti FALSE
esOnTimeline

Authentication/[Protocol]/[Provider]/All Allow auto-association to a contact


owContactMappingWithEmail record based on email. For more
information, click here.

For site settings related to various portal features, see:


Authentication identity
Azure AD B2C provider
OAuth 2.0
Open ID Connect
WS -Federation
SAML 2.0
Migrate identity providers to Azure AD B2C
Search within file attachment content
Behavior and format of the date and time field
Add geolocation
Implementing General Data Protection Regulations
Enable header and footer output caching

Manage global portal settings


1. Go to portal settings and select Site settings.
2. Go to Settings > Settings.
3. To create a new setting, select New.
4. To edit an existing setting, select the Site Setting listed in the grid.
5. Specify values for the fields provided:
Name: A unique name referenced by code to retrieve the appropriate setting.
Value: The setting
Description: The purpose of the setting or special instructions.
6. Select Save & Close.

NOTE
Bing Maps integration is not supported in the German Sovereign Cloud. If you try to create the BinMap/Key or
Adxstudio/ProductivityPack/BingMap/Key setting in this environment, an error message will be displayed.
Configure portal authentication
1/23/2020 • 2 minutes to read • Edit Online

In a portal application, an authenticated portal user is associated with either a contact or system user. The default
portals configuration is contact-based. To log in, a contact must have the appropriate web authentication
information configured. Portal users must be assigned to a web roles to gain permissions beyond unauthenticated
users. To configure permissions for a web role, configure its webpage access and website access control rules.
The latest portal authentication experience allows portal users to sign in with their choice of a local contact
membership provider based account or an external account based on ASP.NET Identity.
Local authentication: Local authentication is the common forms-based authentication uses the contact
records of a Common Data Service environment for authentication. To build custom authentication
experiences, developers can use the ASP.Net Identity API to create custom login pages and tools.
External authentication: External authentication is provided by the ASP.NET Identity API. In this case,
account credentials and password management are handled by a third-party identity provider. This includes
OpenID based providers such as Yahoo! and Google and OAuth 2.0 based providers such as Twitter, Facebook,
and Microsoft. Users sign up to the portal by selecting an external identity to register with the portal. After it is
registered, an external identity has access to the same features as a local account.
Both local and external account registration can use invitation codes for sign up, as well as the email confirmation
workflow. In addition, portal administrators may choose to enable or disable any combination of authentication
options through portal site settings.

NOTE
Portal users must have an unique email address. If two or more contact records (including deactivated contact records) have
the same email address, the contacts will not be able to authenticate on the portal.

Account sign-up (registration)


Portal administrators have several options for controlling account sign-up behavior. Open registration is the least
restrictive sign-up configuration where the portal allows a user account to be registered by simply providing a
user identity. Alternative configurations may require users to provide an invitation code or valid email address to
register with the portal. Regardless of the registration configuration, both local and external accounts participate
equally in the registration workflow. That is, users have the option to choose which type of account they want to
register.

Open registration
During sign-up, the user has the option of creating a local account (providing a username and password) or
selecting an external identity from a list of identity providers. If an external identity is selected, the user is required
to sign in through the chosen identity provider to prove that they own the external account. In either case, the user
is immediately registered and authenticated with the portal. A new contact record is created in the Common Data
Service environment upon sign-up.
With open registration enabled, users are not required to provide an invitation code to complete the sign-up
process.
See also
Set authentication identity for a portal
Set authentication identity for a portal
1/23/2020 • 12 minutes to read • Edit Online

Portals provides authentication functionality built on the ASP.NET Identity API. ASP.NET Identity is in turn built
on the OWIN framework, which is also an important component of the authentication system. The services
provided include:
Local (username/password) user sign-in
External (social provider) user sign-in through third-party identity providers
Two-factor authentication with email
Email address confirmation
Password recovery
Invitation code sign-up for registering pregenerated contact records

NOTE
The Mobile Phone Confirmed field on the Portal Contact form of the Contact entity currently serves no purpose. This
field must be used only when upgrading from Adxstudio Portals.

Requirements
Portals requires:
Portals Base
Microsoft Identity
Microsoft Identity Workflows solution packages

Authentication overview
Returning portal visitors can authenticate by using local user credentials or external identity provider accounts. A
new visitor can register for a new user account either by providing a username and password or by signing in
through an external provider. Visitors who are sent an invitation code (by the portal administrator) have the
option to redeem the code in the process of signing up for a new user account.
Related site settings:
Authentication/Registration/Enabled
Authentication/Registration/LocalLoginEnabled
Authentication/Registration/ExternalLoginEnabled
Authentication/Registration/OpenRegistrationEnabled
Authentication/Registration/InvitationEnabled
Authentication/Registration/RememberMeEnabled
Authentication/Registration/ResetPasswordEnabled

Sign in by using a local identity or external identity


Sign up by using a local identity or external identity

Redeem an invitation code manually

Forgot password or password reset


Returning visitors who require a password reset (and have previously specified an email address on their user
profile) can request a password reset token to be sent to their email account. A reset token allows its owner to
choose a new password. Alternatively, the token can be abandoned, leaving the user’s original password
unmodified.
Related site settings:
Authentication/Registration/ResetPasswordEnabled
Authentication/Registration/ResetPasswordRequiresConfirmedEmail

Related process: Send a password reset to a contact


1. Customize the email in the workflow as necessary.
2. Submit the email to invoke the process.
3. The visitor is prompted to check email.
4. The visitor receives the password reset email with instructions.
5. The visitor returns to the reset form.
6. The password reset is complete.

Redeem an invitation
Redeeming an invitation code allows a registering visitor to be associated with an existing contact record that was
prepared in advance specifically for that visitor. Typically, the invitation codes are sent out by email, but you can
use a general code submission form to send codes though other channels. After a valid invitation code is
submitted, the normal user registration (sign-up) process takes place to set up the new user account.
Related site settings:
Authentication/Registration/InvitationEnabled

Related process: Send invitation


The email sent by this workflow must be customized by using the URL to the redeem invitation page on the
portal: https://portal.contoso.com/register/?returnurl=%2f&invitation={Invitation Code(Invitation)}
1. Create an invitation for a new contact.

2. Customize and save the new invitation.

3. Process: Send invitation


4. Customize the invitation email.
5. The invitation email opens the redemption page.
6. The user signs up by using the submitted invitation code.

Manage user accounts through profile pages


Authenticated users manage their user accounts through the Security navigation bar of the profile page. Users
are not limited to the single local account or single external account they chose at user registration time. Users
who have an external account can choose to create a local account by applying a username and password. Users
who started with a local account can choose to associate multiple external identities to their account. The profile
page is also where the user is reminded to confirm their email address by requesting a confirmation email to be
sent to their email account.
Related site settings:
Authentication/Registration/LocalLoginEnabled
Authentication/Registration/ExternalLoginEnabled
Authentication/Registration/TwoFactorEnabled

Set or change a password


A user who has an existing local account can apply a new password by providing the original password. A user
who does not have a local account can choose a username and password to set up a new local account. The
username cannot be changed after it is set.
Related site settings:
Authentication/Registration/LocalLoginEnabled

Related process:
Create a username and password.
Change an existing password.

Confirm an email address


Changing an email address (or setting it for the first time) puts it into an unconfirmed state. The user can request
a confirmation email to be sent to their new email address, and the email will include instructions to the user for
completing the email confirmation process.
Related process: Send an email confirmation to a contact
1. Customize the email in the workflow as necessary.
2. The user submits a new email, which is in an unconfirmed state.
3. The user checks email for confirmation.
4. Process: Send email confirmation to contact
5. Customize the confirmation email.
6. The user clicks the confirmation link to complete the confirmation process.

NOTE
Ensure that the primary email is specified for the contact because the confirmation email is sent only to the primary email
(emailaddress1) of the contact. The confirmation email is not sent to the secondary email (emailaddress2) or alternate email
(emailaddress3) of the contact record.

Enable two-factor authentication


The two-factor authentication feature increases user account security by requiring proof of ownership of a
confirmed email in addition to the standard local or external account sign-in. A user trying to sign in to an
account that has two-factor authentication enabled is sent a security code to the confirmed email associated with
their account. The security code must be submitted to complete the sign-in process. A user can choose to
remember the browser that successfully passed the verification, so that the security code will not be required for
subsequent sign-ins from the same browser. Each user account enables this feature individually and requires a
confirmed email.

WARNING
If you create and enable the Authentication/Registration/MobilePhoneEnabled site setting to enable the legacy
functionality, an error will occur. This site setting is not provided out of the box and not supported by portals.

Related site settings:


Authentication/Registration/TwoFactorEnabled
Authentication/Registration/RememberBrowserEnabled

Related Process: Send email two-factor code to a contact


1. Enable two-factor authentication.
2. Choose to receive the security code by email.
3. Wait for the email that contains the security code.
4. Process: Send Email Two Factor Code To Contact.
5. Two-factor authentication can be disabled.

Manage external accounts


An authenticated user may connect (register) multiple external identities to their user account, one from each
configured identity provider. After the identities are connected, the user may choose to sign in by using any of the
connected identities. Existing identities can also be disconnected, as long as a single external or local identity
remains.
Related Site Settings:
Authentication/Registration/ExternalLoginEnabled

External Identity Provider Site Settings


1. Select a provider to connect to your user account.

2. Sign in by using the provider you want to connect.


The provider is now connected. The provider can also be disconnected.

Enable ASP.NET identity authentication


The following describes the settings for enabling and disabling various authentication features and behaviors:

SITE SETTING NAME DESCRIPTION

Authentication/Registration/LocalLoginEnabled Enables or disables local account sign-in based on a


username (or email) and password. Default: false

Authentication/Registration/LocalLoginByEmail Enables or disables local account sign-in using an email


address field instead of a username field. Default: false

Authentication/Registration/ExternalLoginEnabled Enables or disables external account sign-in and registration.


Default: true

Authentication/Registration/RememberMeEnabled Selects or clears a Remember me? check box on local sign-in


to allow authenticated sessions to persist even when the web
browser is closed. Default: true

Authentication/Registration/TwoFactorEnabled Enables or disables the option for users to enable two-factor


authentication. Users with a confirmed email address can opt
into the added security of two-factor authentication. Default:
false

Authentication/Registration/RememberBrowserEnabled Selects or clears a Remember browser? check box on second-


factor validation (email code) to persist the second-factor
validation for the current browser. The user will not be
required to pass the second-factor validation for subsequent
sign-ins as long as the same browser is being used. Default:
true

Authentication/Registration/ResetPasswordEnabled Enables or disables the password reset feature. Default: true


SITE SETTING NAME DESCRIPTION

Authentication/Registration/ResetPasswordRequiresConfirme Enables or disables password reset for confirmed email


dEmail addresses only. If enabled, unconfirmed email addresses
cannot be used to send password reset instructions. Default:
false

Authentication/Registration/TriggerLockoutOnFailedPassword Enables or disables recording of failed password attempts. If


disabled, user accounts will not be locked out. Default: true

Authentication/Registration/IsDemoMode Enables or disables a demo mode flag to be used in


development or demonstration environments only. Do not
enable this setting on production environments. Demo mode
also requires the web browser to be running locally to the
web application server. When demo mode is enabled, the
password reset code and second-factor code are displayed to
the user for quick access. Default: false

Authentication/Registration/LoginButtonAuthenticationType If a portal only requires a single external identity provider (to


handle all authentication), this allows the Sign-In button of
the header nav bar to link directly to the sign-in page of that
external identity provider (instead linking to the intermediate
local sign-in form and identity provider selection page). Only
a single identity provider can be selected for this action.
Specify the AuthenticationType value of the provider.
For a single sign-on configuration using OpenIdConnect,
such as using Azure Active Directory B2C, the user needs to
provide the Authority.
For OAuth2 based providers the accepted values are:
Facebook, Google, Yahoo, [!INCLUDE[cc-microsoft]
(../../../includes/cc-microsoft.md)], LinkedIn,
Yammer,
or Twitter
For WS-Federation based providers, use the value specified
for the
Authentication/WsFederation/ADFS/AuthenticationType
and
Authentication/WsFederation/[!INCLUDE[pn-azure-
shortest](../../../includes/pn-azure-shortest.md)]/\
[provider\]/AuthenticationType
site settings. Examples:
https://adfs.contoso.com/adfs/services/trust, Facebook-
0123456789, Google, Yahoo!, uri:WindowsLiveID.

Enable or disable user registration


The following describes the settings for enabling and disabling user registration (sign-up) options:

SITE SETTING NAME DESCRIPTION

Authentication/Registration/Enabled Enables or disables all forms of user registration. Registration


must be enabled for the other settings in this section to take
effect. Default: true

Authentication/Registration/OpenRegistrationEnabled Enables or disables the sign-up registration form for creating


new local users. The sign-up form allows any anonymous
visitor to the portal to create a new user account. Default:
true
SITE SETTING NAME DESCRIPTION

Authentication/Registration/InvitationEnabled Enables or disables the invitation code redemption form for


registering users who possess invitation codes. Default: true

Authentication/Registration/CaptchaEnabled Enables or disables captcha on the user registration page.


Default: false
Note: This site setting might not be available by default. To
enable captcha, you must create the site setting and set its
value to true.

NOTE
Ensure that the primary email is specified for the user because registration is done by using the primary email
(emailaddress1) of the user. The user cannot be registered by using the secondary email (emailaddress2) or alternate email
(emailaddress3) of the contact record.

User credential validation


The following describes the settings for adjusting username and password validation parameters. Validation
occurs when users sign up for a new local account or change a password.

SITE SETTING NAME DESCRIPTION

Authentication/UserManager/PasswordValidator/EnforcePass Whether the password contains characters from three of the


wordPolicy following categories:
Uppercase letters of European languages (A through
Z, with diacritic marks, Greek and Cyrillic characters)
Lowercase letters of European languages (a through z,
sharp-s, with diacritic marks, Greek and Cyrillic
characters)
Base 10 digits (0 through 9)
Nonalphanumeric characters (special characters) (for
example, !, $, #, %)
Default: true. For more information: Password policy.

Authentication/UserManager/UserValidator/AllowOnlyAlphan Whether to allow only alphanumeric characters for the


umericUserNames username. Default: false. For more information:
UserValidator<TUser,
TKey>.AllowOnlyAlphanumericUserNames.

Authentication/UserManager/UserValidator/RequireUniqueE Whether a unique email address is needed for validating the


mail user. Default: true. For more information:
UserValidator<TUser, TKey>.RequireUniqueEmail.

Authentication/UserManager/PasswordValidator/RequiredLen The minimum required password length. Default: 8. For more


gth information: PasswordValidator.RequiredLength.

Authentication/UserManager/PasswordValidator/RequireNon Whether the password requires a non-letter or digit character.


LetterOrDigit Default: false. For more information:
PasswordValidator.RequireNonLetterOrDigit.
SITE SETTING NAME DESCRIPTION

Authentication/UserManager/PasswordValidator/RequireDigit Whether the password requires a numeric digit (from 0


through 9). Default: false. For more information:
PasswordValidator.RequireDigit.

Authentication/UserManager/PasswordValidator/RequireLow Whether the password requires a lowercase letter (from a


ercase through z). Default: false. For more information:
PasswordValidator.RequireLowercase.

Authentication/UserManager/PasswordValidator/RequireUpp Whether the password requires an uppercase letter (from A


ercase through Z). Default: false. For more information:
PasswordValidator.RequireUppercase.

User account lockout settings


The following describes the settings that define how and when an account becomes locked from authentication.
When a certain number of failed password attempts are detected in a short period of time, the user account is
locked for a period of time. The use can try again after the lockout period elapses.

SITE SETTING NAME DESCRIPTION

Authentication/UserManager/UserLockoutEnabledByDefault Indicates whether the user lockout is enabled when users are
created. Default: true. For more information:
UserManager<TUser, TKey>.UserLockoutEnabledByDefault.

Authentication/UserManager/DefaultAccountLockoutTimeSpa The default amount of time that a user is locked out for after
n Authentication/UserManager/MaxFailedAccessAttemptsBefor
eLockout is reached. Default: 24:00:00 (1 day). For more
information: UserManager<TUser,
TKey>.DefaultAccountLockoutTimeSpan.

Authentication/UserManager/MaxFailedAccessAttemptsBefor The maximum number of access attempts allowed before a


eLockout user is locked out (if lockout is enabled). Default: 5. For more
information: UserManager<TUser,
TKey>.MaxFailedAccessAttemptsBeforeLockout.

Authentication/ApplicationCookie/ExpireTimeSpan The default amount of time cookie authentication sessions


are valid for. Default: 24:00:00 (1 day). For more information:
CookieAuthenticationOptions.ExpireTimeSpan.

Cookie authentication site settings


Settings for modifying the default authentication cookie behavior. Defined by the CookieAuthenticationOptions
class.

SITE SETTING NAME DESCRIPTION

Authentication/ApplicationCookie/AuthenticationType The type of the application authentication cookie. Default:


ApplicationCookie. For more information:
AuthenticationOptions::AuthenticationType.
SITE SETTING NAME DESCRIPTION

Authentication/ApplicationCookie/CookieName Determines the cookie name used to persist the identity.


Default: .AspNet.Cookies. For more information:
CookieAuthenticationOptions::CookieName.

Authentication/ApplicationCookie/CookieDomain Determines the domain used to create the cookie. For more
information: CookieAuthenticationOptions::CookieDomain.

Authentication/ApplicationCookie/CookiePath Determines the path used to create the cookie. Default: /. For
more information: CookieAuthenticationOptions::CookiePath.

Authentication/ApplicationCookie/CookieHttpOnly Determines if the browser should allow the cookie to be


accessed by client-side javascript. Default: true. For more
information: CookieAuthenticationOptions::CookieHttpOnly.

Authentication/ApplicationCookie/CookieSecure Determines if the cookie should only be transmitted on


HTTPS request. Default: SameAsRequest. For more
information: CookieAuthenticationOptions::CookieSecure.

Authentication/ApplicationCookie/ExpireTimeSpan Controls how much time the application cookie will remain
valid from the point it is created. Default: 14 days. For more
information: CookieAuthenticationOptions::ExpireTimeSpan.

Authentication/ApplicationCookie/SlidingExpiration The SlidingExpiration is set to true to instruct the middleware


to re-issue a new cookie with a new expiration time any time
it processes a request which is more than halfway through
the expiration window. Default: true. For more information:
CookieAuthenticationOptions::SlidingExpiration.

Authentication/ApplicationCookie/LoginPath The LoginPath property informs the middleware that it


should change an outgoing 401 Unauthorized status code
into a 302 redirection onto the given login path. Default:
~/signin. For more information:
CookieAuthenticationOptions::LoginPath.

Authentication/ApplicationCookie/LogoutPath If the LogoutPath is provided the middleware then a request


to that path will redirect based on the ReturnUrlParameter.
For more information:
CookieAuthenticationOptions::LogoutPath.

Authentication/ApplicationCookie/ReturnUrlParameter The ReturnUrlParameter determines the name of the query


string parameter which is appended by the middleware when
a 401 Unauthorized status code is changed to a 302 redirect
onto the login path. For more information:
CookieAuthenticationOptions::ReturnUrlParameter.

Authentication/ApplicationCookie/SecurityStampValidator/Vali The period of time between security stamp validations.


dateInterval Default: 30 mins. For more information:
SecurityStampValidator::OnValidateIdentity.

Authentication/TwoFactorCookie/AuthenticationType The type of the two-factor authentication cookie. Default:


TwoFactorCookie. For more information:
AuthenticationOptions::AuthenticationType.

Authentication/TwoFactorCookie/ExpireTimeSpan Controls how much time the two-factor cookie will remain
valid from the point it is created. Default: 5 mins. For more
information: CookieAuthenticationOptions::ExpireTimeSpan.
SITE SETTING NAME DESCRIPTION

See also
Configure portal authentication
OAuth2 provider settings for portals
Open ID Connect provider settings for portals
WS -Federation provider settings for portals
SAML 2.0 provider settings for portals
Azure AD B2C provider settings for portals
1/23/2020 • 11 minutes to read • Edit Online

Azure Active Directory (Azure AD ) powers Office 365 and Dynamics 365 services for employee or internal
authentication. Azure Active Directory B2C is an extension to that authentication model that enables external
customer sign-ins through local credentials and federation with various common social identity providers.
A portal owner can configure the portal to accept Azure AD B2C as an identity provider. Azure AD B2C supports
Open ID Connect for federation.
In the process of configuring Azure AD B2C as an identity provider for your portal, multiple values are generated
that you will use later while you configure the portal. You can note these values in the following table. While
configuring the portal, replace the variable name with the values you note here.

VARIABLE NAME VALUE DESCRIPTION

Application-Name Name of the application that represents


the portal as a relying party

Application-ID The Application ID associated with the


application created in Azure Active
Directory B2C.

Policy-Signin-URL The Issuer (iss) URL defined in the


metadata endpoint.

Federation-Name A unique name to identify the type of


federation provider such as 'B2C'. This
will be used in Site Setting names to
group configuration settings for this
specific provider.

Use Azure AD B2C as an identity provider for your portal


1. Sign in to your Azure portal.
2. Create an Azure AD B2C tenant.
3. Select Azure AD B2C on the leftmost navigation bar.
4. Create Azure application.

NOTE
You must choose Yes for the Allow implicit flow field and specify your portal URL in the Reply URL field. The value
in the Reply URL field should be in the format [portal domain]/signin-[Federation-Name]. For example,
https://contosocommunity.microsoftcrmportals.com/signin-B2C .

5. Copy the application name, and enter it as the value of Application-Name in the preceding table.
6. Copy the application ID, and enter it as the value of Application-ID in the preceding table.
7. Create a sign-up or sign-in policy.
8. Select the policy, and then select Edit.
9. Select Token, session & SSO config.
10. From the Issuer (iss) claim list, select the URL that has /tfp in its path.
11. Save the policy.
12. Select the URL in the Metadata endpoint for this policy field.
13. Copy the value of the issuer field and enter it as the value of Policy-Signin-URL in the preceding table.

Portal configuration
After creating and configuring the B2C tenant in Azure, you must configure your portal to federate with Azure AD
B2C by using the Open ID Connect protocol. You must create a unique name for your federation to Azure AD B2C
—for example, B2C —and store it as the value of the Federation-Name variable in the above table.
Configure your portal
1. Open the Portal Management app.
2. Go to Portals > Websites.
3. Select the website record for which Azure AD B2C needs to be enabled.
4. Go to Site Settings.
5. Create the following site settings:
Name: Authentication/OpenIdConnect/[Federation-Name]/Authority
Value: [Policy-Signin-URL ]
Name: Authentication/OpenIdConnect/[Federation-Name]/ClientId
Value: [Application-ID ]
Name: Authentication/OpenIdConnect/[Federation-Name]/RedirectUri
Value: [portal domain]/signin-[Federation-Name]
For example, https://mysite.com/signin-b2c

6. To support a federated sign-out, create the following site setting:


Name: Authentication/OpenIdConnect/[Federation-Name]/ExternalLogoutEnabled
Value: true
7. To hardcode your portal to a single identity provider, create the following site setting:
Name: Authentication/Registration/LoginButtonAuthenticationType
Value: [Policy-Signin-URL ]
8. To support password reset, create the required site settings described here.
9. To support claims mapping, create the required site settings described here.
For a complete list of related site settings, see here.
Password reset
The following site settings are required if you want to support password reset with Azure AD B2C local accounts:
SITE SETTING DESCRIPTION

Authentication/OpenIdConnect/[Federation- ID of the password reset policy.


Name/PasswordResetPolicyId

Authentication/OpenIdConnect/[Federation- A comma-delimited list of issuers that includes the [Policy-


Name]/ValidIssuers Signin-URL] and the issuer of the password reset policy.

Authentication/OpenIdConnect/[Federation- ID of the sign-in or sign-up policy.


Name]/DefaultPolicyId

Related site settings


You can create or configure the following site settings in portals to support Azure AD B2C as an identity provider:

SITE SETTING DESCRIPTION

Authentication/Registration/ProfileRedirectEnabled Specifies whether the portal can redirect users to the profile
page after successful sign-in. By default, it is set to true.

Authentication/Registration/EmailConfirmationEnabled Specifies whether email validation is required. By default, it is


set to true.

Authentication/Registration/LocalLoginEnabled Specifies whether local sign-in is required. By default, it is set


to true.

Authentication/Registration/ExternalLoginEnabled Enables or disables external authentication.

Authentication/Registration/AzureADLoginEnabled Enables or disables Azure AD as an external identity provider.


By default, it is set to true.

Authentication/OpenIdConnect/[Federation- Enables or disables federated sign-out. When set to true,


Name]/ExternalLogoutEnabled users are redirected to the federated sign-out user experience
when they sign out from the portal. When set to false, users
are signed out from the portal only. By default, it is set to
false.

Authentication/LoginTrackingEnabled Enables or disables tracking the user's last sign-in. When set
to true, the date and time are displayed in the Last
Successful Sign-in field on the contact record. By default, this
is set to false.

Authentication/OpenIdConnect/[Federation- Enables or disables the registration requirement for the


Name]/RegistrationEnabled existing identity provider. When set to true, registration is
enabled for the existing provider only if the site setting
Authentication/Registration/Enabled is also set to true. By
default, it is set to true.

Authentication/OpenIdConnect/[Federation- Specifies the URL within the portal to redirect to after a user
Name]/PostLogoutRedirectUri signs out.

Related content snippet


If registration is disabled for a user after the user has redeemed an invitation, display a message by using the
following content snippet:
Name: Account/Register/RegistrationDisabledMessage
Value: Registration has been disabled.

Customize the Azure AD B2C user interface


Azure AD B2C supports user interface customization. You can customize the user experience for sign-up and sign-
in scenarios.
Step 1: Create a web template
Create a web template by using the following values:
Name: Azure AD B2C Custom Page
Source: Use the following sample web template source HTML.

<!DOCTYPE html>
<html lang=en-US>
<head>
<meta charset=utf-8>
<meta name=viewport content=width=device-width, initial-scale=1.0>
<meta http-equiv=X-UA-Compatible content=IE=edge>
<title>
{{ page.title | h }}
</title>
<link href={{ request.url | base }}/bootstrap.min.css rel=stylesheet>
<link href={{ request.url | base }}/theme.css rel=stylesheet>
<style>
.page-heading {
padding-top: 20px;
}
.page-copy {
margin-bottom: 40px;
}
.highlightError {
border: 1px solid #cb2027!important;
background-color: #fce8e8!important;
}
.attrEntry .error.itemLevel {
display: none;
color: #cb2027;
font-size: .9em;
}
.error {
color: #cb2027;
}
.entry {
padding-top: 8px;
padding-bottom: 0!important;
}
.entry-item {
margin-bottom: 20px;
}
.intro {
display: inline;
margin-bottom: 5px;
}
.pageLevel {
width: 293px;
text-align: center;
margin-top: 5px;
padding: 5px;
font-size: 1.1em;
height: auto;
}
#panel, .pageLevel, .panel li, label {
#panel, .pageLevel, .panel li, label {
display: block;
}
#forgotPassword {
font-size: .75em;
padding-left: 5px;
}
#createAccount {
margin-left: 5px;
}
.working {
display: none;
background:
url(data:image/gif;base64,R0lGODlhbgAKAPMAALy6vNze3PTy9MTCxOTm5Pz6/Ly+vNTS1Pz+/�N0Jp6BUJ9EBIISAQAh+QQJCQAKACx
RAAIABgAGAAAEE1ClYU4RIIMTdCaegVCfRASCEgEAOw==) no-repeat;
height: 10px;
width: auto;
}
.divider {
margin-top: 20px;
margin-bottom: 10px;
}
.divider h2 {
display: table;
white-space: nowrap;
font-size: 1em;
font-weight: 700;
}
.buttons {
margin-top: 10px;
}
button {
width:auto;
min-width:50px;
height:32px;
margin-top:2px;
-moz-border-radius:0;
-webkit-border-radius:0;
border-radius:0;
background:#2672E6;
border:1px solid #FFF;
color:#fff;
transition:background 1s ease 0s;
font-size:100%;
padding:0 2px
}

button:hover {
background:#0F3E83;
border:1px solid #3079ed;
-moz-box-shadow:0 0 0;
-webkit-box-shadow:0 0 0;
box-shadow:0 0 0
}
.password-label label {
display: inline-block;
vertical-align: baseline;
}
img {
border:0
}
.divider {
margin-top:20px;
margin-bottom:10px
}
.divider h2 {
display:table;
white-space:nowrap;
font-size:1em;
font-weight:700
font-weight:700
}
.divider h2:after,.divider h2:before {
border-top:1px solid #B8B8B8;
content:'';
display:table-cell;
position:relative;
top:.7em;
width:50%
}
.divider h2:before {
right:1.8%
}
.divider h2:after {
left:1.8%
}
.verificationErrorText {
color:#D63301
}
.options div {
display:inline-block;
vertical-align:top;
margin-top:7px
}
.accountButton,.accountButton:hover {
background-
image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAh1BMVEX///9QUFBOTk5LS0tERERCQk
I/Pz9ISEg6OjpGRkZNTU08PDyAgID09PSlpaWWlpZxcXFgYGBZWVlUVFT6+vrx8fHt7e3s7Ozo6Oji4uLJycnGxsa4uLiqqqqgoKCNjY2JiYmG
hoZra2tmZmb7+/vu7u7d3d3U1NTNzc2+vr67u7usrKx7e3vprNQnAAAA8klEQVQ4y63Q127DMAxAUZpDwyMeSdqsNqu7/f/va6zahgGJKAr0vg
k6DyQh+6V/BiTOOeNRA9zuAWBdM6WBlPDTvaUUoAuMrT0mgNvA1IJjQB3MKjACvp6DK0WAH+agtH8H9jQHLUUgz7Uhx8xOXzNESxirLCYA2mw8
tacI5FyIYXq8A9ge2Qs6oTnw2e2ruho2rjBcXJ4ADh3jBOQLQnVhRFx2gNDZ4ACogbHXj/ft9Dj5AcgbJFu5AThQWuYBIGmgtAFQo4EFB+CPGt
hJAPypgY3BHsheA5UNwLyAvsYNoDyroKUe4EoFTQ/yDtTONvsGUJ8KTUYyH+UAAAAASUVORK5CYII=);
background-repeat:no-repeat
}
.accountButton {
border:1px solid #FFF;
color:#FFF;
margin-left:0;
margin-right:2px;
transition:background-color 1s ease 0s;
-moz-border-radius:0;
-webkit-border-radius:0;
border-radius:0;
text-align:center;
word-wrap:break-word;
height:34px;
width:158px;
padding-left:30px;
background-color:#505050;
}
.accountButton:hover {
background-color:#B9B9B9;
border:1px solid #FFF;
-moz-box-shadow:0 0 0;
-webkit-box-shadow:0 0 0;
box-shadow:0 0 0
}
.accountButton:focus {
outline:gold solid 1px
}
#MicrosoftAccountExchange {
background-
image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAPFBMVEU1pe/////t+v4uoe5btvNixP
VVwfUsoe9tyfXU7/y95vu24vrd9f5NtfLH6/ys3/o/sPE6qfD2/f+f2vnAysuQAAAAaElEQVQ4y93SORKAIAwFUEGCsoT1/nd1JkkDFhY24qt+
8VMkk20lu6DAaVBOBsVKsuO8aYo08IqlYyxoRTQExfyKheRIgu5Yl4KoVhSUgNOhoiYRsmb5g2u+LtzXDNOhjKgoAZ9/8k8uZWsGqcIav5wAAA
AASUVORK5CYII=);
background-color:#33A7F2
}
#MicrosoftAccountExchange:hover {
background-color:#ADDBF9
background-color:#ADDBF9
}
#GoogleExchange {
background-
image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAb1BMVEXcTkH////cTD/bSj3ZQDLYOy
zaRDbeV0vbSDrZPS/66Obyv7rsnpfpkorjcWfgZlvXOCr++Pj5393haFz88/L88fD67Or319T1zsv1zsrxuLPuqaLuqKLoi4LlfXTgYlbWMyTW
MiPwtrHwta/fXVH/sCIIAAAAmElEQVQ4y+2RyQ7DIBBDMcwAIXvovqXb/39jRaX0AEmr5px3tSV7PGLhX6TVRFpN61l9zPNS6kn9gDcXO67zDn
CnO2BCiNIyMtgKKJgyY2zQ68JEDtqju0nFTcOsxPUMw1GDDUqt+tY51/YNVlhvacTgEfCDIY0Q/lkBSg4RaUmmDo4/JdMzHy1Q2ejMeCj6PrXQ
P5+1MI8X0Y4HL4c826EAAAAASUVORK5CYII=);
background-color:#DC4E41
}
#GoogleExchange:hover {
background-color:#F1B8B3
}
#TwitterExchange {
background-
image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAdVBMVEVgqd3///9Ypdtdp9xaptxSot
pQodlNn9lWo9pUo9rX6Pa+2vGTw+iLvuZlqt79/P7K4PO62O+y0+6hyutysuD2+fzi7vne6/fT5PTE3fKs0O2lzeuZx+l7tuJqrd71+Pzz9vzn
8PnQ4/SCueSAueNsrt9InNh7sQwBAAAAwklEQVQ4y92PRw6EMAwAXeIkdBbY3uv/n7gSAoLDD5hbPCPZgZVihEgYgNSUpmfS7bfbtHS2nReyL2
Qoc+yp8ZRAwCEWjgGAPQ7sssKoAGsWBrrgyMZCwD77Uel+59E3Tt14xZ7qlY7BRf1CDgeMKMw8sBXGlKxWtLGvHCgkQ80m0YHpjjq4sQ74pn1m
ISLJVSAMiwJO98l/TWSNF1eGKzqKfZ7Vj0mnHHwodpP+WIYlZP373DTtVWxYr2FD3pOBdfIHhOAHYHQI9VgAAAAASUVORK5CYII=);
background-color:#60A9DD
}
#TwitterExchange:hover {
background-color:#BFDCF1
}
#FacebookExchange {
background-
image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAaVBMVEU7W5z///85Wps3WJsiRo8xU5
fw8vYyUpY0VZiAj70pS5OBkb0vUpb7+fwsTpTR1ud6irllerBPaqX09fnx8vfs7fSQoMZxg7VsgLNGY6FCX58ZP4v++/7r7vTZ3OupstGIlsFW
calDYaCK3qwDAAAAnklEQVQ4y+XQyw7CIBAFUBgc5VUoWGtb3/7/RyoYkyZAiSsXvdt7kstA/hRg/B0GpZ6byQ3Dw0NBaH+lMYRle3T0kwayAC
RdBrr/gnN+QtpQWv8cR4DswiUAjozlz4RdF8AmlnmwjaDQImoZwQkRedoToUS7D+ColGoTwQidx8oEQDMHN1MBva5MOL70SCHuE1TOhOpHrRt0
FWAOP4IX8PsG2qEOR30AAAAASUVORK5CYII=);
background-color:#3B5B9C
}
#FacebookExchange:hover {
background-color:#B0BDD7
}
#LinkedInExchange {
background-
image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAb1BMVEUAe7b///8AdrMklscAc7EAeL
UAcbB5ttifzeMqmckAdLIAaqz7+/6PxeAShr0CgLkAba4nmMctksTv9Puw1eij0OWGvNtfrNJNo80YjMAeib/D4vGt3Oy82+yfzOOCvtyJvdx3
tddirtI/ncoxmMj9KsrQAAAAw0lEQVQ4y9WSVw7DIAxAG8CkjJDVzO5x/zMWk0RNJaB/kfo+sGUeCMvstgI4J7F9aS5NxSLnTWLpZVDgexTqIi
ycUNBhgTxRyCKPYJ3dl7sITCkO+FyLXaWU310DscASOesf3ahWChGJ5cb4ASO5Joiu2EegWEmZa1c3yUwOHmHNuQgJup4CgF8YlKpcMhKvkNmb
1REz6hdetsyziIBldv8lpH8ouGm28zQFCu2SOSAXlJYGYCgpFThEMFPm/zCryja8Acy7CRfMrcKPAAAAAElFTkSuQmCC);
background-color:#0077B5
}
#LinkedInExchange:hover {
background-color:#99CAE1
}
#AmazonExchange {
background-image:url(https://images-na.ssl-images-
amazon.com/images/G/01/lwa/btnLWA_gold_156x32.png);
background-color:#FFF;
color:transparent
}

#next {
-moz-user-select:none;
user-select:none;
cursor:pointer;
width:auto;
padding-left:10px;
padding-right:10px;
height:30.5px;
-moz-border-radius:0;
-webkit-border-radius:0;
border-radius:0;
background:#2672E6;
border:1px solid #FFF;
border:1px solid #FFF;
color:#fff;
transition:background 1s ease 0s;
font-size:100%
}
#next:hover {
background:#0F3E83;
border:1px solid #FFF;
box-shadow:0 0 0
}
#next:hover,.accountButton:hover {
-moz-box-shadow:0 0 0;
-webkit-box-shadow:0 0 0;
box-shadow:0 0 0;
}
</style>
</head>
<body>
<div class=navbar navbar-inverse navbar-static-top role=navigation>
<div class=container>
<div class=navbar-header>
<div class=visible-xs-block>
{{ snippets[Mobile Header] }}
</div>
<div class=visible-sm-block visible-md-block visible-lg-block navbar-brand>
{{ snippets[Navbar Left] }}
</div>
</div>
</div>
</div>
<div class=container>
<div class=page-heading>
<ul class=breadcrumb>
<li>
<a href={{ request.url | base }} title=Home>Home</a>
</li>
<li class=active>{{ page.title | h}}</li>
</ul>
{% include 'Page Header' %}
</div>
<div class=row>
<div class=col-md-12>
{% include 'Page Copy' %}
<div id=api></div>
</div>
</div>
</div>
<footer role=contentinfo>
<div class=footer-top hidden-print>
<div class=container>
<div class=row>
<div class=col-md-6 col-sm-12 col-xs-12 text-left>
{{ snippets[About Footer] }}
</div>
<div class=col-md-6 col-sm-12 col-xs-12 text-right>
<ul class=list-social-links>
<li><a href=#><span class=sprite sprite-facebook_icon></span></a></li>
<li><a href=#><span class=sprite sprite-twitter_icon></span></a></li>
<li><a href=#><span class=sprite sprite-email_icon></span></a></li>
</ul>
</div>
</div>
</div>
</div>
<div class=footer-bottom hidden-print>
<div class=container>
<div class=row>
<div class=col-md-4 col-sm-12 col-xs-12 text-left>
{{ snippets[Footer] | liquid }}
</div>
<div class=col-md-8 col-sm-12 col-xs-12 text-left >
</div>
</div>
</div>
</div>
</footer>
</body>
</html>

Step 2: Create a page template


Create the following page template:
Name: Azure AD B2C Custom Page
Type: Web Template
Web Template: Azure AD B2C Custom Page
Use Website Header and Footer: Clear this check box
Step 3: Create a webpage
Create the following webpage:
Name: Sign-in
Parent Page: Home
Partial Url: azure-ad-b2c-sign-in
Page Template: Azure AD B2C Custom Page
Publishing State: Published
Step 4: Create site settings
Site settings are required to configure cross-origin resource sharing (CORS ) to allow Azure AD B2C to request the
custom page and inject the sign-in or sign-up user interface. Create the following site settings.

NAME VALUE

HTTP/Access-Control-Allow-Methods GET, OPTIONS

HTTP/Access-Control-Allow-Origin https://login.microsoftonline.com

For a complete list of other CORS settings, see CORS protocol support.
Step 5: Azure configuration
1. Sign in to your Azure portal.
2. Navigate to the Azure AD B2C Tenant Management blade.
3. Navigate to Settings > Sign-up or sign-in policies. A list of available policies is displayed.
4. Select the policy you want to edit.
5. Select Edit.
6. Select Edit policy > Page UI customization > Unified sign-up or sign-in page
7. Set Use custom page to Yes.
8. Set Custom page URI to the URL of the Azure AD B2C Custom Page webpage created in step 3 of this
procedure. For example, https://mydomain.com/azure-ad-b2c-sign-in .
9. Select OK.

Claims mapping
When users sign in, either for the first time or subsequently, the federated identity provider provides claims based
on its database regarding the users' signing in. These claims are configurable in the identity provider.
Azure AD B2C email claims
Azure AD B2C sends the email claim as a collection. The portal accepts the first email provided in the collection as
the primary email address of the contact.
Claims to support sign-up scenarios
When a new customer who does not exist in Common Data Service is provisioned, the inbound claims can be
used to seed the new contact record that the portal will create. Common claims can include first and last name,
email address, and phone number, but they are configurable. The following site setting is required:
Name: Authentication/OpenIdConnect/[Federation-Name]/RegistrationClaimsMapping
Description: List of logical name/claim pairs to be used to map claim values to attributes in the contact record
created during registration.
Format: attribute1=claim1,attribute2=claim2,attribute3=claim3
For example:
firstname=https://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname,lastname=https://schemas.xmlso
ap.org/ws/2005/05/identity/claims/surname,jobtitle=jobTitle

NOTE
Ensure that you map the email address to the primary email (emailaddress1) of the contact. If you have added secondary
email (emailaddress2) or alternate email (emailaddress3) to the contact record and mapped it to the email, identity
information will not be added to the contact and a new one will be created with the email address used for registration set in
the primary email (emailaddress1).

Claims to support sign-in scenarios


The data in Common Data Service and in the identity provider are not directly linked, so the data might get out of
sync. The portal should have a list of claims that you want to accept from any sign-in event to update in Common
Data Service. These claims can be a subset of, or equal to, the claims coming in from a sign-in scenario. This must
be configured separately from sign-in claims mapping, because you might not want to overwrite some key portal
attributes. The following site setting is required:
Name: Authentication/OpenIdConnect/[Federation-Name]/LoginClaimsMapping
Description: List of logical name/claim pairs to be used to map claim values to attributes in the contact record
created after sign-in.
Format: attribute1=claim1, attribute2=claim2, attribute3=claim3
For example:
firstname=https://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname,lastname=https://schemas.xmlso
ap.org/ws/2005/05/identity/claims/surname,jobtitle=jobTitle
The claim name is the CLAIM TYPE field listed next to the attribute in the sign-in policies Application claims.
Allow auto -association to a contact record based on email
Customers who have contact records with emails associated then launch a website where their external users will
sign in with Azure AD B2C through an email validation mechanism. The new sign-in should be associated with the
existing contact record instead of creating a duplicate record. This functionality only successfully maps a contact
that does not have an active identity, and the email address must be unique (not related to multiple contact
records). The following site settings are required:
Name: Authentication/[Protocol]/[Provider]/AllowContactMappingWithEmail
Description: Specifies whether contacts are mapped to a corresponding email. When set to true, this setting
associates a unique contact record with a matching email address, and then automatically assigns the external
identity provider to the contact after the user has successfully signed in. By default, it is set to false.
Name: Authentication/UserManager/UserValidator/RequireUniqueEmail
Description: Specifies whether a unique email address is needed for validating the user. When an existing contact
email address is used to sign-in, the setting must be set to false. By default, it is set to true that may cause sign-in
attempts to fail for contact records with email address already present.
Configure OAuth2 provider settings for portals
2/3/2020 • 5 minutes to read • Edit Online

The OAuth 2.0 based external identity providers involve registering an "application" with a third-party service to
obtain a "client ID" and "client secret" pair. Often this application requires specifying a redirect URL that allows the
identity provider to send users back to the portal (relying party). The client ID and client secret are configured as
portal site settings in order to establish a secure connection from relying party to identity provider. The settings
are based on the properties of the MicrosoftAccountAuthenticationOptions, TwitterAuthenticationOptions,
FacebookAuthenticationOptions, and GoogleOAuth2AuthenticationOptions classes.
The supported providers are:
Microsoft Account
Twitter
Facebook
Google
LinkedIn
Yahoo

Create OAuth applications


In general, if an OAuth provider uses app settings that require a redirect URI value, specify
https://portal.contoso.com/or https://portal.contoso.com/signin-\[provider depending on how the provider
performs redirect URI validation (some providers require the full URL path to be specified along with the domain
name). Substitute the name of the provider in place of [provider] in the redirect URI.

Google People API settings


NOTE
Google+ API is deprecated. We strongly recommend that you migrate to Google People API.

Following these steps to configure your Power Apps portal with [Google's OAuth 2.0 authentication] for user
authentication.
1. Open Google Developers Console.
2. Create an API project or open an existing project.
3. Select ENABLE APIS AND SERVICES from dashboard of APIs and Services.
4. Search and enable API Google People API.
5. Inside Google APIs, select Credentials on left navigation.

NOTE
If you have consent screen configured already with portals top level domain, you can skip steps 6 through 14 and
directly move to step 15. However, go through step 11 before moving to step 15 if your consent screen is
configured but portals top level domain is not added.
6. Select CONFIGURE CONSENT SCREEN.
7. Select External user type.
8. Select Create.
9. Type Application name and upload an image for logo if required.
10. Select appropriate Support email.
11. Type powerappsportals.com as the top level domain in Authorized domains. Use
microsoftcrmportals.com if you have not updated your Power Apps portal domain name. You can also
type a custom domain name if you have configured.
12. Provide links for home page, privacy policy and terms of service as required.
13. Select Save.
14. Select Credentials from left navigation menu.
15. Select OAuth client ID from the Create credentials drop down menu.
16. Select application type as Web application.
17. Type Name for the OAuth Client ID.
18. Type your Power Apps portal URL in Authorized JavaScript Origins list.
19. Type Authorized redirect URIs as the Power Apps portal URL followed by /signin-google. For example,
if portal URL is https://contoso.powerappsportals.com, authorized redirect URIs field should be
https://contoso.powerappsportals.com/signin-google.
20. Select Create.
21. Copy client ID and client secret from OAuth client dialog box and configure OAuth2 site settings in
Power Apps portals.

Facebook app settings


1. Open Facebook Developers App Dashboard
2. Select Add a New App.
3. Select Website.
4. Select Skip and Create App ID.
Specify a Display Name.
Choose a Category.
Select Create App ID.
5. While on the dashboard for the new app, go to Settings >Basic (tab) and add the following details:
App Domains (optional): portal.contoso.com
Contact Email: <email address of your choice>
Select Add Platform, and then select Website.
Site URL: https://portal.contoso.com/ or https://portal.contoso.com/signin-facebook
6. Select Save Changes.
7. Go to Status & Review > Status tab.
8. Select Yes when prompted to make the app and all its features available to the general public. You must
have filled in the valid data in Step 5 above to enable this setting.
Microsoft application settings
1. Open Microsoft account Developer Center
2. Select Create application and specify an Application name.
3. Select I accept to accept Terms and Conditions.
4. Go to Settings >API settings, and then set the redirect URL as https://portal.contoso.com/signin-microsoft

Twitter apps settings


1. Open Twitter Application Management.
2. Select Create New App.
Specify a Name and Description for your app.
Set the Website URL as https://portal.contoso.com.
Set the Callback URL as https://portal.contoso.com or https://portal.contoso.com/signin-twitter.
3. Select Create your Twitter application.

LinkedIn app settings


1. Open LinkedIn Developer Network.
2. Select Add New Application.
Specify an Application Name, Description, and so on.
Set Website URL as https://portal.contoso.com.
Set OAuth User Agreement/Default Scope: r_basicprofie and r_emailaddress
Set OAuth 2.0 Redirect url: https://portal.contoso.com/signin-linkedin.
3. Select Add Application.

Yahoo! YDN App settings


NOTE
Due to ongoing compatibility issues between the updated Yahoo YDN OAuth provider endpoint and Power Apps portals,
users are temporarily unable to authenticate with Yahoo identity provider.

1. Open Yahoo! Developer Network.


2. Select Create an App.
Specify an Application Name.
Application Type: Web Application.
Callback Domain: portal.contoso.com
3. Select Create App.

Create site settings by using OAuth2


The application dashboard for each provider will display the client ID (app ID, consumer key) and client secret
(app secret, consumer secret) for each application. Use these two values to configure the portal site settings.
NOTE
A standard OAuth2 configuration only requires the following settings (with Facebook as an example):
Authentication/OpenAuth/Facebook/ClientId
Authentication/OpenAuth/Facebook/ClientSecret

Substitute the [provider] tag in the site setting name with a specific identity provider name: Facebook, Google,
Yahoo,Microsoft, LinkedIn, or Twitter.

SITE SETTING NAME DESCRIPTION

Authentication/Registration/ExternalLoginEnabled Enables or disables external account sign-in and registration.


Default: true

Authentication/OpenAuth/[provider]/ClientId Required. The client ID value from the provider application. It


may also be referred to as an App ID or Consumer Key. The
following setting names are allowed for backwards
compatibility:
Authentication/OpenAuth/Twitter/ConsumerKey
Authentication/OpenAuth/Facebook/AppId
Authentication/OpenAuth/LinkedIn/ConsumerKey

Authentication/OpenAuth/[provider]/ClientSecret Required. The client secret value from the provider application.
It may also be referred to as an App Secret or Consumer
Secret. The following setting names are allowed for backwards
compatibility:
Authentication/OpenAuth/Twitter/ConsumerSecret
Authentication/OpenAuth/Facebook/AppSecret
Authentication/OpenAuth/LinkedIn/ConsumerSecret

Authentication/OpenAuth/[provider]/AuthenticationType The OWIN authentication middleware type. Example: yahoo.


authenticationoptions.authenticationtype.

Authentication/OpenAuth/[provider]/Scope A comma separated list of permissions to request.


microsoftaccountauthenticationoptions.scope.

Authentication/OpenAuth/[provider]/Caption The text that the user can display on a sign in user interface.
microsoftaccountauthenticationoptions.caption.

Authentication/OpenAuth/[provider]/BackchannelTimeout Timeout value in milliseconds for back channel


communications.
microsoftaccountauthenticationoptions.backchanneltimeout.

Authentication/OpenAuth/[provider]/CallbackPath The request path within the application's base path where the
user-agent will be returned.
microsoftaccountauthenticationoptions.callbackpath.

Authentication/OpenAuth/[provider]/SignInAsAuthenticationT The name of another authentication middleware which will be


ype responsible for actually issuing auserClaimsIdentity.
microsoftaccountauthenticationoptions.signinasauthentication
type.

Authentication/OpenAuth/[provider]/AuthenticationMode The OWIN authentication middleware mode.


security.authenticationoptions.authenticationmode.
See also
Configure portal authentication
Set authentication identity for a portal
Open ID Connect provider settings for portals
WS -Federation provider settings for portals
SAML 2.0 provider settings for portals
Configure Open ID Connect provider settings for
portals
1/23/2020 • 5 minutes to read • Edit Online

OpenID Connect external identity providers are services that conform to the Open ID Connect specifications.
Integrating a provider involves locating the authority (or issuer) URL associated with the provider. A configuration
URL can be determined from the authority which supplies metadata required during the authentication workflow. The
provider settings are based on the properties of the OpenIdConnectAuthenticationOptions class.
Examples of authority URLs are:
Google: https://accounts.google.com/https://accounts.google.com/.well-known/openid-configuration
Azure Active Directory: https://login.microsoftonline.com/<Azure AD Application>/
Each OpenID Connect provider also involves registering an application (similar to that of an OAuth 2.0 provider) and
obtaining a Client Id. The authority URL and the generated application Client Id are the settings required to enable
external authentication between the portal and the identity provider.

NOTE
The Google OpenID Connect endpoint is currently not supported because the underlying libraries are still in the early stages of
release with compatibility issues to address. The OAuth2 provider settings for portals endpoint can be used instead.

OpenID settings for Azure Active Directory


To get started, sign into the Azure Management Portal and create or select an existing directory. When a directory is
available follow the instructions to add an application to the directory.
1. Under the Applications menu of the directory, select Add.
2. Choose Add an application my organization is developing.
3. Specify a custom name for the application and choose the type web application and/or web API.
4. For the Sign-On URL and the App ID URI, specify the URL of the portal for both fields
https://portal.contoso.com/
5. At this point, a new application is created. Navigate to the Configure section in the menu.
Under the single sign-on section, update the first Reply URL entry to include a path in the URL:
https://portal.contoso.com/signin-azure-ad. This corresponds to the RedirectUri site setting value
6. Under the properties section, locate the client ID field. This corresponds to the ClientId site setting value.
7. In the footer menu, select View Endpoints and note the Federation Metadata Document field
The left portion of the URL is the Authority value and is in one of the following formats:
https://login.microsoftonline.com/01234567-89ab-cdef-0123-456789abcdef/
https://login.microsoftonline.com/contoso.onmicrosoft.com/
To get the service configuration URL, replace the FederationMetadata/2007-06/FederationMetadata.xml path tail with
the path .well-known/openid-configuration. For instance,
https://login.microsoftonline.com/contoso.onmicrosoft.com/.well-known/openid-configuration
This corresponds to the MetadataAddress site setting value.
Related site settings
Apply portal site settings referencing the above application.

NOTE
A standard Azure AD configuration only uses the following settings (with example values):
Authentication/OpenIdConnect/AzureAD/Authority - https://login.microsoftonline.com/01234567-89ab-cdef-0123-
456789abcdef/
Authentication/OpenIdConnect/AzureAD/ClientId - fedcba98-7654-3210-fedc-ba9876543210
The Client ID and the authority URL do not contain the same value and should be retrieved separately.
Authentication/OpenIdConnect/AzureAD/RedirectUri - https://portal.contoso.com/signin-azure-ad

Multiple identity providers can be configured by substituting a label for the [provider] tag. Each unique label forms a
group of settings related to an identity provider. Examples: AzureAD, MyIdP

SITE SETTING NAME DESCRIPTION

Authentication/Registration/ExternalLoginEnabled Enables or disables external account sign-in and registration.


Default: true

Authentication/OpenIdConnect/[provider]/Authority Required. The Authority to use when making OpenIdConnect


calls. Example:
https://login.microsoftonline.com/contoso.onmicrosoft.com/
. For more
information:OpenIdConnectAuthenticationOptions.Authority.

Authentication/OpenIdConnect/[provider]/MetadataAddress The discovery endpoint for obtaining metadata. Commonly


ending with the path:/.well-known/openid-configuration .
Example:
https://login.microsoftonline.com/contoso.onmicrosoft.com/.well-
known/openid-configuration
. For more
information:OpenIdConnectAuthenticationOptions.MetadataAd
dress.

Authentication/OpenIdConnect/[provider]/AuthenticationType The OWIN authentication middleware type. Specify the value of


the issuer in the service configuration metadata. Example:
https://sts.windows.net/contoso.onmicrosoft.com/ . For
more information: AuthenticationOptions.AuthenticationType.

Authentication/OpenIdConnect/[provider]/ClientId Required. The client ID value from the provider application. It


may also be referred to as an "App ID" or "Consumer Key". For
more information:
OpenIdConnectAuthenticationOptions.ClientId.

Authentication/OpenIdConnect/[provider]/ClientSecret The client secret value from the provider application. It may also
be referred to as an "App Secret" or "Consumer Secret". For
more information:
OpenIdConnectAuthenticationOptions.ClientSecret.

Authentication/OpenIdConnect/[provider]/RedirectUri Recommended. The AD FS WS-Federation passive endpoint.


Example: https://portal.contoso.com/signin-saml2. For more
information: OpenIdConnectAuthenticationOptions.RedirectUri.
SITE SETTING NAME DESCRIPTION

Authentication/OpenIdConnect/[provider]/Caption Recommended. The text that the user can display on a sign in
user interface. Default: [provider]. For more information:
OpenIdConnectAuthenticationOptions.Caption.

Authentication/OpenIdConnect/[provider]/Resource The 'resource'. For more information:


OpenIdConnectAuthenticationOptions.Resource.

Authentication/OpenIdConnect/[provider]/ResponseType The 'response_type'. For more information:


OpenIdConnectAuthenticationOptions.ResponseType.

Authentication/OpenIdConnect/[provider]/Scope A space separated list of permissions to request. Default:


openid. For more information:
OpenIdConnectAuthenticationOptions.Scope .

Authentication/OpenIdConnect/[provider]/CallbackPath An optional constrained path on which to process the


authentication callback. If not provided and RedirectUri is
available, this value will be generated from RedirectUri. For more
information:
OpenIdConnectAuthenticationOptions.CallbackPath.

Authentication/OpenIdConnect/[provider]/BackchannelTimeout Timeout value for back channel communications. Example:


00:05:00 (5 mins). For more information:
OpenIdConnectAuthenticationOptions.BackchannelTimeout.

Authentication/OpenIdConnect/[provider]/RefreshOnIssuerKeyN Determines whether a metadata refresh should be attempted


otFound after a SecurityTokenSignatureKeyNotFoundException. For more
information:
OpenIdConnectAuthenticationOptions.RefreshOnIssuerKeyNotF
ound.

Authentication/OpenIdConnect/[provider]/UseTokenLifetime Indicates that the authentication session lifetime (e.g. cookies)


should match that of the authentication token. For more
information:
OpenIdConnectAuthenticationOptions.UseTokenLifetime.

Authentication/OpenIdConnect/[provider]/AuthenticationMode The OWIN authentication middleware mode. For more


information: AuthenticationOptions.AuthenticationMode.

Authentication/OpenIdConnect/[provider]/SignInAsAuthenticati The AuthenticationType used when creating the


onType System.Security.Claims.ClaimsIdentity. For more information:
OpenIdConnectAuthenticationOptions.SignInAsAuthenticationT
ype.

Authentication/OpenIdConnect/[provider]/PostLogoutRedirectU The 'post_logout_redirect_uri'. For more information:


ri OpenIdConnectAuthenticationOptions.PostLogoutRedirectUri.

Authentication/OpenIdConnect/[provider]/ValidAudiences Comma-separated list of audience URLs. For more information:


TokenValidationParameters.AllowedAudiences.

Authentication/OpenIdConnect/[provider]/ValidIssuers Comma-separated list of issuer URLs. For more information:


TokenValidationParameters.ValidIssuers.

Authentication/OpenIdConnect/[provider]/ClockSkew The clock skew to apply when validating times.

Authentication/OpenIdConnect/[provider]/NameClaimType The claim type used by the ClaimsIdentity to store the name
claim.
SITE SETTING NAME DESCRIPTION

Authentication/OpenIdConnect/[provider]/RoleClaimType The claim type used by the ClaimsIdentity to store the role
claim.

Authentication/OpenIdConnect/[provider]/RequireExpirationTim A value indicating whether tokens must have an 'expiration'


e value.

Authentication/OpenIdConnect/[provider]/RequireSignedTokens A value indicating whether a


System.IdentityModel.Tokens.SecurityToken
xmlns=https://ddue.schemas.microsoft.com/authoring/2003/5
can be valid if not signed.

Authentication/OpenIdConnect/[provider]/SaveSigninToken A Boolean to control if the original token is saved when a


session is created.

Authentication/OpenIdConnect/[provider]/ValidateActor A value indicating whether the


System.IdentityModel.Tokens.JwtSecurityToken.Actor should be
validated.

Authentication/OpenIdConnect/[provider]/ValidateAudience A Boolean to control if the audience will be validated during


token validation.

Authentication/OpenIdConnect/[provider]/ValidateIssuer A Boolean to control if the issuer will be validated during token


validation.

Authentication/OpenIdConnect/[provider]/ValidateLifetime A Boolean to control if the lifetime will be validated during token


validation.

Authentication/OpenIdConnect/[provider]/ValidateIssuerSigning A Boolean that controls if validation of the


Key System.IdentityModel.Tokens.SecurityKey that signed the
securityToken
xmlns=https://ddue.schemas.microsoft.com/authoring/2003/5 is
called.

Enable authentication using a multi-tenant Azure Active Directory


application
You can configure your portal to accept Azure Active Directory users from any tenant in Azure and not just a specific
tenant by using the multi-tenant application registered in Azure Active Directory. To enable multi-tenancy, set the
Multi-tenanted switch to Yes in the Azure Active Directory application.
Related site settings
Multiple identity providers can be configured by substituting a label for the [provider] tag. Each unique label forms a
group of settings related to an identity provider. You can create or configure the following site settings in portals to
support authentication against Azure Active Directory using a multi-tenanted application:

SITE SETTING NAME DESCRIPTION

Authentication/OpenIdConnect/[provider]/Authority The Authority to use when making OpenIdConnect calls. For


example: https://login.microsoftonline.com/common

Authentication/OpenIdConnect/[provider]/ClientId The client ID value from the provider application. It may also be
referred to as an App ID or Consumer Key.

Authentication/OpenIdConnect/[provider]/ExternalLogoutEnable Enables or disables external account sign-out and registration.


d Set this value as True.

Authentication/OpenIdConnect/[provider]/IssuerFilter A wildcard-based filter that matches on all issuers across all


tenants. In most cases, use the value:
https://sts.windows.net/*/

Authentication/OpenIdConnect/[provider]/RedirectUri The reply URL location where the provider sends the
authentication response.For example:
https://portal.contoso.com/signin-oidc
SITE SETTING NAME DESCRIPTION

Authentication/OpenIdConnect/[provider]/ValidateIssuer A Boolean to control if the issuer will be validated during token


validation. Set this value as False.

See also
Configure portal authentication
Set authentication identity for a portal
OAuth2 provider settings for portals
WS-Federation provider settings for portals
SAML 2.0 provider settings for portals
Configure WS-Federation provider settings for
portals
1/23/2020 • 5 minutes to read • Edit Online

A single Active Directory Federation Services server can be added (or another WS -Federation–compliant security
token service) as an identity provider. In addition, a single Azure ACS namespace can be configured as a set of
individual identity providers. The settings for both AD FS and ACS are based on the properties of the
WsFederationAuthenticationOptions class.

Create an AD FS relying party trust


Using the AD FS Management tool, go to Trust Relationships > Relying Party Trusts.
1. Select Add Relying Party Trust.
2. Welcome: Select Start.
3. Select Data Source: Select Enter data about the relying party manually, and then select Next.
4. Specify Display Name: Enter a name, and then select Next. Example: https://portal.contoso.com/
5. Choose Profile: Select AD FS 2.0 profile, and then select Next.
6. Configure Certificate: Select Next.
7. Configure URL: Select the Enable support for the WS -Federation Passive protocol check box.
Relying party WS -Federation Passive protocol URL: Enter https://portal.contoso.com/signin-federation
Note: AD FS requires that the portal run on HTTPS.

NOTE
The resulting endpoint has the following settings: Endpoint type: WS-Federation
Binding: POST
Index: n/a (0)
URL: https://portal.contoso.com/signin-federation

8. Configure Identities: Specify https://portal.contoso.com/, select Add, and then select Next. If applicable, more
identities can be added for each additional relying party portal. Users will be able to authenticate across any or
all of the available identities.
9. Choose Issuance Authorization Rules: Select Permit all users to access this relying party, and then select
Next.
10. Ready to Add Trust: Select Next.
11. Select Close.
Add the Name ID claim to the relying party trust:
Transform Windows account name to Name ID claim (Transform an Incoming Claim):
Incoming claim type: Windows account name
Outgoing claim type: Name ID
Outgoing name ID format: Unspecified
Pass through all claim values
Create AD FS site settings
Apply portal site settings referencing the above AD FS Relying Party Trust.

NOTE
A standard AD FS (STS) configuration only uses the following settings (with example values):
Authentication/WsFederation/ADFS/MetadataAddress - https://adfs.contoso.com/FederationMetadata/2007-
06/FederationMetadata.xml
Authentication/WsFederation/ADFS/AuthenticationType - https://adfs.contoso.com/adfs/services/trust
Use the value of the entityID attribute in the root element of the Federation Metadata (open the
MetadataAddress URL in a browser that is the value of the above site setting)
Authentication/WsFederation/ADFS/Wtrealm - https://portal.contoso.com/
Authentication/WsFederation/ADFS/Wreply - https://portal.contoso.com/signin-federation

The WS -Federation metadata can be retrieved in PowerShell by running the following script on the AD FS
server:

Import-Module adfs
Get-ADFSEndpoint -AddressPath /FederationMetadata/2007-06/FederationMetadata.xml

SITE SETTING NAME DESCRIPTION

Authentication/Registration/ExternalLoginEnabled Enables or disables external account sign-in and registration.


Default: true

Authentication/WsFederation/ADFS/MetadataAddress Required. The WS-Federation metadata URL of the AD FS


(STS) server. Commonly ending with the
path:/FederationMetadata/2007-06/FederationMetadata.xml .
Example:https://adfs.contoso.com/FederationMetadata/2007-
06/FederationMetadata.xml. For more information:
WsFederationAuthenticationOptions.MetadataAddress.

Authentication/WsFederation/ADFS/AuthenticationType Required. The OWIN authentication middleware type. Specify


the value of the entityID attribute at the root of the
federation metadata XML. Example:
https://adfs.contoso.com/adfs/services/trust. For more
information: AuthenticationOptions.AuthenticationType.

Authentication/WsFederation/ADFS/Wtrealm Required. The AD FS relying party identifier. Example:


https://portal.contoso.com/ . For more information:
WsFederationAuthenticationOptions.Wtrealm.

Authentication/WsFederation/ADFS/Wreply Required. The AD FS WS-Federation passive endpoint.


Example: https://portal.contoso.com/signin-federation. For
more information:
WsFederationAuthenticationOptions.Wreply.

Authentication/WsFederation/ADFS/Caption Recommended. The text that the user can display on a sign in
user interface. Default: ADFS. For more information:
WsFederationAuthenticationOptions.Caption.

Authentication/WsFederation/ADFS/CallbackPath An optional constrained path on which to process the


authentication callback. For more information:
WsFederationAuthenticationOptions.CallbackPath.
SITE SETTING NAME DESCRIPTION

Authentication/WsFederation/ADFS/SignOutWreply The 'wreply' value used during sign-out. For more


information:
WsFederationAuthenticationOptions.SignOutWreply.

Authentication/WsFederation/ADFS/BackchannelTimeout Timeout value for back channel communications. Example:


00:05:00 (5 mins). For more information:
WsFederationAuthenticationOptions.BackchannelTimeout.

Authentication/WsFederation/ADFS/RefreshOnIssuerKeyNotF Determines if a metadata refresh should be attempted after a


ound SecurityTokenSignatureKeyNotFoundException. For more
information:
WsFederationAuthenticationOptions.RefreshOnIssuerKeyNotF
ound.

Authentication/WsFederation/ADFS/UseTokenLifetime Indicates that the authentication session lifetime (e.g. cookies)


should match that of the authentication token.
WsFederationAuthenticationOptions.UseTokenLifetime.

Authentication/WsFederation/ADFS/AuthenticationMode The OWIN authentication middleware mode. For more


information: AuthenticationOptions.AuthenticationMode.

Authentication/WsFederation/ADFS/SignInAsAuthenticationTy The AuthenticationType used when creating the


pe System.Security.Claims.ClaimsIdentity. For more information:
WsFederationAuthenticationOptions.SignInAsAuthenticationT
ype.

Authentication/WsFederation/ADFS/ValidAudiences Comma separated list of audience URLs. For more


information: TokenValidationParameters.AllowedAudiences.

Authentication/WsFederation/ADFS/ValidIssuers Comma separated list of issuer URLs. For more information:


TokenValidationParameters.ValidIssuers.

Authentication/WsFederation/ADFS/ClockSkew The clock skew to apply when validating times.

Authentication/WsFederation/ADFS/NameClaimType The claim type used by the ClaimsIdentity to store the name
claim.

Authentication/WsFederation/ADFS/RoleClaimType The claim type used by the ClaimsIdentity to store the role
claim.

Authentication/WsFederation/ADFS/RequireExpirationTime A value indicating whether tokens must have an 'expiration'


value.

Authentication/WsFederation/ADFS/RequireSignedTokens A value indicating whether a


System.IdentityModel.Tokens.SecurityToken
xmlns=https://ddue.schemas.microsoft.com/authoring/2003/
5 can be valid if not signed.

Authentication/WsFederation/ADFS/SaveSigninToken A Boolean to control if the original token is saved when a


session is created.

Authentication/WsFederation/ADFS/ValidateActor A value indicating whether the


System.IdentityModel.Tokens.JwtSecurityToken.Actor should
be validated.
SITE SETTING NAME DESCRIPTION

Authentication/WsFederation/ADFS/ValidateAudience A Boolean to control if the audience will be validated during


token validation.

Authentication/WsFederation/ADFS/ValidateIssuer A Boolean to control if the issuer will be validated during


token validation.

Authentication/WsFederation/ADFS/ValidateLifetime A Boolean to control if the lifetime will be validated during


token validation.

Authentication/WsFederation/ADFS/ValidateIssuerSigningKey A Boolean that controls if validation of the


System.IdentityModel.Tokens.SecurityKey that signed the
securityToken
xmlns=https://ddue.schemas.microsoft.com/authoring/2003/
5 is called.

Authentication/WsFederation/ADFS/Whr Specifies a "whr" parameter in the identity provider redirect


URL. For more information: wsFederation.

WS-Federation settings for Azure Active Directory


The previous section describing AD FS can also be applied to Azure Active Directory (Azure AD ), because Azure
AD behaves like a standard WS -Federation compliant security token service. To get started sign into the Azure
Management Portal and create or select an existing directory. When a directory is available follow the instructions
to add an application to the directory.
1. Under the Applications menu of the directory, select Add.
2. Choose Add an application my organization is developing.
3. Specify a custom name for the application, and then choose the type web application and/or web API.
4. For the Sign-On URL and the App ID URI, specify the URL of the portal for both fields
https://portal.contoso.com/.
This corresponds to the Wtrealm site setting value.
5. At this point, a new application is created. Go to the Configure section in the menu.
6. In the single sign-on section, update the first Reply URL entry to include a path in the URL
https://portal.contoso.com/signin-azure-ad.
This corresponds to the Wreply site setting value.
7. Select Save in the footer.
8. In the footer menu, select View Endpoints and note the Federation Metadata Document field.
This corresponds to the MetadataAddress site setting value.
Paste this URL in a browser window to view the federation metadata XML, and note the entityID
attribute of the root element.
This corresponds to the AuthenticationType site setting value.
NOTE
A standard Azure AD configuration only uses the following settings (with example values):
Authentication/WsFederation/ADFS/MetadataAddress - https://login.microsoftonline.com/01234567-89ab-cdef-0123-
456789abcdef/federationmetadata/2007-06/federationmetadata.xml
Authentication/WsFederation/ADFS/AuthenticationType - https://sts.windows.net/01234567-89ab-cdef-0123-
456789abcdef/
Use the value of the entityID attribute in the root element of the Federation Metadata (open the
MetadataAddress URL in a browser that is the value of the above site setting)
Authentication/WsFederation/ADFS/Wtrealm - https://portal.contoso.com/
Authentication/WsFederation/ADFS/Wreply - https://portal.contoso.com/signin-azure-ad

See also
Configure portal authentication
Set authentication identity for a portal
OAuth2 provider settings for portals
Open ID Connect provider settings for portals
SAML 2.0 provider settings for portals
Configure SAML 2.0 provider settings for portals
1/23/2020 • 9 minutes to read • Edit Online

To provide external authentication, you can add one or more SAML 2.0–compliant identity providers (IdP ). This document describes
how to set up various identity providers to integrate with a portal that acts as a service provider.

AD FS (IdP)
Settings for an identity provider such as Active Directory Federation Services (AD FS ).
Create an AD FS relying party trust

NOTE
See Configure AD FS by using PowerShell, below, for information about how to perform these steps in a PowerShell script.

Using the AD FS Management tool, go to Service > Claim Descriptions.


1. Select Add Claim Description.
2. Specify the claim:
Display name: Persistent Identifier
Claim identifier: urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
Enable check box for: Publish this claim description in federation metadata as a claim type that this federation service
can accept
Enable check box for: Publish this claim description in federation metadata as a claim type that this federation service
can send
3. Select OK.
Using the AD FS Management tool, select Trust Relationships >Relying Party Trusts.
1. Select Add Relying Party Trust.
2. Welcome: Select Start.
3. Select Data Source: Select Enter data about the relying party manually, and then select Next.
4. Specify Display Name: Enter a name, and then select Next. Example: https://portal.contoso.com/
5. Choose Profile: Select AD FS 2.0 profile, and then select Next.
6. Configure Certificate: Select Next.
7. Configure URL: Select the Enable support for the SAML 2.0 WebSSO protocol check box. Relying party SAML 2.0 SSO
service URL: Enter https://portal.contoso.com/signin-saml2
Note: AD FS requires that the portal run on HTTPS.

NOTE
The resulting endpoint has the following settings:
Endpoint type: SAML Assertion Consume Endpoints
Binding: POST
Index: n/a (0)
URL: https://portal.contoso.com/signin-saml2

8. Configure Identities: Specify https://portal.contoso.com/, select Add, and then select Next. If applicable, you can add more
identities for each additional relying party portal. Users will be able to authenticate across any or all of the available
identities.
9. Choose Issuance Authorization Rules: Select Permit all users to access this relying party, and then select Next.
10. Ready to Add Trust: Select Next.
11. Select Close.
Add the Name ID claim to the relying party trust:
TransformWindows account name to Name ID claim (Transform an Incoming Claim):
Incoming claim type: Windows account name
Outgoing claim type: Name ID
Outgoing name ID format: Persistent Identifier
Pass through all claim values
Create site settings
Apply portal site settings referencing the above AD FS relying party trust.

NOTE
A standard AD FS (IdP) configuration only uses the following settings (with example values): Authentication/SAML2/ADFS/MetadataAddress -
https://adfs.contoso.com/FederationMetadata/2007-06/FederationMetadata.xml
Authentication/SAML2/ADFS/AuthenticationType - https://adfs.contoso.com/adfs/services/trust
Use the value of the entityID attribute in the root element of the federation metadata (open the MetadataAddress URL in a
browser that is the value of the above site setting)
Authentication/SAML2/ADFS/ServiceProviderRealm - https://portal.contoso.com/
Authentication/SAML2/ADFS/AssertionConsumerServiceUrl - https://portal.contoso.com/signin-saml2
The federation metadata can be retrieved in PowerShell by running the following script on the AD FS server: Import-Module adfs
Get-ADFSEndpoint -AddressPath /FederationMetadata/2007-06/FederationMetadata.xml

Multiple IdP services can be configured by substituting a label for the [provider] tag. Each unique label forms a group of settings
related to an IdP. Examples: ADFS, AzureAD, MyIdP

SITE SETTING NAME DESCRIPTION

Authentication/Registration/ExternalLoginEnabled Enables or disables external account sign-in and registration. Default:


true

Authentication/SAML2/[provider]/MetadataAddress Required. The WS-Federation metadata URL of the AD FS (STS) server. It


commonly ends with the path:/FederationMetadata/2007-
06/FederationMetadata.xml . Example:
https://adfs.contoso.com/FederationMetadata/2007-
06/FederationMetadata.xml
. More information:
WsFederationAuthenticationOptions.MetadataAddress

Authentication/SAML2/[provider]/AuthenticationType Required. The OWIN authentication middleware type. Specify the value
of the entityID attribute at the root of the federation metadata XML.
Example: https://adfs.contoso.com/adfs/services/trust . More
information: AuthenticationOptions.AuthenticationType

Authentication/SAML2/[provider]/ServiceProviderRealm Required. The AD FS relying party identifier. Example:


or https://portal.contoso.com/ . More information:
Authentication/SAML2/[provider]/Wtrealm WsFederationAuthenticationOptions.Wtrealm

Authentication/SAML2/[provider]/AssertionConsumerServiceUrl Required. The AD FS SAML Consumer Assertion endpoint. Example:


or https://portal.contoso.com/signin-saml2. More information:
Authentication/SAML2/[provider]/Wreply WsFederationAuthenticationOptions.Wreply

Authentication/SAML2/[provider]/Caption Recommended. The text that the user can display on a sign-in user
interface. Default: [provider]. More information:
WsFederationAuthenticationOptions.Caption
SITE SETTING NAME DESCRIPTION

Authentication/SAML2/[provider]/CallbackPath An optional constrained path on which to process the authentication


callback. More information:
WsFederationAuthenticationOptions.CallbackPath

Authentication/SAML2/[provider]/BackchannelTimeout Timeout value for back-channel communications. Example: 00:05:00 (5


mins). More information:
WsFederationAuthenticationOptions.BackchannelTimeout

Authentication/SAML2/[provider]/UseTokenLifetime Indicates that the authentication session lifetime (for example, cookies)
should match that of the authentication token.
WsFederationAuthenticationOptions.UseTokenLifetime.

Authentication/SAML2/[provider]/AuthenticationMode The OWIN authentication middleware mode. More information:


AuthenticationOptions.AuthenticationMode

Authentication/SAML2/[provider]/SignInAsAuthenticationType The AuthenticationType used when creating the


System.Security.Claims.ClaimsIdentity. More information:
WsFederationAuthenticationOptions.SignInAsAuthenticationType

Authentication/SAML2/[provider]/ValidAudiences Comma-separated list of audience URLs. More information:


TokenValidationParameters.AllowedAudiences

Authentication/SAML2/[provider]/ClockSkew The clock skew to apply when validating times.

Authentication/SAML2/[provider]/RequireExpirationTime A value indicating whether tokens must have an expiration value.

Authentication/SAML2/[provider]/ValidateAudience A Boolean to control whether the audience will be validated during


token validation.

IdP-initiated sign-in
AD FS supports the IdP-initiated single sign-on (SSO ) profile of the SAML 2.0 specification. In order for the portal (service
provider) to respond properly to the SAML request initiated by the IdP, the RelayState parameter must be encoded properly.
The basic string value to be encoded into the SAML RelayState parameter must be in the format ReturnUrl=/content/sub-
content/, where /content/sub-content/ is the path to the webpage you want to go to on the portal (service provider). The path
can be replaced by any valid webpage on the portal. The string value is encoded and placed into a container string of the format
RPID=<URL encoded RPID>&RelayState=<URL encoded RelayState>. This entire string is once again encoded and added
to another container of the format https://adfs.contoso.com/adfs/ls/idpinitiatedsignon.aspx?RelayState=&lt;URL encoded
RPID/RelayState>.
For example, given the service provider path /content/sub-content/ and the relying party ID https://portal.contoso.com/,
construct the URL with the steps:
Encode the value ReturnUrl=/content/sub-content/
to get ReturnUrl%3D%2Fcontent%2Fsub-content%2F
Encode the value https://portal.contoso.com/
to get https%3A%2F%2Fportal.contoso.com%2F
Encode the value RPID=https%3A%2F%2Fportal.contoso.com%2F&RelayState=ReturnUrl%3D%2Fcontent%2Fsub-
content%2F
to get
RPID%3Dhttps%253A%252F%252Fportal.contoso.com%252F%26RelayState%3DReturnUrl%253D%252Fcontent%252Fsub-
content%252F
Prepend the AD FS IdP-initiated SSO path to get the final URL
https://adfs.contoso.com/adfs/ls/idpinitiatedsignon.aspx?
RelayState=RPID%3Dhttps%253A%252F%252Fportal.contoso.com%252F%26RelayState%3DReturnUrl%253D%252Fcontent%252Fsub-
content%252F
The following PowerShell script can be used to construct the URL (save to a file named Get-IdPInitiatedUrl.ps1).

<#

.SYNOPSIS

Constructs an IdP-initiated SSO URL to access a portal page on the service provider.

.PARAMETER path

The path to the portal page.

.PARAMETER rpid

The relying party identifier.

.PARAMETER adfsPath

The AD FS IdP initiated SSO page.

.EXAMPLE

PS C:\\> .\\Get-IdPInitiatedUrl.ps1 -path "/content/sub-content/" -rpid "https://portal.contoso.com/" -adfsPath


"https://adfs.contoso.com/adfs/ls/idpinitiatedsignon.aspx"

#>

param

[parameter(mandatory=$true,position=0)]

$path,

[parameter(mandatory=$true,position=1)]

$rpid,

[parameter(position=2)]

$adfsPath = https://adfs.contoso.com/adfs/ls/idpinitiatedsignon.aspx

$state = ReturnUrl=$path

$encodedPath = [uri]::EscapeDataString($state)

$encodedRpid = [uri]::EscapeDataString($rpid)

$encodedPathRpid = [uri]::EscapeDataString("RPID=$encodedRpid&RelayState=$encodedPath")

$idpInitiatedUrl = {0}?RelayState={1} -f $adfsPath, $encodedPathRpid

Write-Output $idpInitiatedUrl

SAML 2.0 settings for Azure Active Directory


The previous section describing AD FS can also be applied to Azure AD, because Azure AD behaves like a standard SAML 2.0–
compliant IdP. To get started, sign in to the Azure Management Portal and create or select an existing directory. When a directory is
available, follow the instructions to add an application to the directory.
1. Under theApplications menu of the directory, select Add.
2. Choose Add an application my organization is developing.
3. Specify a custom name for the application, and then choose the type web application and/or web API.
4. For the Sign-On URL and theApp ID URI, specify the URL of the portal for both fields https://portal.contoso.com/. This
corresponds to the ServiceProviderRealm (Wtrealm) site setting value.
5. At this point, a new application is created. Go to the Configure section in the menu.
Under the single sign-on section, update the first Reply URL entry to include a path in the URL
https://portal.contoso.com/signin-azure-ad.
This corresponds to the AssertionConsumerServiceUrl (Wreply) site setting value.
6. In the footer menu, select View Endpoints and note the Federation Metadata Document field.
This corresponds to the MetadataAddress site setting value.
Paste this URL in a browser window to view the federation metadata XML, and note the entityID attribute of the root element.
This corresponds to theAuthenticationType site setting value.

NOTE
A standard Azure AD configuration only uses the following settings (with example values): Authentication/SAML2/AzureAD/MetadataAddress -
https://login.microsoftonline.com/01234567-89ab-cdef-0123-456789abcdef/federationmetadata/2007-06/federationmetadata.xml
Authentication/SAML2/AzureAD/AuthenticationType - https://sts.windows.net/01234567-89ab-cdef-0123-456789abcdef/
Use the value of theentityID attribute in the root element of the federation metadata (open theMetadataAddress URL in a browser that is
the value of the above site setting)
Authentication/SAML2/AzureAD/ServiceProviderRealm - https://portal.contoso.com/
Authentication/SAML2/AzureAD/AssertionConsumerServiceUrl - https://portal.contoso.com/signin-azure-ad |

Shibboleth Identity Provider 3


Use the following guidelines for correctly configuring Shibboleth Identity Provider as an IdP service. The following assumes the IdP
is hosted on the domain https://idp.contoso.com.
The federation metadata URL is https://idp.contoso.com/idp/shibboleth
The IdP must be configured to generate or serve a persistent identifier. Follow the instructions to enable Persistent Identifier
Generation.
The IdP federation metadata (<IDPSSODescriptor>) must be configured to include an SSO redirect binding. Example.

<SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"

Location=https://idp.contoso.com/idp/profile/SAML2/Redirect/SSO/>

Configure the service providers (relying parties) by setting up the metadata-providers.xml.


Each service provider federation metadata (<SPSSODescriptor>) must include an assertion consumer service post binding.
One option is to use a FilesystemMetadataProvider and reference a configuration file that contains:

<AssertionConsumerService index=1 isDefault=true

Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"

Location=https://portal.contoso.com/signin-saml2/>

The Location attribute corresponds to theAssertionConsumerServiceUrl (Wreply) setting.


The service provider federation metadata should specify an entityID attribute for the EntityDescriptor that corresponds to the
AuthenticationType setting.
<EntityDescriptor entityID=https://portal.local.contoso.com/&gt;...
NOTE
A standard Shibboleth configuration only uses the following settings (with example values):
Authentication/SAML2/Shibboleth/MetadataAddress - https://idp.contoso.com/idp/shibboleth
Authentication/SAML2/Shibboleth/AuthenticationType - https://idp.contoso.com/idp/shibboleth
Use the value of the entityID attribute in the root element of the federation metadata (open the MetadataAddress URL in a browser that
is the value of the above site setting)
Authentication/SAML2/Shibboleth/ServiceProviderRealm - https://portal.contoso.com/
Authentication/SAML2/Shibboleth/AssertionConsumerServiceUrl - https://portal.contoso.com/signin-saml2

IdP-initiated sign-in
Shibboleth supports the IdP initiated SSO profile of the SAML 2.0 specification. For the portal (service provider) to respond
properly to the SAML request initiated by the IdP, the RelayState parameter must be encoded properly.
The basic string value to be encoded into the SAML RelayState parameter must be in the format ReturnUrl=/content/sub-
content/, where /content/sub-content/ is the path to the webpage you want to go to on the portal (service provider). The path
can be replaced by any valid webpage on the portal. The full IdP-initiated SSO URL should be in the format
https://idp.contoso.com/idp/profile/SAML2/Unsolicited/SSO?providerId=&lt;URL encoded provider ID>&target=<URL encoded
return path>.
For example, given the service provider path /content/sub-content/ and the relying party ID https://portal.contoso.com/, the
final URL is https://idp.contoso.com/idp/profile/SAML2/Unsolicited/SSO?
providerId=https%3A%2F%2Fportal.contoso.com%2F&target=ReturnUrl%3D%2Fcontent%2Fsub-content%2F
The following PowerShell script can be used to construct the URL (save to a file named Get-ShibbolethIdPInitiatedUrl.ps1).
<#

.SYNOPSIS

Constructs an IdP initiated SSO URL to access a portal page on the service provider.

.PARAMETER path

The path to the portal page.

.PARAMETER providerId

The relying party identifier.

.PARAMETER shibbolethPath

The Shibboleth IdP-initiated SSO page.

.EXAMPLE

PS C:\\> .\\Get-ShibbolethIdPInitiatedUrl.ps1 -path "/content/sub-content/" -providerId "https://portal.contoso.com/" -


shibbolethPath "https://idp.contoso.com/idp/profile/SAML2/Unsolicited/SSO"

#>

param

[parameter(mandatory=$true,position=0)]

$path,

[parameter(mandatory=$true,position=1)]

$providerId,

[parameter(position=2)]

$shibbolethPath = https://idp.contoso.com/idp/profile/SAML2/Unsolicited/SSO

$state = ReturnUrl=$path

$encodedPath = [uri]::EscapeDataString($state)

$encodedRpid = [uri]::EscapeDataString($providerId)

$idpInitiatedUrl = {0}?providerId={1}&target={2} -f $shibbolethPath, $encodedRpid, $encodedPath

Write-Output $idpInitiatedUrl

Configure AD FS by using PowerShell


The process of adding a relying party trust in AD FS can also be performed by running the following PowerShell script on the AD
FS server (save contents to a file named Add-AdxPortalRelyingPartyTrustForSaml.ps1). After running the script, continue with
configuring the portal site settings.

<#

.SYNOPSIS

Adds a SAML 2.0 relying party trust entry for a website.

.PARAMETER domain

The domain name of the portal.

.EXAMPLE

PS C:\\> .\\Add-AdxPortalRelyingPartyTrustForSaml.ps1 -domain portal.contoso.com

#>
param

[parameter(Mandatory=$true,Position=0)]

$domain,

[parameter(Position=1)]

$callbackPath = /signin-saml2

$VerbosePreference = Continue

$ErrorActionPreference = Stop

Import-Module adfs

Function Add-CrmRelyingPartyTrust

param (

[parameter(Mandatory=$true,Position=0)]

$name

$identifier = https://{0}/ -f $name

$samlEndpoint = New-ADFSSamlEndpoint -Binding POST -Protocol SAMLAssertionConsumer -Uri (https://{0}{1} -f $name,


$callbackPath)

$identityProviderValue = Get-ADFSProperties | % { $_.Identifier.AbsoluteUri }

$issuanceTransformRules = @'

@RuleTemplate = MapClaims

@RuleName = Transform [!INCLUDE[pn-ms-windows-short](../../../includes/pn-ms-windows-short.md)] Account Name to Name ID claim

c:[Type == "https://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname"]

=> issue(Type = "https://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", Issuer = c.Issuer, OriginalIssuer =


c.OriginalIssuer, Value = c.Value, ValueType = c.ValueType,
Properties["https://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/format"] = "urn:oasis:names:tc:SAML:2.0:nameid-
format:persistent");

@RuleTemplate = LdapClaims

@RuleName = Send LDAP Claims

c:[Type == "https://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"]

=> issue(store = "[!INCLUDE[pn-active-directory](../../../includes/pn-active-directory.md)]", types =


("https://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname",
"https://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname",
"https://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"), query = ";givenName,sn,mail;{{0}}", param = c.Value);

'@ -f $identityProviderValue

$issuanceAuthorizationRules = @'

@RuleTemplate = AllowAllAuthzRule

=> issue(Type = https://schemas.microsoft.com/authorization/claims/permit, Value = true);

'@

Add-ADFSRelyingPartyTrust -Name $name -Identifier $identifier -SamlEndpoint $samlEndpoint -IssuanceTransformRules


$issuanceTransformRules -IssuanceAuthorizationRules $issuanceAuthorizationRules

# add the 'Identity Provider' claim description if it is missing


# add the 'Identity Provider' claim description if it is missing

if (-not (Get-ADFSClaimDescription | ? { $_.Name -eq Persistent Identifier })) {

Add-ADFSClaimDescription -name "Persistent Identifier" -ClaimType "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" -


IsOffered:$true -IsAccepted:$true

# add the portal relying party trust

Add-CrmRelyingPartyTrust $domain

See also
Configure portal authentication
Set authentication identity for a portal
OAuth2 provider settings for portals
Open ID Connect provider settings for portals
WS-Federation provider settings for portals
Migrate identity providers to Azure AD B2C
1/23/2020 • 3 minutes to read • Edit Online

The portal supports a configurable security system that lets our customers support multiple authentication
systems. The portal includes its own local credentials in addition to federating with external identity providers
using standard protocols such as OIDC, SAML, and WS -Federation. Going forward, we recommended that you
use only Azure AD B2C identity provider for authentication and that you deprecate other identity providers.

Marking an identity provider as deprecate


You can configure your portal to mark other identity providers as deprecated and allow users to migrate to Azure
AD B2C identity provider.
The following site settings are used to control the deprecation of identity providers:

NAME DESCRIPTION

Authentication/Registration/LocalLoginDeprecated A true or false value. If set to true, the local account will be
marked as deprecated. The portal user will be required to
migrate to a non-deprecated account. By default, it is set to
false.

Authentication/[protocol]/[provider]/Deprecated A true or false value. If set to true, the specific account will be
marked as deprecated. The portal user will be required to
migrate to a non-deprecated account. By default, it is set to
false.

When a portal user tries to sign in, and you have marked at least one identity provider as deprecated, the
deprecated account is shown on the page. In the following example, a Microsoft account is marked as deprecated.
The text on the screen for legacy authentication provider can be changed by using the following content snippet:

NAME TYPE VALUE

Account/Signin/SignInExternalDeprecate Text Sign in with a legacy account


dFormHeading

NOTE
The deprecated identity providers are not shown when a user registers or redeems an invitation for a portal.

Migrating a deprecated identity provider to a new identity provider


If a portal user signs in with a deprecated identity provider, the account migration screen displays a message to
sign in with a non-deprecated identity provider. When the user signs in with the non-deprecated identity provider,
the user account is associated with the new provider.
The message on the screen for account migration can be changed using the following content snippets:

NAME TYPE VALUE

Account/Conversion/PageTitle Text Account Migration

Account/Conversion/PageCopy HTML You have signed in with an account that


is no longer supported. To continue
using this portal, you must migrate to a
different account. Select the button
below to sign in with a new or existing
supported account.

Account/Conversion/SignInExternalFor Text Sign in with a supported account.


mHeading

The portal allows multiple identities to be associated with a single contact record. When multiple providers are
deprecated, a portal user must consent to the terms and conditions multiple times. Whenever a user signs in with a
deprecated identity provider, the account migration process is initiated for each deprecated provider and the
contact record is associated with the non-deprecated provider after account migration.
For example: The portal supports Microsoft account (MSA), Google, and Facebook as identity providers for
authentication. If you mark Google and Facebook as deprecated providers, and a portal user only has Google and
Facebook as identity providers for authentication, the user will receive the account migration message when they
try to sign in using either of these two providers. When the user signs in using MSA, MSA is added to the user’s
contact record. The user now has only MSA as the supported authentication identity provider.
When a portal user selects a new identity provider and the identity is already associated with another contact
record, an error message appears. You can configure the error message using the following content snippets:
NAME TYPE VALUE

Account/Signin/AccountConversionIden Text Account Conversion Error


tityUsedErrorHeading

Account/Signin/AccountConversionIden HTML This account already exists. Close your


tityUsedErrorText browser, restart the process, and select
a different account on the Account
Migration page.

Disabling local login


You can configure a portal to disable local login by using the Authentication/Registration/LocalLoginDeprecated
site setting. If someone tries to sign in using local credentials, the account migration screen appears along with the
instruction to sign in with a non-deprecated identity provider. When the account is migrated, local credentials for
the user are disabled.

NOTE
If you mark local login as deprecated, the user will not be able to register for a new account.

The following field is added in the portal contact record to indicate if the local login is disabled for a user:
Local Login Disabled: Indicates that the contact can no longer sign in to the portal using the local account.
By default, it is set to No. This field is set to Yes if a user’s account is migrated to a non-deprecated identity
provider and local login is disabled.
Search
2/3/2020 • 16 minutes to read • Edit Online

In Power Apps portals, you can search for records across multiple entities by using portal’s global search functionality. You can also search within records of entity lists using
entity list search functionality.
Entity list search functionality in the portal uses FetchXML in the back end to search the columns defined in the entity list and then display the results.
Global search uses an external search index that is based on Lucene.Net and is used to search within multiple entities and fields at once.

Global search
Global search of portals allows you to search for records across multiple entities. It also allows you to search across multiple columns and configure what columns of an entity
would be searchable.
Among the benefits of global search are its ability to:
Find matches to any word in the search term in any field in the entity. Matches can include inflectional words like stream, streaming, or streamed.
Return results from all searchable entities in a single list sorted by relevance, based on factors like number of words matched, or their proximity to each other in the text.
Highlight matches in the search results.
Provide facet options that can be used to further filter search results.
In global search, the better the match, the higher it appears in the results. A match has a higher relevancy if more words from the search term are found in close proximity to
each other. The smaller the amount of text where the search words are found, the higher the relevancy. For example, if you find the search words in a company name and
address, it might be a better match than the same words found in a large article, far apart from each other. Because the results are returned in a single list, you can see a mix of
records displayed one after another, with matched works highlighted.
The following sections detail how global search works in Power Apps portals and describe the various configuration options available.

Entities searchable in portal global search


The following entities can be searched within a portal website provided the appropriate solution packages have been installed and search has been added to a portal. The
columns that are indexed will consist of the columns found in the Search view, which can be customized. Each entity in the list has its default set of attributes indexed as listed
here:
Knowledge Article
Notes and attachment of a knowledge article are searchable as well. More information: Search within file attachment content
Articles are searchable only if they are published and their Internal Only field is set to false.
Blog
Blog Post
Blog Post Comment
Forum
Forum Post
Forum Thread
Idea
Idea Comment
Idea Forum
Web File
Attachment content of web files is searchable as well. More information: Search within file attachment content
Web Page
Incident

NOTE
Apart from the entities listed here, no other entity can be enabled for global search in a portal.

Fields searchable in global search


All the fields available in the view defined by the Search/IndexQueryName site setting for any entity are indexed in global search and are searchable.
Default value for Search/IndexQueryName is “Portal Search”.
If the view is not available for any entity, it is not indexed and the results are not displayed in global search.

NOTE
If you change the value of the Search/IndexQueryName site setting, you need to trigger a manual re-index of the build using steps defined in the Rebuild full search index section.

Related site settings


The following site settings are related to global search:

NAME DEFAULT VALUE DESCRIPTION


NAME DEFAULT VALUE DESCRIPTION

Search/Enabled True A Boolean value that indicates whether search is enabled. If


you set its value to false, global search in the portal is turned
off.
If you are using out-of-the-box web templates and you turn
this setting off, the search box will not be displayed in the
header as well as on the search page. Also, no results are
returned even if the direct URL for the search page is hit.

Search/Filters Content:adx_webpage;Events:adx_event,adx_eventschedule;Blo A collection of search logical name filter options. Defining a


gs:adx_blog,adx_blogpost,adx_blogpostcomment;Forums:adx_c value here will add drop-down filter options to global search.
ommunityforum,adx_communityforumthread,adx_communityf This value should be in the form of name/value pairs, with
orumpost;Ideas:adx_ideaforum,adx_idea,adx_ideacomment;Issu name and value separated by a colon, and pairs separated by
es:adx_issueforum,adx_issue,adx_issuecomment;Help a semicolon. For example:
Desk:incident "Forums:adx_communityforum,adx_communityforumthread,ad
x_communityforumpost;Blogs:adx_blog,adx_blogpost,adx_blog
postcomment".

Search/IndexQueryName Portal search The name of the system view used by the portal search query
to define the fields of an entity enabled that are indexed and
searched.

Search/Query +(@Query) _title:(@Query) This setting adds additional weights and filters to the query
_logicalname:adx_webpage~0.9^0.2 - that a user enters in the default search box that is displayed
_logicalname:adx_webfile~0.9 adx_partialurl:(@Query) on the portal. In the default value, @Query is the query text
_logicalname:adx_blogpost~0.9^0.1 - entered by a user.
_logicalname:adx_communityforumthread~0.9 For information on how to modify this value, follow Lucene
query syntax.
Important: This weighting and filtering only applies to the
search box that comes in the default search page of the
portal. If you are using a liquid search tag to create your own
search page, then this setting doesn’t apply.

Search/Stemmer English The language used by the portal search's stemming algorithm.

Search/FacetedView True This enables facets in the search results. When set to True,
facets will be shown along with results on the search page.

Search/IndexNotesAttachments True Indicates whether the content of notes attachments in


knowledge base articles and web files should be indexed. By
default, it is set to False. More information: Search within file
attachment content

Search/RecordTypeFacetsEntities Blogs:adx_blog,adx_blogpost;Forums:adx_communityforum,ad This determines how the entities are grouped in Record Type
x_communityforumthread,adx_communityforumpost;Ideas:adx facet on the Search page. This setting is in the format
_ideaforum,adx_idea;Downloads:annotation,adx_webfile “DisplayNameinRecordTypeFacet1:logicalnameofentity1,logical
nameofentity2;
DisplayNameinRecordTypeFacet2:logicalnameofentity3,logicaln
ameofentity4”
Display Name in Record Type facet will appear on the UI. This
facet group will combine the result of the entities defined in
the configuration.

KnowledgeManagement/DisplayNotes True Indicates whether to index attachments of knowledge base


articles. By default, it is set to False.

Related content snippets


The following content snippets are related to global search:

NAME DEFAULT VALUE DESCRIPTION

Header/Search/Label Search This content snippet determines the watermark text shown in
the search box in the portal header.

Header/Search/ToolTip Search This content snippet determines the tooltip text shown when
you hover over the search icon in the portal header.

Search/Default/FilterText All This content snippet determines the default text shown in the
filter drop-down list next to the search box.
NAME DEFAULT VALUE DESCRIPTION

Search/Facet/All All This content snippet determines the default text shown for “all
records facet” in the “Record Type” facet of the search result
page.

Search/Facet/ClearConstraints Clear All This content snippet determines the label of the button that
resets all the facets applied in the search results page.

Search/Facet/Downloads Downloads This content snippet determines the label displayed in the
search results of annotation attachments and web file records
in the “Record Type” facet.

Search/Facet/Less Show less This content snippet determines the label of the button that
collapses facet results.

Search/Facet/ModifiedDate Modified date This content snippet determines the label of the header shown
for the Modified date facet.

Search/Facet/More Show more This content snippet determines the label of the button that
expands facet results.

Search/Facet/Product Products This content snippet determines the label of the Products
facet.
NAME DEFAULT VALUE DESCRIPTION

Search/Facet/Rating Rating This content snippet determines the label of the Rating facet.

Search/Facet/RecordType Record Type This content snippet determines the label of the Record Type
facet.

Search/Facet/SortOrder/AverageUserRating Average User Ratings This content snippet determines the label shown for the “Sort
by Average User Ratings” option in the sorting drop-down list
on the Search Results page.

Search/Facet/SortOrder/Relevance Relevance This content snippet determines the label shown for the “Sort
by Relevance” option in the sorting drop-down list on the
Search Results page.

Search/Facet/SortOrder/Views View Count This content snippet determines the label shown for the “Sort
by View Count” option in the sorting drop-down list on the
Search Results page.

Entity-specific handling
Case: By default, the only cases that are searchable are in the Resolved state with the Publish to Web field set to True. This behavior can be modified by updating the
Portal Search view of the Case entity and removing the filters available in the Portal Search view. However, when this check is removed, it is important to ensure that
the Customer Service – Case web template is modified appropriately, as this web template restricts all users from viewing cases that are active and are not published to
the web. If the web template is not modified, cases will be visible in search results. However, when you select them, the case detail web page is displayed with the
Permission denied error.
Knowledge Base: Knowledge articles are searchable only if they are in the Published state with the Internal field set to No. This behavior cannot be modified.
Knowledge articles also have special functionality available in search results as follows:
Facets: Two special facets are available only for knowledge articles and are displayed if knowledge article records are available in search results.
Ratings facet: This facet allows you to filter search results based on the average rating of knowledge articles.
Product facet: This facet allows you to filter search results based on the product associated to the knowledge articles.
Attachment search: This functionality allows you to search within the attachments or notes associated to a knowledge article. This allows you to search within
note description, title, attachment file name, and attachment content of notes or attachments that are exposed on the portal. More information: Search within file
attachment content

Special characters and syntax supported by search


As part of portal global search, a variety of special characters and syntaxes are supported to filter search results better. These special characters and syntaxes are broadly
divided into the following groups:
Term: Every query entered by a user for search is parsed into terms and operators. Following are the types of terms:
Single term: Single term is a single word. For example, a query {hello world} would be parsed into two single terms, “hello” and “world”. Each single term is
searched separately. Therefore, in the query {hello world}, all the records having the term “hello” or “world” would be displayed in search results.
Phrases: A phrase is a group of terms surrounded by double quotes (“”). For example, a query {“hello world”} would be parsed as a phrase “hello world”. Each
phrase is searched completely. Therefore, in the query {“hello world”}, all the records having the complete phrase “hello world” would be displayed in search
results and any record that only has “hello” or “world” would not be displayed.
Each search query can consist of one or many of these terms of any type that are combined using Boolean operators to create complex queries.
Term modifiers
Wildcard search: There are two types of wildcards available to be used within single terms of search queries (not within phrase queries): Single character
wildcard search and multiple character wildcard search.
Single character wildcard search: To perform a single character wildcard search, use the question mark (?) symbol. The single character wildcard search
looks for terms that match that with the single character replaced. For example, to search for "text" or "test" you can use the search query as “te?t”.
Multiple character wildcard search: To perform a multiple character wildcard search, use the asterisk (*) symbol. Multiple character wildcard searches
look for zero or more characters. For example, to search for test, tests or tester, you can use the search query as “test*”. You can also use multiple character
wildcard search in the middle of the query. For example, “te*t”.

NOTE
You cannot use a * or ? symbol as the first character of a search.
Wildcard search cannot be used in a phrase query. For example, if you use query as “hell* world”, it will not display results with the “hello world” text.

Proximity search: Proximity search allows you to search words that are within a specific distance from each other. For example, if you want results for the
words “Picture” and “blurry” appearing within 10 words of each other, you can use proximity search.
To do proximity searches, use the tilde (~) symbol at the end of the query. For example, if you want results for the words “Picture” and “blurry” appearing within
10 words of each other, then the query would be “Picture blurry”~10.
Boosting a term: Global search provides the relevance level of matching documents based on the terms found. To boost a term, use the caret (^) symbol with a
boost factor (a number) at the end of the term you are searching. The higher the boost factor, the more relevant the term will be.
Boosting allows you to control the relevance of a document by boosting its term. For example, if you are searching for Smart TV and you want the term Smart
to be more relevant, boost it using the ^ symbol along with the boost factor next to the term. You would type: Smart^4 TV. This will make documents with the
term Smart appear more relevant.
You can also boost phrase terms as in the example: Smart TV^4 New TV. In this case, the “Smart TV” phrase would be boosted in comparison to “New TV”.
By default, the boost factor is 1. Although the boost factor must be positive, it can be less than 1 (for example, 0.2).
Boolean operators: Boolean operators allow terms to be combined through logic operators. Global search supports OR, AND, NOT, "+", and "-" as Boolean
operators.

NOTE
Boolean operators must be written in uppercase.

OR: The OR operator is the default conjunction operator. This means that if there is no Boolean operator between two terms, the OR operator is used. The OR
operator links two terms and finds a matching record if either of the terms exists in a record. This is equivalent to a union using sets. The symbol || can be used in
place of the word OR. For example, the search query “Smart TV” (excluding quotation marks) will search for all records with the word Smart or TV in them. This
query can also be written as “Smart OR TV”, “Smart || TV”.
AND: The AND operator matches records where both terms exist anywhere in the text of a single document. This is equivalent to an intersection using sets. The
symbol && can be used in place of the word AND. For example, the search query “Smart AND TV” (excluding quotation marks) will search for all records with
the words Smart and TV in them. This query can also be written as “Smart && TV”.
NOT: The NOT operator excludes records that contain the term after NOT. This is equivalent to a difference using sets. The symbol ! can be used in place of the
word NOT. For example, the search query “Smart NOT TV” (excluding quotation marks) will search for all records that have the word Smart but don’t have the
word TV in them. This query can also be written as “Smart ! TV”.
Plus (+) symbol: The plus (+) symbol, also known as the required operator, requires that the term after the "+" symbol exists somewhere in a record. For
example, the search query “Smart + TV” will search for all records where the word TV must be present, and the word Smart may be present as well.
Minus (–) symbol: The minus (-) symbol, also known as the prohibit operator, excludes documents that contain the term after the "-" symbol. For example, the
search query “Smart - TV” will search for all records where the word Smart is present, and the word TV must not be present.
Grouping: Portal global search supports using parentheses to group clauses to form sub queries. This can be very useful if you want to control the Boolean logic for a
query. For example, if you want to search for all records where either one of the terms “HD” or “Smart” is present but the word TV is always present, then the query
can be written as “(HD or Smart) AND TV” (excluding quotation marks).

Liquid search tag


You can invoke portal global search from liquid templates by using the searchindex tag. More information: searchindex

IMPORTANT
When you use the searchindex tag, facets are not returned as part of results, nor can they be applied as a filter.

Update search index


Search index updates in Power Apps portals happen automatically like the cache invalidation. Keep these important things in mind, though:
All search-enabled entities must have the Change Notification metadata flag enabled, otherwise the portal will not be notified of the changes and the search index will
not be updated.
Any change can take up to 30 minutes to be reflected in a portal search. However, 95 percent of the changes will be updated within 15 minutes. If attachments are
involved, it can take longer depending on the size of the attachment.
It is advisable to rebuild the full index manually after performing a bulk data migration or bulk updates to records within a short span of time. For details, see Rebuild
full search index.

Rebuild full search index


Rebuild of full search index is required whenever:
You make a metadata change to search properties like changing certain query-specific site settings or changing the search view of an entity, and so on.
Bulk data migration or updates are performed.
A website record, associated to your portal, is changed in a Common Data Service environment.
You can also rebuild a full search index from a portal.
1. Sign in to the portal as an administrator.
2. Navigate to the URL as follows: <portal_path>/_services/about
3. Select Rebuild search index.

IMPORTANT
A full index rebuild is a very expensive operation and should not be done during peak hours of usage, as this can bring your portal down.

Remove an entity from global search


At times, you might be required to completely remove certain entities from portal global search to ensure that your customers get the right results quickly.
In the following example, we will remove the Case entity from portal global search.
Step 1: Block case entity from getting indexed
To block the Case entity from getting indexed, you must rename the view of the Case entity that defines the record set to be indexed by the portal (defined by the
Search/IndexQueryName site setting). By default, the name of that view is Portal Search.
1. Go to https://make.powerapps.com and select Solutions.

2. Search for Default Solution and select Edit to open.

3. Search and edit Case entity to see its components.


4. Select Views tab and then select Portal Search to open it in a view editor.
5. In the view editor, rename the view according to your requirement. Ensure the new name doesn't have the Portal Search term.
6. Save and publish the changes and close the view editor.
7. Rebuild the full index as described in the Rebuild full search index section.

NOTE
In this example, we are making changes in an unmanaged layer by directly editing the view. You can also do this via a managed solution.
Step 2: Remove case entity from the UI
After performing the actions described in Step 1, the Case entity would be stopped from getting indexed. To remove the case entity from UI surface areas, you must modify
the site setting associated with portal global search. The following site setting must be modified:
search/filters: This will remove case entity from filters on the Search page as well as the search box in the header of the site. By default, the value is:
Content:adx_webpage,adx_webfile;Blogs:adx_blog,adx_blogpost;Forums:adx_communityforum,adx_communityforumthread,adx_communityforumpost;Ideas:adx_ideaforum,adx_idea;Help
Desk:incident;Knowledge:knowledgearticle

You must delete Help Desk:incident; from the value of this site setting so that the Incident entity is removed from filters that come next to the search box in the UI.
The modified value will be:
Content:adx_webpage,adx_webfile;Blogs:adx_blog,adx_blogpost;Forums:adx_communityforum,adx_communityforumthread,adx_communityforumpost;Ideas:adx_ideaforum,adx_idea;Knowledge:knowledgearticle

Once this site setting is changed, the Case entity will be removed from filters on the search page as well as in the header.
Use faceted search to improve portal search
1/23/2020 • 2 minutes to read • Edit Online

Portal content may be searched by using filters based on characteristics of the content. The filters implemented by
faceted portal search allow customers to find the content they want more quickly than a traditional search.

Enable or disable faceted search


Out-of-the-box faceted search is enabled in your portals. To control or enable it, follow these steps:
1. Open the Portal Management app and go to Portals > Website > Site Settings.
2. Select the Search/FacetedView site setting.
3. Change the Value to True to enable or False to disable faceted search.
To disable a single piece of the faceted view:
1. Open the Portal Management app and go to Portals > Web Templates.
2. Select the view to disable (that is, Knowledge Management – Top Rated Articles)
3. Select Deactivate at the top of the page.

Group entities as part of a record type for faceted view


The site setting Search/RecordTypeFacetsEntities allows you to group similar entities together so users have
logical ways of filtering search results. For example, instead of having separate options for forums, forum posts,
and forum threads, these entities are grouped under the Forums record type.
Go to Portals > Websites > Site Settings and open the Search/RecordTypeFacetsEntities site setting.
Notice that the different entities are preceded by the word Forums:. This is because the first value is the name with
they are grouped as. This word will be translated based on the language that is being used on the portal.

Use faceted search to improve knowledge search results


Faceted search enables portals to have search filters on the leftmost side allowing you to choose between items
like forums, blogs, and knowledge articles. More filters are added for specific search types. For example,
knowledge articles can be filtered by Record Type, Modified Date, Rating, and Products to help customers find the
content they need. The rightmost side also has a drop-down box that sorts results based on the customer’s choice
of Relevance or View Count (specific to knowledge articles). Below is a screen capture with an example of some of
the available filters.
Search within file attachment content
1/23/2020 • 3 minutes to read • Edit Online

You can use the notes attachment to include downloadable files in knowledge base articles. You can also use web
files to create an FAQ page with downloadable content.
You can configure your portal to allow portal users to search within the attachment content of knowledge base
articles. This helps users to find the information that they're looking for.
In knowledge base articles, any notes attachment with the defined prefix are indexed. In web files, the latest notes
attachment are indexed.
To index the attachments, you must create the following site settings and set their value to True:

SITE SETTING DESCRIPTION

Search/IndexNotesAttachments Indicates whether the content of notes attachments in


knowledge base articles and web files should be indexed. By
default, it is set to False.

KnowledgeManagement/DisplayNotes Indicates whether to index attachments of knowledge base


articles. By default, it is set to False.

NOTE
Only the files that are attached to knowledge articles can be searched. The files that are attached to web files are not
searchable.

When you search for a term, the search results also include attachments. If the search term matches a notes
attachment, the link to the corresponding knowledge base article is also provided. To see downloadable
attachments, select Downloads under Record Type in the left pane. To modify the Downloads label, edit the
Search/Facet/Downloads content snippet. By default, the value is set to Downloads.
NOTE
To use this functionality, you must enable relevance search. More information: Relevance search

Update portal configurations


If you already have a portal before April 2018 and you have upgraded your portal to the latest version, you must
use the following configurations to have the same user experience as a new portal installation.
Content Snippets
To modify the label displayed in the search results for annotation and web file downloads, create a content
snippet Search/Facet/Downloads, and then set its value as required. The default value is Downloads.
Web Files
The content of file attachments associated with web files can now be indexed. You can update existing web files
for CSS files and image files (for example, bootstrap.min.css, theme.css, and homehero.jpg) to be excluded from
search.
1. Open the Portal Management app and go to Portals > Web Files.
2. Open the file to be excluded from search.
3. Under Miscellaneous, select Yes in the Exclude From Search field.
Web Templates
The Faceted Search - Results Template web template is revised to display files associated with knowledge base
articles as primary search result items with a related article link. You must update the Faceted Search - Results
Template web template to the following source:
{% assign openTag = '{{' %}
{% assign closingTag = '}}' %}
{%raw%}
<script id=search-view-results type=text/x-handlebars-template>
{{#if items}}
<div class=page-header>
<h3>{%endraw%}{{openTag}} stringFormat {{ resx.Search_Results_Format_String }} firstResultNumber
lastResultNumber itemCount {{closingTag}}{%raw%}
<em class=querytext>{{{query}}}</em>
{{#if isResetVisible}}
<a class="btn btn-default btn-sm facet-clear-all" role="button" title="{%endraw%}{{
snippets['Search/Facet/ClearConstraints'] | default: res['Search_Filter_Clear_All'] }}{%raw%}" tabIndex="0">
{%endraw%}{{ snippets['Search/Facet/ClearConstraints'] | default: res['Search_Filter_Clear_All'] }}{%raw%}
</a>
{{/if}}
</h3>
</div>
<ul>
{{#each items}}
<li>
<h3><a title={{title}} href={{url}}>{{#if parent}}<span class=glyphicon glyphicon-file pull-left text-
muted aria-hidden=true></span>{{/if}}{{title}}</a></h3>
<p class=fragment>{{{fragment}}}</p>
{{#if parent}}
<p class=small related-article>{%endraw%}{{ resx.Related_Article }}{%raw%}: <a title={{parent.title}}
href={{parent.absoluteUrl}}>{{parent.title}}</a></p>
{{/if}}
<ul class=note-group small list-unstyled>
{{#if relatedNotes}}
{{#each relatedNotes}}
<li class=note-item>
{{#if isImage}}
<a target=_blank title={{title}} href={{absoluteUrl}}><span class=glyphicon glyphicon-file aria-
hidden=true></span>&nbsp;{{title}}</a>
{{else}}
<a title={{title}} href={{absoluteUrl}}><span class=glyphicon glyphicon-file aria-hidden=true>
</span>&nbsp;{{title}}</a>
{{/if}}
<p class=fragment text-muted>{{{fragment}}}</p>
</li>
{{/each}}
{{/if}}
</ul>
</li>
{{/each}}
</ul>
{{else}}
<h2>{%endraw%}{{ resx.Search_No_Results_Found }}{%raw%}<em class=querytext>{{{query}}}</em>
{{#if isResetVisible}}
<a class="btn btn-default btn-sm facet-clear-all" role="button" title="{%endraw%}{{
snippets['Search/Facet/ClearConstraints'] | default: res['Search_Filter_Clear_All'] }}{%raw%}" tabIndex="0">
{%endraw%}{{ snippets['Search/Facet/ClearConstraints'] | default: res['Search_Filter_Clear_All'] }}{%raw%}
</a>
{{/if}}
</h2>
{{/if}}
</script>
{%endraw%}

Site Settings
You must add \_logicalname:annotation~0.9^0.25 value to the Search/Query site setting. After it's added, the
value should be as follows:
+(@Query) \_title:(@Query) \_logicalname:knowledgearticle~0.9^0.3 \_logicalname:annotation~0.9^0.25
\_logicalname:adx_webpage~0.9^0.2 -\_logicalname:adx_webfile~0.9 adx_partialurl:(@Query)
\_logicalname:adx_blogpost~0.9^0.1 -\_logicalname:adx_communityforumthread~0.9

To configure the facets to group annotations associated with knowledge base articles and web files in a single
facet, edit the Search/RecordTypeFacetsEntities site setting name and append ;Downloads:annotation,adx_webfile
to its value.
To allow attachments associated with knowledge articles to appear in the portal and search results, edit the
KnowledgeManagement/DisplayNotes site setting and set its value to True. The site setting
KnowledgeManagement/NotesFilter contains a prefix value that must be prefixed to the note text field on
notes; only notes with the specified prefix value will appear on the portal. By default, the value is *WEB*, but you
can change it through the site setting.
To enable the indexing of file attachments associated with notes, create the Search/IndexNotesAttachments
site setting and set its value to True.
Enable multiple-language portal support
2/3/2020 • 3 minutes to read • Edit Online

Business is not confined to a single region or a language. A single portal can display content in multiple languages
to reach customers around the world. The content of your portal can be translated into multiple languages while
maintaining a single content hierarchy.

To enable multiple languages for a portal, follow these steps:


1. Enable languages in a Common Data Service environment.
2. Go to Portals > Website > Websites.
3. Select the website to add language support to.
4. In the Supported Languages section under the General tab, select New Website Language.
5. Fill in the form, including Portal Language (a lookup of languages that are activated in the organization
and are supported by portals) and Publishing State.
NOTE
If you activate new languages after the portal has been provisioned, you can import the metadata translations to get the
metadata translated for the newly activated languages.

Supported languages
The table below shows all the languages currently available out of the box. This list can be found by going to
Portals > Content > Portal Languages. The Portal Display Name of a language can be changed after selecting
the language to change from this page. Note that the list now includes East Asian languages (Japanese, Chinese,
and Korean).

NAME LANGUAGE CODE LCID PORTAL DISPLAY NAME

Basque - Basque eu-ES 1069 euskara

Bulgarian - Bulgaria bg-BG 1026 български

Catalan - Catalan ca-ES 1027 català

Chinese - China zh-CN 2052 中文(中国)

Chinese - Hong Kong SAR zh-HK 3076 中文(香港特別行政區)

Chinese - Traditional zh-TW 1028 中文(台灣)


NAME LANGUAGE CODE LCID PORTAL DISPLAY NAME

Croatian - Croatia hr-HR 1050 hrvatski

Czech - Czech Republic cs-CZ 1029 čeština

Danish - Denmark da-DK 1030 dansk

Dutch - Netherlands nl-NL 1043 Nederlands

English en-US 1033 English

Estonian - Estonia et-EE 1061 eesti

Finnish - Finland fi-FI 1035 suomi

French - France fr-FR 1036 français

Galician - Spain gl-ES 1110 galego

German - Germany de-DE 1031 Deutsch

Greek - Greece el-GR 1032 Ελληνικά

Hindi - India hi-IN 1081

Hungarian - Hungary hu-HU 1038 magyar

Indonesian - Indonesia id-ID 1057 Bahasa Indonesia

Italian - Italy it-IT 1040 italiano

Japanese - Japan ja-JP 1041 日本語

Kazakh - Kazakhstan kk-KZ 1087 қазақ тілі

Korean - Korea ko-KR 1042 한국어

Latvian - Latvia lv-LV 1062 latviešu

Lithuanian - Lithuania lt-LT 1063 lietuvių

Malay - Malaysia ms-MY 1086 Bahasa Melayu

Norwegian (Bokmål) - nb-NO 1044 norsk bokmål


Norway

Polish - Poland pl-PL 1045 polski

Portuguese - Brazil pt-BR 1046 português (Brasil)

Portuguese - Portugal pt-PT 2070 português (Portugal)


NAME LANGUAGE CODE LCID PORTAL DISPLAY NAME

Romanian - Romania ro-RO 1048 română

Russian - Russia ru-RU 1049 русский

Serbian (Cyrillic) - Serbia sr-Cyrl-CS 3098 српски

Serbian (Latin) - Serbia sr-Latn-CS 2074 srpski

Slovak - Slovakia sk-SK 1051 slovenčina

Slovenian - Slovenia sl-SI 1060 slovenščina

Spanish (Traditional Sort) - es-ES 3082 español


Spain

Swedish - Sweden sv-SE 1053 svenska

Thai - Thailand th-TH 1054 ไทย

Turkish - Turkey tr-TR 1055 Türkçe

Ukrainian - Ukraine uk-UA 1058 українська

Vietnamese - Vietnam vi-VN 1066 Tiế ng Việt

Create content in multiple languages


1. Sign in to Dynamics 365 Portals.
2. Go to Portals > Content > Web Pages to see a list of content. For each webpage, there will be a parent
version of the page and a child version of the page for each language activated for the portal.
3. To add a new localization of the page, go to a base page and scroll down to Localized Content.
4. Select the + button on the rightmost side to create a lookup for the localized version.

NOTE
The configuration fields on the home page of a content page is not inherited to the existing content pages. They are used
only in creation of new content pages. You must update the content page configurations individually.

Knowledge articles will only be displayed if they have been translated into the language the user sets the portal to
be displayed in. However, forums and blogs allow for more control over how they are presented in other
languages. Specifying a language for a forum or blog is optional. If a language is not specified, the forum or blog
will be displayed in the primary language of the organization. If you want the forum or blog specific to a language,
you must create it and assign the language to it.
Web link sets are the navigation links at the top of the portal. By navigating to Portals > Content > Web Link
Sets you can control how this content is translated. When a language is active for the portal, a new set of links are
created for the newly activated language.
Create and manage web files
1/23/2020 • 4 minutes to read • Edit Online

A web file represents downloadable file in a portals website, used to store images, documents, and any other file
type.
To store the actual contents of a given file, portals uses the attachment feature of the notes associated with a web
file record. The file attachment of the newest note associated with the web file is used as the file content. As such,
the size of web file content that can be supported by portals is determined by the note attachment size supported
by your Dynamics 365 installation.

Manage web files


Web files can be created, edited, and deleted within Power Apps portals.
1. Open the Portal Management app.
2. Go to Portals > Web Files.
3. To create a new web file, select New.
4. To edit an existing web file, select the web file name.
5. Enter appropriate values in the fields.
6. Select Save & Close.
Web file attributes
The table below explains many of the standard web file attributes used by portals. It is important to note that the
way in which many of the content/display-oriented attributes are rendered is controlled by the page template used,
and thus by the portal developer.

NAME DESCRIPTION

Name The descriptive name of the entity. This value will be used as
the file title in most templates (e.g., for link titles). This field is
required.

Website The website to which the entity belongs. This field is required.

Parent Page The parent Web Page of the entity, in the website content
hierarchy.
While a file is not required to have a parent page – in some
scenarios, for example, a file may have a parent blog post
instead – providing a parent page is the recommended
configuration in most cases.
NAME DESCRIPTION

Partial URL The URL path segment used to build the portal URL of this
page.
The single root (Home) page of your website – the single page
that has no associated Parent Page – must have a Partial URL
value of /.
Partial URL values are used as URL path segments. As such,
they should not contain illegal URL path characters, such as ?,
#, !, %. Since Adxstudio Portals URLs are generated by joining
together Partial URL values with slashes (/), they should also
not generally contain slashes. Recommended practice would
be to restrict Partial URL values to letters, numbers, and
hyphens or underscores. For example: press-release.pdf,
Site_Header.png.

Publishing State The current publishing workflow state of the file, which may
dictate whether or not the file is visible on the site. The most
common use of this feature is to provide published/draft
control over content.
Users with content management permissions may be granted
the ability to use Preview Mode, which allows these users to
see (preview) unpublished content.

Display Date This attribute is a date/time value that can be used by a


template, purely for display purposes. It has no functional
implications, but can be useful for things like, for example,
manually specifying a published date on a press release
document.

Release Date Controls a date/time after which the file will be visible on the
portal. If the current date/time is prior to this date, this file will
not be visible. (The exception to this is that users with content
management permissions may be granted the ability to use
Preview Mode, which allows these users to see (preview)
unreleased content.) This is useful for controlling the release of
time-sensitive content, like news or press releases.

Expiration Date Controls a date/time prior to which the file will be visible on
the portal. If the current date/time is after this date, this file
will not be visible. (The exception to this is that users with
content management permissions may be granted the ability
to use Preview Mode, which allows these users to see
(preview) expired content.)

Summary A short description for the file, this value will generally be used
to add a description of the file to portal navigational elements
that render a link to the file.

Hidden from Sitemap Controls whether or not the file is visible has part of the
portal site map. If this value is checked, the file will still be
available on the site at its URL, and can be linked to, but
standard navigational elements (menus, etc.) will not include
the page.

Display Order An integer value indicating the order in which the file will be
placed, relative to other entities with the same Parent Page.
This controls the ordering of files and other site map entities
when, for example, a list of links to the child entities of a given
page are rendered on the portal.
NAME DESCRIPTION

Cloud Blob Address A text value in the format <container>/<filename> ,


indicating that the content for this file is stored in Azure Blob
Storage.

Content-Disposition Options are inline or attachment. If inline is specified, the


browser should attempt to render it within the browser
window and if it cannot, it will prompt the user to download
or open the file. If attachment is specified, it will immediately
prompt the user to download or open the file, and not try to
load it in the browser, whether it can or not.

Enable Tracking If enabled, every request for this web file will be logged. A
Web File Log record will be created with the date & time, IP
Address, and the contact record if the user is authenticated.
Manage web links
1/23/2020 • 4 minutes to read • Edit Online

A web link can link to any URL or it can link to another webpage within the same website. When a web link is to a
webpage, the security and publishing state of the webpage will apply to the web link as well. Web links are always
part of a web link set. A web link set is a group of links such as a primary navigation or a group of footer links.
Web link sets allow internal, regardless of placement in the site map, and external links to be grouped together and
ordered.

Manage web links in Power Apps portals


Once the portal customizations have been imported into the Common Data Service environment, web links can
be managed from a web link set.
1. Open the Portal Management app.
2. Go to Portals > Web Link Sets.
3. To create a new web link set, select New.
4. To edit an existing web link set, select the web link set name.
5. Enter appropriate values in the fields.
6. If you create a new web link set, select Save to save the record so you can add web links.
7. Go to the Links tab.
8. To create a new web link, select New Web Link.

9. To edit an existing web link, select the web link name.


10. Enter appropriate values in the fields.
11. Save the changes.

Web link set attributes and relationships


The table below explains many of the standard Web Link Set properties used by portals. It is important to note
that the way in which many of the content/display-oriented properties are rendered is controlled by the page
template used.
NAME DESCRIPTION

Name The descriptive name of the web link set. This value usually
describes the placement of the set in the page template such
as Primary Navigation. This field is required.

Website The website to which the entity belongs. This field is required.

Title An optional title for the web link set. This value can be used
on the portal if it's part of the page template. It could be
something like Our Partners and be displayed in a side bar.

Copy An optional description for the web link set. This value can be
used on the portal if it's part of the page template. It could
further describe something like Our Partners in a side bar.

Web link attributes and relationships


The table below explains many of the standard Web Link properties used by portals. It is important to note that
the way in which many of the content/display-oriented properties are rendered is controlled by the page template
used.

NAME DESCRIPTION

Name The title for the web link. This value will be used as the web
link title in most templates. This field is required.

Web Link Set The web link set to which the entity belongs. This field is
required.

Parent Web Link The parent web link of the entity, in a multilevel web link set. If
no parent web link is specified, the entity is at the top/root
level of the web link set.

Page An optional webpage from the same website to link to.

External URL An optional URL to link to. This value can be any properly
formatted URL.

Description An optional summary for the web link. This value can be used
on the portal if it's part of the page template.

Publishing State The current publishing workflow state of the web link, which
may dictate whether the web link is visible on the site. The
most common use of this feature is to provide published/draft
control over content. This field is required.

Robots Follow Link Indicates whether or not search indexers should follow and
index the contents of the link. This field is required.

Display Order An integer value indicating the order in which the web link will
be placed, relative to other web links within the same web link
set.
NAME DESCRIPTION

Display Page Child Links In a template that supports multilevel web link sets, generate
child links for this entity using the portal site map provider.
Note that this option is only valid for web links that refer to
internal pages, and not external URLs.

Open in New Window Indicates whether selecting the link will load the link in a new
browser window.

Disable Page Validation Indicates whether the security of a linked webpage will be
applied to the web link as well.

Image URL An optional URL to an image. The linked image can be used
on the portal if it's part of the page template; for example, as
an icon.

Image Height An optional height for the image from the Image URL
property.

Image Width An optional width for the image from the Image URL
property.

Image Alt Text An optional description for the image from the Image URL
property.

Display Image Only Indicates that the template should render only an image link
for this web link, rather than both the image and link name
together.

NOTE
When a web link is to a webpage, the security and publishing state of the webpage will apply to the web link as well. This
validation can be disabled with the Disable Page Validation option.
Users with content management permissions may be granted the ability to use Preview Mode, which allows these
users to see (preview) unpublished content.

See also
Customize content by using content snippets
Create and manage page templates
1/23/2020 • 2 minutes to read • Edit Online

While web pages are nodes in your portal's sitemap which represent content accessible to portal users, page
templates represent the actual .aspx pages which provide a means to maintain a consistent look and feel
throughout your entire website. Page templates are built using ASP.NET pages, master pages, cascading style
sheets (CSS ), user controls, and server controls.
When creating a new web page for the site, whether through front-side publishing or through the portal interface,
you must select a page template which will present the page's content to users of the portal.
The difference between web pages and page templates is perhaps best understood as the difference between an
exact URL and an actual .aspx page which acts as a blueprint for displaying content. Each webpage represent a
specific URL in your site, which users can navigate to. When a user navigates to a URL, the content associated with
that URL is displayed. However, a webpage contains no information on how that content is displayed. This is
determined by the page template, which is the actual .aspx page which generates the HTML that the user sees.
When you create a new webpage, you must choose a page template from a list of existing templates. Several Page
templates are included with each of the start portals. When using these portals as a base for your own website,
these templates will come in handy as a basic means of demonstrating the functionality of the portal. However, a
portal developer will be necessary to significantly change the layout of these pages. In most cases, the “Page” page
template will be the page template to use as it is general purpose: a web page using this template will have its
content displayed, as well as a list of child pages presented as navigation items.

Manage page templates


Creating a new Page Template is only necessary when creating a brand new .aspx page to display content on your
website, a portal developer’s task. In fact, for the purposing of simply customizing the layout of your site, a portal
developer can largely just modify existing .aspx pages.
1. pen the Portal Management app.
2. Go to Portals > Page Templates.
3. To create a new page template, select New.
4. To edit an existing page template, select the page template name.
5. Enter appropriate values in the fields.
6. Select Save & Close.
Page template attributes
NAME DESCRIPTION

Name Name of the template used for reference.

Website The associated website.


NAME DESCRIPTION

Type The type of the template, which controls how the template will
determine what to render.
Rewrite: Will use the Rewrite URL field to render a
given ASP.NET template.
Web Template: Will use the Web Template field to
render a given Web Template.

Rewrite URL Path of the physical ASP.NET .aspx page (or other resource,
such as .ashx) which will be rendering the content.
This field is displayed only if Rewrite URL is selected from the
Type list.

Web Template A reference to a web template to that will be used to render


this template.
This field is displayed only if Web Template is selected from
the Type list.

Is Default If 'Yes' then the template will be the default assigned to the
dropdown in the client-side editing tools.

Entity Name The page entity type that this template expects to render. This
will be use by the front-side editing system to present only
appropriate template choices to content authors.
Usually, this will be Web Page (adx_webpage), but may be
another portal entity, such as Forum, Forum Thread, Blog, or
Blog Post.

Description A description of this template, for the benefit of front-side


editing users.
Customize content by using content snippets
1/23/2020 • 2 minutes to read • Edit Online

Content snippets are small chunks of editable content that can be placed by a developer on a page template,
allowing for customizable content to populate any portion of a page's layout easily. Snippet controls, which are
responsible for rendering the content of snippets on the web-facing portal, are placed on a page template by
developers.

Edit snippets
Snippets can be edited either through the Portal Management app. The main power of the snippet is the fact that
you can abstract a bit of content (other than the main copy of the page) and edit it separately, allowing essentially
any static content on your site to be fully content-managed and editable.
1. Open the Portal Management app.
2. Go to Portals > Content Snippets.
3. To create a new snippet, select New.
4. To edit an existing snippet, select an existing Content Snippet in the grid.
Enter values for the following fields:

NAME DESCRIPTION

Name The name can be used by a developer to place the snippet


value into a page template within the portal's code.

Website The website that is associated with the snippet.

Value The content of the snippet to be displayed in the portal. This


can contain plain text or HTML markup.
Add a redirect URL to a new URL on a portal
1/23/2020 • 2 minutes to read • Edit Online

Customers frequently want to have a simple URL that redirects to a page deeper in the site, or they want to allow
for a legacy URL to be used with the site and automatically redirect to a new URL in the site. Page redirects allow a
content author to specify a URL that, when requested, will be redirected on a permanent or temporary basis to a
specific webpage or web file. These redirect URLs are managed separately from the page content so that they do
not have to fit directly in the web hierarchy.

Create a redirect
1. Open the Portal Management app.
2. Go to the Portals > Website > Redirects.
3. select New.
4. Enter the redirect information as described below.

NAME DESCRIPTION

Name The friendly name of the redirect. (Can be anything. Make it


easy to identify.)

Website The website the redirect is associated with. (The site the user is
redirected from.)

Inbound URL The partial URL that is to be redirected. (The page the user is
redirected from.)

Status Code One of the following: 302 (Temporary Redirect): returns a


temporary redirect status. This is the default. - 301
(Permanent Redirect): returns a permanent redirect status,
indicating the resource has moved permanently.

URL A target external URL to be redirected to. (Use this if the user
is being redirected to a link external to the website specified
above.)

Web Page A target internal webpage to be redirected to. (Use this if the
user is being redirected to a page internal to the website
specified above.)

Site Marker A target internal site marker to be redirected to.

4. After entering the required fields and specifying a value for at least one of the URL, Web Page, or Site
Marker fields, select Save.
Use the redirect
When the inbound URL is requested, the browser is redirected to the URL of the target webpage for the matching
redirects entry.
For example, for an Inbound URL value of cs-survey with a target webpage set to the Customer Support Survey
page, the following request:
https://customerportal.contoso.com/cs-survey
results in the browser requesting the following URL:
https://customerportal.contoso.com/surveys/customer-service-survey/
Place child nodes by using shortcuts for portals
1/23/2020 • 3 minutes to read • Edit Online

Use shortcuts to place child nodes throughout your portal's sitemap that simply point to other nodes that exist in
your sitemap, or to URLs external to your portal. In other words, webpages, web files, events, and forums can all be
considered "solid" nodes of your portal's sitemap: they are added to your sitemap and when you navigate to them,
you see the actual content of those nodes directly. Shortcuts, on the other hand, can be considered “intangible”
nodes: they are also added to the sitemap (unlike web links, which are not), but when you navigate to them, you see
the content for the target "solid" node that the shortcut points to, and that content is rendered by the page template
for that node.

Manage shortcuts
Creating, editing, and deleting shortcuts can be done within Power Apps portals.
1. Open the Portal Management app.
2. Go to Portals > Shortcuts.
3. To create a shortcut, select New.
4. To edit an existing shortcut, select the existing shortcut in the grid.
5. Enter values for the fields provided.
6. Select Save & Close
Attributes and relationships
NAME DESCRIPTION

Name A Descriptive Name for the shortcut. For internal use only.

Website The website that the shortcut belongs to.

Parent Page The parent webpage of the shortcut entity in the sitemap. The
shortcut will be added to the sitemap as a child of this page.

External URL Target of the shortcut to a URL of a resource outside of your


organization.

Web Page Target of the shortcut to an internal webpage.

Web File Target of the shortcut to a web file.

Event Target of the shortcut to an event.

Forum Target of the shortcut to a forum.

Title The title for the shortcut. This is the name that will appear in
the sitemap and child navigation view areas. If left blank, the
title (or name) of the target entity will be shown instead.
NAME DESCRIPTION

Description A description to appear in child nav views. Optional.

Display Order The front-side editable order that the shortcut will appear in
sitemap and child nav views, in relation to other nodes in the
site map.

Disable Shortcut Target Validation If unchecked, the security of the shortcut will be based on the
target. Otherwise, it will be based on the parent. For more
details, see Security below.

NOTE
A shortcut needs only to have one of the 'Target' fields (External URL, Web Page, Survey, Web File, Event, Forum) assigned a
value, and a shortcut will only have one target. For example, a shortcut does not point at both a Web Page and a survey, or
an External URL and a Web File. If more than one target attribute exists for a shortcut, the shortcut will just take the first one,
ignoring all others. The order of priority for which target will be chosen is reflected on the main shortcut form. So, it will first
check if there exists an External URL for the shortcut, and if there is, then the shortcut's target will be the External URL and all
other target attributes will be ignored. If there is no External URL, then the shortcut will check the Web Page, then the
Survey, Web file, Event, and finally Forum.

Secure shortcuts
Security for shortcuts can be based either on the parent page of the shortcut or on the target of the shortcut. This
will determine whether the shortcut will be visible in the sitemap. Naturally, if security is based off the parent, the
write access of the target of the shortcut will still determine whether front-side editing will function after the
shortcut has been used to navigate to the target of the shortcut. Therefore, shortcut security only affects navigation
and edit rights for front-side editing of shortcuts. The security method used is specific to the shortcut. If you leave
the Boolean value Disable Shortcut Target Validation unselected, the security of the shortcut will be based on
the target; otherwise, it will be based on the parent.

Navigate with shortcuts


After the shortcut entity has been created, it will appear in your website. In the above example, Basic Site has two
additional pages, Page One and Page Two. Page Two Is a Child of Page One, which is a Child of the Home Page.
Additionally, there is a shortcut that is a child of the Home page which points to Page Two.
Behavior and format of the date and time field
1/23/2020 • 2 minutes to read • Edit Online

In Common Data Service, the Date and Time data type is used in many system entity fields. For example, you can
show when an account was last used in a marketing campaign, or show the date and time when a case was
escalated. You can also create custom entities that include the date and time fields. Depending on what the field
represents, you can choose one of the following field behaviors for portal forms and grids:
User Local: The field values are displayed in the user’s local time and formatted as per their current portal
language/locale. The values are stored in UTC time zone format in Common Data Service. When a user in
Common Data Service (or another portal user) in a different time zone views that value, they see it
converted to their own time zone.
Date Only: The field values only contain the date and are displayed with no time zone conversion. The time
portion of the value is always 12:00 AM. The value entered by one user is seen the same by other users in
different time zones (for example, birth dates).

NOTE
The behavior of this field can’t be changed after it’s saved.

Time-Zone Independent: The field values contain date and time, and are displayed with no time zone
conversion. The value entered by one user is seen the same by other users in different time zones.

NOTE
The behavior of this field can’t be changed after it’s saved.

You can also override the default date/time format to be used on portals by creating the following site settings:
DateTime/DateFormat: The date format used on the portal.
DateTime/TimeFormat: The time format used on the portal.
DateTime/DateTimeFormat: The format for full date and time used on the portal.
By default, the portal uses the standard date/time formats specified by the website language settings. The accepted
date/time formats are specified here.
View activities in a portal timeline
1/23/2020 • 2 minutes to read • Edit Online

While working on a case or interacting with a customer, you might create an activity such as an appointment, an
email or a phone call. When you navigate to the Timeline in your support portal, you might not find this activity
because by default all activities are not displayed in portal Timeline.
To view all activities in a portal Timeline:
1. Set the CustomerSupport/DisplayAllUserActivitiesOnTimeline site setting to true.

NOTE
If DisplayAllUserActivitiesOnTimeline site setting does not exist, you can create a new setting with this name.

2. If not present, add the activity type to include in the view filter:
a. Go to Settings > Customizations > Customize the System.
b. Select Activity entity and expand Views.
c. Edit the Portal Timeline View.
d. Update the Edit Filter Criteria and add the required activity type such as Appointment, Email or
Phone Call.
e. Save and Publish the customizations.

IMPORTANT
Preparing customizations may take some time. If you see a message that the browser page has become
unresponsive, wait for the page to become responsive, and don't close it.

3. Since this is a portal metadata change , clear the server-side cache to ensure the updated data is displayed
on the portal.
Rate or vote on a webpage on a portal
1/23/2020 • 2 minutes to read • Edit Online

Ratings provide users with the ability to rate or vote on a webpage. Ratings can also be enabled for comments on
pages. By default, this feature is disabled, but it can be enabled on a page-by-page basis.
Ratings are custom activities and thus can be used in the same way as any other activity such as emails, phone
calls, and so on. Because ratings are activities, by using customization you can have ratings appear for any entity
you choose that appears and is rendered on the portal, including custom entities.

Enable ratings for pages


1. Open the Portal Management app.
2. Go to Portals > Web Pages.
3. Select the Web Page in which you want to enable ratings.
4. On the General tab, under Page Options, set Enable Ratings to Yes.
5. Select Save & Close.

Use ratings
For webpages that have page ratings enabled and the developer has applied the control to the template, users can
rate the page either by using the rating scale or voting, depending on the type chosen when the control was added
to the page template.
Rating Type

Vote Type

Manage ratings
The ratings for webpages can be viewed, modified, or deleted within Power Apps portals.
1. Open the Portal Management app.
2. Navigate to the Web page that you are interested in seeing the ratings for.
3. On the Related tab, select Activities. The associated view lists the ratings for the selected webpage. Within
this view, users can modify or delete existing ratings.
Enable header and footer output caching on a portal
1/23/2020 • 3 minutes to read • Edit Online

To improve processing performance for Header and Footer web templates in a portal, enable header and footer
output caching. Header and Footer web templates are parsed and rendered every time a page is loaded. Caching
header and footer output significantly reduces page processing time.
For a new user, output caching is enabled by default. The following site settings are available and set to true by
default to support this functionality:
Header/OutputCache/Enabled: Set the value to true to enable output caching for header.
Footer/OutputCache/Enabled: Set the value to true to enable output caching for footer.
For a user who upgraded to a newer version of portals, output caching is disabled by default—that is, the Header
and Footer web templates are parsed and rendered on every page load. To enable output caching, you must
update the Header, Footer, and Languages Dropdown web templates and create the required site settings.

NOTE
If you enable output caching only by creating site settings, parts of the header and footer will not render properly and error
messages will be displayed.

Enable header and footer output caching for an existing user


Step 1: Update the Header web template
1. Open the Portal Management app.
2. Go to Portals > Web Templates.
3. Open the Header web template.
4. In the Source field, do the following:
Find the following code and update it:
Existing code

<li>
<a href={% if homeurl%}/{{ homeurl }}{% endif %}/Account/Login/LogOff?returnUrl={{
request.raw_url_encode | escape }} title={{ snippets[links/logout] | default:resx[Sign_Out] |
escape }}>
{{ snippets[links/logout] | default:resx[Sign_Out] | escape }}
</a>
</li>
</ul>
</li>
{% else %}
<li>
<a href={% if homeurl%}/{{ homeurl }}{% endif %}/SignIn?returnUrl={{ request.raw_url_encode
}}>
{{ snippets[links/login] | default:resx[Sign_In] }}
</a>
</li>

Updated code
<li>
<a href={% if homeurl%}/{{ homeurl }}{% endif %}{{ website.sign_out_url_substitution }} title=
{{ snippets[links/logout] | default:resx[Sign_Out] | escape }}>
{{ snippets[links/logout] | default:resx[Sign_Out] | escape }}
</a>
</li>
</ul>
</li>
{% else %}
<li>
<a href={% if homeurl%}/{{ homeurl }}{% endif %}{{ website.sign_in_url_substitution }}>
{{ snippets[links/login] | default:resx[Sign_In] }}
</a>
</li>

Find the following code and update it:


Existing code

{% assign current_page = page.adx_partialurl %}


{% assign sr_page = sitemarkers[Search].url | remove: '/' %}
{% assign forum_page = sitemarkers[Forums].url | remove: '/' %}
{% if current_page == sr_page or current_page == forum_page %}
<section class=page_section section-landing-{{ current_page }} color-inverse>
<div class=container>
<div class=row >
<div class=col-md-12 text-center>
{% if current_page == sr_page %}
<h1 class=section-landing-heading>{% editable snippets 'Search/Title' default:
resx['Discover_Contoso'] %}</h1>
{% include 'Search' %}
{% endif %}
</div>
</div>
</div>
</section>
{% endif %}

Updated code
{% substitution %}
{% assign current_page = page.id %}
{% assign sr_page = sitemarkers[Search].id %}
{% assign forum_page = sitemarkers[Forums].id %}
{% if current_page == sr_page or current_page == forum_page %}
{% assign section_class = section-landing-search %}
{% if current_page == forum_page %}
{% assign section_class = section-landing-forums %}
{% endif %}
<section class=page_section section-landing-{{ current_page }} {{ section_class | h }}
color-inverse>
<div class=container>
<div class=row >
<div class=col-md-12 text-center>
{% if current_page == sr_page %}
<h1 class=section-landing-heading>{% editable snippets 'Search/Title' default:
resx['Discover_Contoso'] %}</h1>
{% include 'Search' %}
{% endif %}
</div>
</div>
</div>
</section>
{% endif %}
{% endsubstitution %}

5. Save the web template.


Step 2: Update the Footer web template
1. Open the Portal Management app.
2. Go to Portals > Web Templates.
3. Open the Footer web template.
4. In the Source field, find the following code and update it:
Existing code

<section id=gethelp class=page_section section-diagonal-right color-inverse {% if page %}{% unless


page.parent %}home-section{% endunless %}{% endif %} hidden-print>

Updated code

<section id=gethelp class=page_section section-diagonal-right color-inverse {% substitution %}{% if


page %}{% unless page.parent %}home-section{% endunless %}{% endif %}{% endsubstitution %} hidden-
print>

5. Save the web template.


Step 3: Update the Languages Dropdown web template
1. Open the Portal Management app.
2. Go to Portals > Web Templates.
3. Open the Languages Dropdown web template.
4. In the Source field, find the following code and update it:
Existing code
<a href=/{{ language.url }} title={{ language.name }} data-code={{ language.code }}>{{ language.name }}
</a>

Updated code

<a href=/{{ language.url_substitution }} title={{ language.name }} data-code={{ language.code }}>{{


language.name }}</a>

5. Save the web template.


Step 4: Create site settings
Create the following site settings:

NAME VALUE

Header/OutputCache/Enabled True

Footer/OutputCache/Enabled True
Add a chart created in a model-driven app to a
webpage in portal
2/3/2020 • 2 minutes to read • Edit Online

You add a chart to a webpage by using a Liquid tag named Chart. You can add the chart Liquid tag in the Copy
field on a webpage or in the Source field on a Web template.
For example, {% chart id:EE3C733D -5693-DE11-97D4-00155DA3B01E %}

You can also specify the ID of a view (saved query) to filter the query. For example:
<!—Leads by Source – Open Leads -->
{% chart id:"EE3C733D -5693-DE11-97D4-00155DA3B01E" viewid:"00000000-0000-0000-00AA-
000010001006" %}

Get the ID of a chart


1. Go to the target entity, for example, Sales > Leads.
2. Expand the Charts area.
3. Choose the chart you want.
4. Select More Commands, and then select Export Chart.
5. Open the XML file of the exported chart in a text editor.
6. Copy the value of the <visualizationid> tag.

7. Paste the visualizationid value into your Liquid chart tag declaration for the chart ID parameter, for example:
{% chart id:EE3C733D -5693-DE11-97D4-00155DA3B01E %}.

Get the ID of a view


You must open the view editor to get the view ID to be used with the Liquid chart tag.
1. Go to make.powerapps.com and select the appropriate environment.
2. In the left navigation bar, select Data > Entities.
3. Select the appropriate entity and go to 'Views' tab.
4. You can see the list of views. Go to options (...) and select 'Edit View'.
5. Copy the id value from the View window's address bar.
6. Paste this ID into your Liquid chart tag declaration for the viewid parameter, for example:

<!—Leads by Source – Open Leads -->


{% chart id:"EE3C733D-5693-DE11-97D4-00155DA3B01E" viewid:"00000000-0000-0000-00AA-000010001004" %}

Entity permission requirement


Read privilege is asserted for the target entity being queried in the chart. For anonymous or authenticated users to
be able to view the chart, you must ensure that the appropriate Entity Permission records are created and assigned
to applicable web roles.
If permission is not granted, the user will see an access denied message.

Unsupported charts and chart types


The following chart types are currently not supported in portals:
Doughnut
Tag
The following table lists the charts that are currently not supported in portals.

CHART NAME CHART ID ENTITY TYPE

Accounts by Owner - Tag Chart be178262-6142-4b41-85b7- account


4ccedc62cfd9

Activities by Owner - Tag Chart c83b331e-87c7-488c-b8e7- activitypointer


89a6098ea102

Activities by Priority - Doughnut Chart d3f6c1eb-2e4b-428b-8949- activitypointer


682a311ae057

Contacts by Account 2ff3ebea-6310-4dde-b3a1- contact


e1144ea42b7b

Contacts by Country ea89e2ad-2602-4333-8724- contact


aa5775d66b77

Contacts by Preferred Contact Method 751b7456-308e-4568-a3a9- contact


47135aae833a

Goal Progress (Count) a93b8f7b-9c68-df11-ae90- goal


00155d2e3002
CHART NAME CHART ID ENTITY TYPE

Goal Progress (Money) aec6d51c-ea67-df11-ae90- goal


00155d2e3002

Today's Target Vs. Actuals (Count) 1b697c8e-9a6f-df11-986c- goal


00155d2e3002

Today's Target Vs. Actuals (Money) 1e697c8e-9a6f-df11-986c- goal


00155d2e3002

Cases By Account 38872e4f-ac99-e511-80da- incident


00155dc1b253

Cases By Priority 0f0fb995-9d6f-453c-b26d- incident


8f443e42e676

Cases By Product 17c3f166-5b22-4476-819b- incident


b05da2e8d24f

Articles expiring this month by owner 47d696ad-7c3b-e511-80d1- knowledgearticle


00155db10d2b

By Owner 330068fd-833b-e511-80d1- knowledgearticle


00155db10d2b

By Subject bcd3f9a5-913b-e511-80d1- knowledgearticle


00155db10d2b
About entity forms
3/12/2020 • 16 minutes to read • Edit Online

A data-driven configuration to allow end users to add a form to collect data in the portal without the need for a
developer to surface the form in the portal, entity forms are created in Common Data service and then placed
into webpages in the portal or used in conjunction with subgrids and entity lists to build out complete web
applications. More information: About entity lists

Add a form to your portal


The entity form contains relationships to webpages and additional properties to control the initialization of the
form within the portal. The relationship to webpages allows dynamic retrieval of the form definition for a given
page node within the website.
To view existing entity forms or to create new entity forms, open the Portal Management app and go to Portals
> Entity Forms.
When creating a new entity form, the first step is to decide the Entity and Form Name that you will be
rendering, in addition to the mode: Insert, Edit, or Read Only. The mode selected will determine if you are
creating a new record from the portal, editing an existing record, or just displaying information about a record
on the portal.

NOTE
An Entity Form must be associated with a webpage for a given website for the form to be viewable within the site.
The Connection entity subgrids are not supported in entity forms. If you add a Connection entity subgrid to the form
using Form designer, error messages are displayed when you render the form on the portal and use the Connection
entity.
Duplicate fields, multi-select option set, custom controls, and business rules are not supported in entity forms.
Business rules and client API can enable locked fields on a read-only form.
If you create an entity form in the Insert mode, you can't change a button's alignment or place an action button above
the entity form.
If you render a lookup control as a dropdown list on the form, the related records filter does not work.
The webpages associated with the entity form can be viewed by selecting the Web Pages link listed in the
Related navigation links in the leftmost menu.
When creating or editing a webpage, an Entity Form can be specified in the lookup field provided on the Web
Page form.
The various master pages used by the portal contain declarations of the EntityForm server control. When
rendering the webpage containing either the Page (~/Pages/Page.aspx) page template or Full Page
(~/Pages/FullPage.aspx) page template, the controls will determine whether the entity form lookup contains a
value, in which case the form will be rendered.

Secure your forms


To secure your forms, you must create entity permissions that determine access and ownership of the records
according to web roles. If a user lands on an entity form and does not have permissions, they will receive an
error message. To enable permissions for an entity form, set Enable Entity Permissions to true. More
information: Create web roles for portals.

Entity form attributes and relationships


NAME DESCRIPTION

Name The descriptive name of the record. This field is required.

Entity Name The name of the entity from which the form will be loaded
from. This field is required.

Form Name The name of the Form on the target entity that is to be
rendered. This field is required.

Tab Name Optional name of a Tab on a Form for a specified entity that
is to be rendered.

Mode One of the following values:


Insert
Edit
ReadOnly
Selecting Insert indicates the form should insert a new record
upon submission. Specifying Edit indicates the form should
edit an existing record. Selecting ReadOnly indicates the
form should display an existing record's non editable form.
Edit and ReadOnly requires that a source record exist and
parameters specified in the 'Record Source Type' and 'Record
ID Query String Parameter Name' fields to select the
appropriate record when the form is loaded in the portal.
NAME DESCRIPTION

Record Source Type One of the following values:


Query String
Current Portal User
Record Associated to Current Portal User
Selecting Query String requires a parameter name that must
be provided in the query string of the URL to the form. This
can be specified in the 'Record ID Query String Parameter
Name' field.
Selecting Current Portal User will retrieve the portal user
record for the current authenticated user.
Selecting Record Associated to Current Portal User will
retrieve the portal user record for the current authenticated
user and then retrieve the record for the given relationship
as specified by the 'Relationship Name' field.

Record ID Query String Parameter Name A parameter name provided in the query string of the URL
to the Web Page containing this Entity Form.

Relationship Name Required when Record Source Type is Record Associated to


Current Portal User. The logical name of the relationship
between the current portal user record and the target
record. This must return the same entity type specified by
the Entity Name field.

Allow Create If Null An optional boolean value available when Record Source
Type is Record Associated to Current Portal User. Indicates
that if the related record does not exist, allow the user to
create it the first time, otherwise an exception will be thrown
if the record does not already exist as the form needs a
record to data bind to.

Enable Entity Permissions Will Cause the form to respect Entity Permissions. The
default is false for backwards compatibility reasons. If set to
true, explicit permissions are REQUIRED for any user wanting
to access the form.

Form Options
NAME DESCRIPTION

Add Captcha Displays captcha.

Show Captcha for Authenticated users Displays captcha for authenticated users.

Validation Group The group name assigned to input controls for evaluating
valid input of named groups.

Auto Generate Steps From Tabs Indicates that multiple tabs on an entity form will be
displayed with each tab as a sequential step starting with the
first tab and continue until all tabs have been navigated to
and upon final submission a record is inserted. By default, it
is not selected. The default value indicates that only one tab
or form is to be rendered for the current step. If the Tab
Name is not specified, then the first tab is displayed.
NAME DESCRIPTION

Render Web Resources Inline Eliminates the iframe that encompasses a web resource in an
entity form.

ToolTips Enabled The tooltip is set using the description of the attribute on the
target entity.

Show Unsupported Fields All fields are currently supported. This is reserved for
potential changes Common Data Service may make to field
types.

Set Recommended Fields as Required Makes all attributes required that have the field requirement
level set to 'Business Recommended'.

Make All Fields Required Makes all fields required regardless of the field requirement
level.

Validation Summary CSS Class CSS Class name assigned to the validation summary. Default
is 'validation-summary alert alert-error alert-block'

Enable Validation Summary Links A boolean value of true or false that indicates whether
anchor links should be rendered in the validation summary
to scroll to the field containing an error. Default value is true.

Validation Summary Link Text The label assigned to the validation summary links. Default
value is 'click here'.

Validation Summary Header Text The label assigned to the validation summary header.

Instructions Instructions to work with the form.

Record Not Found Message Message to be displayed when a record is not found.

On Success Settings
NAME DESCRIPTION

On Success One of the following values:


Display Success Message (Default)
Redirect

Hide Form on Success Requires On Success set to Display Success Message. When
selected, the form is hidden upon successful submission of
the form.

Success Message Requires On Success set to Display Success Message. The


message displayed to the user upon successful submission. If
one is not specified a default message (Submission
completed successfully") will be displayed. For each language
pack installed and enabled for the organization a field will be
available to enter the message in the associated language.
NAME DESCRIPTION

External URL Requires On Success set to Redirect. Specify a URL to an


external resource on the web.

or Web Page Requires On Success set to Redirect. Select a Web Page from
the current website.

Append Existing Query String Requires On Success set to Redirect. When selected, the
existing query string parameters will be added to the target
URL prior to redirection.

Append Record ID To Query String Requires On Success set to Redirect. When selected, the ID of
the record created is appended to the query string of the
URL being redirected to.

Record ID Query String Parameter Name Requires On Success set to Redirect. The name of the ID
parameter in the query string of the URL being redirected to.

Append Custom Query String Requires On Success set to Redirect. A custom string that
can be appended to the existing Query String of the redirect
URL.

Append Attribute Value to Query String - Parameter Name Requires On Success set to Redirect. A name to give to the
parameter that correlates to the attribute value on the target
entity that gets appended to the Query String of the redirect
URL.

Append Attribute Value to Query String - Attribute Logical Requires On Success set to Redirect. A logical name of an
Name attribute on the target entity to get the value to be
appended to the Query String of the redirect URL.

Additional Settings
NAME DESCRIPTION

Associate Current Portal User Indicates the currently logged in user's record should be
associated with the target entity record.

Target Entity Portal User Lookup Attribute The logical name of the attribute on the target entity that
stores the portal user.

Is Activity Party Boolean value indicating whether or not the Target Entity
Portal User Lookup Attribute is an Activity Party type.
NAME DESCRIPTION

Attach File Select to have the form include a file upload control at the
bottom of the form to allow a file to be attached to the
record.
Note: Portals with version 9.2.2.x and later do not require
enabling Enable Entity Permissions on the entity form to
attach files. However, if you have it selected, you must
ensure that appropriate privileges are provided on the
parent entity and the annotation entity to display the Attach
File button on the form. Annotation entity must have at
least Create and Append privileges and the parent entity
must have the corresponding AppendTo privilege.
Depending on whether you have a create or update form,
you may also need Create, Read and Write privileges to
complete the scenario of the form.

Attach File Storage Location Options: Note Attachment, Azure Blob Storage. If your
organization is configured to use Azure Storage, you can
choose to storage uploaded files for this Entity Form there.
Otherwise, files with be stored as Note Attachments.

Allow Multiple Files Boolean value indicating whether or not the user can upload
more than one file.

Accept The accept attribute specifies the MIME types of files that the
server accepts through file upload. To specify more than one
value, separate the values with a comma (e.g.
audio/,video/,image/*).

Label The text displayed next to the file upload control. For each
language pack installed and enabled for the organization a
field will be available to enter the message in the associated
language.

Attach File Required Makes the attachment of a file required to proceed.

Required Error Message The message displayed during form validation if Is Required
is true and the user has not attached a file. For each
language pack installed and enabled for the organization a
field will be available to enter the message in the associated
language.

Restrict Files to Accepted Types Forces validation on the Accept field. If not selected, the
Accept attribute will only be used as a suggestion for the file
upload dialog.

File Type Error Message The message displayed during form validation if Restrict Files
to Accepted Types is true and the user has attempted to
upload an invalid file type. For each language pack installed
and enabled for the organization a field will be available to
enter the message in the associated language.

Maximum File Size (in kilobytes) Forces validation on the maximum allowed size of the
uploaded file.
NAME DESCRIPTION

File Size Error Message The message displayed during form validation if Maximum
File Size (in kilobytes) is true and the user has attempted to
upload a file that is too large. For each language pack
installed and enabled for the organization a field will be
available to enter the message in the associated language.

Custom JavaScript A custom block of JavaScript that will added to the bottom
of the page just before the closing form tag element. The
HTML input id of an entity field is set to the logical name of
the attribute. This makes selecting a field, setting values, or
other client-side manipulation easy with jQuery.
$(document).ready(function() {
$("#address1_stateorprovince").val("Saskatchewan");});

Entity Reference
The following parameters pertain to setting an entity reference when the form is saved.
This provides a way to associate the current record being created or updated by the form with another target
record. This is useful if you have multiple steps with multiple entity types and wish to relate the resulting records
or if the page is passed a query string of a record id that you would like associated. For example we have a
careers page that lists job postings, each with a link to an application for the job that contains the id of the job
posting to the application form so that when the application is created the job posting is associated with the
record.

NAME DESCRIPTION

Set Entity Reference On Save Yes or No. A value of yes indicates that an entity reference
should be assigned when the form is saved, otherwise none
will be set.

Relationship Name The Relationship Definition Name for a given relationship


between two entity types.

Entity Logical Name The logical name of the reference entity.

Target Lookup Attribute Logical Name Logical name of the lookup attribute on the target entity
being created or updated.

Populate Lookup Field If the lookup regarding the reference entity is on the form,
checking this value will populate the field on the form with
the value retrieved using the setting below.
NAME DESCRIPTION

Reference Entity Source Type One of the following values:


Query String
Current Portal User
Result From Previous Step
Selecting Query String requires a parameter name that must
be provided in the query string of the URL to the form. This
can be specified in the Query String Name field. If this
parameter is the primary key then select Yes for the Query
String Is Primary Key, otherwise select No and provide the
logical name of the attribute on the target entity to query by
specified in the Query Attribute Logical Name field.
Selecting Current Portal User will retrieve the contact record
for the current authenticated user. Selecting Result From
Previous Step will retrieve the record created as a result of
the step prior to the current step or from a specific step
based on the step associated with the Entity Source Step.

Reference Entity Step The Web Form Step record of a previous step to retrieve the
entity created or edited in that step to associate it with the
record for this current step.

Query String Name Parameter name provided in the Query String of the URL to
the Web Page containing the Web Form.

Query String Is Primary Key Yes indicates the Query String value is the Primary Key value.
No indicates the Query String value is an attribute type other
than the Primary Key.

Query Attribute Logical Name Logical name of the attribute to query the record.

Show ReadOnly Details Indicates that a form should be rendered at the top of the
page displaying read-only information pertaining to the
reference record. Requires a Form Name.

Form Name The name of the form on the reference entity that should be
used to display read-only details.

Entity form action configuration


By default an Entity Form will allow for reading or updating of an existing record, or the insertion of a new
record. However, you can easily enable and configure additional actions for records in an Entity Form as well
(Delete, Activate, Deactivate, etc.). It is also possible to override default labels, sizes, and other attributes that will
appear if there are actions enabled.
These settings are found in the Additional Settings section of the entity form. By default, only Basic Settings
are shown. You can select Advanced Settings to show additional settings.
You can add action buttons for the actions that are applicable for an individual record and will appear for each
row in the grid provided the appropriate privilege has been granted by entity permissions. The following actions
are available:
Delete
Workflow
Create Related Record
Activate
Deactivate
Clicking on one of these options displays a configuration area for that action. Furthermore, certain entities have
special actions that are available to them on a per-entity basis:
Calculate Value of Opportunity (opportunity)
Cancel Case Action (incident)
Close (resolve) Case Action (incident)
Convert Quote to Order (quote)
Convert Order to Invoice (salesorder)
Generate Quote from Opportunity (opportunity)
Lose Opportunity Action (opportunity)
Win Opportunity Action (opportunity)
Reopen Case Action (incident)
Set Opportunity on Hold (opportunity)

NOTE
It is recommend to create a workflow instead of adding an Activate or a Deactivate button for out of the box entities
having defined specific state and status code values that they require for their business processes. For example, Incident
(status options), Opportunity(status options), Entitlements (status options).

Geolocation configuration for entity forms


A managed form can be configured to display a map control to either display an existing location as a pin on a
map or to provide the ability for the user to specify a location. See Add Geolocation.
The form's map control requires additional configuration to tell it what the IDs of the various location fields are,
to assign values to them or retrieve values from them. The Entity Form record has a configuration section that
defines these field mappings that you must specify. The field names will vary depending on the schema you
have created.
NOTE
The address field in a read-only entity form is replaced with the map when geolocation is enabled.
The Geolocation section is not visible in the German Sovereign Cloud environment. If a user has enabled geolocation
by using a different form, it will not be displayed during rendering on portal.

Request validation
Request validation, a feature of ASP.NET since version 1.1, prevents the server from accepting content
containing un-encoded HTML. This feature is designed to help prevent some script-injection attacks whereby
client script code or HTML can be unknowingly submitted to a server, stored, and then presented to other users.
We still strongly recommend that you validate all input data and HTML encode it when appropriate.
By default, request validation is enabled on portal resulting in following generic error if you enter script code
without HTML encoding inside entity form fields:
To disable request validation, follow these steps:
1. Go to portal settings and select Site Settings.
2. Select New.
3. Type the name as DisableValidationWebTemplate.
4. Select appropriate web site record.
5. Type the value as true. By default, setting is false that enables request validation.
6. Type appropriate description.
7. Select Save & Close.
Cau t i on

When request validation is disabled, content can be submitted to a page. You must ensure that content is
properly encoded or processed.
See also
Configure a portal
Web Form properties for portals
Web Form steps for portals
Web Forms metadata for portals
Web Form subgrid configuration for portals
Notes configuration for Entity Forms and Web Forms for portals
About entity lists
2/5/2020 • 34 minutes to read • Edit Online

An entity list is a data-driven configuration that you use to add a webpage that will render a list of records without
the need for a developer to surface the grid in the portal. By using entity lists, you can expose records for display
on portals.
The grid supports sorting and will be paginated if the number of records is larger than the page size specified. If
Web Page for Details View has been specified, each record will contain a link to the page, and the ID of the
record will be appended to the query string along with the ID Query String Parameter Name. The entity list also
supports multiple views. If more than one view has been specified, a drop-down list will be rendered to allow the
user to switch between the various views.
The data can also be filtered by the current portal user, the current portal user's parent Customer account, and the
current portal website. If a value exists for both filter conditions Portal User Attribute and Account Attribute,
the portal will render a drop-down list to allow the user to view their own (My) data or their parent Customer
account's data.

Add an entity list to your portal


The entity list contains relationships to webpages and various properties to control the initialization of the list of
records within the portal. The relationship to the webpage allows dynamic retrieval of the list definition for a given
page node within the website. To view existing Entity views or to create new Entity views, go to Portals > Entity
Lists.

NOTE
An entity list must be associated with a webpage in a given website for the list to be viewable within the site.
Multi-select option set is not supported in entity lists.

The webpages associated with the entity list can be viewed by selecting the Web Pages link listed in the Related
navigation links in the leftmost menu. When creating your entity list, the first step is to choose the entity for which
you want to render a list on the portal. You'll then choose one or more model-driven app views to render.
When creating or editing a webpage, you can specify an entity list in the lookup field provided on the Web Page
form. The page template typically will be the Page template, but can be one of several other templates designed
for content because the master templates contain the necessary logic to determine whether an entity list should be
rendered.

Entity list attributes and relationships


NAME DESCRIPTION

Name The descriptive name of the record. This field is required.

Entity Name The name of the entity from which the Saved Query view will
be loaded. This field is required.
NAME DESCRIPTION

View The Saved Query view(s) of the target entity that is to be


rendered. This field is required. If more than one view has
been specified, the webpage will contain a drop-down list to
allow the user to switch between the various views.

Page Size An integer value that specifies the number of records per
page. This field is required. Default: 10

Web Page for Details View An optional webpage that can be linked to for each record.
The ID Query String Parameter Name and record ID will be
appended to the query string of the URL to this webpage.

Details Button Label The text displayed for the details view button if Web Page
for Details View has been specified. Default: View details
Note: For each language pack installed and enabled for the
Common Data Service environment, a field will be available to
enter the message in the associated language.

Web Page for Create An optional webpage that will be the target of the create
button.

Create Button Label The text displayed for the create button if Web Page for
Create has been specified. Default: Create
Note: For each language pack installed and enabled for the
Common Data Service environment, a field will be available to
enter the message in the associated language._

ID Query String Parameter Name A parameter name provided in the query string of the URL to
the Web Page for Details View. Default: id

Empty List Text Deprecated. The message displayed when there are no
records.
Note: For each language pack installed and enabled for the
Common Data Service environment, a field will be available to
enter the message in the associated language.

Portal User Attribute An optional lookup attribute on the primary entity that
represents the portal user record, either contact or system
user, to which the current user's ID can be applied to filter the
data rendered in the list.

Account Attribute An optional lookup attribute on the primary entity that


represents an account record to which the current user
contact's parent Customer account value can be applied to
filter the data rendered in the list.

Website Attribute An optional lookup attribute on the primary entity that


represents the website to which the current website's ID can
be applied to filter the data rendered in the list.
NAME DESCRIPTION

Search Enabled An optional Boolean value indicating whether search should


be enabled. A text box will be rendered to allow users to do a
quick search for records. Use the asterisk (*) wildcard character
to search on partial text. The search appends Or condition
filters for each column in the view to the view's existing
predefined filter conditions to query and return the resulting
records.

Search Placeholder Text An optional string used as the label displayed in the text box
on initial load.

Search Tooltip Text An optional string used as the tooltip displayed when the user
points to the Search text box.

Add custom Javascript


The Options tab on the form contains a text area that you can enter custom JavaScript; if your page includes
jQuery library, you can use that here as well. The script block will be added at the bottom of the webpage just
before the page’s closing form tag.

The list gets its data asynchronously, and when it is complete it will trigger an event loaded that your custom
JavaScript can listen for and do something with items in the grid. The following code is a trivial example:

$(document).ready(function (){
$(".entitylist.entity-grid").on("loaded", function () {
$(this).children(".view-grid").find("tr").each(function (){
// do something with each row
$(this).css("background-color", "yellow");
});
});
});

Find a particular attribute field and get its value to possibly modify the rendering of the value. The following code
gets each table cell that contains the value of the accountnumber attribute. Replace accountnumber with an attribute
appropriate for your entity and view.
$(document).ready(function (){
$(".entitylist.entity-grid").on("loaded", function () {
$(this).children(".view-grid").find("td[data-attribute='accountnumber']").each(function (i, e){
var value = $(this).data(value);
// now that you have the value you can do something to the value
});
});
});

Entity list configuration


You can easily enable and configure actions (Create, Edit, Delete, and so on) for records in an entity list. It is also
possible to override default labels, sizes, and other attributes so that the entity list will be displayed exactly the way
you want.
These settings are found in the Configuration section of the entity list form. By default, only Basic Settings are
shown. Select Advanced Settings to see additional settings.

Attributes

NAME DESCRIPTION

Basic Settings

View Actions Use to add action buttons for actions that are applicable for
the entity set and will appear above the grid. The available
actions are:
Create
Download
Selecting one of these options displays a configuration area
for that action.
NAME DESCRIPTION

Items Actions Use to add action buttons for actions that are applicable for
an individual record and will appear for each row in the grid,
provided the appropriate privilege has been granted by Entity
Permissions. The actions generally available are:
Details
Edit
Delete
Workflow
Activate
Deactivate
Selecting one of these options displays a configuration area
for that action. See below for details about each action.
Furthermore, certain entities have special actions that are
available to them on a per-entity basis:
Calculate Value of Opportunity (opportunity)
Cancel Case action (incident)
Close (resolve) Case action (incident)
Convert Quote to Order (quote)
Convert Order to Invoice (salesorder)
Generate Quote from Opportunity (opportunity)
Lose Opportunity action (opportunity)
Win Opportunity action (opportunity)
Reopen Case action (incident)
Set Opportunity on Hold (opportunity)

Override Column Attributes Use to override display settings for individual columns in the
grid.
Attribute: Logical name of the column you want to
override
Display Name: New column title to override the default
Width: Width (in either percent or pixels) of the column
to override the default. See also Grid Column Width
Style
To override settings on a column, select + Column and fill in
the details.

Advanced Settings

Loading Message Overrides the default HTML message that appears while the
grid is loading.

Error Message Overrides the default HTML message that appears when an
error occurs while loading the grid.

Access Denied Message Overrides the default HTML message that appears when a
user does not have sufficient Entity Permissions to view the
entity list.

Empty Message Overrides the HTML message that appears when the grid
contains no data.

Details Form Dialog Controls the settings for the dialog box that appears when a
user activates the Details action.
NAME DESCRIPTION

Edit Form Dialog Controls the settings for the dialog box that appears when a
user activates the Edit action.

Create Form Dialog Controls the settings for the dialog box that appears when a
user activates the Create action.

Delete Dialog Controls the settings for the dialog box that appears when a
user activates the Delete action.

Error Dialog Controls the settings for the dialog box that appears when an
error occurs during any action.

CSS Class Specify a CSS class or classes that will be applied to the HTML
element that contains the entire grid area, including the grid
and action buttons.

Grid CSS Class Specify a CSS class or classes that will be applied to the entity
list's HTML <table> element.

Grid Column Width Style Configures whether the Width values in the Override Column
Attributes are specified in Pixels or Percent.

General action settings


In general, Entity actions have settings that can be configured. In all cases, this is to give you more options in terms
of customization, and the fields are not required. Simply adding the action will allow the action to be taken on the
portal, provided the appropriate privilege has been granted by Entity Permissions.
Generally, you can configure the corresponding dialog box for each action, which will appear only if you select
Confirmation Required.

NAME DESCRIPTION

Basic Settings

Confirmation Required? Determines whether a confirmation will prompt the user to


confirm when the action is selected.

Advanced Settings

Confirmation Overrides the confirmation HTML message displayed when


the user activates the action.

Button Label Overrides the HTML label for this action displayed in the
entity list row.

Button Tooltip Overrides the tooltip text that appears when the user points
to the button for this action displayed in the entity list row.

Button CSS Class Adds a CSS class to the button.


NAME DESCRIPTION

Redirect to Webpage Some actions (not all) allow a redirect upon completion of the
action. Highly recommended for the Delete action, optional in
most other cases, you can choose a webpage to redirect to
when the action is completed.

Redirect URL An alternative to the Redirect to Webpage option—allows


redirecting to a specific URL.

General dialog box advanced settings

NAME DESCRIPTION

Title Overrides the HTML that appears in the title bar of the dialog
box.

Primary Button Text Overrides the HTML that appears in the Primary (Delete)
button on the dialog box.

Close Button Text Overrides the HTML that appears in the Close (Cancel) button
on the dialog box.

Dismiss Button Sr Text Overrides the screen reader text associated with the dialog
box's Dismiss button.

Size Specifies the size of the Delete dialog box. The Options are
Default, Large, and Small. The default size is Default.

CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box.

Tile CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box's title bar.

Primary Button CSS Class Specify a CSS class or classes that will be applied to the dialog
box's Primary (Delete) button.

Close Button CSS Class Specify a CSS class or classes that will be applied to the dialog
box's Close (Cancel) button.

Create action settings


Enabling a Create Action renders a button above the entity list that, when selected, opens a dialog box with an
entity form that the user can use to create a new record, provided the Create privilege has been granted by Entity
Permissions.

NAME DESCRIPTION

Basic Settings
NAME DESCRIPTION

Entity Form Specifies the entity form that will be used to create the new
record. The drop-down list will include all entity forms that are
configured for the entity type of the entity list.
Note: If the entity type of the entity list has no entity forms,
the drop-down list will appear empty. If no entity form is
supplied for the Create action, it will be ignored and the
button will not be rendered on the entity list.

Advanced Settings

Button Label Overrides the HTML label displayed in the Create action
button above the list.

Button Tooltip Overrides the tooltip text that appears when the user points
to the Create action button.

Create Form dialog box advanced settings

NAME DESCRIPTION

Loading Message Overrides the message that appears while the dialog box is
loading.

Title Overrides the HTML that appears in the title bar of the dialog
box.

Dismiss Button Sr Text Overrides the screen reader text associated with the dialog
box's Dismiss button.

Size Specifies the size of the Create Form dialog box. The Options
are Default, Large, and Small. The default size is Large.

CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box.

Title CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box's title bar.

Download action settings


Enabling a Download Action renders a button above the entity list that, when selected, downloads the data from
the list to an Excel (.xlsx) file.

NAME DESCRIPTION

Basic Settings

None

Advanced Settings

Button Label Overrides the HTML label displayed in the Download action
button above the entity list.
NAME DESCRIPTION

Button Tooltip Overrides the tooltip text that appears when the user points
to the Download action button.

Details action settings


Enabling a Details Action allows a user to view a read-only entity form of a selected row in the entity list.

NAME DESCRIPTION

Basic Settings

Entity Form Specifies the entity form that will be used to view the details
of the selected entity. The drop-down list will include all entity
forms that are configured for the entity type of the entity list.
Note: If the entity type of the entity list has no entity forms,
the drop-down list will appear empty. If no entity form is
supplied for the Details action, it will be ignored and the
button will not be rendered in the entity list.

Advanced Settings

Record ID Query String Parameter Name Specifies the name of the Query String parameter that will be
used to select the entity to view in the selected entity form.
This should match the value in that entity form's Record ID
Query String Parameter Name. The default value for this field,
both here and in entity form configuration, is id.

Button Label Overrides the HTML label for this action displayed in the
entity list row.

Button tooltip Overrides the tooltip text that appears when the user points
to the button for this action displayed in the entity list row.

Details dialog box advanced settings

NAME DESCRIPTION

Loading Message Overrides the HTML that appears when the dialog box is
loading.

Title Overrides the HTML that appears in the title bar of the dialog
box.

Dismiss Button Sr Text Overrides the screen reader text associated with the dialog
box's Dismiss button.

Size Specifies the size of the Details dialog box. The Options are
Default, Large, and Small. The default size is Large.

CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box.

Title CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box's title bar.
Edit action settings
Enabling an Edit Action allows a user to view an editable entity form that is data-bound to the record of the
selected row from the entity list, provided the Write privilege has been granted by Entity Permissions.

NAME DESCRIPTION

Basic Settings

Entity Form Specifies the entity form that will be used to edit the selected
entity. The drop-down list will include all entity forms that are
configured for the entity type of the entity list.
Note: If the entity type of the entity list has no entity forms,
the drop-down list will appear empty. If no entity form is
supplied for the Edit action, it will be ignored and the button
will not be rendered in the entity list.

Advanced Settings

Record ID Query String Parameter Name Specifies the name of the Query String parameter that will be
used to select the entity to edit in the selected entity form.
This should match the value in that entity form's Record ID
Query String Parameter Name. The default value for this field,
both here and in entity form configuration, is id.

Button Label Overrides the HTML label for this action displayed in the
entity list row.

Button Tooltip Overrides the tooltip text that appears when the user points
to the button for this action displayed in the entity list row.

Edit form dialog box advanced settings

NAME DESCRIPTION

Loading Message Overrides the HTML that appears when the dialog box is
loading.

Title Overrides the HTML that appears in the title bar of the dialog
box.

Dismiss Button Sr Text Overrides the screen reader text associated with the dialog
box's Dismiss button.

Size Specifies the size of the Edit dialog box. The Options are
Default, Large, and Small. The default size is Large.

CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box.

Title CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box's title bar.

Delete action settings


Enabling a Delete Action allows a user to permanently delete the record of the selected row from the entity list,
provided the Delete privilege has been granted by Entity Permissions.
NAME DESCRIPTION

Basic Settings

none

Advanced Settings

Confirmation Overrides the confirmation HTML message displayed when


the user activates the Delete action.

Button Label Overrides the HTML label for this action displayed in the
entity list row.

Button Tooltip Overrides the tooltip text that appears when the user points
to the button for this action displayed in the entity list row.

Delete dialog box (advanced) settings

NAME DESCRIPTION

Title Overrides the HTML that appears in the title bar of the dialog
box.

Primary Button Text Overrides the HTML that appears in the Primary (Delete)
button on the dialog box.

Close Button Text Overrides the HTML that appears in the Close (Cancel) button
on the dialog box.

Dismiss Button Sr Text Overrides the screen reader text associated with the dialog
box's Dismiss button.

Size Specifies the size of the Delete dialog box. The Options are
Default, Large, and Small. The default size is Default.

CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box.

Title CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box's title bar.

Primary Button CSS Class Specify a CSS class or classes that will be applied to the dialog
box's Primary (Delete) button.

Close Button CSS Class Specify a CSS class or classes that will be applied to the dialog
box's Close (Cancel) button.

Workflow action settings


Enabling a Workflow action allows a user to run an on-demand workflow against the record of the selected row
from the entity list. You may add any number of Workflow actions to the entity list.
NAME DESCRIPTION

Basic Settings

Workflow Specifies the on-demand workflow that will run when the user
activates this action.
Note: If the entity type of the entity list has no workflows, the
drop-down list will appear empty. If no workflow is supplied
for the Workflow action, it will be ignored and the button will
not be rendered in the entity list.

Button Label Sets the HTML label for this action displayed in the entity list
row. This setting is required.

Advanced Settings

Button Tooltip Overrides the tooltip text that appears when the user points
to the button for this action displayed in the entity list row.

Securing entity lists


To secure an entity list, you must configure Entity Permissions for the entity for which records are being displayed
and also set the Enable Entity Permissions Boolean value on the entity list record to true.
The act of securing an entity list will ensure that for any user who accesses the page, only records that they have
been given permission to are shown. This is achieved by an additional filter being added to the model-driven app
views that are being surfaced via the list. This filter will filter only for records that are accessible to the user, via
Read permission.
In addition, any actions that are defined for the list will respect the corresponding permissions for that action on a
per-record basis. That is, if you have Edit permission for a record, the Edit action will be enabled for that record.
The same applies for Delete, Create, and so on. Note that if no records are available, a message indicating this will
be shown when the list is loaded.
However, good website design requires that if a user is not in a role that has any permissions for the entity (that is,
there will never be a situation where they should see any records), they should not have access to the page at all.
Ideally, the page should be protected by using Webpage Access Permissions.
If you have secured an entity list by selecting Enable Entity Permissions, and want to display the records level
actions that are applicable to the signed in user, you must set the value of EntityList/ShowRecordLevelActions
site setting to true. For example, there are two users: Preston and Teddy. Preston has contact level all access on the
Case entity, whereas Teddy has global read access. If an entity list is created to show all the case records, Preston
would see all actions (View, Edit, and Delete) on the records that are related his contact. On other records, he
would only see the View action. On the other hand, Teddy would only see the View action on all records.
If the EntityList/ShowRecordLevelActions site setting is set to false and the entity has multiple permissions, all
the record level actions are visible. But, when a user tries to perform an action that he is not authorized to, an error
is displayed.

Adding a view details page


By setting the Web Page for Details View lookup to a webpage, the details of a record listed in the grid can be
viewed as read-only or edited, depending on the configuration of the associated form or page.
This page can be a completely customized page template, perhaps created by using Liquid. The most common
scenario is probably to have the details page be a webpage that either contains an entity form or Web form.
The important thing to be aware of is that each record listed in the grid will have a hyperlink to the details page,
and the link will contain a named Query String parameter with the ID of the record. The name of the Query String
parameter depends on the ID Query String Parameter Name specified on the entity list. The final thing to note is
that the targeted details webpage must also be aware of the name of this Query String parameter to get the ID of
the record that it needs to query and load its data.

Using an entity form to display details


To create an entity form please refer the instructions found on the entity form page.
The following are the important settings to be aware of for ensuring that the record from the entity list is loaded in
the entity form.
The Record ID Query String Parameter Name on Entity Form must match the ID Query String Parameter Name
on Entity List.
The Mode can be either Edit or ReadOnly, depending on your needs.
Using a Web form to display details
The following are the important settings to be aware of for ensuring that the record from the entity list is loaded in
the Web form.
The Primary Key Query String Parameter Name on Web Form Step must match the ID Query String Parameter
Name on Entity List.
The Mode can be either Edit or ReadOnly, depending on your needs.
Using a details page for the Create function
You can use a custom page, entity form, or Web form in the same fashion for the Create function. This is an
alternative to defining a Create action on the form. You cannot define both a Create action and a custom page for
Create: defining a custom action takes precedence.
If you assign a webpage to the Create Lookup on the entity list and do not specify a Create action by using
Configuration, a Create button will be rendered on the list; this button will link the user to the custom page you
have designated for Create.

Entity list filter configuration


Adding the ability to filter records on an entity list is easy: simply enable the filtering option and then choose one
or more filter types to display to users. It is possible to filter by an attribute that matches text provided by the user,
or to select from a series of options. You can even design virtually any type of filter you can imagine by using
Advanced Find.
Enable the entity list filter
In the Metadata Filter section, select the Enabled check box. This will add the Filter area to the entity list when it
is displayed. Until you have defined at least one filter type, the box will appear empty.
You can define how the Filter area on the entity list will be rendered by using the Orientation setting. The default,
Horizontal, renders the Filter area above the entity list. Vertical orientation renders the Filter area as a box to the
left of the entity list.

Filter types

FILTER TYPE DESCRIPTION

Text Filter Filter the entity list by using a text box to search for matching
text in a selected attribute of the given entity.

Attribute Filter Set Filter the entity list by using a series of check boxes, each of
which tries to match its condition against a particular attribute
of the given entity.

Lookup Set Filter the entity list by using a series of check boxes, each of
which represents a relationship between a record for the given
entity and a record for a related entity.

Range Filter Set Similar to the Attribute Filter Set, except that each check box
can represent two conditions rather than one (for example,
greater than or equal to 0 AND less than 100).

Dynamic Picklist Set Similar to choosing a picklist value on an Attribute Filter Set.
The Dynamic Picklist Set does not require that you specify the
picklist options to filter by; instead, it generates the full list of
options when the entity list is loaded.

Dynamic Lookup Set Similar to the Lookup Set. The Dynamic Lookup Set does not
require that you specify the lookup options to filter by;
instead, it generates the full list of options when the entity list
is loaded.

FetchXML Filter Filter the entity list by using a FetchXML filter condition.

Text filter
The Text filter adds a text box to the entity list Filter area that is tied to an attribute of the entity type of the entity
list. When a user applies the filter, the entity list only displays those records whose selected attribute contains the
value.
To add a Text filter, select +Text Filter.

The Text filter uses the following attributes:

NAME DESCRIPTION

Attribute The name of the attribute on the entity list's selected entity
type to filter by. Only attributes with the type String are valid
for a Text filter.

Display Name Override the label for the filter when the entity list is
displayed. By default, this will be automatically set to the
name of the selected attribute.

Attribute Filter Set


The Attribute Filter Set adds a series of options to filter the entity list by, tied to a single attribute of the entity list's
selected entity type. When a user applies the filter, the entity list only displays those records that exactly match at
least one of the selected options.

The Attribute Filter Set uses the following attributes:

NAME DESCRIPTION

Attribute The name of the attribute on the entity list's selected entity
type to filter by. Only attributes with the following types are
valid for a Text filter: String, BigInt, Decimal, Double, Integer,
Money, Picklist, DateTime, and Boolean.

Display Name Override the label for the filter when the entity list is
displayed. By default, this will be automatically set to the
name of the selected attribute.

Options A collection of possible values to filter by. See below for more
details.

Attribute Filter Set options


An Attribute Filter Set can usually have any number of options, with the exceptions of picklist and Boolean
attributes. A Boolean Attribute Filter Set can have only one or two options—one true option and one false option.
A Picklist Attribute Filter Set can have at most one option for each possible value in the picklist.
Options have the following attributes:

NAME DESCRIPTION

Operator The comparison operator used to filter results, for example


Equals, Less Than, and so on. The list of operators for the
option will depend on the type of the attribute selected for
the filter. For example, numeric (Decimal) types will have
operators such as Less Than or Greater Than, whereas String
attributes will use operators such as Begins With or Contains.
Picklist and Boolean operators are always Equals.

Value The actual value used for this filter condition.

Display Name Overrides the display name for this option in the Filter box. By
default, this will be set to the same value as the Value
attribute.

Lookup Set
The Lookup Set adds a series of options to filter the entity list by, tied to a related entity to the entity list's selected
entity type. When a user applies the filter, the entity list only displays those records that exactly match at least one
of the selected related records.

The Lookup Set uses the following attributes:

NAME DESCRIPTION

Relationship The name of the related entity to the entity list's selected
entity type to filter by. Only entities with a one-to-many or
many-to-many relationship with the entity list's selected
entity type appear as options for this filter type.

Display Name Override the label for the filter when the entity list is
displayed. By default, this will be automatically be set to the
name of the selected relationship.

Options A collection of possible values to filter by. See below for more
details.

Lookup Set options


A Lookup Set can typically have any number of options, with the only limit being the number of related records of
the selected related type.
Options have the following attributes:
NAME DESCRIPTION

Value The record of the selected related type to filter by.

Display Name Overrides the display name for this option in the Filter box. By
default, this will be set to the same value as the Value
attribute.

Range Filter Set


The Range Filter Set adds a series of options, each with one or two conditions, to the Filter area. When a user
applies the filter, the entity list only displays those records that exactly match all conditions on at least one of the
selected options.

The Range Filter Set uses the following attributes:

NAME DESCRIPTION

Attribute The name of the attribute on the entity list's selected entity
type to filter by. Only attributes with the following types are
valid for a Text filter: String, BigInt, Decimal, Double, Integer,
Money, DateTime.

Display Name Override the label for the filter when the entity list is
displayed. By default, this will be automatically set to the
name of the selected attribute.

Options A collection of possible values to filter by. See below for more
details.

Range Filter Set options


A Range Filter Set can have any number of options. Each option will produce a filter condition with either one or
two subconditions, both of which must be met for the condition to be true.
Options have the following attributes:

NAME DESCRIPTION

Operator 1 The first comparison operator used to filter results, for


example Equals and Less Than. The list of operators for the
option will depend on the type of the attribute selected for
the filter. For example, numeric (Decimal) types will have
operators such as Less Than or Greater Than, whereas String
attributes will use operators such as Begins With or Contains.
Picklist and Boolean operators are always Equals.

Value 1 The first value used for this filter condition.


NAME DESCRIPTION

Operator 2 (optional) The second comparison operator used to filter results, for
example Equals and Less Than. The list of operators for the
option will depend on the type of the attribute selected for
the filter. For example, numeric (Decimal) types will have
operators such as Less Than or Greater Than, whereas String
attributes will use operators such as Begins With or Contains.
Picklist and Boolean operators are always Equals.

Value 2 (optional) The second value used for this filter condition.

Display Name Overrides the display name for this option in the Filter box. By
default this will be set dynamically, based on the operators
and values selected.

Dynamic Picklist Set


The Dynamic Picklist Set adds a series of options to filter by that represent all the values of a specified Picklist
field. This is different from selecting a Picklist in the Attribute Filter Set. In the Attribute Filter Set, you must specify
a set of options that will be made available to the user to filter by; in the Dynamic Picklist Set, you need only
specify the Picklist field and the entire set of options will be provided automatically. If you need greater control, we
recommend that you use the Attribute Filter Set.

The Dynamic Picklist Set uses the following options:

NAME DESCRIPTION

Attribute The name of the Picklist attribute on the entity list's selected
entity type to filter by.

Display Name Override the label for the filter when the entity list is
displayed. By default, this will be automatically set to the
name of the selected attribute.

Dynamic Lookup Set


The Dynamic Lookup Set adds a dynamic series of options to filter the entity list by, tied to a related entity to the
entity list's selected entity type. When a user applies the filter, the entity list only displays those records that exactly
match at least one of the selected related records.
This is different from a Lookup Set. In the Lookup Set, you must manually specify the related entities to filter by. In
the Dynamic Lookup Set, you need only specify the relationship on which to filter, and a list of options will be
generated based on the specified view of related entities.
The Dynamic Lookup Set uses the following options:

NAME DESCRIPTION

Relationship The name of the related entity to the entity list's selected
entity type to filter by. Only entities with a one-to-many or
many-to-many relationship with the entity list's selected
entity type appear as options for this filter type.

View The view (Saved Query) to use as a source for the dynamic list
of entities to filter by.

Label Column The field from the view that provides each entity's Name
value.

Filter Lookup On Relationship Specifies a relationship between the entity specified by the
Relationship field and the signed-in user. If the entity specified
by the Relationship field also has a relationship to a contact,
you can narrow the list of filter options to those related to the
signed-in user.

Display Name Override the label for the filter when the entity list is
displayed. By default, this will be automatically set to the
name of the selected relationship.

FetchXML filter
The range filter can create either a simple text box filter like the Text filter or a set of options like the other filter
types. It allows you to manually create virtually any type of filter for the entity list by using FetchXML.

The FetchXML filter uses only one attribute:

NAME DESCRIPTION

FetchXML The XML statement representing the filter.

Entity list Map view


With entity lists, it is possible to enable and configure a Map view of the data, powered by Bing maps with search
functionality to find locations near an address. By populating your records with latitude and longitude coordinate
values and specifying the necessary configuration options listed in this section, your records can be rendered as
pushpins on a map. Any record that does not have a latitude or longitude value will be excluded from the search.
The initial load of the page will display all records within the initial value of the Distance Values field (in miles or
km, depending on the Distance Units specified) from the Default Center Latitude and Default Center Longitude
coordinates. The view specified is ignored when Map view is used, and a distance query is applied to the dataset to
return the mappable results.

NOTE
This option is not supported in the German Sovereign Cloud environment. The Map view section will not be visible in this
environment.

Entity List Calendar view


Use the Entity List Calendar view to render an entity list as a calendar, with each individual record configured to act
as a single event.
To display records by using a calendar, those records need to include at a minimum a date field. For events to have
exact start and end times, the appropriate fields need to be in place, and so on. Assuming these fields are
configured, an Entity List Calendar view will appear on the portal.

Entity list OData feeds


If enabled, an entity can be published to an OData feed. The OData protocol is an application-level protocol for
interacting with data via RESTful web services. Data from this feed can be viewed in a web browser, consumed by
a client-side web application, or imported into Excel.

NOTE
The OData feed that is published is anonymous and does not have any authorization checks; therefore, it is important not to
enable oData feeds for data that is unsuitable for anonymous portal access.

Enhanced view filter for entity lists


You can use Entity Permissions if you want to secure records, but if you want to simply provide a filter as part of
the set of filter options that is relevant to the current portal user, you can use the Entity List feature. This feature
supports filtering of the current user, user's parent account, or website at any depth. Simply build the view filter to
match any single contact record and the code will replace its value with the actual value at runtime—no need to
assign values to fields in the Filter Conditions section.
The control will find all condition elements where uitype="contact" and set the value to the actual value of the
current portal user's contact ID.
The control will find all condition elements where uitype="account" and set the value to the actual value of the
current portal user's parent account ID.
The control will find all condition elements where uitype="adx_website" and set the value to the actual value of
the current website ID.
Example View Filter Criteria
The following image shows an arbitrary contact assigned to a filter condition, this contact happens to be a stub
'dummy' contact but this could be any contact record. The ID of this record will be replaced by the actual value of
the ID of the user viewing the page. If the user is not logged in then no records will be returned. This provides
greater flexibility in filtering the data based on the user and website contextually.
NOTE
If you are filtering by current portal user's contact or parent account then it is recommended that you associate a Web Page
Access Control Rule to the Web Page to force the user to sign in. You would create a Web Role with "Authenticated Users
Role" checked. Create a Web Page Access Control Rule with "Restrict Read" right and associate the Web Role. This will force
users to be signed in to view the page and therefore allow the data to be filled accordingly.

See also
Configure a portal
Redirect to a new URL on a portal
Manage websites
1/23/2020 • 2 minutes to read • Edit Online

A website is the core entity of portals application. A portal application selects a single Website record, and this
determines what portal entities – web pages, web files, web roles, content snippets, etc. – are applicable to this
application.
With a website providing an application scope, multiple distinct portal applications can be connected to a single
organization.

NOTE
Determination of which website record a given portal application is bound to is usually by the website's name, specified in the
configuration of the portal deployment. However, it is also possible to control this by URL path prefix (see the descriptions of
Parent Website and Partial URL under website attributes), or by domain, using website bindings.

Manage websites
Websites are created when you create a new portal. However, advanced website management can be performed
from the Portal Management app.

WARNING
When you delete a website record, data related to the website record in portal metadata entities, such as webpages and web
links, is also deleted. This is generally the desired behavior, as it means an entire website and all its related data can be
removed from an organization in a single operation.

1. Open the Portal Management app.


2. Go to Portals > Websites.
3. To edit an existing website, select the website name.
4. Enter or edit appropriate values in the fields.
5. Select Save & Close.
Website attributes
NAME DESCRIPTION

Name The descriptive name of the website. This field is required.

Primary Domain Name The primary domain name of the portal to which this website
record will be added.

Parent Website The parent website of the website. This field can generally be
ignored, except in certain advanced portal configurations in
which a single portal application is bound to one master
website at the application root path, with one or more child
websites available at specific sub-paths.
NAME DESCRIPTION

Partial URL The root URL path segment for all URLs generated for portal
entities related to this website.
For example, if a portal application is deployed to be available
at the root of the domain example.com, and this attribute has
no value, a request to http://example.com/ will render the
Home web page of the application website (as the Home web
page is required to have its Partial URL set to "/").
If this attribute is set to the value "my-website", the Home
Web Page will instead have a URL of
http://example.com/my-website/ , and all pages in the
website will have the same "/my-website/" path prefix.
In most portal configurations, this field can be ignored and left
blank.
Partial URL values are used as URL path segments. As such,
they should not contain illegal URL path characters, such as
"?", "#", "!", "%". Since portal URLs are generated by joining
together Partial URL values with slashes ("/"), they should also
not generally contain slashes.
Recommended practice would be to restrict Partial URL values
to letters, numbers, and hyphens or underscores. For example:
"press-releases", "Users_Guide", "product1".

See also
Website bindings
Create and manage website bindings
1/23/2020 • 2 minutes to read • Edit Online

In a portal, the default method of selecting a website is finding a website by matching the name of the website
defined in the web.config file of that particular portal. Website bindings provide alternative methods of selecting a
website by using the host name when loading a portal or path of the request to select the appropriate website. This
eliminates the need to modify separate web.config files for each version of a specific website. This streamlines the
deployment of portals across various development, staging, and production environments. Furthermore, this
allows a common portal codebase to operate multiple websites.

Manage website bindings


Website bindings can be created, edited, and deleted within Power Apps portals.
1. Open the Portal Management app.
2. Go to Portals > Website Bindings.
3. To create a new website binding, select New.
4. To edit an existing website binding, select the website binding name.
5. Enter appropriate values in the fields.
6. Select Save & Close.
Website binding attributes
These are the attributes common to all bindings.

NAME DESCRIPTION

Name A title to identify the website binding when viewing the


records.

Website The website that should be selected by the portal.

Release Date A date that determines when the website is allowed to be


selected.

Expiration Date A date that determines when the website will stop being
selected.

Application Settings
Specify values for these attributes for an application level binding. This binding maps based on IIS website or
application.

NAME DESCRIPTION

Site Name The name of the IIS website.

Virtual Path The name of the IIS application under the website.
NAME DESCRIPTION

For Azure websites and cloud services, the site name and virtual path values are determined by the and nodes of
the ServiceDefinition.csdef file.

<ServiceDefinition>
<WebRole>
<Sites>
<Site name=Dynamics Portals>
<VirtualApplication name=customer-portal/>

See also
Create and manage websites
Define web form properties for portals
1/23/2020 • 4 minutes to read • Edit Online

The web form contains relationships to webpages and a start step to control the initialization of the form within
the portal. The relationship to the webpage allows dynamic retrieval of the form definition for a given page node
within the website.
The other options on the web form record itself control top-level preferences for the multiple-step process as a
whole, for example whether you'd like to display a progress bar.
To view existing Web forms or to create new web forms, open the Portal Management app and go to Portals >
Web Forms.

NOTE
A Web Form must be associated with a webpage for a given website for the form to be viewable within the site.

When creating or editing a webpage from the the Portal Management app, a Web Form can be specified in the
lookup field provided on the New Web Page form.

Web form attributes


The following attributes and relationships determine the functionality of the Web form.

NAME DESCRIPTION

Name A title of the form used for reference.

Start Step The first step of the form. A Web form will consist of one or
more steps. For more information about these steps please
refer to the section titled Web Form Step found below. The
first step cannot be of type Condition.

Authentication Required If checked, when a user who is not signed in visits the page
that contains the form, they will be redirected to the sign-in
page. Upon successful sign-in, the user will be redirected back
to the page that contains the form.

Start New Session On Load Selecting Yes indicates that if the user opens the form in a
new browser or new tab, or closes the browser or page and
returns, the form will start a completely new session and
begin at the first step. Otherwise the session will be persisted
and the user can close the browser or page and resume later
exactly where they left off. Default: No.

Multiple Records Per User Permitted Selecting Yes indicates that a user is permitted to create more
than one submission. This assists the form in determining
what to do when a user revisits a form. Default: Yes.

Edit Expired State Code The target entity's state code integer value that, when
combined with the status reason, indicates when an existing
record can no longer be edited.
NAME DESCRIPTION

Edit Expired Status Reason The target entity's status code integer value that, when
combined with the state code, indicates that when an existing
record has these values the record is not to be edited
anymore—for example, when a record is updated as complete.

Edit Expired Message The message displayed when the existing record's state code
and status reason match the values specified. For each
language pack installed and enabled for the organization, a
field will be available to enter the message in the associated
language. Default message; You have already completed a
submission. Thank you!

Progress indicator settings


NAME DESCRIPTION

Enabled Check to display the progress indicator. Default: Disabled.

Type One of the following: Title, Numeric (Step x of n), and Progress
Bar. Default: Title

Position One of the following: Top, Bottom, Left, Right. Position is


relative to the form. Default: Top.

Prepend Step Number to Step Title Check to add the number of the step to the beginning of the
title of the step. Default is unchecked.

Example of the various progress indicator types:


Title

Title with Step Number prepended


Numeric

Progress Bar

“Save changes” warning


NAME DESCRIPTION

Display Save Changes Warning On Close Select to display a warning message if the user has made
changes to field(s) and they try to reload the page, close the
browser, select the browser's back button, or select the
previous button in a multiple step form.

Save Changes Warning Message For each language pack installed and enabled for the
organization, a field will be available to enter the message in
the associated language. If no message is specified, the
browser's default will be used.

Example:

NOTE
Firefox does not provide the ability to specify a custom message.
Geolocation configuration for web form
A managed form can be configured to display a map control to either display an existing location as a pin on a
map or to provide the ability for the user to specify a location. See Add Geolocation.
The form's map control requires additional configuration to tell it what the IDs of the various location fields are, to
assign values to them or retrieve values from them. The Web Form Step record has a section that defines these
field mappings that you must assign values for. The field names will vary depending on the schema you have
created.

NOTE
The Geolocation section is not visible in the German Sovereign Cloud environment. If a user has enabled geolocation by
using a different form, it will not be displayed during rendering on portal.

See also
Configure a portal
Define entity forms
Web Form steps for portals
Web Forms metadata for portals
Web Form subgrid configuration for portals
Notes configuration for Web Forms for portals
Define web form steps for portals
1/23/2020 • 2 minutes to read • Edit Online

The Web Form Step provides the flow logic of the form's user experience such as steps and conditional branching.
It also provided details regarding the rendering of a form and additional behavior.

NOTE
Web Forms persists the history of the steps a user has visited in an object on a Web Form Session entity. If a Web Form's
steps have been modified, previously created history data could now be stale. Anytime steps are changed, it is
recommended that you delete all Web Form Session records to eliminate miss match between sequence of steps logged in
history and the current sequence.

Each Web Form will be presented on the portal has one or more steps. These steps share some common
properties, outlined below. Each Step contains a pointer (a lookup) to the next step, with the exception of terminal
steps. Terminal steps do not have a next time, and are thus the last step of the Web Form (due to conditional
branching, there can be multiple terminal steps)

NAME DESCRIPTION

Name A title used for reference.

Web Form The Web Form associated with the current step.

Type One of the following:


Load Form/Load Tab step type: displays properties of forms.
Load Form/Load Tab step type: displays properties of
tabs.
Conditional step type: displays properties for
specifying expressions to be evaluated for conditional
branching.
Redirect step type: displays the settings appropriate
for configuring a website redirection.

For further details on the settings for these web form step
types, please refer to their corresponding sections below.
Note: The first step cannot be of type "Condition".
NAME DESCRIPTION

Next Step The step that will follow the current step. This will be blank for
single step single form.

Target Entity Logical Name The logical name of the entity associated with the form.

Move Previous Permitted Indicates whether the user is given an option to navigate to
the previous step in a multiple step web form. Default is true.
Uncheck to prevent the user from being able to move to the
previous step.

See also
Configure a portal
Define entity
Load Form/Load Tab step type
Redirect step type
Conditional step type
Add custom JavaScript
Define a load form and load tab step type
1/23/2020 • 8 minutes to read • Edit Online

This step type allows the web form step to act as an entity form within the overall web form process. It loads a
form with a similar set of options available as an Entity Form.

Settings
NAME DESCRIPTION

Name The descriptive name of the record. Required

Entity Name The name of the entity from which the form will be loaded
from. Required

Form Name The name of the Form on the target entity that is to be
rendered. Required

Tab Name The name of a Tab on a Form for a specified entity that is to
be rendered. Optional

Mode One of the following values:


Insert
Edit
ReadOnly
Selecting Insert indicates the form should insert a new record
upon submission. Specifying Edit indicates the form should
edit an existing record. Selecting ReadOnly indicates the form
should display an existing record's noneditable form. Edit and
ReadOnly requires that a source record exist and parameters
specified in the 'Record Source Type' and 'Record ID Query
String Parameter Name' fields to select the appropriate record
when the form is loaded in the portal.

Auto Generate Steps From Tabs Checked indicates that multiple tabs on an entity form will be
displayed with each tab as a sequential step starting with the
first tab and continue until all tabs have been navigated to
and upon final submission a record is inserted. Unchecked is
the default behavior. Unchecked value indicates that only one
tab or form is to be rendered for the current step. If the Tab
Name is not specified, the first tab is displayed.
NAME DESCRIPTION

Record Source Type One of the following values:


Query String
Current Portal User
Result From Previous Step
Selecting Query String requires a parameter name that must
be provided in the query string of the URL to the form. This
can be specified in the 'Record ID Query String Parameter
Name' field. Selecting Current Portal User will retrieve the
portal user record for the current authenticated user.
Selecting Result from previous step will retrieve the record
that was the record source for a previous step of the web
form.

Record ID Query String Parameter Name A parameter name provided in the query string of the URL to
the Web Page containing this Entity Form.

Relationship Name Required when Record Source Type is Record Associated to


Current Portal User. The logical name of the relationship
between the current portal user record and the target record.
This must return the same entity type specified by the Entity
Name field.

Allow Create If Null An optional Boolean value available when Record Source Type
is Record Associated to Current Portal User. Checked
indicates that if the related record does not exist, allow the
user to create it the first time, otherwise an exception will be
thrown if the record does not already exist because the form
needs a record to data-bind to.

Enable Entity Permissions Will cause the form to respect Entity Permissions. The default
is false for backwards compatibility reasons. If set to true,
explicit permissions are REQUIRED for any user wanting to
access the form. Note that this only applies to the FIRST step
of a form.

Additional settings
NAME DESCRIPTION

Render Web Resources Inline Eliminates the iFrame that encompasses a web resource in a
entity form.

ToolTips Enabled The tooltip is set using the description of the attribute on the
target entity.

Show Unsupported Fields All fields are currently supported. This is reserved for potential
changes may make to field types.

Set Recommended Fields as Required Makes all attributes required that have the field requirement
level set to 'Business Recommended'.

Make All Fields Required Makes all fields required regardless of the field requirement
level.
NAME DESCRIPTION

Validation Summary CSS Class CSS Class name assigned to the validation summary. Default:
'validation-summary alert alert-error alert-block'

Enable Validation Summary Links A Boolean value of true or false that indicates whether anchor
links should be rendered in the validation summary to scroll
to the field containing an error. Default: true

Validation Summary Link Text The label assigned to the validation summary links. Default:
Click here

Instructions Display a block of text at the top of the form.

Record Not Found Message Message displayed when the source record cannot be loaded.
Default: The record you are looking for could not be found.

Form options
NAME DESCRIPTION

Add Captcha Portal uses RadCaptcha by Telerik to prevent malicious spam


attacks. The service requires a unique key to authenticate
requests for your portal application.

Validation Group The group name assigned to input controls for evaluating
valid input of named groups.

Previous Button CSS Class CSS Class name assigned to the Previous button.

Previous Button Text Label on the previous button.

Next Button CSS Class CSS Class name assigned to the next button.

Submit Button Text Label on the next button.

Submit Button CSS Class CSS Class name assigned to the submit button. Default:
button submit

Submit Button Text Label on the submit button. Default is 'Submit'

Submit Button Busy Text Label on the submit button during the running process.
Default: Processing...

Associate the current portal user with the creation of a record


These options are used to keep track of which portal contact creates a record through the portal UI

NAME DESCRIPTION

Associate Current Portal User Checked indicates the currently logged in user's record should
be associated with the target entity record.
NAME DESCRIPTION

Target Entity Portal User Lookup Attribute The logical name of the attribute on the target entity that
stores the portal user.

Is Activity Party Boolean value indicating whether the Target Entity Portal User
Lookup Attribute is an Activity Party type. See ActivityParty
entity

Entity reference
The following parameters pertain to setting an entity reference when the form is saved.
This provides a way to associate the current record being created or updated by the form with another target
record. This is useful if you have multiple steps with multiple entity types and wish to relate the resulting records
or if the page is passed a query string of a record ID that you would like associated. For example we have a
careers page that lists job postings, each with a link to an application for the job that contains the id of the job
posting to the application form so that when the application is created the job posting is associated with the
record.

NAME DESCRIPTION

Set Entity Reference On Save Yes or No. A value of yes indicates that an entity reference
should be assigned when the form is saved, otherwise none
will be set.

Relationship Name The Relationship Definition Name for a given relationship


between two entity types.
Note: Do not specify a relationship name if you specify a
Target Lookup Attribute Logical Name.

Entity Logical Name The logical name of the reference entity.

Target Lookup Attribute Logical Name Logical name of the lookup attribute on the target entity
being created or updated.
Note: Do not specify a relationship name if you specify a
Target Lookup Attribute Logical Name.

Populate Lookup Field If the lookup regarding the reference entity is on the form,
checking this value will populate the field on the form with
the value retrieved using the setting below.
NAME DESCRIPTION

Source Type One of the following values:


Query String
Current Portal User
Result From Previous Step
Selecting Query String requires a parameter name that must
be provided in the query string of the URL to the form. This
can be specified in the Query String Name field. If this
parameter is the primary key then select Yes for the Query
String Is Primary Key, otherwise select No and provide the
logical name of the attribute on the target entity to query by
specified in the Query Attribute Logical Name field.
Selecting Current Portal User will retrieve the contact record
for the current authenticated user. Selecting Result From
Previous Step will retrieve the record created as a result of the
step prior to the current step or from a specific step based on
the step associated with the Entity Source Step.

Reference Entity Step The Web Form Step record of a previous step to retrieve the
entity created or edited in that step to associate it with the
record for this current step.

Query String Name Parameter name provided in the Query String of the URL to
the Web Page containing the Web Form.

Query String Is Primary Key Yes indicates the Query String value is the Primary Key value.
No indicates the Query String value is an attribute type other
than the Primary Key.

Query Attribute Logical Name Logical name of the attribute to query the record.

Show ReadOnly Details Checked indicates that a form should be rendered at the top
of the page displaying read-only information pertaining to
the reference record. Requires a Form Name.

Form Name The name of the form on the reference entity that should be
used to display read-only details.

Additional functionality
NAME DESCRIPTION

Attach File Check to have the form include a file upload control to the
bottom of the form to allow a file to be attached to the
record.

Allow Multiple Files A Boolean value that indicates whether the user can upload
more than one file.

Accept The accept attribute specifies the MIME types of files that the
server accepts through file upload. To specify more than one
value, separate the values with a comma (for example,
audio/*,video/*,image/*).
NAME DESCRIPTION

Label The text displayed next to the file upload control. For each
language pack installed and enabled for the Common Data
Service environment a field will be available to enter the
message in the associated language.

Is Required Checked makes the attachment of a file required to proceed.

Required Error Message The message displayed during form validation if Is Required is
true and the user has not attached a file. For each language
pack installed and enabled for the Common Data Service
environment a field will be available to enter the message in
the associated language.

Custom JavaScript A custom block of JavaScript that will added to the bottom of
the page just before the closing form tag element. The HTML
input id of an entity field is set to the logical name of the
attribute. This makes selecting a field, setting values, or other
client side manipulation easy with jQuery.
$(document).ready(function() {
$(#address1_stateorprovince).val(Saskatchewan); });

See also
Configure a portal
Define entity forms
Web Form steps for portals
Redirect step type
Conditional step type
Add custom JavaScript
Add a redirect step type
1/23/2020 • 2 minutes to read • Edit Online

The Redirect Step Type allow for a redirect of the User's browser session to another page in the portal or to an
external URL. This is useful for seamlessly directing flow.

NAME DESCRIPTION

External URL Requires On Success set to Redirect. Specify a URL to an


external resource on the web.

or Web Page Requires On Success set to Redirect. Select a Web Page from
the current website.

Append Existing Query String Requires On Success set to Redirect. When checked the
existing query string parameters will be added to the target
URL prior to redirection.

Append Record ID To Query String Requires On Success set to Redirect. When checked the ID of
the record created is appended to the query string of the URL
being redirected to.

Record ID Query String Parameter Name Requires On Success set to Redirect. The name of the ID
parameter in the query string of the URL being redirected to.

Append Custom Query String Requires On Success set to Redirect. A custom string that can
be appended to the existing Query String of the redirect URL.

Append Attribute Value to Query String - Parameter Name Requires On Success set to Redirect. A name to give to the
parameter that correlates to the attribute value on the target
entity that gets appended to the Query String of the redirect
URL.

Append Attribute Value to Query String - Attribute Logical Requires On Success set to Redirect. A logical name of an
Name attribute on the target entity to get the value to be appended
to the Query String of the redirect URL.

See also
Configure a portal
Define entity forms
Web Form steps for portals
Load Form/Load Tab step type
Conditional step type
Add custom JavaScript
Add a conditional step type
1/23/2020 • 2 minutes to read • Edit Online

A Web Form Step can be a 'Condition' type that indicates the step should evaluate an expression. If the expression
evaluates to true then the next step is displayed. If the expression evaluates to false and if the 'Next Step If
Condition Fails' has been specified, that step will be displayed. The current entity is the target used to evaluate the
expression against. Record Source defaults to the Record Source of the previous step.

Attributes
NAME DESCRIPTION

Condition The Conditional expression to be evaluated

Next Step if Condition Fails The Conditional Step Type, unlike all others, has two Next
Step lookups. The default Next Step lookup will be respected if
the condition evaluates to true. This property sets the next
step should the condition evaluate to false.

The available operands are as follows:

OPERAND(S) TYPE

=, == Equals

!= Not Equals

> Greater Than

< Less Than

>= Greater Than or Equals

<= Less Than or Equals

& And

| Or

! Not

=*, ==*, -= Like

!=* Not Like

Format
The format of the expression is as follows:
[entity attribute logical name] [operand] [value]
Example:
new_categorycode = 750101
A condition can have multiple expressions. You can use parentheses to group nested expressions, for example:
new_categorycode = 750101 & gendercode = 2
new_categorycode = 750101 & (gendercode = 2 | gendercode = 3)
new_name = Jane Doe
new_twooptionfield = true
new_twooptionfield = false
See also
Configure a portal
Define entity forms
Web Form steps for portals
Load Form/Load Tab step type
Redirect step type
Add custom JavaScript
Add custom JavaScript
1/23/2020 • 2 minutes to read • Edit Online

The Web Form Step record contains a field named Custom JavaScript that can be used to store JavaScript code
to allow you to extend or modify the form's visual display or function.
The custom block of JavaScript will be added to the bottom of the page just before the closing form tag element.

Form fields
The HTML input ID of an entity field is set to the logical name of the attribute. This makes selecting a field, setting
values, or other client-side manipulation easy by with jQuery.

$(document).ready(function() {
$("#address1_stateorprovince").val("Saskatchewan");
});

Additional client-side field validation


Sometimes you might need to customize the validation of fields on the form. The following example demonstrates
adding a custom validator. This example forces the user to specify an email only if the other field for preferred
method of contact is set to Email.

NOTE
The client-side field validation is not supported in a subgrid.
if (window.jQuery) {
(function ($) {
$(document).ready(function () {
if (typeof (Page_Validators) == 'undefined') return;
// Create new validator
var newValidator = document.createElement('span');
newValidator.style.display = "none";
newValidator.id = "emailaddress1Validator";
newValidator.controltovalidate = "emailaddress1";
newValidator.errormessage = "<a href='#emailaddress1_label'>Email is a required field.</a>";
newValidator.validationGroup = ""; // Set this if you have set ValidationGroup on the form
newValidator.initialvalue = "";
newValidator.evaluationfunction = function () {
var contactMethod = $("#preferredcontactmethodcode").val();
if (contactMethod != 2) return true; // check if contact method is not 'Email'.
// only require email address if preferred contact method is email.
var value = $("#emailaddress1").val();
if (value == null || value == "") {
return false;
} else {
return true;
}
};

// Add the new validator to the page validators array:


Page_Validators.push(newValidator);

// Wire-up the click event handler of the validation summary link


$("a[href='#emailaddress1_label']").on("click", function () {
scrollToAndFocus('emailaddress1_label','emailaddress1'); });
});
}(window.jQuery));
}

General validation
On click of the Next/Submit button, a function named webFormClientValidate is executed. You can extend this
method to add custom validation logic.

if (window.jQuery) {
(function ($) {
if (typeof (webFormClientValidate) != 'undefined') {
var originalValidationFunction = webFormClientValidate;
if (originalValidationFunction && typeof (originalValidationFunction) == "function") {
webFormClientValidate = function() {
originalValidationFunction.apply(this, arguments);
// do your custom validation here
// return false; // to prevent the form submit you need to return false
// end custom validation.
return true;
};
}
}
}(window.jQuery));
}

See also
Configure a portal
Define entity forms
Web Form steps for portals
Load Form/Load Tab step type
Redirect step type
Conditional step type
Configure web form metadata for portals
1/23/2020 • 7 minutes to read • Edit Online

The Web Form Metadata contains additional behavior modification logic to augment or override the functionality
of form fields that is otherwise not possible with native entity form editing capabilities.

Add a new record


1. On the Web Form Step that has fields that you would like to modify, go to Related > Metadata
2. Select New Web Form Metadata.

Web form metadata properties


The following attributes provide additional styling and capabilities for elements on a form.

NAME DESCRIPTION

Web Form Step The Web Form Step associated with the Web Form Metadata
record.

Type Available options are:


Attribute
Section
Tab
Selecting Attribute as the Type value displays the appropriate
options for modifying fields on the current form rendered for
the related step. Selecting Section as the Type value displays
the options available for modifying a section on the form.
Selecting Tab as the Type value displays the options available
for modifying a tab on a form.

Web form metadata type = Attribute


The following properties are displayed when the Type selected is 'Attribute'.

NAME DESCRIPTION

Attribute Logical Name The logical name of the attribute field to be modified.

Label Replaces the default label assigned to the attribute on the


entity with the text specified in this input. For each language
pack installed and enabled for the Common Data Service
environment a field will be available to enter the message in
the associated language.

Control style
The following options modify the style and functionality of an attribute's field.
NAME DESCRIPTION

Style One of the following:


Option Set as Vertical Radio Button List
Option Set as Horizontal Radio Button List
Single Line of Text as Geolocation Lookup Validator
(requires Bing Maps Settings - details found here)
Group Whole Number as Constant Sum (requires
Group Name)
Group Whole Number as Rank Order Scale No Ties
(requires Group Name)
Group Whole Number as Rank Order Scale Allow Ties
(requires Group Name)
Multiple Choice Matrix (requires Group Name)
Multiple Choice (requires Group Name)
Group Whole Number as Stack Rank (requires Group
Name)

Group Name A name used to group controls together as a composite


control.

Multiple Choice Minimum Required Selected Count This is the required minimum values selected in the multiple
choice question. Only necessary if 'Multiple Choice' Control
Style is selected.

Multiple Choice Max Selected Count This is the maximum number of values that is permitted to be
selected in the multiple choice question. Only necessary if
'Multiple Choice' Control Style is selected.

Constant Sum Minimum Total This is the required minimum value applied to a constant sum
response field. Only necessary if 'Group Whole Number as
Constant Sum' Control Style is selected.

Constant Sum Maximum Total This is the maximum number of value that is permitted to be
applied to a constant sum response field. Only necessary if
'Group Whole Number as Constant Sum' Control Style is
selected.

Randomize Option Set Values Specifying Yes results in randomly ordered options listed for
an Option Set control. Only applicable to attributes that are of
type Option Set.

CSS Class Adds a custom CSS class name to the control.

Prepopulate field
The following options provide a default value for fields on the form.

NAME DESCRIPTION

Ignore Default Value Ignores the default value of the specified attribute field. Useful
for attributes that are Two Option fields that are rendered as
Yes and No radio buttons. Because a value of yes or no is
automatically assigned by default, this option makes it
possible to display Yes/No questions without a predefined
response.
NAME DESCRIPTION

Type One of the following:


Value
Today's Date
Current User's Contact
Selecting Value requires a value to be specified in the Value
field that will be assigned to the field when the form is loaded.
Selecting Today's Date will assign the current date and time to
the attribute field. Selecting Current User's Contact requires a
From Attribute that is an attribute on the contact entity that
will be retrieved from the current user's contact record and set
on the attribute field specified.

Value A value to be assigned to the field when the form is loaded.

From Attribute An attribute on the contact entity that will be retrieved from
the current portal user's record and assigned to the field when
the form is loaded.

Set Value On Save


The following options specify a value to be set when the form is saved.

NAME DESCRIPTION

Set Value On Save Yes indicates that a value should be assigned to the attribute
using the input provided in the Value field.
Note: All attribute types are supported except the following:
Unique Identifier.

Type One of the following:


Value
Today's Date
Current User's Contact
Selecting Value requires a value to be specified in the Value
field that will be assigned to the field when the form is loaded.
Selecting Today's Date will assign the current date and time to
the attribute field. Selecting Current User's Contact requires a
From Attribute that is an attribute on the contact entity that
will be retrieved from the current user's contact record and set
on the attribute field specified.

Value Value assigned to the attribute when the form is being saved.
For Two Option (Boolean) fields use true or false.
For Option Set field use the integer value for the option.
For Lookup (EntityReference) fields, use the GUID.
Note: If the attribute is also on the form the user's value will
be overwritten with this value.

From Attribute An attribute on the contact entity that will be retrieved from
the current portal user's record and assigned to the field
during save.

Validation
The following section contains properties that modify various validation parameters and error messages.
For each language pack installed and enabled for the Common Data Service environment, a field will be available
to enter the message in the associated language.

NAME DESCRIPTION

Validation Error Message Overrides the default validation error message for the field.

Regular Expression A regular expression to be added to validate the field.

Regular Expression Validation Error Message The validation error message to display if the regular
expression validated fails.

Field is Required Check to make the attribute field required to contain a value.

Required Field Validation Error Message Overrides the default required field error message if the field
does not contain a value.

Range Validation Error Message Overrides the default range validation error message
displayed if the field's value is outside of the appropriate
minimum and maximum values specified on the entity
attribute that are of type Whole Number, Decimal Number,
Floating Point Number or Currency.

Geolocation Validator Error Message Applicable if the attribute is a Single Line of Text and the
Control Style specified is Single Line of Text as Geolocation
Lookup Validator then this will override the default error
message displayed if input validation fails.

Constant Sum Validation Error Message Applicable if the attribute is a Whole Number type and the
Control Style specified is Group Whole Number as Constant
Sum then this will override the default error message
displayed if input validation fails.

Multiple Choice Validation Error Message Applicable if the attribute is a Two Option type and the
Control Style specified is Multiple Choice then this will
override the default error message displayed if input
validation fails.

Rank Order No Ties Validation Error Message Applicable if the attribute is a Whole Number type and the
Control Style specified is Group Whole Number as Rank Order
No Ties then this will override the default error message
displayed if input validation fails.

Description and instructions


The following properties specify the location and content of custom description or instructions.

NAME DESCRIPTION

Add Description Yes results in custom text being displayed on the form in the
position specified.

Position One of the following:


Above the field
Below the field
Above the label
NAME DESCRIPTION

Use Attribute's Description Property Select 'Yes' to use the description assigned to the attribute
metadata on the entity. Select 'No' to provide a custom
description. Default is 'No'.

Description Custom text to be displayed on the form. Used in conjunction


when Use Attribute's Description Property is set to 'No'. For
each language pack installed and enabled for the Common
Data Service environment a field will be available to enter the
message in the associated language.

Web Form metadata type = Section


The following properties are displayed when the Type selected equals 'Section'.

NAME DESCRIPTION

Section Name The name of the section on the entity's form to be modified.

Label Replaces the default label assigned to the section on the


entity with the text specified in this input. For each language
pack installed and enabled for the Common Data Service
environment a field will be available to enter the message in
the associated language.

Web Form metadata type = Tab


The following properties are displayed when the Type selected equals 'Tab'

NAME DESCRIPTION

Tab Name The name of the tab on the entity's form to be modified.

Label Replaces the default label assigned to the tab on the entity
with the text specified in this input. For each language pack
installed and enabled for the Common Data Service
environment a field will be available to enter the message in
the associated language.

See also
Configure a portal
Define entity forms
Web Form properties for portals
Web Form steps for portals
Web Form subgrid configuration for portals
Notes configuration for Web Forms for portals
Configure Web form subgrids for portals
1/23/2020 • 13 minutes to read • Edit Online

Web form subgrids are configured in an identical fashion to entity form subgrids: first, create a metadata record
for the Web form step that has a subgrid, and then add configuration metadata.
Adding subgrids to your managed forms on the portal is easy—just add the subgrid to the form that you are
managing by using the out-of-the-box form designer, and you’re done. The grid will use the view that is specified
in Common Data Service form designer, show only related records if that option was chosen, optionally show a
search bar, and even respect entity permissions for portals. It doesn't get any simpler to display a read-only list of
records. To enable actions for the grid— Create, Update, Delete, and so on—you must configure those actions by
using metadata configuration.

Add subgrid metadata to your form


To add subgrid metadata to an entity form, go to Entity Form Metadata by using either the top drop-down list
or the subgrid on the main form of the record that you are working with. More information: Define entity forms.
To add a new record, select Add New Entity Form Metadata.
To edit an existing record, select the record in the grid. Selecting Subgrid as the Type value displays another
attribute, Subgrid Name.

NAME DESCRIPTION

Subgrid Name The unique name of the subgrid on the entity's related form.

Selecting the subgrid in the form editor will display a properties window. This contains a Name field that should
be used to assign to the Subgrid Name field on the Entity Form Metadata record.
Specifying a valid subgrid name will display the subgrid configuration settings. By default, only Basic Settings
are shown. Select Advanced Settings to show additional settings.
By default, most settings are shown collapsed to save space. Select **** to expand a section and see additional
options. Select **** to collapse the section.

Attributes
NAME DESCRIPTION

Basic Settings

View Actions Use to add action buttons for actions that are applicable for
the entity set and will appear above the subgrid. The available
actions are:
Create
Download
Associate
Selecting one of these options displays a configuration area
for that action. See below for details about each action.
NAME DESCRIPTION

Item Actions Use to add action buttons for actions that are applicable for
an individual record and will appear in each row in the
subgrid, provided the associated privilege has been granted
by Entity Permissions. The available actions are:
Details
Edit
Delete
Workflow
Disassociate
Selecting on one of these options displays a configuration
area for that action. See below for details about each action.

Override Column Attributes Use to override display settings for individual columns in the
grid.
Attribute: Logical name of the column you want to
override.
Display Name: New column title to override the default
Width: Width (in either percent or pixels) of the
column to override the default. See also Grid Column
Width Style. To override settings on a column, select
Column and fill in the details.

Advanced Settings

Loading Message Overrides the default HTML message that appears while the
subgrid is loading.

Error Message Overrides the default HTML message that appears when an
error occurs while the subgrid is loading.

Access Denied Message Overrides the default HTML message that appears when a
user does not have sufficient permissions to read the entity
type associated with the subgrid.

Empty Message Overrides the HTML message that appears when the
associated subgrid contains no data.

Lookup Dialog Controls the settings for the dialog box that appears when a
user activates the Associate action.

Details Form Dialog Controls the settings for the dialog box that appears when a
user activates the Details action.

Edit Form Dialog Controls the settings for the dialog box that appears when a
user activates the Edit action.

Create Form Dialog Controls the settings for the dialog box that appears when a
user activates the Create action.

Delete Dialog Controls the settings for the dialog box that appears when a
user activates the Delete action.

Error Dialog Controls the settings for the dialog box that appears when an
error occurs during any action.
NAME DESCRIPTION

CSS Class Specify a CSS class or classes that will be applied to the HTML
element that contains the entire subgrid area, including the
grid and action buttons.

Grid CSS Class Specify a CSS class or classes that will be applied to the
subgrid's HTML <table> element.

Grid Column Width Style Configures whether the Width values in the Override Column
Attributes are specified in Pixels or Percent.

Create action
Enabling a Create action renders a button above the subgrid that, when selected, opens a dialog box with an
entity form that allows a user to create a new record.
Create action settings
NAME DESCRIPTION

Basic Settings

Entity Form Specifies the entity forms and custom logic that will be used
to create the new record. The drop-down list includes all
entity forms that are configured for the subgrid's entity type.
Note: If the subgrid's entity type has no entity forms, the
drop-down list will appear empty. If no entity form is supplied
for the Create action, it will be ignored and the button will not
be rendered on the subgrid's entity form.

Advanced Settings

Button Label Overrides the HTML label displayed in the Create action
button above the subgrid.

Button Tooltip Overrides the tooltip text that appears when the user points
to the Create action button.

Create Form dialog box advanced settings


NAME DESCRIPTION

Loading Message Overrides the message that appears while the dialog is
loading.

Title Overrides the HTML that appears in the title bar of the dialog
box.

Dismiss Button Sr Text Overrides the screen reader text associated with the dialog
box's Dismiss button.

Size Specifies the size of the Create Form dialog box. The Options
are Default, Large, and Small. The default size is Large.
NAME DESCRIPTION

CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box.

Title CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box's title bar.

Download action
Enabling a Download action renders a button above the subgrid that, when selected, downloads the data from
the subgrid to an Excel (.xlsx) file.
Download action settings
NAME DESCRIPTION

Basic Settings

None

Advanced Settings

Button Label Overrides the HTML label displayed on the Download action
button above the subgrid.

Button Tooltip Overrides the tooltip text that appears when the user points
to the Download action button.

Associate action
Enabling an Associate action displays a button above the subgrid that, when selected, opens a table of entities
that the user can choose to associate to the entity record currently being displayed by the entity form, provided the
Append and AppendTo privileges have been granted by Entity Permissions for the applicable entity types.
Associate action settings
NAME DESCRIPTION

Basic Settings

View Specifies the view (Saved Query) that will be used to find and
display the list of eligible entities.
Note: If the subgrid's entity type has no saved queries, the
drop-down list will appear empty. If no view is supplied for the
Associate action, it will be ignored and the button will not be
rendered on the subgrid's entity form.

Advanced Settings

Button Label Overrides the HTML label displayed in the Associate action
button above the subgrid.
NAME DESCRIPTION

Button Tooltip Overrides the tooltip text that appears when the user points
to the Associate action button.

Lookup dialog box advanced settings


NAME DESCRIPTION

Title Overrides the HTML that appears in the title bar of the dialog
box.

Primary Button Text Overrides the HTML that appears in the Primary (Add) button
on the dialog box.

Close Button Text Overrides the HTML that appears in the Close (Cancel) button
on the dialog box.

Dismiss Button Sr Text Overrides the screen reader text associated with the dialog
box's Dismiss button.

Size Specifies the size of the Associate dialog box. The Options are
Default, Large, and Small. The default size is Large.

CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box.

Title CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box's title bar.

Primary Button CSS Class Specify a CSS class or classes that will be applied to the dialog
box's Primary (Add) button.

Close Button CSS Class Specify a CSS class or classes that will be applied to the dialog
box's Close (Cancel) button.

Select Records Title Overrides the HTML that appears in the title of the Record
Selection area.

Default Error Message Overrides the message that appears when an error occurs
while associating the selected entity or entities.

Grid Options Specify settings for the appearance of the entity grid. See
below for options.

Lookup dialog box advanced grid options settings


NAME DESCRIPTION

Loading Message Overrides the message that appears while the grid of entities
is loading.
NAME DESCRIPTION

Error Message Overrides the message that appears when an error occurs
while loading the grid of entities.

Access Denied Message Overrides the message that appears when a user does not
have sufficient entity permissions to view the grid of entities.

Empty Message Overrides the message that appears when there are no
entities that can be associated with the current entity form.

CSS Class Specify a CSS class or classes that will be applied to the
associate grid area.

Grid CSS Class Specify a CSS class or classes that will be applied to the
associate grid's <table> element.

Details action
Enabling a Details action allows a user to view a read-only entity form that is data-bound to the record of the
subgrid's selected row.
Details Action settings
NAME DESCRIPTION

Basic Settings

Entity Form Specifies the entity form that will be used to view the details
of the selected record. The drop-down list will include all
entity forms that are configured for the subgrid's entity type.
Note: If the subgrid's entity type has no entity forms, the
drop-down will appear empty. If no entity form is supplied for
the Details action, it will be ignored and the button will not be
rendered in the subgrid.

Advanced Settings

Record ID Query String Parameter Name Specifies the name of the query string parameter that will be
used to select the entity to view in the selected entity form.
This should match the value in that entity form's Record ID
Query String Parameter Name. The default value for this field,
both here and in Entity Form configuration, is id.

Button Label Overrides the HTML label for this action displayed in the
subgrid row.

Button Tooltip Overrides the tooltip text that appears when the user points
to the button for this action displayed in the subgrid row.

Details form dialog box advanced settings


NAME DESCRIPTION

Loading Message Overrides the HTML that appears when the dialog box is
loading.

Title Overrides the HTML that appears in the title bar of the dialog
box.

Dismiss Button Sr Text Overrides the screen reader text associated with the dialog
box's Dismiss button.

Size Specifies the size of the Details dialog box. The Options are
Default, Large, and Small. The default size is Large.

CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box.

Title CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box's title bar.

Edit action
Enabling an Edit action allows a user to view an editable entity form that is data-bound to the record of the
subgrid's selected row, if the Write privilege has been granted by Entity Permissions.
Edit action settings
NAME DESCRIPTION

Basic Settings

Entity Form Specifies the entity form that will be used to edit the selected
record. The drop-down list will include all entity forms that are
configured for the subgrid's entity type.
Note: If the subgrid's entity type has no entity forms, the
drop-down list will appear empty. If no entity form is supplied
for the Edit action, it will be ignored and the button will not
be rendered in the subgrid.

Advanced Settings

Record ID Query String Parameter Name Specifies the name of the query string parameter that will be
used to select the entity to edit in the selected entity form.
This should match the value in that entity form's Record ID
Query String Parameter Name. The default value for this field,
both here and in entity form configuration, is id.

Button Label Overrides the HTML label for this action displayed in the
subgrid row.

Button Tooltip Overrides the tooltip text that appears when the user points
to the button for this action displayed in the subgrid row.

Edit form dialog box advanced settings


NAME DESCRIPTION

Loading Message Overrides the HTML that appears when the dialog box is
loading.

Title Overrides the HTML that appears in the title bar of the dialog
box.

Dismiss Button Sr Text Overrides the screen reader text associated with the dialog's
Dismiss button.

Size Specifies the size of the Edit dialog box. The Options are
Default, Large, and Small. The default size is Large.

CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box.

Title CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box's title bar.

Delete action
Enabling a Delete action allows a user to permanently delete the entity represented by a row in the subgrid, if
the Delete privilege has been granted by Entity Permissions.
Delete action settings
NAME DESCRIPTION

Basic Settings

None

Advanced Settings

Confirmation Overrides the confirmation HTML message displayed when


the user activates the Delete action.

Button Label Overrides the HTML label for this action displayed in the
subgrid row.

Button Tooltip Overrides the tooltip text that appears when the user points
to the button for this action displayed in the subgrid row.

Delete dialog box advanced settings


NAME DESCRIPTION

Title Overrides the HTML that appears in the title bar of the dialog
box.
NAME DESCRIPTION

Primary Button Text Overrides the HTML that appears in the Primary (Delete)
button on the dialog box.

Close Button Text Overrides the HTML that appears in the Close (Cancel) button
on the dialog box.

Dismiss Button Sr Text Overrides the screen reader text associated with the dialog
box's Dismiss button.

Size Specifies the size of the Delete dialog box. The Options are
Default, Large, and Small. The default size is Default.

CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog.

Title CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box's title bar.

Primary Button CSS Class Specify a CSS class or classes that will be applied to the dialog
box's Primary (Delete) button.

Close Button CSS Class Specify a CSS class or classes that will be applied to the dialog
box's Close (Cancel) button.

Workflow action
Enabling a Workflow action allows a user to run an on-demand workflow against the selected record in the
subgrid. You can add any number of Workflow actions to the subgrid metadata.
Workflow action settings
NAME DESCRIPTION

Basic Settings

Workflow Specifies the on-demand workflow that will run when the user
activates this action.
Note: If the subgrid's entity type has no workflows, the drop-
down list will appear empty. If no workflow is supplied for the
Workflow action, it will be ignored and the button will not be
rendered in the subgrid.

Button Label Sets the HTML label for this action displayed in the subgrid
row. This setting is required.

Advanced Settings

Button Tooltip Overrides the tooltip text that appears when the user points
to the button for this action displayed in the subgrid row.
Disassociate action
Enabling a Disassociate action allows a user to remove the link between the record represented by the currently
viewed entity form and the record represented by the selected row in the subgrid, as long as the Append and
AppendTo privileges have been granted by Entity Permissions for the applicable entity types.
Disassociate action settings
NAME DESCRIPTION

Basic Settings

None

Advanced Settings

Button Label Overrides the HTML label for this action displayed in the
subgrid row.

Button Tooltip Overrides the tooltip text that appears when the user points
to the button for this action displayed in the subgrid row.

See also
Configure a portal
Define entity forms
Web Form properties for portals
Web Form steps for portals
Web Forms metadata for portals
Notes configuration for Web Forms for portals
Add geolocation
1/23/2020 • 2 minutes to read • Edit Online

Geolocation is the identification of the real-world geographic location of an object. Geolocation is closely related
to the use of positioning systems, but places a greater emphasis on determining a meaningful location (for
example, a street address) rather than just a set of geographic coordinates. The word geolocation can also mean
the latitude and longitude coordinates of a particular location.
A managed form can be configured to display a map control either to display an existing location as a pin on a
map or to provide the ability for the user to specify a location.

If the form or Address Line field is editable and this field is blank, when the page loads it will prompt the user
asking if they would like to share their location. If they choose to share their location, the map will be updated with
their currently detected location. The user can refine the location of the pin by dragging it. If the user chooses not
to share their location, they can manually specify the location in the fields provided and the mapping service will
be queried to find the location, update latitude and longitude, and reposition the pin on the map accordingly.

Add geolocation
To add geolocation functionality to a managed form, the following tasks must be completed.
Form customization
Edit the entity form by using the form designer and make the following modifications:
1. Create a new section and provide an appropriate label, for example Map. This section will contain the map.
2. Set the name of the section to section_map or a name that ends with section_map, for example
contoso_section_map. This name is important because the form engine looks for a section with this name to
determine when to render a map.
3. Add a new or existing field that will store the formatted address, and add it to the Map section created in the
previous step.
4. Create a new section and provide an appropriate label, for example Location. This section will contain the
address fields for the selected location.
5. Add the required address fields to the Location section created in the previous step:
Address Line
City
County
State/Province
Country/Region
Zip/Postal Code
Latitude
Longitude
The resulting form should look similar to the following. You can choose different display names for these fields.
You can also choose to lay out these sections any way you prefer.

Site settings
Geolocation with map functionality on managed forms requires configuration settings to complete requests with
the mapping service REST endpoint. The following site settings are used to configure the location service.

NAME VALUE

Bingmaps/credentials Unique key to authenticate requests to the Bing Maps API.


Visit www.bingmapsportal.com to create a Bing Maps account
and get a key. Required.

Bingmaps/restURL URL to the Bing Maps REST API. Optional. If a value is not
specified, the default
https://dev.virtualearth.net/REST/v1/Locations is used.

Field configurations
The map control requires additional configuration to tell it what the IDs of the various location fields are, so it can
assign values to them or retrieve values from them. The configuration depends on the type of managed form.
For entity forms, see Geolocation configuration for entity forms.
For web forms, see Geolocation configuration for Web forms.
Implementing General Data Protection Regulations in
your Power Apps portals
1/23/2020 • 4 minutes to read • Edit Online

The General Data Protection Regulation (GDPR ) is a legal act of the European Union (EU ), which protects data for
all individuals within the EU. With GDPR, people can control the use of their personal data in Common Data
Service.
As an administrator, you can configure your portal to meet GDPR standards. For example, minors must have
parental consent to use the portal. You can also establish terms and conditions for people who use your portal.
Users must agree to the terms and conditions to use the portal.
GDPR allows you to obtain consent from portal users about the use of their personal data, identify minor users,
and get parental consent for minors.

Audit logging
The Last Successful Sign-in field in the portal contact record shows when a portal user has last logged in. This
date is picked up by an audit of the contact record and makes that information available in the standard audit
stream. This allows the administrator to see inactive community members and delete their records.

NOTE
The login tracking feature has been deprecated. It is recommended to use an analytics technology like Azure Application
Insights to capture this kind of information. To see the list of deprecated features, click here.

Identifying minor portal users and obtaining parental consent


Regulations for identifying minors vary by country/region. Because a minor can only access the portal with
parental consent, you can configure the portal to identify minors using these fields in the portal contact record:
Is Minor: Indicates that the contact is considered a minor in their jurisdiction. By default, No is selected.
Is Minor with Parental Consent: Indicates that the contact is considered a minor in their jurisdiction and
has parental consent. By default, No is selected.
The following site settings control the use of portals by minors and minors without parental consent:

NAME DESCRIPTION

Authentication/Registration/DenyMinors Denies use of the portal by minors. By default, it is set to false.

Authentication/Registration/DenyMinorsWithoutParentalCons Denies use of the portal by minors without parental consent.


ent By default, it is set to false.

If a portal user is determined to be a minor and the portal is configured to block minors, an appropriate message
appears and content is not shown.
If a portal user is determined to be a minor without parental consent, and the portal is configured to block minors
without parental consent, an appropriate message appears and content is not shown.
The following content snippets control messages that appear when the portal is used by minors and minors
without parental consent. You can change the message according to your requirements.

NAME TYPE VALUE

Account/Signin/MinorNotAllowedHeadi Text Age Requirements


ng

Account/Signin/MinorNotAllowedCopy HTML The use of this portal is not suitable for


use by minors and is not allowed.

Account/Signin/MinorWithoutParentalC Text Parental Consent


onsentNotAllowedHeading

Account/Signin/MinorWithoutParentalC HTML The use of this portal by minors


onsentNotAllowedCopy requires parental consent.

When someone registers using an external provider and the portal is configured to block minors or minors
without parental consent, the contact record is not created and the user is not authenticated.

Agreeing to terms and conditions


According to the GDPR, portal users must agree to the terms and conditions to allow marketing, profiling, or
access to private information. As an administrator, you can publish your own terms and conditions to get consent
of the portal user before they are authenticated to the site.

The following content snippets control the display of terms and conditions on the screen. You can change the text
according to your requirements.
NAME TYPE VALUE

Account/Signin/TermsAndConditionsHe Text Terms and Conditions


ading

Account/Signin/TermsAndConditionsCo HTML
py

Account/Signin/TermsAndConditionsAg Text I agree to these terms and conditions


reementText

Account/Signin/TermsAndConditionsBut Text Continue


tonText

The Account/Signin/TermsAndConditionsCopy content snippet is empty by default. A portal administrator must enter
the terms and conditions in this content snippet.
The following site settings control the terms publication date and whether the terms should be displayed on the
portal:

NAME DESCRIPTION

Authentication/Registration/TermsPublicationDate A date/time value in GMT format to represent the effective


date of the current published terms and conditions. If the
terms agreement is enabled, portal users that have not
accepted the terms after this date will be asked to accept
them the next time they sign in. If the date is not provided,
and the terms agreement is enabled, the terms will be
presented every time portal users sign in.
Note: If you want a portal user to agree to the terms and
conditions every time they sign in, do not provide a value for
this site setting.

Authentication/Registration/TermsAgreementEnabled A true or false value. If set to true, the portal will display the
terms and conditions of the site. Users must agree to the
terms and conditions before they are considered
authenticated and can use the site. By default, it is set to false.

The following field is added in the portal contact record to store the date and time a portal user agreed to the
terms and conditions:
Portal Terms Agreement Date: Indicates the date and time that the person agreed to the portal terms and
conditions.
See also
Migrate identity providers to Azure AD B2C
Create and run advertisements on a portal
1/23/2020 • 5 minutes to read • Edit Online

Create text or image-based ads and have them run in multiple placements throughout your site. Randomize ads or
select specific ads for specific placements. You can choose release and expiration dates for time-sensitive,
scheduled content. Ads can be hyperlinked to any destination and open in the current window or a new window.
Advertisements are displayed in the portal via two entities: The Ad Placement entity and associated Ad entity. Ads
can be surfaced in many ways: with pre-made Liquid Templates available within portals via Liquid
Templating/example Web Templates, or within the.aspx page via MVC actions.

Create a new advertisement


Ads represent the specific advertisement or image that will appear on the portal at a given time. The Ad entity will
be displayed in the location specified by the ad placement. The ad must be associated with an ad placement to
appear on the portal. For this demonstration, the out-of-the-box example Place Holder ad and Sidebar Bottom ad
placement will be surfaced in the Company Portal to exhibit basic functionality and to help you gain familiarity
before you create more complex ads. Any of the starter sites can be used in place of the Company Portal. However,
note that the Liquid Templates used for this demonstration call on the Sidebar Bottom ad placement name.
1. Open the Portal Management app.
2. Go to Portals > Ads
3. Open the Placeholder ad associated with the Company Portal website (this can be done with the starter
site of your choosing by selecting +New and creating an identical ad below the Website).
4. Select the Save icon in the lower-right corner (or Save & Close in the upper-left corner if you have created
a new ad).
Within the Ad form, you specify a Name to describe the ad, the Website where the ad will be displayed, and a
Publishing State. Optionally you can specify a Web Template and Release/Expiration date. You must provide
some sort of data for the ad to be displayed. Use the Ad entity attribute table later in this guide to craft the specifics
of your ad.

Create a new advertisement placements


1. Open the Portal Management app.
2. Go to Portals > Ad Placements.
3. Select the Web Template Field to select a Web Template. For demonstration purposes, the Random Ad Web
Template was chosen.
4. On the rightmost corner of the Ads grid, select + to select the ad created in the previous step.
5. Select the Save icon in the lower-right corner
When creating a new ad placement, specify a Name to describe the ad placement and the Website where the ad
placement will be displayed as required. The example Web Templates that enable the use of ads as an out-of-the-
box feature will be displayed within the lookup of the Web Template field in the form. These templates are also
intended to be used as a source to create custom templates.
NOTE
The ad created above will not be displayed on the home page of the starter portal.

Using Liquid templates to place advertisements


Content managers may use Liquid to add an ad to any editable content area, as described in Work with Liquid
templates and, more specifically, Ads.
This template renders an ad by name, or a random ad from an ad placement. Currently, the code below will not
render multiple ads in the ad placement (that is, a rotating ad). To render multiple ads in the ad placement, you
would need to build a Liquid ads API. For more information about built-in web templates, see Store source content
by using web templates.

{% include 'ad' ad_name:'Name' %}


{% include 'ad' ad_placement_name:'Placement Name' %}
1. {% include 'Random Ad' placement:ads.placements[Sidebar Bottom] %}

OR

1. {% include 'Ad Template' ad:ads{Retail Ad - Go Greene] %}

Attributes
The Ad Entity has the following attributes:

NAME DESCRIPTION

Name A descriptive name for the ad

Website The associated website. Required.

Web Template The associated web templates that will be used by default to
render the ad. This field is optional; if it is blank the ad will be
rendered using a default template.

Release Date Controls the date and/or time after which the ad will be visible
on the portal. If the ad placement is rotating through multiple
ads, an unreleased ad will not appear. If no released ads are
associated with an ad placement, nothing will appear. This is
useful for controlling the release of time-sensitive content.

Expiration Date Controls a date or time prior to which the ad will be visible on
the portal.

Publishing State The current Publishing State.

Redirect URL When the ad is clicked, the user will go to this URL. This field
is optional. If no value is given, the ad will not be clickable.

Open In New Window Boolean. If set to true, the ad will open a new browser window
when clicked.

Title A single line of text for the ad which can be displayed on the
portal. Whether it is displayed is determined by a property on
the AdPlacement control. This is primarily useful for text-based
ads or simple one-line links that you want to place on the
portal by using ad placements. If the title is displayed, by
default it will be rendered as a hyperlink that points to the
Redirect URL. This behavior may be altered by using a custom
web template.
NAME DESCRIPTION

Copy A multiple-line body of text or other web content that will be


displayed in the ad placement. This allows the placement to be
used in a similar way to content snippets, but it is best to
avoid using them to serve simply as a bucket to hold content
(use snippets for that). Instead, they are best used to display
rotating image or textual content.

Image URL The URL of the image that will be displayed by the ad.
Optional; Use this field if you want the ad to render a static
resource or a web file. The Image will be clickable and link to
the redirect URL, if one is given. If an ad has a note attached
to it with an image file attachment, the ad will render that as
its image. This is possibly the most convenient way to set up
images for ads, and ties the image directly to the ad. In this
case, using the Image URL field is not necessary.

Image width Width of the image. This field is not required but is
recommended to ensure that the rendered ad is valid and
accessible HTML

Image Height Height of the image. This field is not required but is
recommended to ensure that the rendered ad is valid and
accessible HTML

Image Alt Text Alt Text for the image. This field is not required but is
recommended to ensure that the rendered ad is valid and
accessible HTML.

See also
Configure a portal
About entity lists
Create and run advertisements on a portal
Gather feedback by using polls on a portal
Rate or vote on a webpage on a portal
Redirect to a new URL on a portal
Gather feedback by using polls on a portal
1/23/2020 • 5 minutes to read • Edit Online

Polls give your web audiences a quick and easy way to voice their opinion on specific topics, and then immediately
and automatically see feedback from their vote.
Use the polls capability of portals to ask your audience about topics of interest and let them give single answers or
multiple-choice responses. Either way, their responses are instantly stored and associated with the applicable
Contact record for immediate review or aggregate reporting. You can use polls as simple market research tools
and, if you refresh or rotate the polls dynamically, you'll keep your website looking current and topical.
Polls can be placed on the portal by using the PollPlacement control. This control works similarly to the
AdPlacement control. If there are any polls associated with the Poll Placement entity that is being rendered by the
PollPlacement control, those polls will be rendered. If there is more than one poll for a given placement, the
placement will randomly present one of the specified polls.

NOTE
Users can vote anonymously. Duplicate votes are not permitted. Basic information about submissions can be tracked, and
users who sign in to the website will have their submissions linked to the Contact entity that tracks that user in Common
Data Service.

Add a poll to the page


Content managers can use Template tags to add a poll to any editable content area:
{% include 'Random Poll' placement:polls.placements[Sidebar] %}

or
{% include 'Poll Template' ad:ads[Wireframe Development] %}

NOTE
Example web templates are configured in the starter websites. You can use the Random Poll template to display a random
poll from a particular Poll Placement entity, or you can use the Poll Template template to display a specific poll. You can edit
these templates or follow their example and create your own by using Polls.

Create a poll placement


To create a new poll placement region:
1. Open the Portal Management app.
2. Go to Portals > Poll Placements.
3. Select New.
4. Select the associated Website, give the placement a name, and—optionally—select the web templates that
will control how it is rendered.
5. After the placement has been created, you must associate one or more polls with this placement. On the
Polls tab of the Poll Placement entity, select Add Existing Poll.
6. In the resulting lookup box, select an existing poll record or create a new poll by selecting New Poll.

Polls
A poll is a simple yes/no or multiple-choice question that you can display on your portal via poll placements. There
are many customizable options for the display of polls available for developers, but for content managers, adding
polls to your website is as easy as choosing a question and series of possible answers (poll options). A poll must
have related options to function, and must be associated with a poll placement to be rendered on the portal.
A new poll can be created in two ways:
By going to the Polls section in the Portals area.
By selecting the New button on the Look Up Records window while adding a poll to a poll placement.

Poll attributes
NAME DESCRIPTION

Name The descriptive name of the poll.

Website The associated web templates.

Web Template The associated web templates that will be used by default to
render the poll. This field is optional; if it is blank, the poll will
be rendered by using a default template.

Question This is the actual question that is being asked in the poll. The
associated poll options are the possible answers that can be
selected for this poll.

Submit Button Label The text that is to be used for the submission button.

Release Date Controls the date and time after which the poll will be visible
on the portal. If the poll placement is rotating through
multiple polls, an unreleased poll will not be shown. If no
released polls are associated with a poll placement, nothing
will appear. This is useful for controlling the release of time-
sensitive content.

Expiration Date Controls the date/time prior to which the poll will be visible on
the portal.

Close Voting Date Until this date, users who have not yet voted on a poll can
vote on the poll.

NOTE
When a user has voted on a poll, they will see a summary of current results for the poll. These results will also be
displayed for a poll that is past its closed date, but for which the user has not yet voted. This allows you to continue to
reveal the results of polls after you no longer want people to be able to vote on them.
The difference between the Close Voting Date and Expiration Date is that after the expiration date has passed, the poll will
no longer show up on the poll placement (it will not be cycled to). The Close Voting Date only determines the date past
which users cannot vote on the poll.
Now that the poll has been created, you must associate one or more poll options with this poll. On the Options
tab of the poll, select New Poll Option.

Poll options
A poll is a question that is being presented to the user. A poll has two or more possible answers as determined by
the content author. These answers are represented by Poll Options, which must be associated with the poll in
question. A new poll option is created via the Look Up Records window when adding poll options to a poll, as
described above.

Poll option attributes


NAME DESCRIPTION

Name The descriptive name for the poll option.

Poll The poll that the option is associated with.

Answer The text to display as an available poll voting option.

Votes The number of votes the poll option has received (read-only).

Display Order A numeric value that will determine the display order of the
poll options.

Poll submissions
When a user visits the website, they will be given the opportunity to vote on the poll displayed on the page.
Users can vote only one time; after this, if the poll is displayed, they will see the results for that poll.

The details of the poll voting results are stored in Common Data Service as Poll Submission records. The Poll
Submission entity contains the following information:

NAME DESCRIPTION

Name Displays the name of the voter if the user is signed in;
otherwise, records the anonymous ID.

Poll The associated poll.

Poll Option The poll option that the user selected.

Contact The associated Contact record of the voter if the user is signed
in.

Visitor ID The anonymous ID of the voter if the user is anonymous.

See also
Configure a portal
About entity lists
Create and run advertisements on a portal
Rate or vote on a webpage on a portal
Redirect to a new URL on a portal
Create and manage publishing states
1/23/2020 • 4 minutes to read • Edit Online

Publishing states allow for the definition of a content lifecycle in portals website. At a basic level, a publishing state
can determine whether an associated entity should be considered visible/published on a portal. In more complex
configurations, they can define a multi-stage process for content review and publishing, with security restrictions
on each stage.
Publishing states can be used with web pages, web files, web links, forums, and advertisements.
By default, two publishing states are available: Draft and Published. Draft specifies content that should not be
visible to non-content-author users, while Published specifies content that should be visible to all portal users
(barring other security restrictions). You can modify the default configuration to meet your specific requirements, if
desired – by adding new states or renaming states.

Manage publishing states


Publishing states can be created, edited, and deleted within portals.
1. Open the Portal Management app.
2. Go to Portals > Websites.
3. Select the website to manage publishing states.
4. Go to the Publishing States tab. The list of available publishing states is displayed.

5. To add a new publishing state, select New publishing state.


6. To edit an existing publishing state, select the publishing state name.
7. In the Publishing State window, enter appropriate values in the fields.
8. Select Save & Close.
Publishing state attributes
NAME DESCRIPTION

Name The descriptive name of the state. This field is required.

Website The website to which the state belongs. This field is required.

Is Default If checked, designates this state as the default state for the
website. This will determine the default state selected when
creating new entities through the portal front-side editing
interface.
Note:Only one Publishing State in a given Website should be
marked as the default state.

Is Visible If checked, designates that entities associated with this state


will be considered visible (or published) on the portal.
While an entity associated with a non-visible state will not be
visible on the portal, an entity associated with a visible state
may also not be visible, due to security permissions, expiration
dates, or other visibility rules.
Users with content management permissions may be granted
the ability to use Preview Mode, which allows these users to
see (preview) unpublished content.

Display Order An integer value indicating the order in which the state will be
placed, in menus and drop-down lists for selecting a
Publishing State – mostly found in the portal front-side
editing interfaces.

Publishing state transition rules


Publishing state transition rules allow you granular control over which web roles have the right to make what
content changes on the portal in terms of publishing state.
To be precise, publishing state transition rules govern the transitions between publishing states (Draft or
Published). When a user attempts to switch the publishing state of an item from one to another, if a rule exists for
this transition, then the security provider will assert that the web role for the logged-in user has permission to
perform this transition.
If the logged-in user who is attempting the change is in any of the roles you assign to the rule, the transition will be
successful. If a user does not have permissions to make a change from one rule to another, then the front-side
editing will not allow them to make that change. Alternatively, you can create the rule; then as you create web roles
add the rule to the web roles. One rule can be associated with any number of web roles and vice versa.
1. Open the Portal Management app.
2. Go to Portals > Publishing State Transition Rules.
3. To create a new rule, select New.
4. To edit an existing rule, select the rule name.
5. In the Publishing State Transition Rule window, enter appropriate values in the fields.
6. Select Save so you can continue adding web roles to it.
7. On the Web Roles tab, select Add Existing Web Role. In the Lookup Records pane, browse and add the
appropriate web roles.
8. Select Save.

State-based control rules


Web page access control rules can be linked with publishing states to allow or deny the right to view or modify
content based on the branch of the website and the publishing state of content within that branch. To accomplish
this, associate a web page access control rule with a publishing state. Once it is associated with a publishing state,
the rule will only be applied to web pages when that publishing state is active.
For example, say you wanted someone in the content publishing role to be able to modify a page's content, but
only when that page is in Draft mode. This would ensure that changes to the page are not done while the page is
'live' and would allow for an approval process to be undertaken on pending changes.
To do this, you would create a rule with the grant change permission and apply it to the branch in question (or the
home page if the rule is to apply to the entire site). You would then associate this rule with the draft state.

You would then associate this rule with the appropriate web role, for example, Content publishing. Assuming this
web role is not associated with a more permissive rule (i.e. a rule that grants change regardless of publishing state)
then users in the content publishing web role will be able to modify pages in the draft state but will not be able to
modify pages in the published state.
Work with Liquid templates
1/23/2020 • 2 minutes to read • Edit Online

Liquid is an open-source template language integrated into portals. It can be used to add dynamic content to
pages, and to create a wide variety of custom templates. Using Liquid, you can:
Add dynamic content directly to the Copy field of a webpage or the content of a content snippet.
Store source content by using web templates, entirely through configuration within Power Apps, for use
throughout the Power Apps portals content management system.
Render a website header and primary navigation bar, entirely through configuration within Power Apps.
See also
Store source content by using web templates
Understand Liquid operators
Liquid types
Liquid conditional operators
Liquid Objects
Liquid Tags
Liquid Filters
Store source content by using web templates
1/23/2020 • 5 minutes to read • Edit Online

Web Template is a Power Apps entity (adx_webtemplate), included with Power Apps portals, that is used to
store template source content. A web template will generally contain Liquid for dynamic content rendering and
is the central entity used to integrate Liquid templates with the rest of the Power Apps portals system.
Web Templates can be included in other content or combined with other templates by using template tags, and
are referenced in these tags by their Name attribute. They can also be used to create entire custom Page
Templates, or create custom headers and footers for your portal website.

Web template attributes

Name The name of the template. Used to reference this template


when it is included in other content, or extended by other
templates.

Source The source content of the template. In Power Apps, a source


code editor with syntax highlighting and other code editing
features is provided for this field.

MIME Type Optionally provides a MIME type for the content of the
template. If none is provided, a type of text/html is assumed.
This value will only be used in cases where the template is
associated with a Page Template, and controls the rendering
of all content for that template.

Web templates as page templates


Web Templates can be used in conjunction with page templates to create new templates for the Power Apps
portals content management system. This can be done entirely within Power Apps, without the need to write
.NET code or redeploy your portal application.
To create a new page template based on a web template, select a Type of Web Template when creating a new
Page Template record. Then select a Web Template.
Note the option Use Website Header and Footer (which is checked by default). If this is checked, your Web
Template will control rendering of all page content between the global website header and footer. If this option
is unchecked, your Web Template will be responsible for rendering the entire response in the case that you're
rendering HTML, this means everything from the doctype to the root <html> tags, and everything in between.
While the most common use cases for Web Templates will be to render HTML, rendering the entire response
(by deselecting Use Website Header and Footer) gives you the option of rendering any text-based format
you choose. This is where the MIME Type attribute of Web Template becomes relevant. When a Page
Template that does not use the website header and footer is rendered, the HTTP response Content-Type header
will be set to the MIME Type of the associated Web Template. (text/html will be used if no MIME Type is
provided.) This gives you a wide variety of options for rendering non-HTML content by using Liquid. A
common use case would be to render an RSS feed, by setting a MIME Type of application/rss+xml.
Web templates as website headers and footers
Web templates can also be used to override the global header and footer used by a Power Apps portal. To do
this, set the Header Template or Footer Template field of your website to the web template of your choice.
Note that if you override Website Header, your selected template assumes responsibility for rendering the
primary navigation, sign-in/sign-out links, search interface, and so on for your site interface elements that are
normally handled by the default header template.

Built-in web templates


There is a set of premade Liquid templates available within Power Apps portals. To use them, you must include
them by name, using the list below as a reference.

NAME DESCRIPTION CODE

Ad This template renders an ad by name, {% include 'ad' ad_name:'Name'


or a random ad from an ad placement. %}{% include 'ad'
ad_placement_name:'Placement
Name' %}

Blogs This template renders recent blog {% include 'blogs' %}


posts in a list group.

Breadcrumbs This template renders links of ancestor {% include 'breadcrumbs' %}


pages back to the Home page from
the current page.

Child Link List Group This template renders links to any {% include
child pages of the current page in a list 'child_link_list_group' %}{%
include 'child_link_list_group'
group. title_only:true %}{% include
'child_link_list_group'
image_width:'64px',
image_height:'64px' %}

Events: Upcoming This template renders links to events {% include 'events_upcoming' %}


that occur between now and 60 days {% include 'events_upcoming'
number_of_days_in_advance:60 %}
from now.

Forums This template renders a list of the {% include 'forums' %}


website's forums with their respective
number of threads and posts.

Layout 1 Column This template renders a single column {% extends 'layout_1_column' %}


layout containing breadcrumbs, page {% block main %}... {% endblock
%}
title, and page copy content.

Layout 2 Column Wide Left This template renders a two column {% extends
layout. The left column is wider than 'layout_2_column_wide_left' %}{%
block main %}...{% endblock %}{%
the right. It contains breadcrumbs, block aside %}...{% endblock %}
page title at the top of the page and
the page copy content is located in
the left column.
NAME DESCRIPTION CODE

Layout 2 Column Wide Right This template renders a two column {% extends
layout. The right column is wider than 'layout_2_column_wide_right' %}
{% block main %}...{% endblock
the left. It contains breadcrumbs, page %}{% block aside %}...{%
title at the top of the page and the endblock %}
page copy content is located in the
right column.

Layout 3 Column Wide Middle This template renders a three column {% extends
layout. The middle column is wider 'layout_3_column_wide_middle' %}
{% block left_aside %}...{%
than the left and right. The layout endblock %}{% block main %}...{%
contains breadcrumbs and the page endblock %}{% block right_aside
title at the top of the page and the %}...{% endblock %}
page copy content is located in the
middle column.

Page Copy This template renders the editable {% include 'page_copy' %}


page copy content HTML with
support for embedded Liquid.

Page Header This template renders the page title. {% include 'page_header' %}

Poll This template renders a poll by name, {% include 'poll'


or a random poll from a poll poll_name:'Name' %}{% include
'poll'
placement. poll_placement_name:'Placement
Name' %}

Search This template renders a basic search {% include 'search' %}


form with a single text input and
search button.

Side Navigation This template renders a vertical tree {% include 'side_navigation' %}


view style navigation. It has links to {% include 'side_navigation'
depth_offset:1 %}
ancestor pages back to the first level
(or specified depth offset), links to
sibling pages of the current page, and
links to children of the current page.

Snippet This template renders an editable {% include 'snippet'


HTML content snippet by name. snippet_name:'Name' %}

Top Navigation This template renders an editable nav {% include 'top_navigation' %}


bar with drop-down menus for the
Primary Navigation web link set.

Weblink List Group This template renders a list group of {% include 'weblink_list_group'
links for a web link set. weblink_set_name:'Name' %}

See also
Understand Liquid operators
Liquid types
Conditional
Liquid Objects
Liquid Tags
Liquid Filters
Understand Liquid operators
1/23/2020 • 2 minutes to read • Edit Online

Liquid has access to all common logical and comparison operators. These can be used in tags such as if and
unless.

Basic operators
== EQUALS

!= Does not equal

> Greater than

< Less than

>= Greater than or equal to

<= Less than or equal to

or Condition A or condition B

and Condition A and condition B

contains
contains tests for the presence of a substring within a string.

{% if page.title contains 'Product' %}

The title of this page contains the word Product.

{% endif %}

contains can also test for the presence of a string within an array of strings.

startswith
startswith tests whether a string starts with a given substring.

{% if page.title startswith 'Profile' %}

This is a profile page.

{% endif %}

endswith
endswith tests whether a string ends with a given substring.
{% if page.title endswith 'Forum' %}

This is a forum page.

{% endif %}

See also
Store source content by using web templates
Liquid types
Conditional
Liquid Objects
Liquid Tags
Liquid Filters
Available Liquid types
1/23/2020 • 2 minutes to read • Edit Online

Liquid objects can return one of seven basic types: String, Number, Boolean, Array, Dictionary, DateTime, or
Null. Liquid variables can be initialized by using the assign or capture tags.

String
A String is declared by wrapping text in single or double quotes.

{% assign string_a = Hello World! %}

{% assign string_b = 'Single quotes work too.' %}

Get the number of characters in a string with the size property.

{{ string_a.size }} <!-- Output: 12 -->

Number
Numbers can be integers or floats.

{% assign pi = 3.14 %}

{% if page.title.size > 100 %}

This page has a long title.

{% endif %}

Boolean
A Boolean is either true or false.

{% assign x = true %}

{% assign y = false %}

{% if x %}

This will be rendered, because x is true.

{% endif %}

Array
An array holds a list of values of any type. You can access a given item by (zero-based) index using [ ], iterate over
them using the for tag, and get the number of items in the array using the size property.
{% for view in entitylist.views %}

{{ view.name }}

{% endfor %}

{{ entitylist.views[0] }}

{% if entitylist.views.size > 0 %}

This entity list has {{ entitylist.views.size }} views.

{% endif %}

Dictionary
Dictionaries hold a collection of values that can be accessed by a string key. You can access a given item by string
key using [ ], iterate over them using the for tag, and get the number of items in the dictionary using the size
property.

{{ request.params[ID] }}

{% if request.params.size > 0 %}

The request parameters collection contains some items.

{% endif %}

DateTime
A DateTime object represents a specific date and time.

{{ page.modifiedon | date: 'f' }}

Null
Null represents an empty or non-existent value. Any outputs that attempt to return a null value will render
nothing. It will be treated as false in conditions.

{% if request.params[ID] %}

This will render if the ID request parameter is NOT null.

{% endif %}

See also
Store source content by using web templates
Understand Liquid operators
Conditional
Liquid Objects
Liquid Tags
Liquid Filters
Available Liquid conditional operators
1/23/2020 • 2 minutes to read • Edit Online

When used in conditional statements (if,unless), some Liquid values will be treated as true, and some will be
treated as false.
In Liquid, null and the Boolean value false are treated as false;everything else is treated as true. Empty strings,
empty arrays, etc. are treated as true. For examples,

{% assign empty_string = %}
{% if empty_string %}
<p>This will render.</p>
{% endif %}

You can test for empty strings and arrays using the special value empty if necessary.

{% unless page.title == empty %}


<h1>{{ page.title }}</h1>
{% endunless %}

You can also test the size of Liquid types, Liquid types, or Liquid types using the special size property.

{% if page.children.size > 0 %}
<ul>
{% for child in page.children %}
<li>{{ child.title }}</li>
{% endfor %}
</ul>
{% endif %}

Summary
TRUE FALSE

True ×

False ×

Null ×

String ×

empty string ×

0 ×

1, 3.14 ×

array or dictionary ×
TRUE FALSE

empty array or dictionary ×

Object ×

See also
Store source content by using web templates
Understand Liquid operators
Liquid types
Liquid Objects
Liquid Tags
Liquid Filters
Available Liquid objects
1/23/2020 • 38 minutes to read • Edit Online

Liquid objects contain attributes to output dynamic content to the page. For example, the page object has an
attribute called title that can be used to output the title of the current page.
To access an object attribute by name, use a dot . To render an object's attribute in a template, wrap it in {{ and }}.

{{ page.title }}

Attributes of an object can also be accessed by using a string name and []. This is useful in cases where the
desired attribute is determined dynamically, or the attribute name contains characters , spaces, special characters,
and so on that would be invalid when using the . syntax.

{{ page[title] }}

{% assign attribute_name = Name with spaces %}

{{ object[attribute_name] }}

The following objects can be used and accessed anywhere, in any template.

OBJECT DESCRIPTION

entities Allows you to load any Power Apps entity by ID. More
information: entities

now A date/time object that refers to the current UTC time at the
time the template is rendered.
Note: This value is cached by the portal web app and is not
refreshed every time. More information: Date filters

page Refers to the current portal request page. The page object
provides access to things like the breadcrumbs for the current
page, the title or URL of the current page, and any other
attributes or related entities of the underlying Power Apps
record. More information: page

params A convenient shortcut for request.params. More information:


request

request Contains information about the current HTTP request. More


information: request

settings Allows you to load any Site Setting by name. More


information: settings

sitemap Allows access to the portal site map. More information:


sitemap

sitemarkers Allows you to load any Site Markers by name. More


information: sitemarkers
OBJECT DESCRIPTION

snippets Allows you to load any Content Snippet by name. More


information: snippets

user Refers to the current portal user, allowing access to all


attributes of the underlying Power Apps contact record. If no
user is signed in, this variable will be null. More information:
user

weblinks Allows you to load any Web Link Set by name or ID. More
information: weblinks

website Refers to the portal Website record, allowing access to all


attributes of the Power Apps Website (adx_website) record for
the portal. More information: website

ads
Provides the ability to access and render an ad.
The ads object allows you to select a specific ad or ad placement:

<div>

{% assign ad = ads[Ad Name] %}

<h4>{{ ad.title }}</h4>

<a href={{ ad.redirect_url }}>

<img src={{ ad.image.url }} alt={{ ad.image.alternate_text }} />

</a>

</div>

Ads attributes
ATTRIBUTE DESCRIPTION

placements Returns the adplacements object.

[ad name or id] You can access any ad by its Name or Id properties.
{% assign ad = ads[Ad Name] %}
{% assign ad = ads["da8b8a92-2ee6-476f-8a21-
782b047ff460"] %}

Ad Placements attributes
ATTRIBUTE DESCRIPTION
ATTRIBUTE DESCRIPTION

[ad placement name or id] You can access any adplacement by its Name or Id properties.
{% assign placement = ads.placements[Placement Name
or Id] %}
{% assign placement = ads.placements[2423d713-abb3-
44c3-8a7d-c445e16fccad] %}

Ad Placement attributes
An ad placement is an entity object, with all of the same attributes, in addition to those listed below.

ATTRIBUTE DESCRIPTION

Ads Returns the collection of ad objects associated with the


placement. Iteration tags and Array filters may be used with
this collection.

Name Returns the Name field for the ad placement.

placement_url The URL that can be used to retrieve the ad placement fully
rendered by a template.

random_url The URL that can be used to retrieve a random ad from the
placement fully rendered by a template.

Ad attributes

NOTE
An ad is an entity object, with all of the same attributes in addition to those listed below.

ATTRIBUTE DESCRIPTION

ad_url The URL that can be used to retrieve the ad fully rendered by
a template.

Copy Returns the Copy field for the ad.

image Returns the image object (if any) for the ad.

Name Returns the Name field for the ad.

open_in_new_window Returns true if the URL specified by redirect_url should open


in a new window.

redirect_url The URL that the user will be directed to by selecting the ad.

Ad Image attributes
ATTRIBUTE DESCRIPTION

alternate_text Return the text that is intended to appear in the tag's alt
attribute.
ATTRIBUTE DESCRIPTION

height Returns the height in pixels for the image

url Returns the URL source for the image.

width Returns the width in pixels for the image

blogs
Provides the ability to access and render Blogs and Blog Posts.
The blogs object allows you to select a specific blog or blog posts.
{% assign posts = blogs.posts | paginate: 0,4 %}

<div class=content-panel panel panel-default>

<div class=panel-heading>

{% assign sitemarker = sitemarkers[Blog Home] %}

{% assign snippet = snippets[Home Blog Activity Heading] %}

<a class=pull-right href={{sitemarker.url}}> All Blogs </a>

<h4>

<a class=feed-icon fa fa-rss-square href={{ blogs.feedpath }} />

{{ snippet.adx_value }}

</h4>

</div>

<ul class=list-group>

{% for post in posts.all %}

<li class=list-group-item >

<a class=user-avatar href={{ post.author_url }}>

<img src={{ post.user_image_url }} />

</a>

<h4 class=list-group-item-heading>

<a href={{ post.app_relative_path }}>{{ post.title }}</a>

</h4>

<div class=content-metadata>

<abbr class=timeago>{{ post.publish_date }}</abbr>

&ndash;

<a href={{ post.author_url }}> {{ post.author_name }} </a>

&ndash;

<a href={{ post.application_path }}#comments>

<span class=fa fa-comment aria-hidden=true></span> {{ post.comment_count }}

</a>

</div>

</li>

{% endfor %}

</ul>

</div>
blogs Object
The blogs object allows you to access any specific blog in the portal, or to access all blog posts in the portal
(regardless of the blog).
The following table explains the attributes associated with the blogs object.

ATTRIBUTE DESCRIPTION

posts Returns a blogposts object containing all blog posts in the


portal.

[blog name or id] You can access any blog by its Name or Id properties.

{% assign blog = blogs[Blog Name] %}

{% assign blog = blogs[da8b8a92-2ee6-476f-8a21-782b047ff460] %} |

blog Object
The blog object allows you to work with a single blog, allowing you to access the posts for that blog.
The following table explains various attributes associated with blog Object.

ATTRIBUTE DESCRIPTION

posts Returns a blogposts object containing all blog posts for the
blog.

Name The name of the blog.

title The title of the blog.

url The URL of the blog.

blogposts Object
The blogposts object allows you to access a collection of blog post objects. You can order the blog posts and
achieve pagination in addition to using liquid filters:
{% assign blogposts = blogs.posts | order_by “adx_name”, “desc” | paginate: 0,4 | all %} Note that blogs.posts.all is
also a valid way to get all blog posts blogs.posts | from_index: 0 | take: 2 is also possible
The following table explains various attributes associated with blogposts Object.

ATTRIBUTE DESCRIPTION

All Returns all blogpost objects in the collection

blogpost Object
Refers to a single blog post.
The following table explains various attributes associated with blogpost Object.

ATTRIBUTE DESCRIPTION

url The URL of the post.


ATTRIBUTE DESCRIPTION

content Returns the content field for the post.

content Returns the Content field for the post.

author Returns the authorf for the post (which is simply a contact
entity object.

title The Title of the post.

comment_count Returns the integer value of the count of how many


comments there for a given post.

publish_date The date at which the post was published.

entities
Allows you to load any Power Apps entity by ID. If the entity exists, an entity object will be returned. If an entity
with the given ID is not found, null will be returned.

{% assign account = entities.account['936DA01F-9ABD-4d9d-80C7-02AF85C822A8'] %}

{% if account %}

{{ account.name }} ({{ account.statecode.label }})

{% endif %}

{% assign entity_logical_name = 'contact' %}

{% assign contact = entities[entity_logical_name][request.params.contactid] %}

{% if contact %}

{{ contact.fullname }} ({{ contact.parentcustomerid.name }})

{% endif %}

Entity
An entity object provides access to the attributes of a Power Apps entity record.

ATTRIBUTE DESCRIPTION

Id The GUID ID of the entity, as a string. For example,


936DA01F-9ABD-4d9d-80C7-02AF85C822A8

logical_name The Power Apps logical name of the entity.

Notes Loads any notes (annotation) associated with the entity,


ordered from oldest to newest (createdon). Notes are
returned as note objects.

permissions Loads Entity Permission assertion results for the entity.


Results are returned as a permissions object.
ATTRIBUTE DESCRIPTION

url Returns the Power Apps portals content management system


URL path for the entity. If the entity has no valid URL in the
current website, returns null. Generally, this will only return a
value for certain entity types that have been integrated into
the portal CMS , unless you have customized the URL
Provider in your application.

[attribute or relationship name] You can access any attribute of the Power Apps entity by
logical name.
{{ entity.createdon }}{% assign attribute_name =
'name' %}{{ entity[attribute_name] }}
The values of most entity attributes map directly to Liquid
types: Two Option fields map to Booleans, text fields to
strings, numeric/currency fields to numbers, date/time fields
to date objects. But some attribute types are returned as
objects:
Lookup (Entity Reference) fields are returned as entity
reference objects.
Option Set/Picklist fields are returned as option set
value objects.
You can also load any related entities by relationship
schema name.
{{ page.adx_webpage_entitylist.adx_name }} In the
case that a relationship is reflexive (that is, self-
referential), a reflexive relationship object will be returned.
(Otherwise, the result would be ambiguous.)
{{ page.adx_webpage_webpage.referencing.adx_name
}}
Note: Loading large numbers of related entities, or
accessing large numbers of relationships in a single
template, can have a negative impact on template
rendering performance. Avoid loading related entities for
each item in an array, within a loop. Where possible, use
Power Apps common data service entity tags to load
collections of entities.

Entity Reference
Lookup attribute values are returned as entity reference objects, with the following attributes.

ATTRIBUTE DESCRIPTION

Id The GUID ID of the referenced entity, as a string.


For example, 936DA01F-9ABD-4d9d-80C7-02AF85C822A8

logical_name The Power Apps logical name of the referenced entity.

Name The primary name attribute of the referenced entity.

Note
A note is an entity object that provides access to the attributes and relationships of an annotation record. In
addition to all the attributes of an entity object, a note has the following additional attributes.

ATTRIBUTE DESCRIPTION
ATTRIBUTE DESCRIPTION

documentbody Loads the documentbody attribute of the note annotation


record, as a Base64-encoded string. Because the content of
this attribute may be large, it is not loaded with the rest of
the note attributes, it is only loaded on demand.
Note: Use of the documentbody attribute could have a
negative impact on template rendering performance, and
should be done with caution.
Use the url attribute to provide a link to the note attachment
instead, if possible.

url Returns the URL path for the built-in portal annotation
attachment handler. If the user has permission, and the note
has an attached file, a request to this URL will download the
note file attachment.

NOTE
Additional filters

Option Set Value


Option Set/Picklist attribute values are returned as entity reference objects, with the following attributes.

ATTRIBUTE DESCRIPTION

Label The localized label of the option set/picklist attribute value.


For example, Active

Value The integer value of the option set/picklist attribute value. For
example, 0

Entity Permissions
The Entity Permissions object provides access to aggregated permission assertion results for an entity.

ATTRIBUTE DESCRIPTION

can_append Returns true if the current user has permission to append


records to relationships of this record. Returns false
otherwise.

can_append_to Returns true if the current user has permission to append this
record to a relationship of another entity. Returns false
otherwise.

can_create Returns true if the current user has permission to create new
records of this entity type. Returns false otherwise.

can_delete Returns true if the current user has permission to delete this
record. Returns false otherwise.

can_read Returns true if the current user has permission to read this
record. Returns false otherwise.
ATTRIBUTE DESCRIPTION

can_write Returns true if the current user has permission to update this
record. Returns false otherwise.

rules_exist Returns true if the permission results represented by this


object are the result of explicitly defined permission rules.
Returns false if they are the default results in the absence of
explicitly defined permissions.

Reflexive Relationship
Attempts to load reflexive (that is, self-referential) relationships on entities are returned as objects with the
following attributes.

ATTRIBUTE DESCRIPTION

is_reflexive Returns true. Can be used to test whether an object returned


by a relationship is a reflexive relationship object.

referenced Returns an array of referenced entities for the given


relationship.

referencing Returns a referencing entity for the given relationship.


Returns null if no referencing entity exists. If the relationship
is many-to-many (N:N), returns an array of referencing
entities.

entitylist
The entitylist object is used within the Power Apps common data service entity tags. It provides access to all the
attributes of a given entity list.

NOTE
Render the entity list associated with the current page

Attributes

NOTE
entities

ATTRIBUTE DESCRIPTION

create_enabled Returns true if creation of new records is configured for the


entity list. Returns false otherwise.

create_url Returns the configured URL path for a creation link/button


for the entity list.

detail_enabled Returns true if a detail view for individual records is


configured for the entity list. Returns false otherwise.
ATTRIBUTE DESCRIPTION

detail_id_parameter Returns the query string parameter name to use for the
record ID when constructing a record detail view URL. See
URL filters for details on using Liquid filters to construct URLs.
For example, id

detail_label Returns the configured localized label for detail view


links/buttons for the entity list.

detail_url Returns the configured URL path for a detail view


links/buttons for the entity list.

empty_list_text Returns the configured localized text to be displayed when


the entity list view returns no results.

enable_entity_permissions Returns true if Entity Permission filtering is enabled for this


entity list. Returns false otherwise.

entity_logical_name Returns the Power Apps entity logical name for records to be
displayed by this entity list. For example, contact

filter_account_attribute_name Returns the attribute logical name for the lookup to account
that will be used to filter result records by the current portal
user's parent account. For example, accountid

filter_apply_label Returns the configured localized label to be used for the


link/button that applies an advanced attribute filter to the
entity list results.

filter_definition Returns the JSON attribute filter definition for the entity list.
See Entity List filters for details on how to use the metafilters
Liquid filter to process this definition.

filter_enabled Returns true if advanced attribute filtering is enabled for the


entity list. Returns false otherwise.

filter_portal_user_attribute_name Returns the attribute logical name for the lookup to contact
that will be used to filter result records by current portal
user's contact. For example, contactid

filter_website_attribute_name Returns the attribute logical name for the lookup to


adx_website that will be used to filter result records by the
current portal website. For example, adx_websiteid

language_code Returns the Power Apps integer language code that will be
used to select all localized labels for this entity list.

page_size Returns the configured result page size for the entity list.

primary_key_name Returns the primary key attribute logical name for records to
be displayed by this entity list.

search_enabled Returns true if search is enabled for this entity list. Returns
false otherwise.
ATTRIBUTE DESCRIPTION

search_placeholder Returns the configured localized text for the entity list search
field placeholder.

search_tooltip Returns the configured localized text for the entity list search
tooltip.

views Returns the available views for the entity list, as entity list
view objects.

[attribute logical name] You can access any attribute of the entity list (adx_entitylist)
Power Apps record by logical name, in the same manner as
an entity object. For example, {{ entitylist.adx_name }}

Entity List View Attributes


ATTRIBUTE DESCRIPTION

columns Returns the columns of the view as entity list view column
objects.

entity_logical_name Returns the Power Apps entity logical name for the records
included in the view. For example, contact

Id Returns the GUID ID of the view.

language_code Returns the Power Apps integer language code that will be
used to select all localized labels (column headers, etc.) for the
view.

Name Returns the Power Apps display name of the view.

primary_key_logical_name Returns the Power Apps entity primary key logical name for
the records included in the view. For example, contactid

sort_expression Returns the default sort expression for the view. For example,
name ASC, createdon DESC

Entity List View Column Attributes


ATTRIBUTE DESCRIPTION

attribute_type Returns the Power Apps attribute type name for the column,
as a string. For example, Lookup, Picklist, String, Boolean,
DateTime

logical_name Returns the Power Apps attribute logical name for the
column. For example, createdon

Name Returns the localized Power Apps display name for the
column. For example, Created On

sort_ascending Returns a sort expression string for sorting the column in


ascending order. For example, createdon ASC
ATTRIBUTE DESCRIPTION

sort_descending Returns a sort expression string for sorting the column in


descending order. For example, createdon DESC

sort_disabled Returns true if sorting is disabled for the column. Returns


false otherwise.

sort_enabled Returns true if sorting is enabled for the column. Returns


false otherwise.

width Returns the configured width for the column, in pixels.

entityview
The entityview object is used within the entityview tag, and provides access to the metadata for the view, in
addition to view result records.
Attributes
ATTRIBUTE DESCRIPTION

columns Returns the columns in the view, as entity view column


objects.

entity_permission_denied Returns true if access to view results was denied due to


insufficient Entity Permissions for the current user. Returns
false if read access to view results was granted.

entity_logical_name The Power Apps entity logical name of the view result
records. For example, contact

first_page The page number of the first page of view results. This will be
1 unless there were no results returned, in which case it will
be null.

Id The GUID ID of the Power Apps view that defines this


entityview.

language_code The Power Apps integer language code being used to load
localized labels for the current view.

last_page The page number of the last page of view results. If there
were no results returned, this will be null.

name The name of the Power Apps view that defines this
entityview., for example, Active Contacts.

next_page The page number of the next page of view results. If there is
no next page of results, this will be null.

Page The page number of the current page of view results.

pages Returns an array of page numbers containing all pages of


results for the current view.
ATTRIBUTE DESCRIPTION

page_size The number of results returned per page for the current view.

previous_page The page number of the next page of view results. If there is
no previous page of results, this will be null.

primary_key_logical_name The Power Apps logical name of the primary key attribute of
the result entity for this view. For example, contactid.

records The current page of result records for the view, as entity
objects.

sort_expression The default sort expression for the view. For example,
nameASC, createdon DESC.

total_pages The total number of result pages for the view.

total_records The total number of results for the view (across all pages).

events
Provides the ability to access and render Events. The events object allows you to select a specific event or all
events.
events Object
The events object allows you to access any specific event in the portal, or to access all events in the portal
(regardless of the event).
The events object has following attributes:

ATTRIBUTE DESCRIPTION

occurences Returns a eventoccurancessobject containing all event


occurrences in the portal

[event name or id] You can access any event by its Name or Id properties.
{% assign event = events["Event Name"] %}
{% assign event = events["da8b8a92-2ee6-476f-8a21-
782b047ff460"] %}

event Object
The event object allows you to work with a single event, allowing you to access the schedules and occurrences for
that event.
The event object has following attributes:

ATTRIBUTE DESCRIPTION

occurrences Returns a eventoccurrencesobject containing all occurrences


for the event.

name The name of the event.


ATTRIBUTE DESCRIPTION

url The URL of the event.

eventoccurences Object
The eventoccurrences object allows you to access a collection of event occurrences objects. You can order the
event occurrences and specify a date range for the occurrences to retrieve, and achieve pagination as well by
using liquid filters

{% assign occurances = event.occurrences.from[today].to[advance_date] %}

note that

{% assign occurances = event.occurrences.min[today].max[advance_date] %}

is also possible.
Following attributes are associated with eventoccurrences object

ATTRIBUTE DESCRIPTION

All Returns all eventoccurance objects in the collection.

eventoccurence Object
Represents a single event occurrence. The associated attributes are given below:

ATTRIBUTE DESCRIPTION

url The URL of the occurrence.

is_all_day_event Is this an all-day event?

start_time The start time for the event.

end_time The end time for the event.

forloop
Contains properties useful within a for loop block.

NOTE
forloop can only be used within a for tag.

Code
{% for child in page.children %}

{% if forloop.first %}

This is the first child page!

{% else %}

This is child page number {{ forloop.index }}.

{% endif %}

{% endfor %}

Output

This is the first child page!

This is child page number 2.

This is child page number 3.

Attributes
ATTRIBUTE DESCRIPTION

first Returns true if it's the first iteration of the loop. Returns false
if it's not the first iteration.

index The current item's position in the collection, where the first
item has a position of 1.

index0 The current item's position in the collection, where the first
item has a position of 0.

Last Returns true if it's the last iteration of the loop. Returns false if
it's not the last iteration.

length Returns the number of iterations for the loop ߝ the number
of items in the collection being iterated over.

rindex Number of items remaining in the loop (length - index) where


1 is the index of the last item.

rindex0 Number of items remaining in the loop (length - index) where


0 is the index of the last item.

forums
Provides the ability to access and render Forums and Forum Threads. Note that the ability to use liquid to render
forum data extends to posts, but to create a new post or thread, you must use an ASP.NET web forms Page
Template with said functionality built in (such as the default Forum Thread and Forum Post Page Templates).
The forums object allows you to select a Forum or Forum Threads :
<div class=content-panel panel panel-default>

<div class=panel-heading>

<h4>

<span class=fa fa-comments aria-hidden=true></span>

{{ snippets[Home Forum Activity Heading] | default: Forum Activity | h }}

</h4>

</div>

{% for forum in website.forums %}

<ul class=list-group>

<li class=list-group-item>

<div class=row>

<div class=col-sm-6>

<h4 class=list-group-item-heading><a href="{{ forum.url | h }}"> {{ forum.name | h }}</a></h4>

<div class=list-group-item-text content-metadata>{{ forum.adx_description | h }}</div>

</div>

<div class=col-sm-3 content-metadata>{{ forum.thread_count }} threads</div>

<div class=col-sm-3 content-metadata>{{ forum.post_count }} posts</div>

</div>

</li>

</ul>

{% endfor %}

</div>

forums Object
The forums object allows you to access any specific forum in the portal, or to access all forum threads in the
portal (regardless of the forum).
The forum object allows you to work with a single forum, allowing you to access the threads for that forum.
The forumthreads object allows you to access a collection of forumthread objects. You can order the forum
threads and achieve pagination as well by using liquid filters.

{% assign threads = forum.threads | order_by adx_name, desc | paginate: 0,4 | all %}

A Single Forum Thread


The forumposts object allows you to access a collection of forumpost objects.
Attributes
ATTRIBUTE DESCRIPTION

threads Returns a forumthreads object containing all forumthread


objects in the portal.

All Returns all forum objects in the portal. Note that


website.forums Is also an equivalent.

thread_count Returns the integer value of the count of how many threads
there are in the entire website.

post_count Returns the integer value of the total number of posts in the
portal.

[forum name or id] You can access any forum by its Name or Id properties.
`{% assign forum = forums[Forum Name] %}
{% assign forum = forums[da8b8a92-2ee6-476f-8a21-
782b047ff460] %}

forum Object
Attributes

NOTE
entities

ATTRIBUTE DESCRIPTION

threads Returns a forumthreads object containing all forum threads


for the forum.

Name The Name of the Forum.

thread_count Returns the integer value of the count of how many threads
there are in the forum.

post_count Returns the integer value of the count of how many posts
there are in the entire forum.

forumthreads Object
Attributes
ATTRIBUTE DESCRIPTION

All Returns all forumthread objects in the collection.

forumthread Object
Attributes

NOTE
entities
ATTRIBUTE DESCRIPTION

posts Returns a forumposts object containing all forum posts for


the thread.

author Returns the author for the thread (which is simply a contact
entity object).

latest_post Returns the latest post in the thread.

first_post Returns the first post in the thread.

post_count Returns the integer value of the count of how many posts
there are in the thread.

is_answered Is the thread answered or not?

is_sticky Is the thread a sticky thread?

forumposts Object
Attributes
ATTRIBUTE DESCRIPTION

All Returns all forumthread objects in the collection.

A Single Forum Post


Attributes

NOTE
entities

ATTRIBUTE DESCRIPTION

author Returns the author for the post (which is simply a contact
entity object).

content The content of the post.

is_answer Is this post an answer to the thread?

knowledge
Provides access to Power Apps knowledgearticle and category entity records to render articles and categories in
a portal.
Attributes
ATTRIBUTE DESCRIPTION
ATTRIBUTE DESCRIPTION

articles Returns an articles object containing article objects for the


knowledgearticle entity records available in the portal.

categories Returns a categories object containing category objects for


the category entity records available in the portal.

articles object
The articles object allows you to access a collection of article objects. You can order the articles and achieve
pagination as well by using liquid filters.

{% assign count = count | default: 3 %}


{% assign languagecode = website.selected_language.code %}
{% assign popular_articles = knowledge.articles | popular: count,languagecode %}
{% if popular_articles %}
<div class=list-group>
{% for article in popular_articles %}
<div class=list-group-item clearfix>
<a class=title href={{ article.url | escape }}>{{ article.title | escape }}</a>
<p class=description>{{ article.description | escape }}</p>
</div>
{% endfor %}
</div>
{% endif %}

Attributes
ATTRIBUTE DESCRIPTION

popular Returns a collection of article objects containing the most


views.
{% assign popular_articles =
knowledge.articles.popular %}

recent Returns a collection of article objects containing the latest


modified date.
{% assign recent_articles =
knowledge.articles.recent %}

top Returns a collection of article objects containing the highest


rating.
{% assign top_articles = knowledge.articles.top %}

Filters
The following filters can accept optional parameters for page size and language. First parameter is the number or
records to retrieve. The default page size is 5. The second parameter is the code of a language to retrieve articles
for a given language. Filters may be combined with other Liquid filters.

{% assign page_size = 5 %}
{% assign language_code = website.selected_language.code %}
{% assign recent_articles = knowledge.articles | recent: page_size, language_code %}
ATTRIBUTE DESCRIPTION

popular Returns a collection of article objects containing the most


views.
{% assign popular_articles = knowledge.articles \|
popular: 10, en-US %}

recent Returns a collection of article objects containing the latest


modified date.
{% assign recent_articles = knowledge.articles \|
recent: 5 %}

top Returns a collection of article objects containing the highest


rating.
{% assign top_articles = knowledge.articles \| top:
3, en-US %}

categories object
The categories object allows you to access a collection of category objects. You can order the categories and
achieve pagination as well by using liquid filters.

{% assign category_url = sitemarkers['Category'].url %}


{% assign count = count | default: 0 %}
{% assign categories = knowledge.categories | top_level: count %}
{% if categories %}
<div class=list-group unstyled>
{% for category in categories %}
<a href={{ category_url | add_query: 'id', category.categorynumber }} class=list-group-item>
{{ category.title }}
</a>
{% endfor %}
</div>
{% endif %}

Attributes
ATTRIBUTE DESCRIPTION

recent Returns a collection of category objects containing the latest


modified date.

top_level Returns a collection of category objects that do not have a


parent category.

Filters
The following filters can accept an optional parameter indicating the page size. The default page size is 5. Filters
may be combined with other Liquid filters.

{% assign page_size = 5 %}
{% assign recent_categories = knowledge.categories | recent: page_size %}
ATTRIBUTE DESCRIPTION

recent Returns a collection of category objects containing the latest


modified date. You can provide parameters
{% assign recent_categories = knowledge.categories
\| recent: 10 %}

top_level Returns a collection of category objects that do not have a


parent category.
{% assign root_categories = knowledge.categories \|
top_level %}

article Object
The article object allows you to work with a single knowledgearticle to display details of that article in the portal.
Attributes
article is an entity object, with all of the same attributes, in addition to those listed below.

ATTRIBUTE DESCRIPTION

article_public_number The Article Public Number of the article.

comment_count The integer value of the count of how many comments there
are for a given article.

content The content of the article.

current_user_can_comment Returns a Boolean value indicating whether the current user


can add comments on the article.

is_rating_enabled Returns a boolean value indicating whether rating on an


article is enabled.

keywords The keywords on the article.

name An alternate alias for the title of the article.

rating The decimal rating value on the article.

title The title of the article.

view_count The integer value of the number of times the article has been
viewed.

category Object
The category object allows you to work with a single category to display its details in the portal.
Attributes
category is an entity object, with all of the same attributes, in addition to those listed below.
ATTRIBUTE DESCRIPTION

categorynumber The Category Number of the category.

name An alternate alias for the title of the category.

title The title of the category.

page
Refers to the current portal request page. This object combines the attributes of the sitemap and the current
request entities (usually a webpage).
The page object provides access to things like the breadcrumbs for the current page, the title or URL of the
current page, and any other attributes or related entities of the underlying Power Apps record.

<ul class=breadcrumb>

{% for crumb in page.breadcrumbs %}

<li><a href={{ crumb.url | escape }}>{{ crumb.title | escape }}</a></li>

{% endfor %}

<li class=active>{{ page.title | escape }}</li>

</ul>

<div class=page-header>

<h1>{{ page.title | escape }}</h1>

</div>

<div class=page-copy>

{{ page.adx_copy }}

</div>

<div class=list-group>

{% for child in page.children %}

<a class=list-group-item href={{ child.url | escape }}>

{{ child.title | escape }}

</a>

{% endfor %}

</div>

<!-- Page {{ page.id }} was last modified on {{ page.modifiedon }}. -->

Page attributes
NOTE
entities

ATTRIBUTE DESCRIPTION

breadcrumbs Returns the breadcrumb site map node objects for the page,
starting from the site map root node and ending at parent.

children Returns the child site map node objects of the page.

parent Returns the parent site map node of the page. If the page is
the Home page, parent will be null.

title The title of the page.

url The URL of the page.

[attribute or relationship name] You can access any attribute of the page's underlying Power
Apps record by logical name.
{{ page.createdon }}
{% assign attribute_name = 'name' %}
{{ page[attribute_name] }}
The values of most entity attributes map directly to Liquid
types: Two Option fields map to Booleans, text fields to
strings, numeric/currency fields to numbers, date/time fields
to date objects. But some attribute types are returned as
objects:
Lookup (Entity Reference) fields are returned as entity
reference objects.
Option Set/Picklist fields are returned as option set
value objects.
You can also load any related entities by relationship
schema name.
{{ page.adx_webpage_entitylist.adx_name }}
In the case that a relationship is reflexive (that is, self-
referential), a entities object will be returned. (Otherwise,
the result would be ambiguous.)
{{ page.adx_webpage_webpage.referencing.adx_name
}}
Note: Loading large numbers of related entities, or
accessing large numbers of relationships in a single
template, can have a negative impact on template
rendering performance. Avoid loading related entities for
each item in an array, within a loop. Where possible,
prefer use of the Power Apps common data service entity
tags to load collections of entities.

polls
Provides the ability to access and render a poll.
The polls object allows you to select a specific poll or poll placement:
<div>

{% assign poll = polls[Poll Name] %}

<h4>{{ poll.question }}</h4>

{% for option in poll.options %}

<div>

<input type=radio name={{ poll.name }} id={{ option.id }} />

<label for={{ option.id }}>{{ option.answer }}</label>

</div>

{% endfor %}

<button type=button>{{ poll.submit_button_label }}</button>

</div>

Polls Attributes
ATTRIBUTE DESCRIPTION

placements Returns the pollplacements object.

[poll name or id] You can access any poll by its Name or Id properties.
{% assign poll = polls[Poll Name] %}
{% assign poll = polls["41827a5c-33de-49b8-a0c7-
439e6a02eb98"] %}

Poll Placements Attributes


ATTRIBUTE DESCRIPTION

[poll placement name or id] You can access any poll placement by its Name or Id
properties.
{% assign placement = polls.placements[Placement
Name or Id] %}
{% assign placement = polls.placements[7677c5d4-
406e-4b6c-907c-916ac17dba0f] %}

Poll Placement Attributes

NOTE
entities

ATTRIBUTE DESCRIPTION

Name Returns the Name field for the poll placement.

placement_url The URL that can be used to retrieve the poll placement fully
rendered by a template.
ATTRIBUTE DESCRIPTION

polls Returns the collection of poll objects associated with the


placement. Iteration tags and Array filters may be used with
this collection.

random_url The URL that can be used to retrieve a random poll from the
placement fully rendered by a template.

submit_url The URL to which a completed poll is submitted.

Poll Attributes

NOTE
entities

ATTRIBUTE DESCRIPTION

has_user_voted Returns true if the current user (signed in or anonymous) has


already voted in this poll.

Name Returns the Name field for the poll.

options Returns the collection of poll option objects associated with


the poll. Iteration tags and entities may be used with this
collection.

poll_url The URL that can be used to retrieve the poll fully rendered
by a template.

question Returns the Question field for the poll.

submit_button_label Returns a string that can be used to override the submit


button label for the poll.

submit_url The URL to which a completed poll is submitted.

user_selected_option Returns the polloption object selected by the user (if they
have already voted).

votes Returns the number of votes that have been tabulated for
the poll.

Poll Option Attributes

NOTE
entities

ATTRIBUTE DESCRIPTION

answer Returns the Answer field for the poll.


ATTRIBUTE DESCRIPTION

percentage Returns the percentage of votes in the poll for the option as a
decimal number from 0 through 100.

votes Returns the number of votes that have been tabulated for
the option.

request
Contains information about the current HTTP request.

{% assign id = request.params['id'] %}

<a href={{ request.url | add_query: 'foo', 1 }}>Link</a>

NOTE
You can build URLs dynamically in Liquid by using URL Filters.

Attributes
ATTRIBUTE DESCRIPTION

params Named parameter values for the current request. params is a


combination of URL query string parameters, form post
parameters, and cookies.

Path The path of the current request URL.


/profile/

path_and_query The path and query of the current request URL.


/profile/?foo=1&bar=something

query The query part of the current request URL.


?foo=1&bar=something

url The full URL of the current request.


https://www.example.com/profile/?foo=1&bar=something

searchindex
The searchindex object is used within the Power Apps common data service entity tags, and provides access to
the results of a query.
{% searchindex query: 'support', page: params.page, page_size: 10 %}

{% if searchindex.results.size > 0 %}

<p>Found about {{ searchindex.approximate_total_hits }} matches:</p>

<ul>

{% for result in searchindex.results %}

<li>

<h3><a href={{ result.url | escape }}>{{ result.title | escape }}</a></h3>

<p>{{ result.fragment }}</p>

</li>

{% endfor %}

</ul>

{% else %}

<p>Your query returned no results.</p>

{% endif %}

{% endsearchindex %}

Attributes
ATTRIBUTE DESCRIPTION

approximate_total_hits Returns an approximate count of total hits matching the


index query. Note that due to the way the search index works
in regard to security filtering and other design factors, this
number is only an approximation, and may not exactly match
the total number of results available to the current user in
some situations.

Page Returns the page number of the current query.

page_size Returns the maximum page size of the current query. Note
that if you want the actual number of results returned for the
current page (because this may be less than the specified
maximum page size), use results.size.

results Returns the query result page, as search index result objects.

Search Index Results


ATTRIBUTE DESCRIPTION

entity The underlying entities for the result.


ATTRIBUTE DESCRIPTION

fragment A relevant short text fragment for the result, with terms
matching the specified query highlighted using the <em>
HTML tag. Note that certain types of queries do not support
highlighted fragments, such as fuzzy queries (~) and wildcard
queries (*). This property will be null in those cases.

Id The Power Apps entity ID of the underlying record for the


result, as a string. For example, 936DA01F-9ABD-4d9d-
80C7-02AF85C822A8

logical_name The Power Apps entity logical name of the underlying record
for the result. For example, adx_webpage

number The number of the result, across all result pages, starting
from 1. For example, for the first result of the second page of
results, with a page size of 10, this value will be 11.

score The Lucene score of the result, as a floating-point value.


Results will be returned ordered by this value.

title The title of the result.

url The URL for the result. This will usually—but not necessarily—
be an absolute path for the current application, rather than a
full URL. For example: /articles/article1/

settings
Allows you to load any site setting by name. If a setting with the given name is not found, null will be returned.

NOTE
Settings are returned as strings, but you can use Type filters to convert them to other types.

{{ settings[My Setting] }}

{% assign search_enabled = settings[Search/Enabled] | boolean %}

{% if search_enabled %}

Search is enabled.

{% endif %}

{% assign pagesize = settings['page size'] | integer | default: 10 %}

{% if pagesize > 10 %}

Page size is greater than 10.

{% endif %}
NOTE
Render a website header and primary navigation bar

sitemap
Allows access to the portal site map.

<h1>{{ sitemap.root.title }}</h1>

<ul class=breadcrumb>

{% for crumb in sitemap.current.breadcrumbs %}

<li><a href={{ crumb.title }}>{{ crumb.title }}</a></li>

{% endfor %}

<li class=active>{{ sitemap.current.title }}</li>

</ul>

{% for child in sitemap.current.children %}

<a href={{ child.url }}>{{ child.title }}</a>

{% endfor %}

It's also possible to load a site map node by URL path:

{% assign node = sitemap[/content/page1/] %}

{% if node %}

{% for child in node.children %}

<a href={{ child.url }}>{{ child.title }}</a>

{% endfor %}

{% endif %}

Site Map Attributes


ATTRIBUTE DESCRIPTION

Current Returns the site map node object for the current page.

Root Returns the site map node object for the root (home) page of
the website.

Site Map Node Attributes


ATTRIBUTE DESCRIPTION

Breadcrumbs Returns the breadcrumb site map node objects for the node,
starting from the site map root node and ending at parent.

Children Returns the child site map node objects of the node.
ATTRIBUTE DESCRIPTION

Description The description/summary content for the node. (This field


may contain HTML.)

Entity Returns the underlying entities of the node. If the node has
no underlying entity, this value will be null.

is_sitemap_ancestor Returns true if the sitemap node is an ancestor of the current


node, otherwise false.

is_sitemap_current Returns true if the sitemap node is the current node,


otherwise false.

Parent Returns the parent site map node of the node. If the node is
the root node, parent will be null.

Title The title of the node.

url The URL of the node.

sitemarkers
Allows you to load any site marker by name. If the sitemarker exists, a sitemarker object will be returned. If a
sitemarker with the given name is not found, null will be returned.

{{ sitemarkers[Login].url }}

{% assign my_sitemarker = sitemarkers[My Site Marker] %}

{% if my_sitemarker %}

<a href={{ my_sitemarker.url }}>{{ my_sitemarker.adx_name }}</a>

{% else %}

Site marker My Site Marker does not exist.

{% endif %}

NOTE
Render a website header and primary navigation bar

Sitemarker Attributes
ATTRIBUTE DESCRIPTION

url The URL of the sitemarker target.

[attribute logical name] You can access any attribute of the sitemarker target Power
Apps record by logical name. For example, {{
sitemarker.adx_name }}
snippets
Allows you to load any content snippets by name. If a snippet with the given name is not found, null will be
returned.

{{ snippets[Header] }}

{% assign footer = snippets[Footer] %}

{% if footer %}

{{ footer }}

{% else %}

No footer snippet was found.

{% endif %}

tablerowloop
Contains properties useful within a Iteration tags loop block.

NOTE
tablerowloop can only be used within a Iteration tags tag.

Attributes
ATTRIBUTE DESCRIPTION

Col Returns the index of the current row, starting at 1.

col0 Returns the index of the current row, starting at 0.

col_first Returns true if the current column is the first column in a row,
returns false if it is not.

col_last Returns true if the current column is the last column in a row,
returns false if it is not.

First Returns true if it's the first iteration of the loop. Returns false
if it's not the first iteration.

Index The current item's position in the collection, where the first
item has a position of 1.

index0 The current item's position in the collection, where the first
item has a position of 0.

Last Returns true if it's the last iteration of the loop. Returns false if
it's not the last iteration.

Length Returns the number of iterations for the loop ߝ the number
of items in the collection being iterated over.
ATTRIBUTE DESCRIPTION

Rindex Number of items remaining in the loop (length - index) where


1 is the index of the last item.

rindex0 Number of items remaining in the loop (length - index) where


0 is the index of the last item.

user
Refers to the current portal user, allowing access to all attributes of the underlying Power Apps contact record. If
no user is signed in, this variable will be null.
user is an entity object.

{% if user %}

Hello, {{ user.fullname }}!

{% else %}

Hello, anonymous user!

{% endif %}

Attributes
In addition to having all of the attributes of an entity object, user has the following attributes.

ATTRIBUTE DESCRIPTION

roles Returns the roles to which the user belongs, as an array.


{% if user.roles contains 'Administrators' %} User
is an administrator. {% endif %}
Note: You can also use the has_role filter to test for
individual role memberships.

basic_badges_url Returns the service url to retrieve a user's badges.


To render badges for a user you must include a tag with the
attributes "data-badge" and "data-uri". To render the current
user's badges:
<div data-badge data-uri='{{user.basic_badges_url
}}'></div>
To render out a user's badges by id (variable userid):
`<div data-badge data-uri='{{user.basic_badges_url

weblinks
Allows you to load any weblinks by name or ID.
If the web link set exists, a web link set object will be returned. If a web link set with the given name or ID is not
found, null will be returned.
<!-- Load web link set by ID -->

{{ weblinks[page.adx_navigation.id].name }}

<!-- Load web link set by name -->

{% assign nav = weblinks[Primary Navigation] %}

{% if nav %}

<h1>{{ nav.title | escape }}</h1>

<ul>

{% for link in nav.weblinks %}

<li>

<a href={{ link.url | escape }} title={{ link.tooltip | escape }}>

{% if link.image %}

<img src={{ link.image.url | escape }} alt={{ link.image.alternate_text | escape }} />

{% endif %}

{{ link.name | escape }}

</a>

</li>

{% endfor %}

</ul>

{% endif %}

NOTE
Render a website header and primary navigation bar |

Web Link Set Attributes

NOTE
A web link set is an entity object, with all of the same attributes, in addition to those listed below.

ATTRIBUTE DESCRIPTION

Copy The HTML copy of the web link set.

Name The name of the web link set.

Title The title of the web link set.

Weblinks The array of web link objects associated with the web link set.
ATTRIBUTE DESCRIPTION

[attribute logical name] You can access any attribute of the web link set Power Apps
record by logical name. For example, {{ weblinkset.createdon }}

Web Link Attributes

NOTE
A web link is an entity object, with all of the same attributes, in addition to those listed below.

ATTRIBUTE DESCRIPTION

Description The HTML description of the web link.

display_image_only Boolean attribute indicating whether the web link should be


displayed as an image only, with no link text.

display_page_child_links Boolean attribute indicating whether the web link should


show links to the sitemap child pages of the linked page, as
sub-links.

Image The web link image object for this link. This attribute will be
null if no image is present.

is_external Boolean attribute indicating whether the target URL of the


web link is to an external site (rather than to an internal
portal page).

is_sitemap_ancestor Returns true if the weblink's URL references an ancestor of


the current sitemap node, otherwise false.

is_sitemap_current Returns true if the weblink's URL references the current


sitemap node, otherwise false.

Name The name/title of the web link.

Nofollow Boolean attribute indicating whether the web link should be


marked as rel=nofollow.

open_in_new_window Boolean attribute indicating whether the web link should be


opened in a new browser window/tab when selected.

Tooltip Tooltip text for the web link.

url The URL of the web link.

Weblinks The array of child web link objects associated with the web
link.

[attribute logical name] You can access any attribute of the web link Power Apps
record by logical name. For example, {{ weblink.createdon }}

Web Link Image Attributes


ALTERNATE_TEX T ALTERNATE TEX T FOR THE IMAGE.

Height Integer containing the specified height of the image. If no


height value was provided, this attribute will be null.

url The URL of the image.

Width Integer containing the specified width of the image. If no


width value was provided, this attribute will be null.

website
Refers to the portal website, allowing access to all attributes of the Power Apps Website (adx_website) record for
the portal.

NOTE
Website is an entity object, with all of the same attributes.

Code

{{ website.adx_name }} ({{ website.id }})

Output

Community Portal (936DA01F-9ABD-4d9d-80C7-02AF85C822A8)

See also
Liquid types
Liquid Tags
Liquid Filters
Available Liquid tags
1/23/2020 • 2 minutes to read • Edit Online

Tags make up the programming logic that tells templates what to do. Tags are wrapped in {% %}.

{% if user.fullname == 'Dave Bowman' %} Hello, Dave. {% endif %}

White space control


Normally, Liquid renders everything outside of variable and tag blocks verbatim, with all the white space as-is.
Occasionally you don't want the extra white space, but you still want to format the template cleanly, which
requires white space.
You can tell the engine to strip all leading or trailing white space by adding a hyphen (-) to the start or end block
tag.
Code

{% for i in (1..5) --%}

{{ i }}

{%-- endfor %}

Output

12345

See also
Liquid types
Liquid Objects
Liquid Filters
Control flow tags
1/23/2020 • 2 minutes to read • Edit Online

Control Flow tags determine which block of code should be executed and what content should be rendered based
on given conditions. Conditions are built using the available Liquid operators, or just based on the truth or
falsehood of a given value.

if
Executes a block of code if a given condition is met.

{% if user.fullname == 'Dave Bowman' %}

Hello, Dave.

{% endif %}

unless
Like if, except it executes a block of code if a given condition isnot met.

{% unless page.title == 'Home' %}

This is not the Home page.

{% endunless %}

elsif/else
Adds more conditions to an if or unless block.

{% if user.fullname == 'Dave Bowman' %}

Hello, Dave.

{% elsif user.fullname == 'John Smith' %}

Hello, Mr. Smith.

{% else %}

Hello, stranger.

{% endif %}

case/when
A switch statement to compare a variable to different values, and execute a different block of code for each value.
{% case user.fullname %}

{% when 'Dave Bowman' %}

Hello, Dave.

{% when 'John Smith' %}

Hello, Mr. Smith.

{% else %}

Hello, stranger.

{% endcase %}

See also
Iteration tags
Variable tags
Template tags
Power Apps common data service entity tags
Iteration tags
1/23/2020 • 2 minutes to read • Edit Online

Iteration tags are used to run/render a block of code repeatedly.

for
Executes a block of code repeatedly. It is most commonly used to iterate over the items in an array or dictionary.
Within the for tag block, the forloop object is available.
Code

{% for child_page in page.children %}

<a href={{ child_page.url }}>{{ child_page.title }}</a>

{% endfor %}

Output

<a href=/parent/child1/>Child 1</a>

<a href=/parent/child2/>Child 2</a>

<a href=/parent/child3/>Child 3</a>

Parameters
These parameters of for can be used alone, or in combination.
limit
Exits the loop after a given number of items.
Code

{% for child_page in page.children limit:2 %}

<a href={{ child_page.url }}>{{ child_page.title }}</a>

{% endfor %}

Output

<a href=/parent/child1/>Child 1</a>

<a href=/parent/child2/>Child 2</a>

offset
Starts the loop at given index.
Code
{% for child_page in page.children offset:1 %}

<a href={{ child_page.url }}>{{ child_page.title }}</a>

{% endfor %}

Output

<a href=/parent/child2/>Child 2</a>

<a href=/parent/child3/>Child 3</a>

range
Defines a range of numbers to loop through.
Code

{% assign n = 4 %}

{% for i in (2..n) %}

{{ i }}

{% endfor %}

{% for i in (10..14) %}

{{ i }}

{% endfor }}

Output

2 3 4

10 11 12 14

reversed
Iterates through the loop in reverse order, starting from the last item.
Code

{% for child_page in page.children reversed %}

<a href={{ child_page.url }}>{{ child_page.title }}</a>

{% endfor %}

Output

<a href=/parent/child3/>Child 3</a>

<a href=/parent/child2/>Child 2</a>

<a href=/parent/child1/>Child 1</a>


cycle
Loops through a group of strings and outputs them in the order that they were passed as parameters. Each time
cycle is called, the next string that was passed as a parameter is output.
Code

{% for item in items %}

<div class={% cycle 'red', 'green', 'blue' %}> {{ item }} </div>

{% end %}

Output

<div class=red> Item one </div>

<div class=green> Item two </div>

<div class=blue> Item three </div>

<div class=red> Item four </div>

<div class=green> Item five</div>

tablerow
Generates an HTML table. Must be wrapped in an opening <table> and closing </table> HTML tags.
Within the tablerow tag block, the tablerowloop is available.
Code

<table>

{% tablerow child_page in page.children %}

{{ child_page.title }}

{% endtablerow %}

</table>

Output
<table>

<tr class=row1>

<td class=col1>

Child Page 1

</td>

<td class=col2>

Child Page 2

</td>

<td class=col3>

Child Page 3

</td>

<td class=col4>

Child Page 4

</td>

</tr>

</table>

Parameters
These parameters of tablerowcan be used alone, or in combination.
Output
<table>

<tr class=row1>

<td class=col1>

Child Page 1

</td>

<td class=col2>

Child Page 2

</td>

</tr>

<tr class=row2>

<td class=col3>

Child Page 3

</td>

<td class=col4>

Child Page 4

</td>

</tr>

</table>

Code

<table>

{% tablerow child_page in page.children cols:2 %}

{{ child_page.title }}

{% endtablerow %}

</table>

Dictates how many rows the generated table should have.


cols
limit
Exits the loop after a given number of items.
Code
<table>

{% tablerow child_page in page.children limit:2 %}

{{ child_page.title }}

{% endtablerow %}

</table>

Output

<table>

<tr class=row1>

<td class=col1>

Child Page 1

</td>

<td class=col2>

Child Page 2

</td>

</tr>

</table>

offset

Starts the loop at given index.


Code

<table>

{% tablerow child_page in page.children offset:2 %}

{{ child_page.title }}

{% endtablerow %}

</table>

Output
<table>

<tr class=row1>

<td class=col1>

Child Page 3

</td>

<td class=col2>

Child Page 4

</td>

</tr>

</table>

range
Defines a range of numbers to loop through.
Code

<table>

{% tablerow i in (1..3) %}

{{ i }}

{% endtablerow %}

</table>

See also
Control flow tags Variable tags Template tags Power Apps common data service entity tags
Variable tags
1/23/2020 • 2 minutes to read • Edit Online

Variable tags are used to create new Liquid variables.

assign
Creates a new variable. Assignments can also use filters to modify the value.
Code

{% assign is_valid = true %}

{% if is_valid %}

It is valid.

{% endif %}

{% assign name = dave bowman' | upcase %}

{{ name }}

Output

It is valid.

DAVE BOWMAN

capture
Captures the content within its block and assigns it to a variable. This content can then be rendered later by using
output tags.
Code

{% capture hello %}Hello, {{ user.fullname }}.{% endcapture %}

{{ hello }}

{{ hello }}

Output

Hello, DAVE BOWMAN.

Hello, DAVE BOWMAN.

See also
Control flow tags
Iteration tags
Template tags
Power Apps common data service entity tags
Template tags
1/25/2020 • 3 minutes to read • Edit Online

Template tags control the output of a template in various ways, and allow the combination of multiple templates
into a single output.

fetchxml
Allows user to query data from CDS and render the results in a page.

NOTE
You can learn more about querying the data using fetchxml at use FetchXML to query data.

{% fetchxml resultVariable %}
<!— Fetchxml query -->
...
{% endfetchxml%}

Results attribute
Results attribute in provided variable (such as 'resultVariable' in above sample) holds FetchXML query results and
a few other attributes.
Entities
This attribute contains the result of fetchxml query. You can iterate the result and use it in your
webtemplate.

<table>
{% for entityVariable in resultVariable.results.entities %}
<tr>
<td>Attribut-1: {{ entityVariable.attribute1 }}</td>
<td>Attribut-2: {{ entityVariable.attribute2 }}</td>
</tr>
{% endfor %}
</table>

EntityName
Gets the logical name of the entity.
ExtensionData
Gets the structure that contains extra data.
MinActiveRowVersion
Gets the lowest active row version value.
MoreRecords
Gets whether there are more records available.
PagingCookie
Gets the current paging information.
TotalRecordCount
Gets the total number of records in the collection.
ReturnTotalRecordCountwastruewhen the query was executed.
TotalRecordCountLimitExceeded
Gets whether the results of the query exceeds the total record count.
XML attribute
XML attribute in provided variable (such as 'resultVariable' in above sample) holds the resultant query which can
be used to get data from Common Data Service. This attribute is useful for debugging purpose when you want to
understand how entity permission is getting applied on this fetchxml tag.

include
Includes the contents of one template in another, by name. In Power Apps portals, the source of this other
template will generally be a web template. This allows for the reuse of common template fragments in multiple
places.
When a template is included in another, the included template will have access to any variables defined in the
parent template.
{% include 'My Template' %}

It's also possible to pass any number of named parameters to the include tag. These will then be defined as
variables in the included template.
{% include 'My Template' a:x, b:y %}

block
Used in conjunction with extends to provide template inheritance. See extends for usage.

extends
Used in conjunction with the block tag, provides template inheritance. This allows multiple templates to use a
shared layout, while overriding specific areas of the parent layout.
In Power Apps portals, the parent template name provided to the tag will generally refer to the name of a web
template.
When extends is used, it must be the first content in the template, and can only be followed by one or more block
tags.
If a block defined in the parent template is not overridden, its contents in the parent template (if any) will be
rendered.

comment
Allows you to leave un-rendered code inside a Liquid template. Any content within the block will not be rendered,
and any Liquid code within will not be executed.
Code
Hello{% comment %}, {{ user.fullname }}{% endcomment %}. My name is Charles.
Output
Hello. My name is Charles.

raw
Allows output of Liquid code on a page without having it parsed and executed.
Output
Hello, {{ user.fullname }}. My name is Charles.

substitution
When user has enabled the header and footer caching, and he wants to avoid caching of certain section output, he
can use this tag. This tag provides the content block in header or footer where output of the wrapped content
block doesn't get cached. This is helpful in the scenarios where user is using an object which can frequently get
updated, such as request, page, language, and date. For example, refer to the header and footer web template
source code update scenarios when header and footer caching is enabled.
See also
Control flow tags
Iteration tags
Variable tags
Power Apps common data service entity tags
Power Apps Common Data Service entity tags
1/23/2020 • 16 minutes to read • Edit Online

Power Apps entity tags are used to load and display Power Apps data, or use other Power Apps portals
framework services. These tags are Power Apps-specific extensions to the Liquid language.

chart
Adds a Power Apps chart to a web page. The chart tag can be added in the Copy field on a Web Page or in the
Source field on a Web Template. For steps to add a Power Apps chart to a web page, see Add a chart to a web
page in portal.

{% chart id:"EE3C733D-5693-DE11-97D4-00155DA3B01E" viewid:"00000000-0000-0000-00AA-000010001006" %}

Parameters
There are two parameters to be provided with the chart tag: chart id and viewid.
chart id
Visualization ID of the chart. You can get this by exporting the chart.
viewid
ID of the entity when opened in view editor.

powerbi
Adds the Power BI dashboards and reports within pages. The tag can be added in the Copy field on a web page
or in the Source field on a web template. For steps to add a Power BI report or dashboard to a webpage in
portal, see Add a Power BI report or dashboard to a webpage in portal .

NOTE
For the tag to work, you must enable Power BI integration from Power Apps Portals admin center. If the Power BI
integration is not enabled, dashboard or report will not be displayed.

Parameters
The powerbi tag accepts the following parameters:
path
Path of the Power BI report or dashboard. If the Power BI report or dashboard is secure, you must provide the
authentication type.

{% powerbi authentication_type:"powerbiembedded" path:"https://app.powerbi.com/groups/00000000-0000-0000-


0000-000000000000/reports/00000000-0000-0000-0000-000000000001/ReportSection01" %}

authentication_type
Type of authentication required for the Power BI report or dashboard. Valid values for this parameter are:
Anonymous: Allows you to embed publish to web Power BI reports. The default authentication type is
Anonymous. When using the authentication type as Anonymous, you must get the Power BI report URL
as described at: Publish to web from Power BI
AAD: Allows you to share secure Power BI reports or dashboards to Power BI Azure Active Directory
authenticated users.
powerbiembedded: Allows you to share the secure Power BI reports or dashboards to external users
who doesn't have Power BI license or Azure Active Directory authentication setup. For information on
Power BI Embedded service setup, see Enable Power BI Embedded service.
While adding the secure Power BI report or dashboard, ensure that it is shared with portal Azure Active
Directory or Power BI Embedded services.

NOTE
The values for the authentication_type parameter are case insensitive.

{% powerbi authentication_type:"AAD" path:"https://app.powerbi.com/groups/00000000-0000-0000-0000-


000000000000/reports/00000000-0000-0000-0000-000000000001/ReportSection01" %}

You can also filter the report on one or more values. The syntax to filter a report is:
URL?filter=Table/Field eq 'value'
For example, say you want to filter the report to see data for a contact named Bert Hair. You must append the
URL with the following:
?filter=Executives/Executive eq 'Bert Hair'
The complete code will be:

{% powerbi authentication_type:"AAD" path:"https://app.powerbi.com/groups/00000000-0000-0000-0000-


000000000000/reports/00000000-0000-0000-0000-000000000001/ReportSection01?filter=Executives/Executive eq
'Bert Hair'" %}

More information on filtering a report: Filter a report using query string parameters in the URL

NOTE
Anonymous report doesn't support filtering.

You can also create a dynamic path by using the capture Liquid variable as below:

{% capture pbi_path %}https://app.powerbi.com/groups/00000000-0000-0000-0000-000000000000/reports/00000000-


0000-0000-0000-000000000001/ReportSection01?filter=Executives/Executive eq '{{user.id}}'{% endcapture %}
{% powerbi authentication_type:"AAD" path:pbi_path %}

More information on Liquid variable: Variable tags


tileid
Displays the specified tile of the dashboard. You must provide the ID of the tile.
{% powerbi authentication_type:"AAD" path:"https://app.powerbi.com/groups/00000000-0000-0000-0000-
000000000000/dashboards/00000000-0000-0000-0000-000000000001" tileid:"00000000-0000-0000-0000-000000000002"
%}

roles
Roles assigned to the Power BI report. This parameter works only when the authentication_type parameter is
set to powerbiembedded.
If you have defined roles in Power BI and assigned them to reports, you must specify the appropriate roles in the
powerbi Liquid tag. Roles allow you to filter the data to be displayed in a report. You can specify multiple roles
separated by a comma. For more information on defining roles in Power BI, see Row -level security (RLS ) with
Power BI.

{% powerbi authentication_type:"powerbiembedded" path:"https://app.powerbi.com/groups/00000000-0000-0000-


0000-000000000000/reports/00000000-0000-0000-0000-000000000000/ReportSection2"
roles:"Region_East,Region_West" %}

If you've assigned a role to a Power BI report, and didn't specify the roles parameter in the Liquid tag or didn't
specify a role in the parameter, an error is displayed.

TIP
If you want to use the web roles defined in your portal as the Power BI roles, you can define a variable and assign web
roles to it. You can then use the defined variable in the Liquid tag.
Let's say you have defined two web roles as Region_East and Region_West in your portal. You can join them by using the
code: {% assign webroles = user.roles | join: ", " %}
In the above code snippet, webroles is a variable and the Region_East and Region_West web roles will be stored in it.
Use the webroles variable as follows in the Liquid tag:
{% powerbi authentication_type:"powerbiembedded" path:"https://app.powerbi.com/groups/00000000-0000-0000-
0000-000000000000/reports/00000000-0000-0000-0000-000000000000/ReportSection2" roles:webroles%}

editable
Renders a given Power Apps portals CMS object as editable on the portal, for users with content editing
permission for that object. Editable objects include page, snippets, and weblinks.
{% editable page 'adx_copy' type: 'html', title: 'Page Copy', escape: false, liquid: true %}

{% editable snippets Header type: 'html' %}

<!--

An editable web link set required a specific DOM structure, with

certain classes on the containing element, as demonstrated here.

-->

{% assign primary_nav = weblinks[Primary Navigation] %}

{% if primary_nav %}

<div {% if primary_nav.editable %}class=xrm-entity xrm-editable-adx_weblinkset{% endif %}>

<ul>

<!-- Render weblinks... -->

</ul>

{% editable primary_nav %}

</div>

{% endif %}

Parameters
The first parameter provided to editable is the editable object. For example, this may be a web link set, snippets,
or the current page. The optional second parameter is to specify an attribute name or key within that object that
is to be rendered and edited. This may be the name of an entity attribute, or a snippet name, for example.
After these initial parameters, the tag supports a number of optional named parameters.
class
Specifies a class attribute value for the root element rendered by this tag.
default
A default value to be rendered in the case that the editable item has no value.
escape
A Boolean value indicating whether a value rendered by this tag will be HTML -encoded. This is false by default.
liquid
A Boolean value indicating whether any Liquid template code found within the text value rendered by this tag
will be processed. This is true by default.
tag
The name of the container HTML tags that will be rendered by this tag. This tag will render div elements by
default. It is generally recommended that you choose between div or span as a value for this parameter.
title
Specifies a label for this editable item within the content editing interface. If none is provided, a friendly label will
be generated automatically.
type
A string value indicating the type of editing interface to be presented, for editable text values. Valid values for this
parameter are html or text. html is the default.

entitylist
Loads a given entity list, by name or ID. The properties of the entity list can then be accessed using an entitylist
object that will be available within the tag block. To render the actual result records of the entity list, use the
entityview tag within the block.
If the entity list is loaded successfully, the content within the block will be rendered. If the entity list is not found,
the block content will not be rendered.

{% entitylist name:My Entity List %}

Loaded entity list {{ entitylist.adx_name }}.

{% endentitylist %}

By default, the entitylist object will be given the variable name entitylist. Optionally, a different variable name can
be provided.

{% entitylist my_list = name:My Entity List %}

Loaded entity list {{ my_list.adx_name }}.

{% endentitylist %}

Parameters
Provide only one of id, name, or key to select the Entity List to load.
id
Loads an entity list by GUID ID. id must be a string that can be parsed as a GUID.

{% entitylist id:936DA01F-9ABD-4d9d-80C7-02AF85C822A8 %}

Loaded entity list {{ entitylist.adx_name }}.

{% endentitylist %}

Generally, literal GUID strings will not be used. Instead, id will be specified using a GUID property of another
variable.

{% entitylist id:page.adx_entitylist.id %}

Loaded entity list {{ entitylist.adx_name }}.

{% endentitylist %}

name
Loads an entity list by name.
{% entitylist name:My Entity List %}

Loaded entity list {{ entitylist.adx_name }}.

{% endentitylist %}

key
Loads an entity list by ID or name. If the provided key value can be parsed as a GUID, the entity list will be
loaded by ID. Otherwise, it will be loaded by name.

<!-- key_variable can hold an ID or name -->

{% entitylist key:key_variable %}

Loaded entity list {{ entitylist.adx_name }}.

{% endentitylist %}

language_code
A Power Apps integer language code to select the entity list localized labels to be loaded. If no language_code is
provided, the default language of the portal application Power Apps connection will be used.

{% entitylist name:"My Entity List", language_code:1033 %}

Loaded entity list {{ entitylist.adx_name }}.

{% endentitylist %}

entityview
Loads a given Power Apps view, by name or ID. The properties of the view ߝ view column metadata, paginated
result records, etc. can then be accessed using an entityview object that will be available within the tag block.
If the view is loaded successfully, the content within the block will be rendered. If the view is not found, the block
content will not be rendered.

{% entityview logical_name:'contact', name:"Active Contacts" %}

Loaded entity view with {{ entityview.total_records }} total records.

{% endentityview %}

By default, the entityview object will be given the variable name entityview. Optionally, a different variable name
can be provided.

{% entityview my_view = logical_name:'contact', name:"Active Contacts" %}

Loaded entity view with {{ my_view.total_records }} total records.

{% endentityview %}

If entityview is nested within an entitylist block, it will inherit its default configuration (result page size, filter
options, etc.) from the entity list. If no view id or name parameters are provided to entityview, it will load the
default view from the enclosing entitylist.
{% entitylist id:page.adx_entitylist.id %}

{% entityview %}

Loaded default view of the entity list associated with the current page, with {{ entityview.total_records }}
total records.

{% endentityview %}

{% endentitylist %}

Parameters
Provide either id or logical_name with name to select the Power Apps view to load. If neither is provided, and
the entityview tag is nested within an entitylist tag, the default view of the enclosing entitylist will be loaded.
id
id must be a string that can be parsed as a GUID.

{% entityview id:936DA01F-9ABD-4d9d-80C7-02AF85C822A8 %}

Loaded entity view {{ entityview.name }}.

{% endentityview %}

Generally, literal GUID strings will not be used. Instead, id will be specified using a GUID property of another
variable.

{% entityview id:request.params.view %}

Loaded entity view {{ entityview.name }} using view query string request parameter.

{% endentityview %}

logical_name
The Power Apps entity logical name of the view to be loaded. Must be used in combination with name.

{% entityview logical_name:'contact', name:"Active Contacts" %}

Loaded entity view with {{ entityview.total_records }} total records.

{% endentityview %}

name
The Power Apps name of the view to be loaded. Must be used in combination with logical_name.

{% entityview logical_name:'contact', name:"Active Contacts" %}

Loaded entity view with {{ entityview.total_records }} total records.

{% endentityview %}

filter
Specifies whether to filter the view results by user or account. Must have a string value of user or account.
{% entityview id:request.params.view, filter:'user' %}

Loaded entity view with {{ entityview.total_records }} total records.

{% endentityview %}

A common use case is to set this parameter based on a request.

{% entityview id:request.params.view, filter:request.params.filter %}

Loaded entity view with {{ entityview.total_records }} total records.

{% endentityview %}

metafilter
Specifies the Entity List metadata filter expression by which to filter view results. This parameter is only valid
when entityview is used in combination with entitylist. In most cases, this parameter is set based on a request.

{% entitylist id:page.adx_entitylist.id %}

{% entityview id:request.params.view, metafilter:request.params.mf %}

Loaded entity view with {{ entityview.total_records }} total records.

{% endentityview %}

{% endentitylist %}

order
Specifies a sort expression for ordering view results. A sort expression can contain one or more entity attribute
logical names, followed by a sort direction of either ASC or DESC.

{% entityview id:request.params.view, order:'name ASC, createdon DESC' %}

Loaded entity view with {{ entityview.total_records }} total records.

{% endentityview %}

A common use case is to set this parameter based on a request.

{% entityview id:request.params.view, order:request.params.order %}

Loaded entity view with {{ entityview.total_records }} total records.

{% endentityview %}

page
Specifies the view result page to load. If this parameter is not specified, the first page of results will be loaded.
This parameter must be passed either an integer value, or a string that can be parsed as an integer. If a value is
provided for this parameter, but the value is null or otherwise cannot be parsed as an integer, the first page of
results will be loaded.
{% entityview id:request.params.view, page:2 %}

Loaded page {{ entityview.page }} of entity view with {{ entityview.total_records }} total records.

{% endentityview %}

A common use case is to set this parameter based on a request.

{% entityview id:request.params.view, page:request.params.page %}

Loaded page {{ entityview.page }} of entity view with {{ entityview.total_records }} total records.

{% endentityview %}

page_size
Specifies the number of results to load for the current result page. If no value is provided for this parameter, and
entityview is used within an entitylist block, the entity list page size will be used. If not within an entitylist block, a
default value of 10 will be used.
This parameter must be passed either an integer value, or a string that can be parsed as an integer. If a value is
provided for this parameter, but the value is null or otherwise cannot be parsed as an integer, the default page
size will be used.

{% entityview id:request.params.view, page_size:20 %}

Loaded entity view with {{ entityview.total_records }} total records.

{% endentityview %}

A common use case is to set this parameter based on a request.

{% entityview id:request.params.view, page_size:request.params.pagesize %}

Loaded entity view with {{ entityview.total_records }} total records.

{% endentityview %}

search
Specifies a search expression by which to filter view results. Simple keyword search expressions will filter by
whether attributes begin with the keyword. Wildcards * can also be included in the expression.

{% entityview id:request.params.view, search:'John\*' %}

Loaded entity view with {{ entityview.total_records }} total matching records.

{% endentityview %}

A common use case is to set this parameter based on a request, so that the search filter can be set based on user
input.
{% entityview id:request.params.view, search:request.params.search %}

Loaded entity view with {{ entityview.total_records }} total matching records.

{% endentityview %}

enable_entity_permissions
Specifies whether to apply entity permission filtering on view results. This parameter is set to false by default. If
entityview is used within an entitylist block, the value of this parameter will be inherited from the entity list
configuration.
This parameter must be passed either an boolean value, or a string that can be parsed as a Boolean (true, false).
If a value is provided for this parameter, but the value is null or otherwise cannot be parsed as a Boolean, the
default of false will be used.

{% entityview id:request.params.view, enable_entity_permissions:true %}

Loaded entity view with {{ entityview.total_records }} total records to which the user has read permission.

{% endentityview %}

language_code
A Power Apps integer language code to select the entity view localized labels (column header labels, etc.) to be
loaded. If no language_code is provided, the default language of the portal application Power Apps connection
will be used.
If entityview is used within an entitylist block, entityview will inherit its language code configuration from
entitylist.

{% entityview logical_name:'contact', name:"Active Contacts", language_code:1033 %}

Loaded entity view {{ entityview.name }}.

{% endentitylist %}

searchindex
Performs a query against the portal search index. The matching results can then be accessed using a searchindex
that will be available within the tag block.
{% searchindex query: 'support', page: params.page, page_size: 10 %}

{% if searchindex.results.size > 0 %}

<p>Found about {{ searchindex.approximate_total_hits }} matches:</p>

<ul>

{% for result in searchindex.results %}

<li>

<h3><a href={{ result.url | escape }}>{{ result.title | escape }}</a></h3>

<p>{{ result.fragment }}</p>

</li>

{% endfor %}

</ul>

{% else %}

<p>Your query returned no results.</p>

{% endif %}

{% endsearchindex %}

By default, the search index object will be given the variable name searchindex. Optionally, a different variable
name can be provided.

{% searchindex liquid_search = query: 'support', page: params.page, page_size: 10 %}

{% if liquid_search.results.size > 0 %}

...

{% endif %}

{% endsearchindex %}

Parameters
The searchindex tag accepts the following parameters.
query
The query used to match results. This parameter is intended to accept the user-specified part of the index query
(if any).

{% searchindex query: 'support' %}

...

{% endsearchindex %}

A common use case is to set this parameter based on a request.


{% searchindex query: request.params.query %}

...

{% endsearchindex %}

This parameter supports the Lucene Query Parser syntax.


filter
An additional query used to match results. This parameter is intended to accept a developer-specified filter for
results, if desired.

{% searchindex query: request.params.query, filter: '+statecode:0' %}

...

{% endsearchindex %}

This parameter supports the Lucene Query Parser syntax.

NOTE
The difference between filter and query is that while both will accept the Lucene Query Parser syntax, query is intended to
be more forgiving about how this syntax is parsed ߝ as it's expected that most end users will not be aware of this syntax.
So, in the case that parsing query according to this syntax fails, the entire query will be escaped and submitted as the
query text. filter, on the other hand, will be parsed strictly and return an error if the case of invalid syntax.

logical_names
The Power Apps entity logical names to which matching results will be restricted, as a comma-delimited string. If
not provided, all matching entities will be returned.

{% searchindex query: request.params.query, logical_names: 'kbarticle,incident' %}

...
>
{% endsearchindex %}

page
The search result page to be returned. If not provided, the first page (1) will be returned.

{% searchindex query: request.params.query, page: 2 %}

...

{% endsearchindex %}

A common use case is to set this parameter based on a request.

{% searchindex query: request.params.query, page: request.params.page %}

...

{% endsearchindex %}
page_size
The size of the result page to be returned. If not provided, a default size of 10 will be used.

{% searchindex query: request.params.query, page_size: 20 %}

...

{% endsearchindex %}

entityform
Fully renders a Power Apps-configured entity forms, by name or ID.

NOTE
The entityform tag is only available for use in content rendered inside a web template–based page template. Attempting
to use the tag inside a Rewrite-based Page Template will not render anything. You may only render a single entityform or
webform tag per page. entityform or webform tags after the first will not be rendered.

{% entityform name: 'My Entity Form' %}

Parameters
name
The name of the Entity Form you wish to load.
{% entityform name:My Entity Form %}

webform
Fully renders a Power Apps-configured web form, by name or ID. The webform tag is only available for use in
content rendered inside a web template based page template. Attempting to use the tag inside a Rewrite-based
Page Template will not render anything. You may only render a single entityform or webform tag per page.
entityform or webform tags after the first will not be rendered.
{% webform name: 'My Web Form' %}

Parameters
name
The name of the Web Form you wish to load.
{% webform name:My Web Form %}

See also
Control flow tags
Iteration tags
Variable tags
Template tags
Available Liquid filters
1/23/2020 • 16 minutes to read • Edit Online

Liquid filters are used to modify the output of strings, numbers, variables, and objects. They are separated from
the value to which they are being applied by a |.
{{ 'hal 9000' | upcase }} <!-- Output: HAL 9000 -->

Some filters accept parameters. Filters can also be combined, and are applied in order from left to right.

{{ 2 | times: 2 | minus: 1 }} <!-- Output: 3 -->

{{ "Hello, " | append: user.firstname }} <!-- Output: Hello, Dave -->

The below section describes various filters.

Array filters
Array filters are used to work with arrays.
batch
Divides an array into multiple arrays of a given size.
Code

{% assign batches = entityview.records | batch: 2 %}

{% for batch in batches %}

<ul>

{% for item in batch %}

<li>{{ item.fullname }}</li>

{% endfor %}

</ul>

{% endfor %}

Output
<ul>

<li>John Smith</li>

<li>Dave Thomas</li>

</ul>

<ul>

<li>Jake Johnson</li>

<li>Jack Robinson</li>

</ul>

concat
Concatenates two arrays into a single new array.
Given a single item as a parameter, concat returns a new array that consists of the original array, with the given
item as the last element.
Code

Group #1: {{ group1 | join: ', ' }}

Group #2: {{ group2 | join: ', ' }}

Group #1 + Group #2: {{ group1 | concat: group2 | join: ', ' }}

Group #1 + Leslie: {{ group1 | concat: 'Leslie' | join: ', ' }}

Output

Group #1: John, Pete, Hannah

Group #2: Joan, Bill

Group #1 + Group #2: John, Pete, Hannah, Joan, Bill

Group #1 + Leslie: John, Pete, Hannah, Leslie

except
Select all the objects in an array where a given attribute does not have a given value. (This is the inverse
ofwhere.)
Code

{% assign redmond = entityview.records | except: 'address1_city', 'Redmond' %}

{% for item in redmond %}

{{ item.fullname }}

{% endfor %}

Output
Jack Robinson

first
Returns the first element of an array.
first can also be used with a special dot notation, in cases where it needs to be used inside a tag.
Code

{% assign words = This is a run of text | split: %}

{{ words | first }}

{% if words.first == This %}

The first word is This.

{% endif %}

Output

This

The first word is This.

group_by
Group the items in an array by a given attribute.
Code

{% assign groups = entityview.records | group_by: 'address1_city' %}

{% for group in groups %}

{{ group.key }}:

{% for item in group.items %}

{{ item.fullname }}

{% endfor %}

{% endfor %}

Output

Redmond:

John Smith

Dave Thomas

Jake Johnson

New York:

Jack Robinson
join
Joins the elements of an array with the character passed as the parameter. The result is a single string.
Code

{% assign words = This is a run of text | split: %}

{{ words | join: , }}

Output

This, is, a, run, of, text

last
Returns the last element of an array.
last can also be used with a special dot notation, in cases where it needs to be used inside a tag.
Code

{% assign words = This is a run of text | split: -%}

{{ words | last }}

{% if words.last == text -%}

The last word is text.

{% endif -%}

Output

text

The last word is text.

order_by
Returns the elements of an array ordered by a given attribute of the elements of the array.
Optionally, you can provide desc as a second parameter to sort the elements in descending order, rather than
ascending.
Code

{{ entityview.records | order_by: 'fullname' | join: ', ' }}

{{ entityview.records | order_by: 'fullname', 'desc' | join: ', ' }}

Output

Dave Thomas, Jack Robinson, Jake Johnson, John Smith

John Smith, Jake Johnson, Jack Robinson, Dave Thomas

random
Returns a single randomly-selected item from the array.
Code

{{ group1 | join: ', ' }}

{{ group1 | random }}

Output

John, Pete, Hannah

Pete

select
Selects the value of a given attribute for each item in an array, and returns these values as an array.
Code

{{ entityview.records | select: 'address1_city' | join: ', ' }}

Output

Redmond, New York

shuffle
Applied to an array, returns a new array with the same items, in randomized order.
Code

{{ group1 | join: ', ' }}

{{ group1 | shuffle | join: ', ' }}

Output

John, Pete, Hannah

Hannah, John, Pete

size
Returns the number of items in an array.
size can also be used with a special dot notation, in cases where it needs to be used inside a tag.
Code
{% assign words = This is a run of text | split: -%}

{{ words | size }}

{% if words.size == 6 -%}

The text contains 6 words.

{% endif -%}

Output

The text contains 6 words.

skip
Skips a given number of items in an array, and returns the rest.
Code

{% assign words = This is a run of text | split: %}

{{ words | skip: 3 | join: ', ' }}

Output

run, of, text

take
Takes a given number of items from the array, returning the taken items.
Code

{% assign words = This is a run of text | split: %}

{{ words | take: 3 | join: ', ' }}

Output

This, is, a

then_by
Adds additional subsequent ordering to an array already ordered byorder_by.
Optionally, you can provide desc as a second parameter to sort the elements in descending order, rather than
ascending.
Code
{{ entityview.records | order_by: 'address1_city' | then_by: 'fullname' | join: ', ' }}

{{ entityview.records | order_by: 'address1_city' | then_by: 'fullname', 'desc' | join: ', ' }}

Output

Dave Thomas, Jack Robinson, Jake Johnson, John Smith

John Smith, Jake Johnson, Jack Robinson, Dave Thomas

where
Select all the objects in an array where a given attribute has a given value.
Code

{% assign redmond = entityview.records | where: 'address1_city', 'Redmond' %}

{% for item in redmond %}

{{ item.fullname }}

{% endfor %}

Output

John Smith

Dave Thomas

Jake Johnson

Date filters
Date filters can be used for date arithmetic or to convert DateTime values into various formats.
date
Formats a DateTime value using a .NET format string.
Standard Date and Time Format Strings
Custom Date and Time Format Strings
Code

{{ now | date: 'g' }}

{{ now | date: 'MMMM dd, yyyy' }}

Output

5/7/2018 7:20 AM

May 07, 2018

date_add_days
Adds the specified number of whole and fractional days to the DateTime value. The parameter can be positive or
negative.
Code

{{ now }}

{{ now | date_add_days: 1 }}

{{ now | date_add_days: -2.5 }}

Output

5/7/2018 7:20:46 AM

5/8/2018 7:20:46 AM

5/4/2018 7:20:46 PM

date_add_hours
Adds the specified number of whole and fractional hours to the DateTime value. The parameter can be positive
or negative.
Code

{{ now }}

{{ now | date_add_hours: 1 }}

{{ now | date_add_hours: -2.5 }}

Output

5/7/2018 7:20:46 AM

5/7/2018 8:20:46 AM

5/7/2018 4:50:46 AM

date_add_minutes
Adds the specified number of whole and fractional minutes to the DateTime value. The parameter can be
positive or negative.
Code

{{ now }}

{{ now | date_add_minutes: 10 }}

{{ now | date_add_minutes: -2.5 }}

Output
5/7/2018 7:20:46 AM

5/7/2018 7:30:46 AM

5/7/2018 7:18:16 AM

date_add_months
Adds the specified number of whole months to the DateTime value. The parameter can be positive or negative.
Code

{{ now }}

{{ now | date_add_months: 1 }}

{{ now | date_add_months: -2 }}

Output

5/7/2018 7:20:46 AM

6/7/2018 7:20:46 AM

3/7/2018 7:20:46 AM

date_add_seconds
Adds the specified number of whole and fractional seconds to the DateTime value. The parameter can be
positive or negative.
Code

{{ now }}

{{ now | date_add_seconds: 10 }}

{{ now | date_add_seconds: -1.25 }}

Output

5/7/2018 7:20:46 AM

5/7/2018 7:20:56 AM

5/7/2018 7:20:45 AM

date_add_years
Adds the specified number of whole years to the DateTime value. The parameter can be positive or negative.
Code

{{ now }}

{{ now | date_add_years: 1 }}

{{ now | date_add_years: -2 }}
Output

5/7/2018 7:20:46 AM

5/7/2019 7:20:46 AM

5/7/2016 7:20:46 AM

date_to_iso8601
Formats a DateTime value according to the ISO 8601 standard. Useful when creating Atom feeds, or the
HTML5 <time> element.
Code

{{ now | date_to_iso8601 }}

Output

2018-05-07T07:20:46Z

date_to_rfc822
Formats a DateTime value according to the RFC 822 standard. Useful when creating RSS feeds.
Code

{{ now | date_to_rfc822 }}

Output

Mon, 07 May 2018 07:20:46 Z

Entity list filters


Entity List filters are used to work with certain entitylist attribute values, and to help create entity list views.
current_sort
Given a sort expression, returns the current sort direction for a given attribute.
Code

{{ 'name ASC, createdon DESC' | current_sort: 'createdon' }}

Output

DESC

metafilters
Parses an entitylist filter_definition JSON value into filter option group objects.
metafilters can be optionally provided with a current attribute filter query and current entitylist, allowing the
returned filter objects to be flagged as either selected or unselected.
Code

{% assign filters = entitylist | metafilters: params.mf, entityview %}


{% if filters.size > 0 %}
<ul id=entitylist-filters>
{% for filter in filters %}
<li class=entitylist-filter-option-group>
{% if filter.selection_mode == 'Single' %}
{% assign type = 'radio' %}
{% else %}
{% assign type = 'checkbox' %}
{% endif %}
<h4 class=entitylist-filter-option-group-label
data-filter-id={{ filter.id | h }}>
{{ filter.label | h }}
</h4>
<ul>
{% for option in filter.options %}
<li class=entitylist-filter-option>
{% if option.type == 'text' %}
<div class=input-group entitylist-filter-option-text>
<span class=input-group-addon>
<span class=fa fa-filter aria-hidden=true></span>
</span>
<input class=form-control
type=text
name={{ filter.id | h }}
value={{ option.text | h }} />
</div>
{% else %}
<div class={{ type | h }}>
<label>
<input
type={{ type | h }}
name={{ filter.id | h }}
value={{ option.id | h }}
{% if option.checked %}
checked=checked
data-checked=true{% endif %}
/>
{{ option.label | h }}
</label>
</div>
{% endif %}
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
<button class=btn btn-default data-serialized-query=mf data-target=#entitylist-filters>Apply
Filters</button>
{% endif %}

reverse_sort
Given a sort direction, returns the opposite sort direction.
Code

<!-- Sort direction is not case-sensitive -->

{{ 'ASC' | reverse_sort }}

{{ 'desc' | reverse_sort }}
Output

DESC

ASC

Math filters
Math filters allow you to perform mathematical operations on numbers.
As with all filters, math filters can be chained, and are applied in order from left to right.
Code

{{ 10 | times: 2 | minus: 5 | divided_by: 3 }}

Output

ceil
Rounds a value up to the nearest integer.
Code

{{ 4.6 | ceil }}

{{ 4.3 | ceil }}

Output

divided_by
Divides a number by another number.
Code

{{ 10 | divided_by: 2 }}

{{ 10 | divided_by: 3 }}

{{ 10.0 | divided_by: 3 }}

Output

3.333333
floor
Rounds a value down to the nearest integer.
Code

{{ 4.6 | floor }}

{{ 4.3 | floor }}

Output

minus
Subtracts a number from another number.
Code

<!-- entityview.page = 11 -->

{{ entityview.page | minus: 1 }}

{{ 10 | minus: 1.1 }}

{{ 10.1 | minus: 1 }}

Output

10

9.1

modulo
Divides a number by another number and returns the remainder.
Code

{{ 12 | modulo: 5 }}

Output

plus
Adds a number to another number.
Code
<!-- entityview.page = 11 -->

{{ entityview.page | plus: 1 }}

{{ 10 | plus: 1.1 }}

{{ 10.1 | plus: 1 }}

Output

12

11

11.1

round
Rounds a value to the nearest integer or specified number of decimals.
Code

{{ 4.6 | round }}

{{ 4.3 | round }}

{{ 4.5612 | round: 2 }}

Output

4.56

times
Multiplies a number by another number.
Code

{{ 10 | times: 2 }}

{{ 10 | times: 2.2 }}

{{ 10.1 | times: 2 }}

Output

20

20

20.2

String filters
String filters manipulate strings.
append
Appends a string to the end of another string.
Code

{{ 'filename' | append: '.js' }}

Output

filename.js

capitalize
capitalizes the first word in a string.
Code

{{ 'capitalize me' | capitalize }}

Output

Capitalize Me

downcase
Converts a string into lowercase.
Code

{{ 'MIxed Case TExt' | downcase }}

Output

mixed case text

escape
HTML -escapes a string.
Code

{{ '<p>test</p>' | escape }}

Output

&lt;p&gt;test&lt;/p&gt;

newline_to_br
Inserts a <br /> line break HTML tag at each line break in a string.
Code
{% capture text %}

{% endcapture %}

{{ text | newline_to_br }}

Output

A<br />

B<br />

C<br />

prepend
Prepends a string to the beginning of another string.
Code

{{ 'Jane Johnson' | prepend: 'Dr. ' }}

Output

Dr. Jane Johnson

remove
Remove all occurrences of a substring from a string.
Code

{{ 'Hello, Dave. How are you, Dave?' | remove: 'Dave' }}

Output

Hello, . How are you, ?

remove_first
Removes the first occurrence of a substring from a string.
Code

{{ 'Hello, Dave. How are you, Dave?' | remove_first: 'Dave' }}

Output

Hello, . How are you, Dave?


replace
Replaces all occurrences of a string with a substring.
Code

{{ 'Hello, Dave. How are you, Dave?' | replace: 'Dave', 'John' }}

Output

Hello, John. How are you, John?

replace_first
Replaces the first occurrence of a string with a substring.
Code

{{ 'Hello, Dave. How are you, Dave?' | replace_first: 'Dave', 'John' }}

Output

Hello, John. How are you, Dave?

split
The split filter takes on a substring as a parameter. The substring is used as a delimiter to divide a string into an
array.
Code

{% assign words = This is a demo of the split filter | split: ' ' %}

First word: {{ words.first }}

First word: {{ words[0] }}

Second word: {{ words[1] }}

Last word: {{ words.last }}

All words: {{ words | join: ', ' }}

Output

First word: This

First word: This

Second word: is

Last word: filter

All words: This, is, a, demo, of, the, split, filter

strip_html
Strips all HTML tags from a string.
Code

<p>Hello</p>

Output

Hello

strip_newlines
Strips any line breaks from a string.
Code

{% capture text %}

{% endcapture %}

{{ text | strip_newlines }}

Output

ABC

text_to_html
Formats a plain text string as simple HTML. All text will be HTML encoded, blocks of text separated by a blank
line will be wrapped in paragraph <p> tags, single line breaks will be replaced with <br>, and URLs will be
converted to hyperlinks.
Code

{{ note.notetext | text_to_html }}

Output

<p>This is the first paragraph of notetext. It contains a URL: <a href="https://example.com/"


rel="nofollow">https://example.com</a></p>

<p>This is a second paragraph.</p>

truncate
Truncates a string down to a given number of characters. An ellipsis (...) is appended to the string and is included
in the character count.
Code

{{ 'This is a long run of text.' | truncate: 10 }}


Output

This is...

truncate_words
Truncates a string down to a given number of words. An ellipsis (...) is appended to the truncated string.
Code

{{ 'This is a long run of text.' | truncate_words: 3 }}

Output

This is a...

upcase
Converts a string into uppercase.
Code

{{ 'MIxed Case TExt' | upcase }}

Output

MIXED CASE TEXT

url_escape
URI-escape a string, for inclusion in a URL.
Code

{{ 'This & that//' | url_escape }}

Output

This+%26+that%2F%2F

xml_escape
XML -escape a string, for inclusion in XML output.
Code

{{ '<p>test</p>' | xml_escape }}

Output

&lt;p&gt;test&lt;/p&gt;
Type filters
Type filters allow you to convert values of one type into other types.
boolean
Attempts to convert a string value into a Boolean. If the value is already a Boolean, it will be returned
unchanged. If the value cannot be converted into a Boolean, null will be returned.
This filter will also accept on, enabled, or yes as true, and off, disabled, and no as false.
Code

{{ true | boolean }}

{{ 'false' | boolean }}

{{ 'enabled' | boolean }}

{{ settings['something/enabled'] | boolean | default: false }}

Output

true

false

true

false

decimal
Attempts to convert a string value into a decimal number. If the value is already a decimal number, it will be
returned unchanged. If the value cannot be converted into a decimal number, null will be returned.
Code

{{ 10.1 | decimal }}

{{ '3.14' | decimal }}

{{ 'text' | decimal | default: 3.14 }}

Output

10.1

3.14

3.14

integer
Attempts to convert a string value into an integer. If the value is already an integer, it will be returned unchanged.
If the value cannot be converted into an integer, null will be returned.
Code
{{ 10 | integer }}

{{ '10' | integer }}

{{ '10.1' | integer }}

{{ 'text' | integer | default: 2 }}

Output

10

10

string
Attempts to convert a value into its string representation. If the value is already a string, it will be returned
unchanged. If the value is null, null will be returned.

URL filters
URL filters allow you to build or extract parts of URLs.
add_query
Appends a query string parameter to a URL. If the parameter already exists in the URL, the parameter value will
be updated.
If this filter is applied to a full absolute URL, an updated absolute URL will be the result. If it is applied to a path,
an updated path will be the result.
Code

{{ 'https://example.com/path?page=1' | add_query: 'foo', 'bar' }}

{{ '/path?page=1' | add_query: 'page', 2 }}

Output

https://example.com/path?page=1&foo=bar

/path?page=2

base
Gets the base URL of a given URL.
Code

{{ 'https://example.com/path?foo=bar&page=2' | base }}

Output
https://example.com

host
Gets the host part of a URL.
Code

{{ 'https://example.com/path?foo=bar&page=2' | host }}

Output

example.com

path
Gets the path part of a URL.
Code

{{ 'https://example.com/path?foo=bar&page=2' | path }}

{{ '/path?foo=bar&page=2' | path }}

Output

/path

/path

path_and_query
Gets the path and query part of a URL.
Code

{{ 'https://example.com/path?foo=bar&page=2' | path_and_query }}

{{ '/path?foo=bar&page=2' | path_and_query }}

Output

/path?foo=bar&page=2

/path?foo=bar&page=2

port
Gets the port number of a URL.
Code
{{ 'https://example.com/path?foo=bar&page=2' | port }}

{{ 'https://example.com/path?foo=bar&page=2' | port }}

{{ 'https://example.com:9000/path?foo=bar&page=2' | port }}

Output

80

443

9000

remove_query
Removes a query string parameter from a URL. If the parameter does not exists in the URL, the URL will be
returned unchanged.
If this filter is applied to a full absolute URL, an updated absolute URL will be the result. If it is applied to a path,
an updated path will be the result.
Code

{{ 'https://example.com/path?page=1' | remove_query: 'page' }}

{{ '/path?page=1' | remove_query: 'page' }}

Output

https://example.com/path

/path

scheme
Gets the scheme part of a URL.
Code

{{ 'https://example.com/path?foo=bar&page=2' | scheme }}

{{ 'https://example.com/path?foo=bar&page=2' | scheme }}

Output

http

https

Additional filters
These filters provide useful general functionality.
default
Returns a default value for any variable with no assigned value (i.e. null).
Code

{{ snippets[Header] | default: 'My Website' }}

Output

<!-- If a snippet with the name Header returns null -->

My Website

file_size
Applied to a number value representing a number of bytes, returns a formatted file size with a unit of
appropriate scale.
Optionally, a precision parameter can be passed, to control the number of decimal places in the result. The
default precision is 1.
Code

{{ 10000000 | file_size }}

{{ 2050 | file_size: 0 }}

{{ entity.notes.first.filesize | file_size: 2 }}

Output

9.5 MB

2 KB

207.14 KB

has_role
Applied to a user, returns true if the user belongs to the given role. Returns false if not.
Code

{% assign is_admin = user | has_role: 'Administrators' %}

{% if is_admin %}

User is an administrator.

{% endif %}

liquid
Renders a string as Liquid code. This code will have access to the current Liquid execution context (variables,
etc.).

NOTE
This filter should be used with caution and should generally only be applied to values that are under the exclusive control
of portal content authors, or other users that can be trusted to write Liquid code.
Code

{{ page.adx_copy | liquid }}

See also
Store source content by using web templates
Understand Liquid operators Liquid types
Liquid Objects
Liquid Tags
Liquid Filters
Create a custom page template
1/23/2020 • 2 minutes to read • Edit Online

In this example, we'll create a custom page template by using Liquid and a page template that is based on a web
template. More information: Store source content by using web templates. Our goal is to build a simple two-
column template that uses a web link set as left-side navigation, with the page content to the right.

Step 1: Create a web template and write the Liquid template code
First, we'll create our Web Template and write the Liquid template code. We're likely to reuse some common
elements of this template in future templates. So, we'll create a common base template that we'll then extend with
our specific template. Our base template will provide breadcrumb links and our page title/header, as well as define
our one-column layout:

TIP
Read about template inheritance using the block and extends tags: Template tags

Two Column Layout (Web Template )


<div class=container>
<div class=page-heading>
<ul class=breadcrumb>
{% for crumb in page.breadcrumbs -%}
<li>
<a href={{ crumb.url }}>{{ crumb.title }}</a>
</li>
{% endfor -%}
<li class=active>{{ page.title }}</li>
</ul>
<div class=page-header>
<h1>{{ page.title }}</h1>
</div>
</div>
<div class=row>
<div class=col-sm-4 col-lg-3>
{% block sidebar %}{% endblock %}
</div>
<div class=col-sm-8 col-lg-9>
{% block content %}{% endblock %}
</div>
</div>
</div>

Step 2: Create a new web template that extends our base layout
template
Use the navigation web link set associated with the current page for our navigation links to create a new web
template that extends our base layout template.
TIP
Familiarize yourself on how to load web link sets using the weblinks object.

Weblinks Left Navigation (Web Template )


{% extends 'Two Column Layout' %}

{% block sidebar %}
{% assign weblinkset_id = page.adx_navigation.id %}
{% if weblinkset_id %}
{% assign nav = weblinks[page.adx_navigation.id] %}
{% if nav %}
<div class=list-group>
{% for link in nav.weblinks %}
<a class=list-group-item href={{ link.url }}>
{{ link.name }}
</a>
{% endfor %}
</div>
{% endif %}
{% endif %}
{% endblock %}

{% block content %}
<div class=page-copy>
{{ page.adx_copy }}
</div>
{% endblock %}

Step 3: Create a new page template based on the web template


In this step, we'll create a new page template that is based on the web template we created in the previous step.
Step 4: Create a web page to display content
Now, all that's left to do is to create a web page that uses our page template, and has an associated Web Link Set,
and we have our result.
See also
Create a custom page template to render an RSS feed
Render the entity list associated with the current page
Render a website header and primary navigation bar
Render up to three levels of page hierarchy by using hybrid navigation
Render up to three levels of page hierarchy by using
hybrid navigation
1/23/2020 • 4 minutes to read • Edit Online

This example renders a type of hybrid navigation, based on the portal site map, that renders up to three levels of
page hierarchy. The rules for this component are:
The ancestor pages of the current page are shown back to the Home page (or to the maximum depth specified
by the optional depth_offset parameter).
If the current page has children, those child pages are shown.
If the current page has no children, the siblings of the current page are shown.

{% assign depth_offset = depth_offset | default: 0 %}


{% assign current_page = current_page | default: page %}
{% assign current_depth = 0 %}

{% if current_page.children.size > 0 %}
{% assign leaf_page = false %}
{% else %}
{% assign leaf_page = true %}
{% endif %}

{% capture page_item %}
<li class=active>
<a href={{ current_page.url | h }} title={{ current_page.title | h }}>
{% if leaf_page %}
<span class=fa fa-fw aria-hidden=true></span>
{% else %}
<span class=fa fa-fw fa-caret-down aria-hidden=true></span>
{% endif %}
{{ current_page.title | h }}
</a>
{% unless leaf_page %}
<ul>
{% for child in current_page.children %}
<li>
<a href={{ child.url | h }} title={{ child.title | h }}>
{% if child.children.size > 0 %}
<span class=fa fa-fw fa-caret-right aria-hidden=true></span>
{% else %}
<span class=fa fa-fw aria-hidden=true></span>
{% endif %}
{{ child.title | h }}
{% if child.entity.logical_name == 'adx_shortcut' %}
&nbsp;<span class=fa fa-fw fa-external-link aria-hidden=true></span>
{% elsif child.entity.logical_name == 'adx_webfile' %}
&nbsp;<span class=fa fa-fw fa-file-o aria-hidden=true><span class=sr-only>(File)</span></span>
{% endif %}
</a>
</li>
{% endfor %}
</ul>
{% endunless %}
</li>
{% endcapture %}

<ul class=side-nav role=navigation>


{% assign crumb_count = 0 %}
{% assign leaf_mode = false %}
{% for crumb in current_page.breadcrumbs %}
{% unless current_depth < depth_offset %}
{% if forloop.last and leaf_page %}
{% assign leaf_mode = true %}
{% else %}
<li>
<a href={{ crumb.url | h }} title={{ crumb.title | h }}>
<span class=fa fa-fw fa-caret-right aria-hidden=true></span>
{{ crumb.title | h }}
</a>
</li>
{% endif %}
{% assign crumb_count = crumb_count | plus: 1 %}
{% endunless %}
{% assign current_depth = current_depth | plus: 1 %}
{% endfor %}

{% if crumb_count < 1 %}
{{ page_item }}
{% elsif crumb_count < 2 and leaf_mode %}
{% for parent_sibling in current_page.parent.parent.children %}
{% if parent_sibling.url == current_page.parent.url %}
<li>
<a href={{ current_page.parent.url | h }} title={{ current_page.parent.title | h }}>
<span class=fa fa-fw fa-caret-down aria-hidden=true></span>
{{ current_page.parent.title | h }}
</a>
<ul>
{% for sibling in current_page.parent.children %}
<li {% if sibling.url == current_page.url %}class=active{% endif %}>
<a href={{ sibling.url | h }} title={{ sibling.title | h }}>
{% if sibling.children.size > 0 %}
<span class=fa fa-fw fa-caret-right aria-hidden=true></span>
{% else %}
<span class=fa fa-fw aria-hidden=true></span>
{% endif %}
{{ sibling.title | h }}
{% if sibling.entity.logical_name == 'adx_shortcut' %}
&nbsp;<span class=fa fa-fw fa-external-link aria-hidden=true></span>
{% elsif sibling.entity.logical_name == 'adx_webfile' %}
&nbsp;<span class=fa fa-fw fa-file-o aria-hidden=true><span class=sr-only>(File)</span>
</span>
{% endif %}
</a>
</li>
{% endfor %}
</ul>
</li>
{% else %}
<li>
<a href={{ parent_sibling.url | h }} title={{ parent_sibling.title | h }}>
{% if parent_sibling.children.size > 0 %}
<span class=fa fa-fw fa-caret-right aria-hidden=true></span>
{% else %}
<span class=fa fa-fw aria-hidden=true></span>
{% endif %}
{{ parent_sibling.title | h }}
{% if parent_sibling.entity.logical_name == 'adx_shortcut' %}
&nbsp;<span class=fa fa-fw fa-external-link aria-hidden=true></span>
{% elsif parent_sibling.entity.logical_name == 'adx_webfile' %}
&nbsp;<span class=fa fa-fw fa-file-o aria-hidden=true><span class=sr-only>(File)</span></span>
{% endif %}
</a>
</li>
{% endif %}
{% endfor %}
{% else %}
<li>
<ul>
{% if leaf_mode %}
{% for parent_sibling in current_page.parent.parent.children %}
{% if parent_sibling.url == current_page.parent.url %}
<li>
<a href={{ current_page.parent.url | h }} title={{ current_page.parent.title | h }}>
<span class=fa fa-fw fa-caret-down aria-hidden=true></span>
{{ current_page.parent.title | h }}
</a>
<ul>
{% for sibling in current_page.parent.children %}
<li {% if sibling.url == current_page.url %}class=active{% endif %}>
<a href={{ sibling.url | h }} title={{ sibling.title | h }}>
{% if sibling.children.size > 0 %}
<span class=fa fa-fw fa-caret-right aria-hidden=true></span>
{% else %}
<span class=fa fa-fw aria-hidden=true></span>
{% endif %}
{{ sibling.title | h }}
{% if sibling.entity.logical_name == 'adx_shortcut' %}
&nbsp;<span class=fa fa-fw fa-external-link aria-hidden=true></span>
{% elsif sibling.entity.logical_name == 'adx_webfile' %}
&nbsp;<span class=fa fa-fw fa-file-o aria-hidden=true><span class=sr-only>(File)
</span></span>
{% endif %}
</a>
</li>
{% endfor %}
</ul>
</li>
{% else %}
<li>
<a href={{ parent_sibling.url | h }} title={{ parent_sibling.title | h }}>
{% if parent_sibling.children.size > 0 %}
<span class=fa fa-fw fa-caret-right aria-hidden=true></span>
{% else %}
<span class=fa fa-fw aria-hidden=true></span>
{% endif %}
{{ parent_sibling.title | h }}
{% if parent_sibling.entity.logical_name == 'adx_shortcut' %}
&nbsp;<span class=fa fa-fw fa-external-link aria-hidden=true></span>
{% elsif parent_sibling.entity.logical_name == 'adx_webfile' %}
&nbsp;<span class=fa fa-fw fa-file-o aria-hidden=true><span class=sr-only>(File)</span>
</span>
{% endif %}
</a>
</li>
{% endif %}
{% endfor %}
{% else %}
{% for sibling in current_page.parent.children %}
{% if sibling.url == current_page.url %}
{{ page_item }}
{% else %}
<li>
<a href={{ sibling.url | h }} title={{ sibling.title | h }}>
{% if sibling.children.size > 0 %}
<span class=fa fa-fw fa-caret-right aria-hidden=true></span>
{% else %}
<span class=fa fa-fw aria-hidden=true></span>
{% endif %}
{{ sibling.title | h }}
{% if sibling.entity.logical_name == 'adx_shortcut' %}
&nbsp;<span class=fa fa-fw fa-external-link aria-hidden=true></span>
{% elsif sibling.entity.logical_name == 'adx_webfile' %}
&nbsp;<span class=fa fa-fw fa-file-o aria-hidden=true><span class=sr-only>(File)</span>
</span>
{% endif %}
</a>
</a>
</li>
{% endif %}
{% endfor %}
{% endif %}
</ul>
</li>
{% endif %}
</ul>

<style type=text/css>
.side-nav {
border-right: solid 1px #eee;
}

.side-nav,
.side-nav ul {
list-style: none;
margin: 0;
padding: 0;
}

.side-nav ul {
margin-left: 20px;
}

.side-nav a {
display: block;
line-height: 30px;
overflow: hidden;
text-decoration: none;
white-space: nowrap;
}

.side-nav li > a:hover {


border-right: solid 1px #23527c;
}

.side-nav li.active > a,


.side-nav li.active > a:hover {
border-right: solid 1px #333;
color: #333;
font-weight: bold;
}
</style>

See also
Create a custom page template by using Liquid and a web template page template
Create a custom page template to render an RSS feed
Render the entity list associated with the current page
Render a website header and primary navigation bar
Render the entity list associated with the current
page
1/23/2020 • 3 minutes to read • Edit Online

Render the Entity List associated with the current page as a paginated sortable table. Uses entitylist, entityview,
Power Apps Common Data Service entity tags, page, and request parameters, and includes search and multiple
view selection.

{% entitylist id:page.adx_entitylist.id %}
<div class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle"
data-toggle="collapse"
data-target="#entitylist-navbar-{{ entitylist.id }}">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ page.url }}">{{ entitylist.adx_name }}</a>
</div>
<div class="collapse navbar-collapse" id="entitylist-navbar-{{ entitylist.id }}">

{% if entitylist.views.size > 1 %}
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-list"></i> Views <span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
{% for view in entitylist.views -%}
<li{% if params.view == view.id %} class="active"{% endif %}>
<a href="{{ request.path | add_query:'view', view.id }}">{{view.name}}</a>
</li>
{% endfor -%}
</ul>
</li>
</ul>
{% endif %}

{% if entitylist.search_enabled %}
<form class="navbar-form navbar-left" method="get">
<div class="input-group">
{% if params.search.size > 0 %}
<div class="input-group-btn">
<a class="btn btn-default"
href="{{ request.path_and_query | remove_query:'search' }}">&times;</a>
</div>
{% endif %}
<input name="search" class="form-control"
value="{{ params.search }}"
placeholder="{{ entitylist.search_placeholder | default: 'Search' }}"
type="text" />
<div class="input-group-btn">
<button type="submit" class="btn btn-default"
title="{{ entitylist.search_tooltip }}">
<i class="fa fa-search">&nbsp;</i>
</button>
</div>
</div>
</div>
</form>
{% endif %}

{% if entitylist.create_enabled %}
<ul class="nav navbar-nav navbar-right">
<li>
<a href="{{ entitylist.create_url }}">
<i class="fa fa-plus"></i> {{ entitylist.create_label | default: 'Create' }}
</a>
</li>
</ul>
{% endif %}

</div>
</div>
</div>

{% entityview id:params.view, search:params.search, order:params.order, page:params.page,


pagesize:params.pagesize, metafilter:params.mf %}
{% assign order = params.order | default: entityview.sort_expression %}
<table class="table" data-order="{{ order }}">
<thead>
<tr>
{% for c in entityview.columns -%}
<th width="{{ c.width }}" data-logicalname="{{ c.logical_name }}">
{% if c.sort_enabled %}
{% assign current_sort = order | current_sort:c.logical_name %}
{% case current_sort %}
{% when 'ASC' %}
<a href="{{ request.path_and_query | add_query:'order', c.sort_descending }}">
{{ c.name }} <i class="fa fa-sort-asc"></i>
</a>
{% when 'DESC' %}
<a href="{{ request.path_and_query | add_query:'order', c.sort_ascending }}">
{{ c.name }} <i class="fa fa-sort-desc"></i>
</a>
{% else %}
<a href="{{ request.path_and_query | add_query:'order', c.sort_ascending }}">
{{ c.name }} <i class="fa fa-unsorted"></i>
</a>
{% endcase %}
{% else %}
{{ c.name }}
{% endif %}
</th>
{% endfor -%}
<th width="1"></th>
</tr>
</thead>

<tbody>
{% for e in entityview.records -%}
<tr>

{% for c in entityview.columns -%}


{% assign attr = e[c.logical_name] %}
{% assign attr_type = c.attribute_type | downcase %}

<td data-logicalname="{{ c.logical_name }}">


{% if attr.is_entity_reference -%}
{{ attr.name }}
{% elsif attr_type == 'datetime' %}
{% if attr %}
<time datetime="{{ attr | date_to_iso8601 }}">
{{ attr }}
</time>
{% endif %}
{% elsif attr_type == 'picklist' %}
{{ attr.label }}
{% else %}
{{ attr }}
{% endif -%}
</th>
{% endfor -%}

<td>
{% if entitylist.detail_enabled -%}
<a class="btn btn-default btn-xs"
href="{{ entitylist.detail_url}}?{{ entitylist.detail_id_parameter }}={{ e.id }}"
title="{{ entitylist.detail_label }}">
<i class="fa fa-external-link"></i>
</a>
{% endif -%}
</td>

<tr>
{% endfor -%}
</tbody>
</table>

{% if entityview.pages.size > 0 %}
{% assign first_page = entityview.first_page %}
{% assign last_page = entityview.last_page %}
{% assign page_offset = entityview.page | minus:1 | divided_by:10 | times:10 %}
{% assign page_slice_first_page = page_offset | plus:1 %}
{% assign page_slice_last_page = page_offset | plus:10 %}

<ul class="pagination">
<li {% unless first_page and entityview.page > 1 %}class="disabled"{% endunless %}>
<a
{% if first_page and entityview.page > 1 %}
href="{{ request.url | add_query:'page', first_page | path_and_query }}"
{% endif %}>
&laquo;
</a>
</li>

<li {% unless entityview.previous_page %}class="disabled"{% endunless %}>


<a
{% if entityview.previous_page %}
href="{{ request.url | add_query:'page', entityview.previous_page | path_and_query }}"
{% endif %}>
&lsaquo;
</a>
</li>

{% if page_slice_first_page > 1 %}
{% assign previous_slice_last_page = page_slice_first_page | minus:1 %}
<li>
<a href="{{ request.url | add_query:'page', previous_slice_last_page | path_and_query }}">
&hellip;
</a>
</li>
{% endif %}

{% for page in entityview.pages offset:page_offset limit:10 -%}


<li{% if page == entityview.page %} class="active"{% endif %}>
<a href="{{ request.url | add_query:'page', page | path_and_query }}">
{{ page }}
</a>
</li>
{% endfor -%}

{% if page_slice_last_page < entityview.pages.size %}


{% assign next_slice_first_page = page_slice_last_page | plus:1 %}
<li>
<a href="{{ request.url | add_query:'page', next_slice_first_page | path_and_query }}">
<a href="{{ request.url | add_query:'page', next_slice_first_page | path_and_query }}">
&hellip;
</a>
</li>
{% endif %}

<li {% unless entityview.next_page %}class="disabled"{% endunless %}>


<a
{% if entityview.next_page %}
href="{{ request.url | add_query:'page', entityview.next_page | path_and_query }}"
{% endif %}>
&rsaquo;
</a>
</li>

<li {% unless last_page and entityview.page < last_page %}class="disabled"{% endunless %}>
<a
{% if last_page and entityview.page < last_page %}
href="{{ request.url | add_query:'page', last_page | path_and_query }}"
{% endif %}>
&raquo;
</a>
</li>
</ul>

{% endif %}

{% endentityview %}
{% endentitylist %}

See also
Create a custom page template by using Liquid and a web template page template
Create a custom page template to render an RSS feed
Render a website header and primary navigation bar
Render up to three levels of page hierarchy by using hybrid navigation
Create a custom page template to render an RSS
feed
1/23/2020 • 2 minutes to read • Edit Online

In this example, we'll create a custom page template to render an RSS feed of news articles, using Liquid and a
Web Template Page Template. More information: Store source content by using web templates

Step 1: Create a new Power Apps view


First, we'll create a new Power Apps view that we'll use to load the data for our feed. In this example, we'll make it
a view on Web Pages, and use this entity to store our articles. We can use this view to configure the sorting and
filtering of results, and include as columns the entity attributes that we want available in our Liquid template.

Step 2: Create a web template for RSS feed


In this step, we'll create a web template for our RSS feed. This template will be applied to a particular webpage in
our website, so we'll use the title and summary of that page as the title and description of the feed. The we'll use
the entityview tag to load our newly-created News Articles view. More information: Power Apps common data
service entity tags. Note that we also set the MIME Type field of the Web Template to application/rss+xml. This
indicates what the response content type could be when our template is rendered.
RSS Feed (Web Template )

<?xml version=1.0 encoding=UTF-8 ?>


<rss version=2.0>
<channel>
<title>{{ page.title | xml_escape }}</title>
<description>{{ page.description | strip_html | xml_escape }}</description>
<link>{{ request.url | xml_escape }}</link>
{% entityview logical_name:'adx_webpage', name:'News Articles', page_size:20 -%}
{% for item in entityview.records %}
<item>
<title>{{ item.adx_name | xml_escape }}</title>
<description>{{ item.adx_copy | escape }}</description>
<link>{{ request.url | base | xml_escape }}{{ item.url | xml_escape }}</link>
<guid>{{ item.id | xml_escape }}</guid>
<pubDate>{{ item.createdon | date_to_rfc822 }}</pubDate>
</item>
{% endfor -%}
{% endentityview %}
</channel>
</rss>

Step 3: Create a page template to assign RSS feed template


Now, we'll create a new page template, allowing us to assign our RSS feed template to any webpage in our
website. Note that we deselect Use Website Header and Footer, as we want to take over rendering of the entire
page response for our feed.
Step 4: Create a web page to host RSS feed
Now all that's left is to create a new web page using the RSS Feed template to host our feed. When we request
this new web page, we'll receive our RSS feed XML:

In this example, we've seen how we can combine Liquid, Web Templates, Power Apps views, and portals content
management features to create a custom RSS feed. The combination of these features adds powerful
customization capabilities to any portal application.
See also
Create a custom page template by using Liquid and a web template page template
Render the entity list associated with the current page
Render a website header and primary navigation bar
Render up to three levels of page hierarchy by using hybrid navigation
Render a website header and primary navigation
bar
1/23/2020 • 3 minutes to read • Edit Online

Render a website header and primary navigation bar, using portals settings, snippets, weblinks, and sitemarkers.
More information: Store source content by using web templates

NOTE
The example in this topic will only function correctly if cross-request header caching is disabled for your application. It is
enabled by default in version 7.0.0019 and later. It can be disabled by creating a Site Setting named
Header/OutputCache/Enabled, and setting its value to false.

<div class=masthead hidden-xs>


<div class=container>
<div class=toolbar>
<div class=toolbar-row>

{% assign search_enabled = settings['search/enabled'] | boolean | default:true %}


{% assign search_page = sitemarkers['Search'] %}
{% if search_enabled and search_page %}
<div class=toolbar-item toolbar-search>
<form method=GET action={{ search_page.url }} role=search>
<label for=q class=sr-only>
{{ snippets[Header/Search/Label] | default:Search }}
</label>
<div class=input-group>
<input type=text class=form-control id=q name=q
placeholder={{ snippets[Header/Search/Label] | default:Search }}
value={{ params.q }}
title={{ snippets[Header/Search/Label] | default:Search }}>
<div class=input-group-btn>
<button type=submit class=btn btn-default
title={{ snippets[Header/Search/ToolTip] | default:Search }}>
<span class=fa fa-search aria-hidden=true></span>
</button>
</div>
</div>
</form>
</div>
{% endif %}

<div class=toolbar-item>
<div class=btn-toolbar role=toolbar>
{% if user %}
<div class=btn-group>
<a href=# class=btn btn-default dropdown-toggle data-toggle=dropdown>
<span class=fa fa-user aria-hidden=true></span>
<span class=username>{{ user.fullname }}</span>
<span class=caret></span>
</a>
<ul class=dropdown-menu pull-right role=menu>
{% assign show_profile_nav = settings[Header/ShowAllProfileNavigationLinks] | boolean |
default:true %}
{% if show_profile_nav %}
{% assign profile_nav = weblinks[Profile Navigation] %}
{% if profile_nav %}
{% for link in profile_nav.weblinks %}
<li>
<a href={{ link.url }}>{{ link.name }}</a>
</li>
{% endfor %}
{% endif %}
{% else %}
<li><a href={{ sitemarkers['Profile'].url }}>{{ snippets[Profile Link Text] |
default:Profile }}</a></li>
{% endif %}
<li class=divider></li>
<li>
<a href=/account-signout?returnUrl={{ request.raw_url }}>
{{ snippets[links/logout] | default:Sign Out }}
</a>
</li>
</ul>
</div>
{% else %}
<div class=btn-group>
<a class=btn btn-primary
href={{ sitemarkers['Login'].url | add_query:'returnurl', request.path_and_query }}>
<span class=fa fa-sign-in aria-hidden=true></span>
{{ snippets[links/login] | default:Sign In }}
</a>
</div>
{% endif %}
</div>
</div>

</div>
</div>
{% editable snippets 'Header' type: 'html' %}
</div>
</div>
<div class=header-navbar navbar navbar-default navbar-static-top role=navigation>
<div class=container>
<div class=navbar-header>
<button type=button class=navbar-toggle data-toggle=collapse data-target=#header-navbar-collapse>
<span class=sr-only>Toggle navigation</span>
<span class=icon-bar></span>
<span class=icon-bar></span>
<span class=icon-bar></span>
</button>
<div class=navbar-left visible-xs>
{% editable snippets 'Mobile Header' type: 'html' %}
</div>
</div>
<div id=header-navbar-collapse class=navbar-collapse collapse>
<div class=navbar-left hidden-xs>
{% editable snippets 'Navbar Left' type: 'html' %}
</div>
{% assign primary_nav = weblinks[Primary Navigation] %}
{% if primary_nav %}
<div class=navbar-left {% if primary_nav.editable %}xrm-entity xrm-editable-adx_weblinkset{% endif %}
data-weblinks-maxdepth=2>
<ul class=nav navbar-nav weblinks>
{% for link in primary_nav.weblinks %}
{% if link.display_page_child_links %}
{% assign sublinks = sitemap[link.url].children %}
{% else %}
{% assign sublinks = link.weblinks %}
{% endif %}
<li class=weblink {% if sublinks.size > 0 %} dropdown{% endif %}>
<a
{% if sublinks.size > 0 %}
href=# class=dropdown-toggle data-toggle=dropdown
{% else %}
href={{ link.url }}
{% endif %}
{% endif %}
{% if link.nofollow %}rel=nofollow{% endif %}
{% if link.tooltip %}title={{ link.tooltip }}{% endif %}>
{% if link.image %}
{% if link.image.url startswith '.' %}
<span class={{ link.image.url | split:'.' | join }} aria-hidden=true></span>
{% else %}
<img src={{ link.image.url }}
alt={{ link.image.alternate_text | default:link.tooltip }}
{% if link.image.width %}width={{ link.image.width }}{% endif %}
{% if link.image.height %}height={{ link.image.height }}{% endif %}
/>
{% endif %}
{% endif %}
{% unless link.display_image_only %}
{{ link.name }}
{% endunless %}
{% if sublinks.size > 0 %}
<span class=caret></span>
{% endif %}
</a>

{% if sublinks.size > 0 %}
<ul class=dropdown-menu role=menu>
{% if link.url %}
<li>
<a href={{ link.url }}
{% if link.nofollow %}rel=nofollow{% endif %}
{% if link.tooltip %}title={{ link.tooltip }}{% endif %}>{{ link.name }}</a>
</li>
<li class=divider></li>
{% endif %}
{% for sublink in sublinks %}
<li>
<a href={{ sublink.url }}
{% if sublink.nofollow %}rel=nofollow{% endif %}
{% if sublink.tooltip %}title={{ link.tooltip }}{% endif %}>
{{ sublink.name | default:sublink.title }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}

</li>
{% endfor %}
</ul>
{% editable primary_nav %}
</div>
{% endif %}
<div class=navbar-right hidden-xs>
{% editable snippets 'Navbar Right' type: 'html' %}
</div>
</div>
</div>
</div>

See also
Create a custom page template by using Liquid and a web template page template
Create a custom page template to render an RSS feed
Render the entity list associated with the current page
Render up to three levels of page hierarchy by using hybrid navigation
Use OAuth 2.0 implicit grant flow within your portal
1/25/2020 • 8 minutes to read • Edit Online

This feature allows a customer to make client-side calls to external APIs and secure them by using OAuth implicit
grant flow. It provides an endpoint to obtain secure access tokens that will contain user identity information to be
used by external APIs for authorization following OAuth 2.0 implicit grant flow. The identity information of a
signed-in user is passed in a secured manner to the external AJAX calls. This will not only help developers to pass
authentication context but will also help users to secure their APIs by using this mechanism.
OAuth 2.0 implicit grant flow supports endpoints that a client can call to get an ID token. Two endpoints are used
for this purpose: authorize and token.

NOTE
Power Apps portals supports following OpenIdConnect flows and response types:
Implicit Flow with response types id_token or id_token token.
Hybrid Flow with response type code id_token.
Authorization Code Flow with response type code is not supported. For more information, read OpenID Connect
documentation for authentication.

Authorize endpoint details


The URL for authorize endpoint is: <portal_url>/_services/auth/authorize . The authorize endpoint supports the
following parameters:

PARAMETER REQUIRED? DESCRIPTION

client_id Yes A string that is passed when making a


call to the authorize endpoint. You must
ensure that the client ID is registered
with the portal. Otherwise, an error is
displayed. Client ID is added in claims in
the token as aud as well as appid
parameter and can be used by clients to
validate that the token returned is for
their app.
The maximum length is 36 characters.
Only alphanumeric characters and
hyphens are supported.

redirect_uri Yes URL of the portal where authentication


responses can be sent and received. It
must be registered for the particular
client_id used in the call and should
be exactly the same value as registered.
PARAMETER REQUIRED? DESCRIPTION

state No A value included in the request that also


is returned in the token response. It can
be a string of any content that you
want to use. Usually, a randomly
generated, unique value is used to
prevent cross-site-request forgery
attacks.
The maximum length is 20 characters.

nonce No A string value sent by the client that is


included in the resulting ID token as a
claim. The client can then verify this
value to mitigate token replay attacks.
The maximum length is 20 characters.

response_type No This parameter supports only token


as a value. This allows your app to
immediately receive an access token
from the authorize endpoint, without
making a second request to the
authorize endpoint.

Successful response
The authorize endpoint returns the following values in the response URL as a fragment:
token: Token is returned as a JSON Web Token (JWT) digitally signed by the portal’s private key.
state: If a state parameter is included in the request, the same value should appear in the response. The app
should verify that the state values in the request and response are identical.
expires_in: The length of time that the access token is valid (in seconds).
For example, a successful response looks as follows:

GET
https://aadb2cplayground.azurewebsites.net/#token=eyJ0eXAiOiJKV1QiLCJhbGciOI1NisIng1dCI6Ik5HVEZ2ZEstZnl0aEV1Q&
expires_in=3599&state=arbitrary_data_you_sent_earlier

Error response
The error in authorize endpoint is returned as a JSON document with the following values:
Error ID: Unique identifier of the error.
Error message: A specific error message that can help you identify the root cause of an authentication error.
Correlation ID: A GUID that is used for debugging purposes. If you have enabled diagnostic logging,
correlation ID would be present in server error logs.
Timestamp: Date and time when the error is generated.
The error message is displayed in the default language of the signed-in user. If the user is not signed in, the sign-in
page is displayed for the user to sign in. For example, an error response looks as follows:

{"ErrorId": "PortalSTS0001", "ErrorMessage": "Client Id provided in the request is not a valid client Id
registered for this portal. Please check the parameter and try again.", "Timestamp": "4/5/2019 10:02:11 AM",
"CorrelationId": "7464eb01-71ab-44bc-93a1-f221479be847" }
Token endpoint details
You can also get a token by making a request to the /token endpoint. It is different from the authorization
endpoint in the way that authorization endpoint handles the token logic in a separate page (redirect_uri), whereas
the token endpoint handles the token logic on the same page. The URL for token endpoint is:
<portal_url>/_services/auth/token . The token endpoint supports the following parameters:

PARAMETER REQUIRED? DESCRIPTION

client_id No A string that is passed when making a


call to the authorize endpoint. You must
ensure that the client ID is registered
with the portal. Otherwise, an error is
displayed. Client ID is added in claims in
the token as aud as well as appid
parameter and can be used by clients to
validate that the token returned is for
their app.
The maximum length is 36 characters.
Only alphanumeric characters and
hyphen are supported.

redirect_uri No URL of the portal where authentication


responses can be sent and received. It
must be registered for the particular
client_id used in the call and should
be exactly the same value as registered.

state No A value included in the request that also


is returned in the token response. It can
be a string of any content that you
want to use. Usually, a randomly
generated, unique value is used to
prevent cross-site-request forgery
attacks.
The maximum length is 20 characters.

nonce No A string value sent by the client that is


included in the resulting ID token as a
claim. The client can then verify this
value to mitigate token replay attacks.
The maximum length is 20 characters.

response_type No This parameter supports only token


as a value. This allows your app to
immediately receive an access token
from the authorize endpoint, without
making a second request to the
authorize endpoint.

NOTE
Even though client_id , redirect_uri , state , and nonce parameters are optional, it is recommended to use them in
order to make sure your integrations are secure.

Successful response
The token endpoint returns state and expires_in as response headers, and token in the form body.
Error response
The error in a token endpoint is returned as a JSON document with the following values:
Error ID: Unique identifier of the error.
Error message: A specific error message that can help you identify the root cause of an authentication error.
Correlation ID: A GUID that is used for debugging purposes. If you have enabled diagnostic logging,
correlation ID would be present in server error logs.
Timestamp: Date and time when the error is generated.
The error message is displayed in the default language of the signed-in user. If the user is not signed in, a sign-in
page is displayed for the user to sign in. For example, an error response looks as follows:

{"ErrorId": "PortalSTS0001", "ErrorMessage": "Client Id provided in the request is not a valid client Id
registered for this portal. Please check the parameter and try again.", "Timestamp": "4/5/2019 10:02:11 AM",
"CorrelationId": "7464eb01-71ab-44bc-93a1-f221479be847" }

Validate ID token
Just getting an ID token is not sufficient to authenticate the user; you must also validate the token's signature and
verify the claims in the token based on your app's requirements. The public token endpoint provides the public key
of the portal, which can be used to validate the signature of the token provided by the portal. The URL for public
token endpoint is: <portal_url>/_services/auth/publickey .

Turn implicit grant flow on or off


By default, implicit grant flow is enabled. If you want to turn off implicit grant flow, set the value of the
Connector/ImplicitGrantFlowEnabled site setting to False.
If this site setting is not available in your portal, you must create a new site setting with the appropriate value.

Configure token validity


By default, the token is valid for 15 minutes. If you want to change the validity of token, set the value of the
ImplicitGrantFlow/TokenExpirationTime site setting to the required value. The value must be specified in
seconds. The maximum value can be 1 hour, and the minimum value must be 1 minute. If an incorrect value is
specified (for example, alphanumeric characters), the default value of 15 minutes is used. If you specify a value
more than the maximum value or less than the minimum value, the maximum and minimum values are used
respectively, by default.
For example, to set the token validity to 30 minutes, set the value of the
ImplicitGrantFlow/TokenExpirationTime site setting to 1800. To set the token validity to 1 hour, set the value
of the ImplicitGrantFlow/TokenExpirationTime site setting to 3600.

Register client ID for implicit grant flow


You must register the client ID with the portal for which this flow is allowed. To register a client ID, you must create
the following site settings:

SITE SETTING VALUE


SITE SETTING VALUE

ImplicitGrantFlow/RegisteredClientId The valid client ID values that are allowed for this portal. The
values must be separated by a semicolon and can contain
alphanumeric characters and hyphens. The maximum length is
36 characters.

ImplicitGrantFlow/{ClientId}/RedirectUri The valid redirect URIs that are allowed for a specific client ID.
The values must be separated by a semicolon. The URL
provided must be of a valid web page of the portal.

Sample code
You can use the following sample code to get started with using OAuth 2.0 Implicit Grant with Power Apps portals
APIs.
Use Portal OAuth token with an external Web API
This sample is an ASP.NET based project and is used to validate the ID token issued by Power Apps portals. The
complete sample can be found here: Use Portal OAuth token with an external Web API.
Authorize Endpoint sample
This sample shows how authorize endpoint returns the ID token as a fragment in the Redirected URL. It also
covers state validation supported in Implicit Grant. The sample can be found here: Authorize Endpoint sample.
Token Endpoint sample
This sample shows how you can use the getAuthenticationToken function to fetch an ID token using the Token
endpoint in Power Apps portals. The sample can be found here: Token Endpoint sample.
Manage web pages
1/23/2020 • 5 minutes to read • Edit Online

A web page represents a particular URL in a portals website, and is one of the core entities of the portals content
management system. Through parent and child relationships to other web pages, this entity forms the hierarchy of
a website (i.e., its site map).
Web pages also form the basis for including other, specialized entity types in the portal site map – web files,
shortcuts, forums, web forms, and blogs are all situated in the portal site map through – and thus derive their
URLs from – a relationship to a parent web page.

Manage web pages


Web pages can be created, edited, and deleted from the Power Apps portals Studio. However, advanced
customization can be performed from the Portal Management app.
1. Open the Portal Management app.
2. Go to Portals > Web Pages.
3. To edit an existing web page, select the web page name.
4. Enter appropriate values in the fields.
5. Select Save & Close.
Web page attributes
The table below explains many of the standard web page attributes used by portals. It is important to note that the
way in which many of the content/display-oriented attributes are rendered is controlled by the page template
used, and thus by the portal developer.

NAME DESCRIPTION

Name The descriptive name of the entity. This value will be used as
the page title in most templates, particularly if a Title value is
not provided. This field is required.

Website The Website to which the entity belongs. This field is required.

Parent Page The parent web page of the entity, in the website content
hierarchy.
All web pages should have a parent page except for the single
root (Home) page of a website.
NAME DESCRIPTION

Partial URL The URL path segment used to build the portal URL of this
page.
The single root (Home) page of your website – the single page
that has no associated Parent Page – must have a Partial URL
value of /.
Partial URL values are used as URL path segments. As such,
they should not contain illegal URL path characters, such as ?,
#, !, %. Since portals URLs are generated by joining together
Partial URL values with slashes (/), they should also not
generally contain slashes. Recommended practice would be to
restrict Partial URL values to letters, numbers, and hyphens or
underscores. For example: press-releases, Users_Guide,
product1.

Page Template The Page Template to be used to render this page on the
portal. This field is required.

Publishing State The current publishing workflow state of the page, which may
dictate whether or not the page is visible on the site. The
most common use of this feature is to provide published/draft
control over content.
Users with content management permissions may be granted
the ability to use Preview Mode, which allows these users to
see (preview) unpublished content.

Display Date This attribute is a date/time value that can be used by a


template, purely for display purposes. It has no functional
implications, but can be useful for things like, for example,
manually specifying a published date on a press release or
news item page.

Release Date Controls a date/time after which the page will be visible on
the portal. If the current date/time is prior to this date, this
page will not be visible. (The exception to this is that users
with content management permissions may be granted the
ability to use Preview Mode, which allows these users to see
(preview) unreleased content.) This is useful for controlling the
release of time-sensitive content, like news or press releases.

Expiration Date Controls a date/time prior to which the page will be visible on
the portal. If the current date/time is after this date, this page
will not be visible. (The exception to this is that users with
content management permissions may be granted the ability
to use Preview Mode, which allows these users to see
(preview) expired content.)

Web Form The Web Form to be displayed on this page.

Title An optional title for the page. If this field is provided, this
value will be used on the portal, instead of the Name field.
This is useful in the case that you want a different title to
appear on the portal, while having the Name be useful for
content authors and users.

Summary A short description for the page, this value will generally be
used to add a description of the page to portal navigational
elements that render a link to the page.
NAME DESCRIPTION

Copy The main HTML content field of the page.

Hidden from Sitemap Controls whether or not the page is visible has part of the
portal site map. If this value is checked, the page will still be
available on the site at its URL, and can be linked to, but
standard navigational elements (menus, etc.) will not include
the page.

Author A Contact record representing the author of the page. This


value is generally used for administrative purposes, but this
information could be rendered on a portal, if the page's Page
Template supports it.

Display Order An integer value indicating the order in which the page will be
placed, relative to other entities with the same Parent Page.
This controls the ordering of pages and other site map entities
when, for example, a list of links to the child entities of a given
page are rendered on the portal.

Navigation A Web Link Set record. This is used by the


WebLinkNavigationPage.aspx Page Template to render a list of
navigation links on the left hand side of the page. Create a
Page Template in CRM and specify the Rewrite Url property as
~/Pages/WebLinkNavigationPage.aspx. Set the Web Page's
Page Template to this template record. This is typically done
to the parent page only and all child pages will automatically
receive the same list of links of its parent. The current page
will have its corresponding link highlighted.

Enable Tracking If enabled, every request for this page will be logged. A Web
Page Log record will be created with the date & time, IP
Address, and the contact record if the user is authenticated.

Enable page comments


Page comments provides users with the ability to view and post comments on a web page. By default this feature
is disabled and can be enabled on a page by page basis.
1. Open the Portal Management app.
2. Go to Portals > Web Pages.
3. Select the web page on which you need to enable comments.
4. From the Comment Policy list, select the required comment policy:
Inherit: The comment policy of the parent page will be used. This is the default setting.
Open: Submissions from all users, anonymous and authenticated, are allowed and displayed
immediately.
Open to Authenticated Users: Only submissions from authenticated users are allowed and they are
displayed immediately.
Moderated: Submissions from all users, anonymous or authenticated, are allowed. The submissions will
not be displayed until a moderator approves them.
Closed: Existing submissions are displayed, but no new submissions are allowed.
None: User submissions are disabled. No submissions can be made or viewed.
5. Save the changes.
Configure a contact for use on a portal
1/23/2020 • 2 minutes to read • Edit Online

After filling out the basic information for a contact, (or having a user fill out the sign-up form in a portal), go to the
web authentication tab on the portal contact form to configure a contact by using local authentication. For more
information about federated authentication options, see Set authentication identity for a portal. To configure a
contact for portals by using local authentication, follow these instructions:
1. Enter a username.
2. On the command ribbon, go to More Commands > Change Password.
Complete the change password workflow, and the necessary fields will be automatically configured. When you
have done this, your contact will be configured for your portals.

Change password for a contact from Portal Management app


1. Open the Portal Management app.
2. Go to Portals > Contacts, and open the contact for which you want to change the password. Alternately,
you can also open the Contacts page from the Share pane.
3. Select Task Flow on the toolbar at the top.

4. Select the Change password for portal contact task flow.


5. In the Change password for portal contact pane, select or create a contact to change the password, and
then select Next.

6. In the New password field, enter a new password, and then select Next.
If you do not enter a password and select Next, you'll be asked whether you want to remove password for
the selected contact.

7. After making the changes, select Done.


See also
Invite contacts to your portals
Set authentication identity for a portal
Invite contacts to your portals
3/17/2020 • 3 minutes to read • Edit Online

Use the invitation feature of portals to invite contacts to your portal through automated email(s) created in your
Common Data Service. The people you invite receive an email, fully customizable by you, with a link to your portal
and an invitation code. This code can be used to gain special access configured by you. With this feature you have
the ability to:
Send Single or Group Invitations
Specify an expiry date if desired
Specify a user or portal contact as the inviter if desired
Automatically assign the invited contact(s) to an account upon invite redemption
Automatically execute a workflow upon invite redemption
Automatically assign the invited contact(s) to a Web Role(s) upon redemption
Invitation redemption can be accomplished using any of our many authentication options. For documentation
regarding portal authentication, see Set authentication identity for a portal and choose the model applicable to
your portal version and configuration. The user will adopt any settings provided by the administrator upon
redemption. An Invite Redemption Activity will be created for the Invite and Contact.
Invitations are sent via the Send Invitation workflow. By default, the workflow creates an email with a generic
message and sends it to the invited Contact's primary email address. The email addresses in the CC and BCC
fields are ignored to ensure secure communication. The Send Invitation workflow contains an email template
that will need to be edited to contain a specific message for your portal and the correct hyperlink to your portal's
Invite Redemption Page.
To edit the Send Invitation workflow email template, locate it and deactivate it. After it is deactivated, edit the
email template to send the message you want and provide a link to the Invite Redemption Page of your portal.

NOTE
The invitation is sent only to the primary email (emailaddress1) of the contact. The invitation will not be sent to the
secondary email (emailaddress2) or alternate email (emailaddress3) of the contact record.

Create invitations from Portal Management app


1. Open the Portal Management app.
2. Go to Portals > Contacts. Alternately, you can also open the Contacts page from the Share pane.
3. Select a contact or open the contact record to be invited.
4. On the command bar, select Create Invitation.
5. On the Invitation page, enter appropriate values in the fields. More information: Invitation attributes
6. Select Save.
7. On the command bar, select Flow > Send Invitation.
8. In the confirmation window, select OK. The invitation will be sent to the selected contact.

Send multiple invitations


You can create invitations for your contacts and then send all invitations at once.
1. Create invitations for the required contacts and then go to Portals > Invitations.
2. Select the created invitations.
3. On the command bar, select Flow > Send Invitation.

4. In the confirmation window, select OK. The invitations will be sent to the selected contacts.
Invitation attributes
The table below explains the attributes of the Invitation page:

NAME DESCRIPTION

Name A descriptive name for helping recognize the invitation.

Type Single or Group. Single will allow only one contact to be


invited and only one redemption. Group allows multiple
contacts to be invited and multiple redemptions.

Owner/Sender The user that will be the sender of the email when the
invitation is sent. This can be overridden in the Send
Invitation workflow if the created email already contains
someone in the from field.

Invitation Code A unique code for the invitation that only the invitee will
know. This is automatically generated when creating a new
invitation.

Expiry Date The date that represents when the invitation will become
invalid for redemption. Optional.

Inviter Can be used when a contact is the sender of the invitation.


Optional.

Invited Contact(s) The contact(s) to be invited to a portal.

Assign to Account An account record to be associated as the redeeming


contact's parent customer when the invite is redeemed.
Optional.

Execute Workflow on Redeeming Contact A workflow process to be executed when the invite is
redeemed. The workflow will be passed the redeeming contact
as the primary entity. Optional.

Assign to Web Roles A set of web roles to be associated with the redeeming
contact when the invite is redeemed. Optional.

Redeemed Contact(s) The contact(s) that have successfully redeemed the invitation.

Maximum Redemptions Allowed The number of times the invitation can be redeemed.
Available for Group type invitations only.

See also
Configure a contact for use on a portal
Set authentication identity for a portal
Create web roles for portals
1/23/2020 • 2 minutes to read • Edit Online

After a contact has been configured to use the portal, it must be given one or more web roles to perform any
special actions or access any protected content on the portal. For example, to access a restricted page, the contact
must be assigned to a role to which read for that page is restricted to. To publish new content, the contact must
be placed in a role which is given content publishing permissions.
To create a web role:
1. Open the Portal Management app.
2. Go to Portals > Web Roles. Alternately, you can also open the Web Roles page from the Share pane.
3. Select New.
4. Enter appropriate values in the fields.
5. Select Save.

Attributes and relationships


The table below explains the Web Role attributes used by portals.

NAME DESCRIPTION

Name The descriptive name of the Web Role

Website The associated website

Description An explanation of the Web Role's purpose. Optional.

Authenticated Users Role Boolean. If set to true, this will be the default web role for
authenticated users (see below). Only one Web Role with the
Authenticated Users Role attribute set to true should exist for
a given website. This will be the default web role for
authenticated users that have not been assigned a web role.

Anonymous Users Role Boolean. If set to true, this will be the default web role for
unauthenticated users (see below). Only one Web Role with
the Anonymous Users Role attribute set to true should exist
for a given website. This will be the default web role for
unauthenticated users. The Anonymous Users Role will only
respect Entity Permissions.

Now that the Web Role has been created, you will be able to configure it to meet your needs via various
permissions, rules, and associations.
Optional default web role for authenticated users: By enabling the Authenticated Users Role, it will
become the default web role for all users. This role is commonly used to provide a predetermined access for
users that are not associated to any other roles. Keep in mind that users can have multiple web roles, but there
can only be one Authenticated Users web role for authenticated users.
Optional default web role for unauthenticated users: The Anonymous Users Role is intended to be
used with Entity Permissions. It will not respect any other rules or permissions. By enabling the "Anonymous
Users Role" it will become the default web role for all users. There can only be one Anonymous Users web
role for unauthenticated users.
See also
Configure a portal
Control webpage access for portals
Add record-based security by using entity permissions for portals
Add record-based security by using entity
permissions for portals
1/23/2020 • 8 minutes to read • Edit Online

To apply record-based security in portals to individual records, use entity permissions. You add entity
permissions to web roles so you can define roles in your organization that correspond logically to the privileges
and concepts of record ownership and access that are introduced by using entity permissions. Remember that a
given contact can belong to any number of roles, and a given role can contain any number of entity
permissions. More information: Create web roles for portals
Although permissions to change and access URLs in a portal site map is granted via Content Authorization, site
managers will also want to secure their custom web applications built with entity forms and entity lists. More
information: Define entity forms and Define entity lists
To secure these features, entity permissions allow for granular rights to be granted for arbitrary entities and for
record-level security to be enabled via relationship definitions.

Add entity permissions to a web role


1. Open the Portal Management app.
2. Go to Portals > Web Roles and open the web role you want to add the permissions to.
3. Under Related, select Entity Permissions.
4. Select Add Existing Entity Permission to add an existing entity permission to a web role.
5. Browse for an entity permission or select New Entity Permission to create a new Entity Permission
record.

When creating a new Entity Permission record, the first step is to determine the entity that will be secured. The
next step is to define scope, as discussed below, and—for any scope other than Global—the relationships that
define that scope. Finally, determine the rights that are being granted to the role via this permission. Note that
rights are cumulative, so if a user is in a role that grants Read, and another that grants Read and Update, the
user will have Read and Update rights for any records that overlap between the two roles.
NOTE
Selecting CMS entities like webpage and web files is invalid and might have other unintended consequences. The portal
will assert the security of CMS entities based on content access controls, not entity permissions.

Global scope
If an Entity Permission record with Read permission is granted to a role that has global scope, any contact in
that role will have access to all records of the defined entity. For example, they will be able to see all leads, all
accounts, and so on. This permission will be automatically respected by any entity lists, essentially showing all
records according to the model-driven app views that have been defined for that list. Further, if a user attempts
to access a record via an entity form that they do not have access to, they will receive a permission error.
Contact scope
With Contact scope, a signed-in user in the role for which the permission record is defined will have the rights
granted by that permission only for records that are related to that user's contact record via a defined
relationship.
On an entity list, this means that a filter will be added to whatever model-driven app views are surfaced by that
list, which only retrieves records directly linked to the current user. (Depending on the scenario, this relationship
can be thought of as ownership or management rights.)
Entity forms will only allow the appropriate permission for Read, Create, Write, and so on if this relationship
exists when the record is loaded. More information: Define entity forms.
Account scope
With Account Scope, a signed-in user in the role for which the permission record is defined will have the rights
granted by that permission only for records that are related to that user's parent account record via a defined
relationship.
Self scope
Self Scope allows you to define the rights a user has to their own Contact (Identity) record. This allows users to
use entity forms or web forms to make changes to their own Contact record linked with their profile. Note that
the default Profile Page has a special built-in form that allows any user to change their basic contact info, and
opt in or out of marketing lists. If this form is included in your portal (which it is by default), users will not
require this permission to use it. However, they will require this permission to use any custom entity forms or
web forms that target their User Contact record.
Parental scope
In this most complex case, permissions are granted for an entity that is a relationship away from an entity for
which an Entity Permission record has already been defined. This permission is actually a child record of the
parent entity permission.
The Parent Permission record defines a permission and scope for an entity (probably Global or Contact scope,
although Parent is also possible). That entity might be related to a Contact (in the case of Contact scope) or
globally defined. With that permission in place, a child permission is created that defines a relationship from
another entity to the entity defined in the parent relationship.
Thus, users in a web role who have access to records defined by parent entity permissions will also have rights
as defined by the child permission record to records related to the parent record.
Attributes and relationships
The table below explains the entity permission attributes.
NAME DESCRIPTION

Name The descriptive name of the record. This field is required.

Entity Name The logical name of the entity that is to be secured or that
will define the contact relationship or parent relationship to
secure a related entity on a child permission. This field is
required.

Scope (mandatory) Global: Grant privileges to the entity record without


any requirement for an owner (contact).
Contact: Grant privileges to the entity record that
has a direct relationship to an owner (contact).
Account: Grant privileges to the entity record that
has a relationship to an account, which serves as the
owner assuming the account is the parent customer
of the contact.
Parent: Grant privileges to the entity record through
the chain of its parent permissions' relationships.

Contact Relationship Required only if Scope = Contact. The schema name of the
relationship between the contact and the entity specified by
the Entity Name field.

Parent Relationship Required only if a parent entity permission is assigned. The


schema name of the relationship between the entity
specified by the Entity Name field and the entity specified by
the Entity Name field on its Parent Entity Permission record.

Parent Entity Permission Required only if Scope = Parent.

Read Privilege that controls whether the user can read a record.

Write Privilege that controls whether the user can update a record.

Create Privilege that controls whether the user can create a new
record. The right to create a record for an entity type does
not apply to an individual record, but instead to a class of
entities.

Delete Privilege that controls whether the user can delete a record.

Append Privilege that controls whether the user can attach another
record to the specified record.The Append and Append To
access rights work in combination. Every time that a user
attaches one record to another, the user must have both
rights. For example, when you attach a note to a case, you
must have the Append access right on the note and the
Append To access right on the case for the operation to
work.

Append To Privilege that controls whether the user can append the
record in question to another record.The Append and
Append To access rights work in combination. For more
information, see the description for Append.
Global permissions for tasks related to leads
In one scenario, we might want to use an entity list and entity forms to surface all leads on the portal to anyone
in a custom Lead Manager web role. On the Lead Edit Form, which is launched whenever a lead row is selected
on the list, a subgrid will display related Task records. These records should be accessible to anyone in the Lead
Manager role. As the first step, we'll give Global permissions to leads to anyone in our Lead Manager Role.
This role has a related Entity Permission for the Lead entity, with a Global scope.
Users in this role can access all leads via entity lists or forms on the portal.

We will now add a Child permission to the Global Lead permission. With the Parent Permission record open,
go to the Child Entity Permissions subgrid, select New to open a lookup for entity permissions, select the
magnifying glass, and then select New to add a new record.

Select the entity as Tasks and the scope as Parental. Note that you can then select the parent relationship
(Lead_Tasks). This permission implies that a contact that is in a web role with the parent permission will then
have global permission to all tasks that are related to leads.
Remember that in order for your list to respect these permissions, you must have enabled Entity Permissions
on the list AND there must be actions that will actually allow users to perform the actions for which their
permissions have been granted. Furthermore, permissions must also be enabled on the entity form record, and
that form must be surfacing a page that has a subgrid on it for the entity that you want to enable with child
permissions, in this case Tasks. Furthermore, to enable Read or Create permissions for tasks, you will need to
configure those entity forms too, and edit the forms to remove the Regarding lookup field.
This then grants permissions for all tasks that are related to leads. If tasks are being surfaced on an entity list, a
filter is essentially added to the list so that only tasks that are related to a lead will show up in the list. In our
example, they are being surfaced with a subgrid on an entity form.

Contact-scoped permissions for tasks


Another example would be if you wanted to allow access to tasks for which a contact is related to the parent
lead for that task. This scenario is nearly identical to the previous section, except in this case the parent
permission has a scope of Contact, instead of Global. A relationship must be specified on the parent
relationship between the Lead entity and the Contact entity.
After these permissions are in place, users in the Lead Manager role can access leads that are related to them
directly as specified by the contact-scope permission, and access tasks related to those same leads as specified
by the child permission record.
See also
Create web roles for portals
Control webpage access for portals
Control webpage access for portals
1/23/2020 • 3 minutes to read • Edit Online

Web page access control rules are rules that you create for your site to control both the publishing actions that a
web role can perform across the pages of your website and to control which pages are visible by which web roles.
The webpage access entity has the following attributes:

NAME DESCRIPTION

Name A descriptive name for the rule.

Website The website that this rule applies to; must match the website
of the page to which this rule is applied. Filters Web Page.

Web Page The webpage that this rule applies to. The rule will affect not
only the page but all child pages of the page, therefore
making this attribute select the branch of the website to
which the rule will apply. If a rule is applied to the home page,
it will apply to the entire portal.

Right Grant change or Restrict read below.

Scope All content: All descendant content is included in


security validation.
Exclude direct child web files: All child web files
directly related to this webpage are excluded from
security validation. This does not exclude child's
descendants.
By default, All content is selected.

Description (Optional) A description of the rule.

After creating a new access control rule, associate it with a page. This will cause it to affect both the page you
assign the rule to and all child pages—in other words, the entire branch of the website.
There are two types of access control rules: Grant Change and Restrict Read.

Grant Change
Grant Change allows a user in a web role associated with the rule to publish content changes for this page and all
child pages of this page. Grant Change takes precedence over restrict read. For example, you might have a news
section of the site, which you want to be editable by users in the news editor web role. These users might not have
access to the entire site, and certainly can't edit the entire site, but within this branch they have full content
publishing authority. You would create a webpage access control rule called grant news publishing to news
editors.
Next, you would set the right to grant change and the webpage to the parent page of the entire news branch of
your site. You would then assign this web role to any contacts you want to designate as news editors. Note that
one user can have many web roles.
A Grant Change rule should always be present in any portal that you wish to enable front-side editing for. This
rule will apply to the home page of the site, thus making it the default rule for the entire site. This rule will be
associated with a web role that is to represent the administrative role for the site. Users who are to be given front-
side content publishing rights will be assigned to this role.

Restrict read
The Restrict Read rule is used to limit viewing of a page (and its child pages) and its content to specific users.
Whereas grant change is a permissive rule (it grants the ability to do something to its users), restrict read is a
restrictive rule in that it restricts an action to a limited set of users. For example, you might have a section of the
site meant to be used by employees only. You might restrict read of this branch to only people in the employee
web role. You would create a new rule called restrict read to employees only.
You would then set the right to restrict read and the page to the page at the top of the branch which is to be read
only by employees. You would then associate this rule with the employee web role and then assign users to this
role.

NOTE
If you apply the Restrict Read right to the root 'home' page of a website and select Exclude direct child web files as the
Scope, the home page's direct child web files will be accessible to all users.

See also
Create web roles for portals
Add record-based security using entity permissions for portals
Create website access permissions
1/23/2020 • 2 minutes to read • Edit Online

Website Access Permissions is a permission set, associated with a web role, that permits front-side editing of the
various content managed elements within the portal other than just web pages. The permission settings determine
which components can be managed in the portal.

NAME DESCRIPTION

Manage Content Snippets Allows the editing of Snippet controls.

Manage Site Markers Allows the editing of hyperlinks that use Site Markers

Manage Web Link Sets Allows the editing of web link sets, including adding an
removing web links from a web link set.

Preview Unpublished Entities Allows the viewing of portal-exposed entities that have a
publishing state of Draft.

To create a website access permission and add it to a web role:


1. Open the Portal Management app.
2. Go to Portals > Website Access Permissions.
3. Select New.
4. Under General, enter name, website, and select the required permissions.
5. Under Web Roles, select Add Existing Web Role, and add the web role to associate the permission with.
6. Save the changes.
Configure notes for entity forms and web forms on
portals
3/25/2020 • 8 minutes to read • Edit Online

Just like with subgrids, adding notes to your managed forms on the portal is easy—just add the notes control to
the model-drive app forms through the form designer and you're done. You can configure the behavior of the
notes control by using metadata.

NOTE
Explicit Entity Permissions are required for any notes to appear on the portal. For read and edit, the Read and Write
privileges must be granted. For create, two permissions must exist: a permission with the Create and Append privileges
must be granted for the note (annotation) entity, the second permission must be assigned to the entity type the note is
being attached to with the Append To privilege granted. The Enable Entity Permissions check box must be selected on the
corresponding entity form or web form step for the entity permissions to take effect.

Notes configuration for entity forms


1. Open the Portal Management app.
2. Go to Portals > Content > Entity Forms. A list of active entity forms is displayed.
3. Select the entity form to which you want to add note configuration.
4. Go to Entity Form Metadata either by using the top drop-down list or the subgrid on the main form of
the entity form record that you are working with.
5. Select Add New Entity Form Metadata to add a new record.
6. From the Type drop-down list, select Notes. The notes configuration–specific settings are displayed. Most
of the settings are collapsed by default. You can expand a section to see additional settings.
7. Fill in the fields by entering appropriate values. More information: Attributes, Create dialog options, Edit
dialog options, and Delete dialog options
8. Save the form.
After adding the configuration, the Note control will be rendered by using the appropriate options enabled
on the portal.

Attributes
NAME DESCRIPTION

Basic settings

Create Enabled Enables the ability to add new notes to the entity.

Create Dialog Options Contains settings for configuring the dialog box when Create
Enabled is true. See Create Dialog Options for more details.

Edit Enabled Enables the ability to edit existing notes on the entity.

Edit Dialog Options Contains settings for configuring the dialog box when
EditEnabled is true. See Edit Dialog Options for more details.

Delete Enabled Enables the ability to delete notes from the entity.

Delete Dialog Options Contains settings for configuring the dialog box when
DeleteEnabled is true. See Delete Dialog Options for more
details.

File Attachment Location Select the location of the file attachment:


Note attachment
Azure Blob Storage

Accept MIME Types(s) Allows you to specify a list of accepted MIME types.
NAME DESCRIPTION

Restrict MIME Types Select whether to allow or restrict MIME types.

Maximum File Size (in KB) Allows you to specify the maximum size of a file that can be
attached.

Advanced settings

List Title Overrides the title over the Notes area.

Add Note Button Label Overrides the label on the Add Notes button.

Note Privacy Label Overrides the label denoting that a note is Private.

Loading Message Overrides the message shown while the list of notes is
loading.

Error Message Overrides the message shown when an error occurs while
trying to load the list of notes.

Access Denied Message Overrides the message shown when the user does not have
sufficient permissions to view the list of notes.

Empty Message Overrides the message shown when the current entity does
not have any notes that can be viewed.

List Orders Allows you to set the order in which notes will be displayed.
The List Orders setting allows you to set the following:
Attribute: the logical name of the column by which
you wish to sort
Alias: the alias for the attribute in the query
Direction: Ascending (smallest to largest, or first to
last), or Descending (largest to smallest, or last to
first).

To add a sorting rule, select "Column" (4) and fill in the details.
List Orders will be processed in order from the top of the list
having highest priority.

Create Dialog Options


NAME DESCRIPTION

Basic settings

Display Privacy Options Field Enables a check box in the Add Note dialog box that allows
the user to mark a note as Private.
NAME DESCRIPTION

Privacy Option Field Default Value Specifies the default value for the Display Privacy Options
Field check box. The default value of this field is False.

Display Attach File Enables a file upload field in the Add Note dialog box, allowing
a user to attach a file to a note.

Attach File Accept The MIME type accepted by the file upload input.

Advanced settings

Note Field Label Overrides the label for the Note field in the Add Note dialog
box.

Note Field Columns Sets the cols value in the Note <textarea>

Note Field Rows Sets the rows value in the Note <textarea>

Privacy Option Field Label Overrides the label for the Privacy Option field (if enabled).

Attach File Label Overrides the label for the Attach File field (if enabled)

Left Column CSS Class Adds the CSS class or classes to the leftmost column
containing labels in the Add Note dialog box.

Right Column CSS Class Adds the CSS class or classes to the rightmost column
containing field inputs in the Add Note dialog box.

Title Overrides the HTML text in the header of the Add Note
dialog box.

Primary Button Text Overrides the HTML that appears in the Primary (Add Note)
button in the dialog box.

Dismiss Button SR Text Overrides the screen reader text associated with the dialog
box's dismiss button.

Close Button Text Overrides the HTML that appears in the Close (Cancel) button
in the dialog box.

Size Specifies the size of the Add Note dialog box. The options are
Default, Large, and Small. For the Add Note dialog box, the
default size is Default.

CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box.

Title CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box's title bar.

Primary Button CSS Class Specify a CSS class or classes that will be applied to the dialog
box's Primary (Add Note) button.
NAME DESCRIPTION

Close Button CSS Class Specify a CSS class or classes that will be applied to the dialog
box's Close (Cancel) button.

Edit Dialog Options


NAME DESCRIPTION

Basic settings

Display Privacy Options Field Enables a check box in the Edit Note dialog box that allows
the user to mark a note as Private.

Privacy Option Field Default Value Specifies the default value for the Display Privacy Options
Field check box. The default value of this field is False.

Display Attach File Enables a file upload field in the Edit Note dialog box, allowing
a user to attach a file to a note.

Attach File Accept The MIME type accepted by the file upload input.

Advanced settings

Note Field Label Overrides the label for the Note field in the Edit Note dialog
box.

Note Field Columns Sets the cols value in the Note <textarea>

Note Field Rows Sets the rows value in the Note <textarea>

Privacy Option Field Label Overrides the label for the Privacy Option field (if enabled).

Attach File Label Overrides the label for the Attach File field (if enabled)

Left Column CSS Class Adds the CSS class or classes to the leftmost column
containing labels in the Edit Note dialog box.

Right Column CSS Class Adds the CSS class or classes to the rightmost column
containing field inputs in the Edit Note dialog box.

Title Overrides the HTML text in the header of the Edit Note dialog
box.

Primary Button Text Overrides the HTML that appears in the Primary (Update
Note) button in the dialog box.

Dismiss Button SR Text Overrides the screen reader text associated with the dialog
box's dismiss button.

Close Button Text Overrides the HTML that appears in the Close (Cancel) button
on the dialog box.
NAME DESCRIPTION

Size Specifies the size of the Edit Note dialog box. The options are
Default, Large, and Small. For the Edit Note dialog box, the
default size is Default.

CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box.

Title CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog's title bar.

Primary Button CSS Class Specify a CSS class or classes that will be applied to the dialog
box's Primary (Update Note) button.

Close Button CSS Class Specify a CSS class or classes that will be applied to the dialog
box's Close (Cancel) button.

Delete Dialog Options


NAME DESCRIPTION

Basic settings

Confirmation Override the confirmation message to delete the note.

Advanced settings

Title Overrides the HTML text in the header of the Delete Note
dialog box.

Primary Button Text Overrides the HTML that appears in the Primary (Delete)
button in the dialog box.

Dismiss Button SR Text Overrides the screen reader text associated with the dialog
box's dismiss button.

Close Button Text Overrides the HTML that appears in the Close (Cancel) button
in the dialog box.

Size Specifies the size of the Delete Note dialog box. The options
are Default, Large, and Small. For the Delete Note dialog box,
the default size is Default.

CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box.

Title CSS Class Specify a CSS class or classes that will be applied to the
resulting dialog box's title bar.

Primary Button CSS Class Specify a CSS class or classes that will be applied to the dialog
box's Primary (Delete) button.
NAME DESCRIPTION

Close Button CSS Class Specify a CSS class or classes that will be applied to the dialog
box's Close (Cancel) button.

Assign entity permissions


You must create and assign the appropriate entity permission to the records as follows, otherwise the Add, Edit,
and Delete buttons for the note will be hidden:
Read, Write, Create, Append, and Append To privileges for the Activity (activitypointer) entity with the
scope as Global. This entity permission must be associated with a web role for the user.
Read, Write, Create, Append, and Append To privileges for the entity that has the Notes control enabled in
it. The scope should be set to Global. This entity permission must be associated with a web role for the
user.

If you created a custom form and added the notes section to it, be sure to select Notes as the default tab you want
to be visible.
Notes configuration for web forms
Web form notes are configured in the same way as entity form notes. You must first create a metadata record for
the Web Form Step that has notes, and then add the notes configuration metadata.

NOTE
Notes description must be prefixed with *WEB* ('WEB' keyword with an asterisk sign (*) before and after) in order to
display on the portal.
Enable Azure Storage
2/15/2020 • 2 minutes to read • Edit Online

Azure Storage integration for portals enables you to take advantage of the greater file storage capability of Azure,
using the same interface and providing the same user experience as for default file attachments. This feature is
supported for web files, entity forms, and web forms.
You must create a storage account with Resource manager as the deployment model. More information: Create
an Azure storage account.
After the storage account is running, portals require certain global settings that tell the application how to locate
your storage account. In the Portal Management app, go to Settings > New, and add a new setting named
FileStorage/CloudStorageAccount.
Azure storage integration only works with Notes configured in Entity Form Metadata. Azure Blob as a storage is
not used if you use Portal Comments that can be setup using Timeline. Though Portal Comments also provide
capability for files to be uploaded as attachments, these files are only stored in Common Data Service.

NOTE
The maximum file upload size is 125 MB.

To locate the value for FileStorage/CloudStorageAccount, you must get a connection string from your Azure portal.
1. Sign in to your Azure portal.
2. Navigate to your storage account.
3. Select Access Keys.

4. In the resulting panel, locate the field labeled Connection String. Select the Copy icon next to the field for
which you need to copy the value, and then paste that value into your new setting:
Specify the storage container
If you do not already have an Azure Blob container in your storage account, you must add one by using your Azure
portal.
In the Portal Management app, go to Settings > New, and add a new setting named
FileStorage/CloudStorageContainerName, using the name of your container as the value.

Add CORS rule


You must add cross-origin resource sharing (CORS ) rule on your Azure Storage account as follows, otherwise you
will see the regular attachment icon rather than the cloud icon:
Allowed origins: Specify your domain. For example, https://contoso.crm.dynamics.com .
Allowed verbs: GET, PUT, DELETE, HEAD, POST
Allowed headers: Specify the request headers that the origin domain may specify on the CORS request. For
example, x-ms-meta-data*, x-ms-meta-target*.
Exposed headers: Specify the response headers that may be sent in the response to the CORS request and
exposed by the browser to the request issuer. For example, x-ms-meta-*.
Maximum age (seconds): Specify the maximum amount time that a browser should cache the preflight
OPTIONS request. For example, 200.
More information: CORS support for the Azure Storage Services

Add site settings


Add the following site settings from Portals > Site Settings. More information: Manage portal site settings.

NAME VALUE

WebFiles/CloudStorageAccount Provide the same connection string as provided for the


FileStorage/CloudStorageAccount setting.

WebFiles/StorageLocation AzureBlobStorage

You can now create a child file in portal and mention fully qualified name (along with container) in Azure Blob
address URL. With these settings, your portal is ready to begin uploading and downloading files to and from Azure
Storage. However, you cannot take full advantage of this feature until you add a web resource to enable uploading
attachments to Azure Storage, and configure entity forms or web forms to use it.
See also
Add web resource
Configure notes
Add the Azure Storage web resource to a form
2/15/2020 • 4 minutes to read • Edit Online

Attachments uploaded to Azure Storage instead of directly to Common Data Service can be managed by using
notes in Common Data Service .
To enable attachments from a particular form to be uploaded into Azure Storage, you must add a web resource to
that form and you must configure Azure Storage for your organization.

NOTE

In this example, the form is added to the Lead form for the Lead entity. We recommend using caution when editing
existing forms.
When a file (for example, attachments.zip) is uploaded to Azure Storage by using the portal, it is represented by a
note on an entity and a placeholder for the attachment.

Note that the attachment file is now named attachment.zip.txt. By default, Common Data Service has no
conception of an Azure file, so this placeholder .txt file is stored in Common Data Service instead. The Azure
Storage context for the placeholder file shows details about the file.

{
Name: attachment.zip,
Type: application/x-zip-compressed,
Size: 24890882,
"Url": "https://accountname.blob.core.windows.net/storage/81a9a9491c36e51182760026833bcf82/attachment.zip"
}

To see and interact with the file stored in Azure, you must add the web resource adx.annotations.html to the form.
As a pre-requisite, ensure that your users have read access to adx_setting. Otherwise, the web resource will not
render properly.
1. In the form editor for the relevant form, select Web Resource on the Insert tab.
2. In the Web resource box, select adx_annotations/adx.annotations.html.
3. Enter a name and label for the resource.
4. In the Custom Parameter (data) box, enter azureEnabled=true.
You can also use the web resource without enabling Azure support in this way, in which case it will function
almost entirely the same as the default control.
5. On the Formatting tab, choose whatever formatting rules you prefer. We recommend that you clear the
Display border check box.
6. Select OK to save the resource.
7. Optionally, you might want to remove the existing notes control, or move it to a tab or section that is
marked to be not visible by default.
8. Save the form, and then publish the changes.

The new control will now be rendered on the page, giving you the ability to manage your attachments in Azure
Storage.
The paper-clip icon has been replaced with a cloud icon to denote that this file is stored in Azure Storage. You can
continue to store attachments in Common Data Service ; those files will be denoted with the paper-clip icon.

NOTE
You must add cross-origin resource sharing (CORS) rule on your Azure Storage account as follows, otherwise you will see the
regular attachment icon rather than the cloud icon.
Allowed origins: Specify your domain. For example, https://contoso.crm.dynamics.com .
Allowed verbs: GET, PUT, DELETE, HEAD, POST
Allowed headers: Specify the request headers that the origin domain may specify on the CORS request. For example, x-
ms-meta-data*, x-ms-meta-target*. For this scenario, you must specify *, otherwise the web resource will not render
properly.
Exposed headers: Specify the response headers that may be sent in the response to the CORS request and exposed by
the browser to the request issuer. For example, x-ms-meta-*.
Maximum age (seconds): Specify the maximum amount time that a browser should cache the preflight OPTIONS
request. For example, 200.
More information: CORS support for the Azure Storage Services.

If the attached file is an image, the control will display the image as a thumbnail whether it is stored in Common
Data Service or Azure Storage.

NOTE
The thumbnail feature is limited to images under 1 MB in size.
CORS protocol support
The cross-origin resource sharing (CORS ) protocol consists of a set of headers that indicates whether a response
can be shared with another domain. The following site settings are used to configure CORS:

SITE SETTING REQUEST HEADER DESCRIPTION

HTTP/Access-Control-Allow-Credentials Access-Control-Allow-Credentials The only valid value for this header is


true (case-sensitive). If you don't need
credentials, omit this header entirely
(rather than setting its value to false).

HTTP/Access-Control-Allow-Headers Access-Control-Allow-Headers A comma-delimited list of the


supported HTTP request headers.

HTTP/Access-Control-Allow-Methods Access-Control-Allow-Methods A comma-delimited list of the allowed


HTTP request methods such as GET,
POST, OPTIONS.

HTTP/Access-Control-Allow-Origin Access-Control-Allow-Origin To allow any resource to access your


resources, you can specify *. Otherwise,
specify the URI that can access the
resources.

HTTP/Access-Control-Expose-Headers Access-Control-Expose-Headers A comma-delimited list of HTTP header


names other than the simple response
headers that the resource might use
and can be exposed.

HTTP/Access-Control-Max-Age Access-Control-Max-Age Maximum number of seconds the


results can be cached.

HTTP/Content-Security-Policy Content-Security-Policy Controls resources the user agent is


allowed to load for a given page.
SITE SETTING REQUEST HEADER DESCRIPTION

HTTP/Content-Security-Policy-Report- Content-Security-Policy-Report-Only Allows web developers to experiment


Only with policies by monitoring, but not
enforcing, their effects. These violation
reports consist of JSON documents
sent via an HTTP POST request to the
specified URI.

HTTP/X-Frame-Options X-Frame-Options Indicates whether a browser should be


allowed to render a page in a <frame>,
<iframe>, <embed> or <object>.

HTTP/X-Content-Type-Options X-Content-Type-Options Disables MIME sniffing and forces


browser to use the type given in
Content-Type.
Manage SharePoint documents
1/23/2020 • 7 minutes to read • Edit Online

Common Data Service supports integration with SharePoint Online that enables you to use the document
management capabilities of SharePoint from within Common Data Service. Power Apps portals now supports
uploading and displaying documents to and from SharePoint directly on an entity form or web form in a portal.
This allows portal users to view, download, add, and delete documents from a portal. Portal users can also create
subfolders to organize their documents.

NOTE
Document management works only with SharePoint Online.
Document management is supported with server-based integration.

To work with the document management capabilities of SharePoint from within Common Data Service, you must:
1. Enable document management functionality in model-driven apps in Dynamics 365
2. Set up SharePoint integration from Power Apps Portals admin center
3. Enable document management for entities
4. Configure the appropriate form in Power Apps documents
5. Create appropriate entity permission and assign it to the appropriate web role

Step 1: Enable document management functionality in model-driven


apps in Dynamics 365
You must enable the document management functionality in model-driven apps in Dynamics 365 by using server-
based SharePoint integration. Server-based SharePoint integration allows model-driven apps in Dynamics 365
and SharePoint Online to perform a server-to-server connection. The default SharePoint site record is used by the
portal. For information on how to enable document management functionality in model-driven apps in Dynamics
365, see Set up model-driven apps in Dynamics 365 to use SharePoint Online.

Step 2: Set up SharePoint integration from Power Apps Portals admin


center
To use the document management capabilities of SharePoint, you must enable SharePoint integration from the
Power Apps Portals admin center.

NOTE
You must be a global administrator to perform this action.

1. Open Power Apps Portals admin center.


2. Go to Set up SharePoint integration > Enable SharePoint integration.
3. Select Enable in the confirmation window. This will enable the portal to communicate with SharePoint.
While the SharePoint integration is being enabled, the portal restarts and will be unavailable for a few
minutes. A message appears when SharePoint integration is enabled.
When SharePoint integration is enabled, the following action becomes available:
Disable SharePoint integration: Allows you to disable the SharePoint integration with your portal. While
the SharePoint integration is being disabled, the portal restarts and will be unavailable for a few minutes. A
message appears when SharePoint integration is disabled.

Enabling or disabling the SharePoint integration will update the Azure Active Directory (Azure AD ) application for
the portal and add or remove the required SharePoint permissions, respectively. You will also be redirected to
provide your consent for the changes to be made in the Azure AD application.
If you do not provide your consent:
Enabling or disabling the SharePoint integration will not be complete and an error message will display.
Your out-of-the-box Azure AD login on the portal will not work.

Step 3: Enable document management for entities


You must enable document management for entities to store documents related to entity records in SharePoint.
For information on how to enable document management for entities, see Enable SharePoint document
management for specific entities.

Step 4: Configure the appropriate form to display documents


Power Apps customization
Identify the form where you want to use document management capabilities. You must edit the form by using
model-driven app form editor and add a subgrid to it. The subgrid adds a section to the form, which allows you to
work with documents from within a portal. You must set the following properties in the subgrid for this feature to
work:
Under Data Source, select Document Locations from the Entity list.
Under Data Source, select Active Document Locations from the Default View list.
You can specify name and label as per your requirement. Save and publish the form once the subgrid is added and
configured.

NOTE
Document management must be enabled for the entity for which you edit the form. More information: Enable document
management for entities

Power Apps portals configuration


Apart from the standard configuration required for entity form or web form, you must set the following properties
to enable document management:
Entity Name and Form Name: Enter the entity and form names customized in the previous step,
respectively.
Select the Enable Entity Permission check box on the form to allow a user to read the documents.
Set the Mode to Edit to allow document uploads.

NOTE
Document uploading requires the parent entity record to exist. If you set the Mode to Insert, the document upload will not
work because the parent entity record is not created until the form is submitted.

Step 5: Create appropriate entity permission and assign it to the


appropriate web role
Two entity permission records are required to establish the necessary access to view and upload documents.
Permissions on the entity of the entity or web form:
Create an Entity Permission record specifying the Entity Name as the entity of the entity form or web
form configured previously.
Select a Scope and scope relationship that is appropriate to the desired behavior of the form.
Enable Read and Append To privileges to allow read access to documents and optionally enable Write
privilege to allow document uploads. Ignore the Child Entity Permissions section for now since it will
be populated by the next step.
Permissions on the Document Location with Parent scope referring to the previous permission record:
Create an Entity Permission record specifying the Entity Name as Document Location entity with
Scope set to Parent.
Select the Parent Entity Permission to the entity permission record created in previous step.
Privileges
The minimum privileges to allow read access to documents are Read, Create, and Append.
Include Write privileges for document upload access.
Include Delete to allow deletion of a document.

NOTE
A corresponding child entity permission on the Document Location entity needs to be created for each instance of the
parent entity permission record that exists on the entity of the entity or web form where documents need to be shown.

Configure file upload size


By default, the file size is set to 10 MB. However, you can configure the file size to a maximum of 50 MB by using
the site setting SharePoint/MaxUploadSize .

Sample configuration to enable document management on the Case


entity form
The below example demonstrates configuration using the Case entity which needs the Dynamics 365 Customer
Service application as a pre-requisite. Although this sample uses the Case entity, it is just an illustration of the steps
mentioned above and can be followed with any other custom entity or any Common Data Service entity that
supports managing documents in SharePoint.
1. Follow the instructions in Step 1 to ensure that server-based configuration is complete for model-driven
apps in Dynamics 365 and SharePoint integration.
2. Follow the instructions in Step 2 to ensure that the portal has permissions to integrate with SharePoint.
3. Follow the instructions in Step 3 to ensure Document Management is enabled for the Case entity.
4. Follow the instructions in Step 4 with the following configurations:
Model-driven apps in Dynamics 365 customization
a. Go to Settings > Customization > Customize the System.
b. In the Default Solution, go to the Case entity > Forms.
c. Open the Web – Edit Case in form editor.

d. Select the Created On field on the form, and on the Insert tab, select Sub-Grid.

e. In the Set Properties dialog box, set the following properties, and select OK:
Name (This can be any name): CaseDocuments
Label (This can be any label name): Case Documents
Entity: Document Locations
Default View: Active Document Locations

f. In the form editor, select Save and then select Publish.


Power Apps portals configuration
a. Go to Portals > Entity Forms.
b. Find and open Customer Service - Edit Case entity form.
c. Review and ensure the following properties are set:
Entity Name: Case (incident)
Form Name: Web – Edit Case
Mode: Edit
Entity Permission: Enabled
d. If you’ve made any changes to the form, select Save.
5. Follow Step 5 to make sure entity permissions are granted to the users.
a. Go to the Web Role record that is associated to the user. For this sample, we’ll assume that the user
has an Administrator web role.
b. Ensure that an Entity Permission record exists by the name of Customer Service - Cases where
contact is customer.

NOTE
Ensure that your web role has this entity permission added. If your user is already an Administrator, then the
above entity permission need not be explicitly assigned.

c. Create a new entity permission, enter the following details, and select Save:
Name (This can be any name): Customer Service - Related Documents
Entity Name: Document Location
Scope: Parent
Parent Entity Permission: Customer Service - Cases where contact is customer
Parent Relationship: incident_SharePointDocumentLocations
Privileges: Read, Create, Append, Write, Delete
d. Sign in to portal to ensure document management is enabled for the Case entity.
a. Go to the Support page.

b. Click on an existing Case record from the list. Go to the Case Documents section on the page and
see the document list added.
Known issues
1/23/2020 • 5 minutes to read • Edit Online

General issues
Due to ongoing compatibility issues between the updated Yahoo YDN OAuth provider endpoint and Power
Apps portals, users are temporarily unable to authenticate with Yahoo identity provider.
The Modified Date for the app might be incorrect because these are pre-provisioned apps and could have
been provisioned earlier.
When you create an environment along with the starter portal, the owner of the portal is not displayed
correctly. It is displayed as System.
If you are reusing the URL of a recently deleted portal to create a new portal, it will have some delay for
runtime to setup. This is because the purge of previous resources would still be in progress and may take
from 30 minutes to 1 hour for the new portal to setup on Azure. The portal will also not be available for
editing during this time and may show errors when launched in studio for editing.
When switching an environment in Power Apps, the portals within an environment may not show up
immediately in Apps or Recent Apps list. This happens particularly on environments that are created in a
different region than their tenant. The workaround is to use browser refresh or wait for some time for portal
to show up in the apps list.
If you keep the portal settings pane open in Power Apps home page while resetting the portal from Power
Apps Portals admin center, a user will see the "Something went wrong" error message in the portal settings
pane, as portal is not available.
In certain cases, when you create a portal, the styles are not applied properly to the portal, and the website
is displayed without the styles when opened through Browse website. This rarely happens and styles can
be recovered by restarting the portal from Power Apps Portals admin center.

Power Apps portals Studio issues


If a portal has page hierarchy of more than three levels, the pages from fourth level onwards are not
displayed in Power Apps portals Studio.
The selected text font size will only be displayed if there is a font size defined specifically for that text. If it is
part of the standard HTML tags such as p, H1, H2, H3, an so on, Power Apps portals Studio will not display
the font size.
Webpage using the Page with side navigation template displays only the link of the pages which existed
during the webpage creation. You can update the links on the left side of the page by changing the page
template to another template and then back to Page with side navigation.
When you delete a webpage, canvas does not reflect the updated menu until the next refresh of canvas.
Color picker and its related strings are supported only in English.
A few template pages on the Employee Self Service portal are not able to render correct breadcrumb.
A few Power Apps portals templates, especially bound to model-driven apps in Dynamics 365, do not have
default menu items as per their hierarchy of pages. The reason is that there is not page order available in all
or few of the webpages. Any portal without the display order of webpages will have this issue.
An error message is displayed when the page content (page copy) exceeds its limit of 65536 characters and
page summary exceed its default limit of 2000 characters.
Navigation menu is only visible on the canvas with a resolution of minimum width of 1600px.
An image uploaded on a page becomes the child of the page. If you delete the page, and use the image on
another page, the image will not render on Power Apps portals Studio and website.
Form rendering is not currently supported in Power Apps portals Studio. When you add a form, you must
select Browse website to open the website and verify the form.
On a text or a section background, if you change the color to No color, Power Apps portals Studio does not
remove the related attributes such as background color or font color, instead make the values null.
In the following scenarios Power Apps portals Studio ceases to load and shows the "Sorry, there's a
disconnect" error:
If the Home page is deleted or disabled for a portal.
If a page template related to the Home page or any page is disabled or deleted.
Power Apps portals Studio will be unable to load source code of those content snippets which do not have a
language assigned in Common Data Service.
In some instances the changes for header and footer, either through WYSIWYG experience of Power Apps
portals Studio or through the code editor, will not be reflected immediately.
If a webpage is assigned the Search template in Power Apps portals Studio, it will show a simple page with
loader. For this to work, you will have to create an appropriate site marker for that page.
The Default studio template also shows up as an option in page template while creating a new page once it
is used in Power Apps portals Studio. Also, this template is only inserted in English language and it does not
support localization based on default Common Data Service or portal language.
A list rendered as a calendar control or map is not configurable through Power Apps portals Studio.
The Partial URL field in page properties does not accept special characters and it breaks the rendering in the
canvas for some time.
Upload CSS might fail in scenarios where CSS file name contains special characters or space in the file
name.
Unpublished webpages do not render in canvas of Power Apps portals Studio.
While using Power Apps portals Studio, if your portal base language is different than the browser's
language, the new webpages created using the Default studio template will have dummy content inserted in
browser's language instead of portal language.
Only CSS applied at the root page is displayed in the Theme pane. Although, if you try uploading a CSS
file with a same name as any other CSS file available in the portal, Power Apps portals Studio asks you to
replace that file.
Power Apps portals Studio is currently not supported on Safari in Mac operating system and has the
following issues:
The selection of component is not correct and hovering on a component provides incorrect target
indication.
Two or three column sections do not render properly in Power Apps portals Studio but works fine on the
website.
Power Apps portals FAQ
3/5/2020 • 30 minutes to read • Edit Online

We have compiled a list of frequently asked questions and provided brief answers to help you get to your
information quickly.

General
Does Power Apps portals support TLS 1.2?
Power Apps portals version 8.3 and later supports TLS 1.2.
What is the difference between Power Apps portals, Dynamics 365 portals and add-on portals?
With the launch of Power Apps portals on October 1, 2019, Dynamics 365 portals are called as Power Apps
portals. In other words, all portals are referred to as Power Apps portals.
One of the major changes introduced in portals after October 1, 2019 is the licensing model. Earlier, portals were
licensed add-ons to Dynamics 365 apps while certain Dynamics 365 licenses included a default portal add-on.
After October 1, 2019, portals are licensed based on usage. All existing portals will be part of a transition period
based on current customer contract after which they will need to be converted to a new licensing model.
You can check the type of a portal from the Power Apps Portals admin center:

Additional differences between Power Apps portals with capacity-based licenses and add-on based licenses:
For add-on portals, the portal type has 'add-on' suffix added. For example, a production add-on portal type lists
as 'Production (add-on)'.
Power Apps portals have a different caching mechanism in comparison with add-on based licenses portals.
Provisioning method is different for portals with capacity-based licenses from add-on based licenses.
You can create Power Apps portal with capacity-based license using steps described in following articles:
Create a Common Data Service starter portal
Create a portal with Dynamics 365 environment
To create Power Apps portal with add-on based license, see provisioning a portal using portal add-on .
See Power Apps portals licensing FAQ for licensing differences between add-on based licenses and capacity-based
licenses.
When is an add-on portal in suspended state?
Portal provisioned using portal add-on plan purchased earlier is suspended at the end of expiration. This expiration
period is 30 days for trial portals while it may vary for an add-on portal in production with a purchased license.
Suspended trial portal is deleted after 7 days while suspension period may vary for production portal. For more
details, read the portal lifecycle for add-on portals.
How do I redirect a user to a default page after signing in?
You can configure a portal to redirect a user to a default page after signing in. To achieve this functionality, you can
include a JavaScript code in the Home web template.
For example, if you want to redirect all users to the Forums page after signing in, you can include a JavaScript code
in the Home web template as follows:

{% if user %}
//if any user logs in
<script>
window.location.href='./forums/'
</script>
{% else %}
//Home web page code, if you don't want to display the page when the user is being redirected
{% endif %}
//Home web page code, if you want to display the page when the user is being redirected

For more information on working with Liquid templates, see Work with Liquid templates.
I'm getting an error that only one portal can be created.
Currently, you can create only one portal of each type in an environment per language. If you try to create more
than one portal, you'll see an error message as follows:

To create more portals, you must create a new environment using the create new environment link in the error
message. For more information on creating a portal, see Create a portal.
I'm getting an error that I can't delete my portal.
If you don't have sufficient privileges to delete a portal, you'll see an error as follows:
For information on deleting a portal and the required privileges, see Delete a portal.
I'm getting an error that I can't create a portal.
If you don't have sufficient privileges to create a portal in an environment, you'll see an error as follows:

For information on creating a portal and the required privileges, see Create a portal.
I'm getting the message: “Your data isn’t quite ready”.
Sometimes the database creation can take time and the correct status might not reflect on the home page. In this
case you'll see the following message:

If you keep getting the create database prompt or your data isn't quite ready prompt, you can try refreshing the
Power Apps home page before selecting the Portal from blank tile.
I'm getting an error that I don't have required permissions to create Azure Active Directory applications.
When you create a portal, portal as a new application is registered in Azure Active Directory associated with the
tenant. If you don't have sufficient permissions to register an application with your Azure Active Directory tenant,
you'll see an error as follows:
To create and register applications in Azure Active Directory, you must contact your tenant administrator to turn on
the App registrations setting for your tenant. For information, see Required permissions.
I'm getting an error that portal creation is blocked in this tenant by global administrator
If portal creation is blocked in a tenant by your global administrator, you'll see an error as follows:

You must contact your global administrator to enable creation of portals by non-administrators also.
If you are a global administrator, you must disable the disablePortalsCreationByNonAdminUsers tenant level setting
through PowerShell. Run the following command in a PowerShell window (run PowerShell as an administrator).

Set-TenantSettings -RequestBody @{ "disablePortalsCreationByNonAdminUsers" = $false }

More information: Disable portal creation in a tenant


I'm getting an error that I don't have appropriate license to access this website.
Internal users of an organization that use portals for accessing authenticated pages require that licenses be
assigned to the environment that a portal is connected to. You can read more about the user rights for portals for
internal users here. When an environment does not have licenses assigned, internal users will get an error such as
follows:

Licensing and provisioning


How do I get a portal subscription?
Power Apps portals are now available completely standalone inside of Power Apps. You no longer need to acquire
license to provision a portal. User access to the portal requires license depending on persona type. Read more
details at Power Apps portals licensing FAQ.
How do I change the audience and type of a portal after it is provisioned?
After you have provisioned a portal, the option to change the portal audience is disabled.
However, you can change the audience and type of portal after it is provisioned by following the steps in Change
the Dynamics 365 instance, audience, or type of portal.

NOTE
It is recommended to reset and provision your portal again to change the audience, type of portal, organization, and so
on. More information: Reset a portal
The changing of Dynamics 365 instance is applicable only to the portals provisioned using the older portal add-ons.

How do I change the base URL of a portal after it is provisioned?


You can change the base URL of a portal after it is provisioned by following the steps in Change the base URL of a
portal.
How do I delete a portal completely after it is provisioned?
Portals consists of the following components:
Portal website host: Portal website host is the Portal code that forms the actual website.
Portal solutions: Solutions that are installed in the Common Data Service environment and contain the
metadata entities for any portal.
To delete a portal completely requires deleting the Portal website host as well as uninstalling Portal solutions from
your Common Data Service environment.
To reset the portal host, follow the steps in Reset a portal. It is important to note that resetting a portal host doesn't
affect the configuration done in your Common Data Service environment.
To delete portal solutions, you will have to delete solutions from the Dynamics 365 solution explorer UI. The order
in which Portal solutions should be uninstalled is provided in Uninstalling Portal Solutions.

Common Data Service environment lifecycle


We recently moved our Common Data Service environment from one geolocation or tenant to another. How do
we handle portals connected to our organization?
When you move your Common Data Service environment from one geolocation or tenant to another, associated
portals to that organization will not move automatically. Also, since your organization has moved, any portal
associated with that organization will not work and will throw an error on startup.
To associate your portal again to relevant organizations:
1. Reset your existing portal host from the existing geolocation or tenant by following the steps in Reset a
portal. This will delete your associated portal resources and the portal URL will not be accessible after the
operation completes.
2. Once your existing portal is reset, go to the new tenant (or to the new geolocation of the existing tenant)
and provision a portal available there.
After restoring a Common Data Service environment from an old backup, the portal connected to the
organization is not working. How do we fix it?
When a Common Data Service environment is restored from a backup, various changes are done in your
organization that can break your portal's connection with the organization. To fix this issue:
If the organization ID is the same after the restore operation and portal solutions are also available:
1. Open Power Apps Portals admin center.
2. Go to the Portal Details tab.
3. In the Portal State drop-down list, choose Off.
4. Select Update.
5. Once the update operation is complete, set the Portal State drop-down list to On and then select Update.
Your portal will be restarted and a connection will be created with the organization again.
If the organization ID is different after the restore operation or portal solutions are deleted from your
organization:
In this case, it is better to reset the portal by following the steps in Reset a portal and then reprovision it.
We recently changed the URL of our Common Data Service environment and our portal stopped working. How
do we fix it?
When you change the URL of your Common Data Service environment, your portal will stop working because it
cannot identify the Common Data Service environment URL anymore. To fix this issue:
1. Open Power Apps Portals admin center.
2. Go to Portal Actions > Update Dynamics 365 URL.
3. Follow the instructions in the wizard.
Your portal will be restarted and start working again.

Debugging and fixing problems


Performance of entity forms: Actions such as create/update/delete on entity forms take a lot of time to
complete or timeout.
This can happen due to multiple reason depending on your data and customizations done on that entity within
Common Data Service. When troubleshooting such performance related issue on record actions from portals,
ensure that there are no synchronous plugins registered on those events that may possibly cause these delays.
Wherever possible, try to implement them asynchronously so that they do not hold or delay the transaction.
When accessing my portal, I see a generic error page. How can I see the actual error?
Whenever a server error occurs while trying to render a portal, a generic error page is displayed to end users
along with the timestamp and activity ID of the error. Portal administrators can configure their portal to get the
actual error details, which are helpful in debugging and fixing issues. To see the actual error:
Disable the custom error page on the portal: This will turn off the custom error page and will allow you to
see the complete stack trace of any error when navigating to that page. You can disable the custom error by
following the steps in Disable custom error.
It is advisable to use this only when you are developing a portal. Once your portal is live for your users, you should
enable custom errors again. More information: View portal error logs
Enable diagnostic logging: This will allow you to get all the portal errors in an Azure Blob storage account.
You can enable diagnostic logging by following the steps in Access portal error logs.
When you enable diagnostic logging, you can search for particular errors that users report by using the Activity ID
shown on the generic error page. The Activity ID is logged along with the error details and is useful to find the
actual issue.

Portal administration and management


Do portals use any static content from CDNs (Content Delivery Network) that I need to whitelist?
Yes. Power Apps portals uses out of the box portal's static assets from Azure CDN that includes default JavaScript
and CSS files for presentation that earlier rendered as part of the portal app. You must whitelist the following CDN
URL to render portals successfully:

https://content.powerapps.com/resource/powerappsportal

NOTE
Power Apps portals hosted in Microsoft Government Cloud do not use CDN.

How do I use a custom login provider on my portal?


Portals supports any custom login provider that provides support for standard authentication protocols. We
support OpenIdConnect, SAML2, and WS -Federation protocols for any custom IDP. OAuth 2 is supported only
for a fixed set of known IDPs. For more information on how to set up an IDP configuration, see Configure portal
authentication.
How do I get new portal releases in my sandbox portal first before it gets applied to production?
Any portal release is done in two phases: early upgrade and general availability (GA). During the early upgrade
phase, we only upgrade portals that are marked for early upgrade. To get a new portal release in your sandbox
(development or test) environment, you can enable your portal for early upgrade. For information on how to
enable a portal for early upgrade, see Upgrade a portal.
How do I use a custom domain name for my portal?
You can enable your portal to use a custom domain name in place of the standard microsoftcrmportals.com
domain name. More information: Link your portal to a custom domain

Portal checker
Portal does not load and displays a generic error page (Server Error in "/" application)
This issue can be caused by a variety of reasons like when a portal is not able to connect to the underlying
Common Data Service environment, Common Data Service environment doesn't exist or its URL has changed,
when request to Common Data Service environment is timed out, and so on. When you run the portal checker
tool, it will try to determine the exact reason and will point you to the correct mitigation.
Below is a list of most common causes and their corresponding mitigation steps:
URL of the connected Common Data Service environment has changed
This happens when the URL of Common Data Service environment is changed by a user after portal is
provisioned against the organization. To fix this issue, update the Dynamics 365 URL:
1. Open Power Apps Portals admin center.
2. Go to Portal Actions > Update Dynamics 365 URL. Once this action is successfully executed, your Common
Data Service environment URL will be updated and portal will start working.
Common Data Service environment connected to your portal is in administration mode
This issue occurs when the Common Data Service environment is put in administration mode either when
changing organization from production to sandbox mode or manually by an organization administrator.
If this is the cause, you can disable administration mode by performing actions listed here. Once administration
mode is disabled, portal will work fine.
Authentication connection between Common Data Service environment and portal is broken
This issue occurs when the authentication connection between Dynamic 365 organization and portal is broken
because either Common Data Service environment was restored from a backup or was deleted and recreated from
a backup. To fix this issue:
1. Open Power Apps Portals admin center.
2. In the Portal Details tab, select Off from the Portal State list.
3. Select Update.
4. Select On from the Portal State list.
5. Select Update. The portal restarts and will be able to make authentication connection.
However, in certain situations especially if the organization ID has changed after the restore operation (or if you
reprovisioned the organization), these mitigation steps will not work. In those situations, you can reset and
reprovision the portal against the same instance. For information on how to reset a portal, see Reset a portal.
Request to Common Data Service environment has timed out
This issue is typically a transient issue which can occur if the API requests to your Common Data Service
environment has timed out. This issue will automatically mitigate itself once the API requests starts working. To
mitigate this issue, you can also try restarting the portal:
1. Open Power Apps Portals admin center.
2. Go to Portal Actions > Restart.
If restarting the portal doesn't work and this issue is occurring for a long period of time, please contact Microsoft
support for help.
Website binding not found
This issue occurs when the website binding records for portal are deleted from the underlying Common Data
Service environment and portal is not able to create binding automatically. To fix this issue:
1. Open the Portal Management app.
2. Go to Portals > Website Bindings.
3. Delete all the website binding records which are pointing to your portal. The Sitename field helps you to
identify website binding records of your portal.
4. After you delete all website binding records, restart the portal.
Once you complete the above steps, your portal will restart and will recreate website binding record automatically.
However, there are situations in which portal will not be able to recreate website binding record automatically
when the GUID of the website record available in your instance is different than the one created during default
installation of portal. In this situation, perform the following steps:
1. Delete all website binding records pertaining to your portal.
2. Create a website binding record manually with following values:
Name: Can be any string
Website: Select the website record which you want to be rendered on portal
Sitename: Type in the hostname of your portal i.e Portal URL without https:// in the beginning. If your Portal is
using custom domain name, then use custom domain name here.
Leave all other fields blank.
3. Once website binding record is recreated, restart your portal from Power Apps Portals admin center.
An unexpected error has occurred while trying to connect to your Common Data Service environment
This situation can arise due to some unexpected issue. To mitigate in this situation, you can either try resetting or
reprovisioning the portal. For information on how to reset a portal, see Reset a portal.
If portal reset and reprovision doesn't solve this issue, please reach out to Microsoft support for help.
Portal is not displaying updated data from Common Data Service environment
Any data displayed on portal is rendered from the portal cache. This cache gets updated whenever data in
Common Data Service environment is updated. However, this process is asynchronous and can take upto 15
minutes. If the changes are made in the metadata entity of portal, for example, web pages, web files, content
snippet, site setting, and so on, it is advised to clear cache manually or restart the portal from Power Apps Portals
admin center. For information on how to clear cache, see Clear the server-side cache for a portal.
However, if you are seeing stale data for a long time in non-portal metadata entities, it can be because of variety of
issues listed below:
Entities not enabled for cache invalidation
If you are seeing stale data only for certain entities and not for everything, this can be because the Change
Tracking metadata is not enabled on that specific entity.
If you run the Portal checker (self-service diagnostic) tool, it will list down Object Type code of all the entities which
are referenced on portal in entity list or entity forms and web forms and are not enabled for change tracking.
Browse your metadata by using the steps mentioned at Browse the metadata for your organization
If you are experiencing stale data issue in any of these entities, you can enable change tracking by using Power
Apps Portals admin center. UI or Dynamics 365 API. More information: Enable change tracking for an entity
Organization not enabled for change tracking
Apart from each entity being enabled for change tracking, organizations on a whole has to be enabled for change
tracking as well. An organization is enabled for change tracking when a portal provisioning request is submitted.
However, this can break if an organization is restored from an old database or reset. To fix this issue:
1. Open Power Apps Portals admin center.
2. In the Portal Details tab, select Off from the Portal State list.
3. Select Update.
4. Select On from the Portal State list.
5. Select Update. The portal restarts and will be able to make authentication connection.
Performance best practices
Performance issues in portals can be caused by a variety of configuration issues. All the out-of-the-box portal
templates are tested for a variety of load conditions and configurations which can affect portal performance and
below is the list of common portal configurations which can lead to performance issues in your portal.
Portal checker (self-service diagnostic) tool will also point out these issues by looking at your portal configuration.
Web page tracking enabled
Enabling a portal web page for page tracking can lead to performance issues in your portal. This functionality is
deprecated since January 2018 release of Dynamics 365 Portals. More information: Dynamics 365 Portals:
Deprecated Features
The portal checker tool will list all the web pages (both root and content page) which are enabled for page tracking.
These pages should be disabled by following these steps:
1. Open the Portal Management app.
2. Go to Advanced find.
3. Search for all the web pages where Enable Tracking (Deprecated) field is enabled (value is set to Yes).
4. Bulk edit all the pages and set this field to No.
Alternatively, you can also go to each page listed in portal checker result and set the value of Enable Tracking
(Deprecated) field to No. It is important to understand that if you are on Dynamics 365 Portals solution version
9.x, this field will not be displayed on the form and you might need to add it to the form first.
Web file tracking enabled
Enabling a portal web file for page tracking can lead to performance issues in your portal. This functionality is
deprecated since January 2018 release of Dynamics 365 Portals. More information: Dynamics 365 Portals:
Deprecated Features
The portal checker tool will list all the web files which are enabled for page tracking. These files should be disabled
by following these steps:
1. Open the Portal Management app.
2. Go to Advanced find.
3. Search for all the web files where Enable Tracking (Deprecated) field is enabled (value is set to Yes).
4. Bulk edit all the records and set this field to No.
Alternatively, you can also go to each file listed in portal checker result and set the value of Enable Tracking
(Deprecated) field to No. It is important to understand that if you are on Portal solution version 9.x, this field will
not be displayed on the form and you might need to add it to the form first.
Login tracking enabled
Enabling a portal login tracking can lead to performance issues in your portal. This functionality is deprecated
since January 2018 release of Dynamics 365 Portals. More information: Dynamics 365 Portals: Deprecated
Features
The portal checker tool will check if login tracking is enabled for your portal and will show a failed check if it is
enabled. Login tracking should be disabled by following these steps:
1. Open the Portal Management app.
2. Go to Portals > Site Settings.
3. Search for site setting named Authentication/LoginTrackingEnabled .
4. Change the value of this site setting to False or delete the site setting.
5. Restart the portal.
Header output cache is disabled
Disabling header output cache on your portal can lead to performance issues in your portal during high load.
More details around this functionality can be found at: Enable header and footer output caching on a portal
The portal checker tool will check if header output cache is disabled on your portal and will show a failed check if it
is disabled. To enable it:
1. Open the Portal Management app.
2. Go to Portals > Site Settings.
3. Search for site setting named Header/OutputCache/Enabled .
4. If the site setting is available, change the value of Site setting to True. If the site setting is not available, create a
new site setting with this name and set its value to True.
5. Restart the portal.
Footer output cache is disabled
Disabling footer output cache on your portal can lead to performance issues in your portal during high load. More
details around this functionality can be found at: Enable header and footer output caching on a portal
The portal checker tool will check if footer output cache is disabled on your portal and will show a failed check if it
is disabled. To enable it:
1. Open the Portal Management app.
2. Go to Portals > Site Settings.
3. Search for site setting named Footer/OutputCache/Enabled .
4. If the site setting is available, change the value of Site setting to True. If the site setting is not available, create a
new site setting with this name and set its value to True.
5. Restart the portal.
Large number of web file records
The web file entity is used by a portal to store any static files you want to use on your portal. Main use case of this
entity is to store static content of your website like CSS, JavaScript, image files, and so on. However, having many
such files can cause slowness during the startup of your portal.
The portal checker tool will check for this scenario and will provide you an indication if you have more than 500
active web files in your portal. If all of these files represent static content like CSS, JavaScript, image files, and so
on, you can take following actions to mitigate this issue.
Use an external file server like Azure blob storage or CDN to store these files and then reference these files
on the appropriate pages either within the page or in underlying template.
If you cannot move files outside, the ensure that all the files are not loaded along with home page. A web
file is loaded along with home page if the parent page of that file is set to home. To avoid this scenario, you
can perform the following steps:
1. Create a dummy web page with no content and a blank template. This page would be used to create a
direct path to your web files.
2. For all the web files which are not needed on home page, change the parent page to this dummy
webpage. Once done, full path to your web file would be Portal URL/{dummy_webpage}/{web file}
3. Reference your web file directly in the HTML of the page template or web template of the page where
you want to use it. This will load your file on demand on that page.
Loading static resources (css/js ) asynchronously
When working on portal implementation, it is important to understand that you completely manage the HTML of
the page which means standard web development practices should be followed to ensure that your webpage's
client side performance is not impacted.
One of the most common cause of performance issues on webpages is loading a lot of static resources (css/js)
synchronously on the load of the page. Synchronous loading of large no of css/js files can lead to long client-side
processing time for your webpages.
In case of portals, whenever you are associating a web file directly to the home page, it creates a dependency in the
generated HTML which means that web file always loaded along with the home page. If this web file is a css/js file,
this would be loaded synchronously and can slow down your client-side processing time.
To avoid this, you can perform the following steps:
1. If a web file is not needed on the home page, make sure its parent page is not set as home page and reuse the
mechanism described above to load it on demand.
2. While loading a JavaScript file on demand on any page, use <async> or <defer> HTML attribute to load the
file asynchronously.
3. While loading a CSS file on demand, you can use <preload> HTML attribute
(https://www.w3.org/TR/preload/) or JavaScript based approach since preload is not supported on all the
browsers yet.
Entity form lookup configuration
Enabling a lookup to render as a drop-down mode in entity forms or web forms can be performance intensive if
the amount of records shown in the drop-down exceed 200 and are changed frequently. This option should only be
used for static lookups, such as country list and state list, having a limited number of records.
If this option is enabled for lookups which can have large number of records, it will slow down the load time of the
webpage on which entity form is available. If this page is used by a lot of users and is loaded a lot of times, it can
slow down the whole website and the website resources would be used to render this page. For these situations,
full lookup experience should be used or a custom HTML control which calls an AJAX endpoint (created using web
templates) should be built for the desired look and feel.
Number of web roles
Web roles are used in portals to enable role-based access control. Typically, the number of web roles in a portal are
limited as the number of different combinations of permissions would be limited as well. If the number of web
roles exceed 100 in your portal, it can cause performance issues which can affect all pages of your portal.
An active Home site marker is not available for this portal
This issue occurs when the Home site marker is not available in your portal configuration. To fix this issue:
1. Open the Portal Management app.
2. In the left pane, select Site Markers.
3. Create a new site marker with following values:
Name: Home
Website: Select the website of your portal host.
Page: Select the webpage record that is set as the home page of your portal.
The Home site marker is not pointing to any webpage
This issue occurs when the Home site marker is available but is not pointing to any webpage. To fix this issue:
1. Open the Portal Management app.
2. In the left pane, select Site Markers.
3. Find the Home site marker record.
4. Update the Page field to point to an active home page of your portal.
The Home site marker is pointing to a deactivated web page
This issue occurs when the Home site marker is available, but is pointing to a deactivated webpage. To fix this
issue:
1. Open the Portal Management app.
2. In the left pane, select Site Markers.
3. Find the Home site marker record.
4. Update the Page field to point to an active home page of your portal.
The Home site marker is not pointing to home page of the portal
This issue occurs when the Home site marker is available, but is pointing to a webpage that is not a home page of
your portal. To fix this issue:
1. Open the Portal Management app.
2. In the left pane, select Site Markers.
3. Find the Home site marker record.
4. Update the Page field to point to an active home page of your portal.
An active Profile site marker is not available for this portal
This issue occurs when the Profile site marker is not available in your portal configuration. To fix this issue:
1. Open the Portal Management app.
2. In the left pane, select Site Markers.
3. Create a new site marker with following values:
Name: Profile
Website: Select the website of your portal host.
Page: Select the webpage record that is set as the profile page of your portal.
The Profile site marker is not pointing to any webpage
This issue occurs when the Profile site marker is available but is not pointing to any webpage. To fix this issue:
1. Open the Portal Management app.
2. In the left pane, select Site Markers.
3. Find the Profile site marker record.
4. Update the Page field to point to an active profile page of your portal.
The Profile site marker is pointing to a deactivated web page
This issue occurs when the Profile site marker is available, but is pointing to a deactivated webpage. To fix this
issue:
1. Open the Portal Management app.
2. In the left pane, select Site Markers.
3. Find the Profile site marker record.
4. Update the Page field to point to an active profile page of your portal.
An active Page Not Found site marker is not available for this portal
This issue occurs when the Page Not Found site marker is not available in your portal configuration. To fix this
issue:
1. Open the Portal Management app.
2. In the left pane, select Site Markers.
3. Create a new site marker with following values:
Name: Page Not Found
Website: Select the website of your portal host.
Page: Select the webpage record that is set as the Page Not Found page of your portal.
The Page Not Found site marker is not pointing to any webpage
This issue occurs when the Page Not Found site marker is available but is not pointing to any webpage. To fix this
issue:
1. Open the Portal Management app.
2. In the left pane, select Site Markers.
3. Find the Page Not Found site marker record.
4. Update the Page field to point to an active Page Not Found page of your portal.
The Page Not Found site marker is pointing to a deactivated web page
This issue occurs when the Page Not Found site marker is available, but is pointing to a deactivated webpage. To
fix this issue:
1. Open the Portal Management app.
2. In the left pane, select Site Markers.
3. Find the Page Not Found site marker record.
4. Update the Page field to point to an active Page Not Found page of your portal.
An active Access Denied site marker is not available for this portal
This issue occurs when the Access Denied site marker is not available in your portal configuration. To fix this
issue:
1. Open the Portal Management app.
2. In the left pane, select Site Markers.
3. Create a new site marker with following values:
Name: Access Denied
Website: Select the website of your portal host.
Page: Select the webpage record that is set as the Access Denied page of your portal.
The Access Denied site marker is not pointing to any webpage
This issue occurs when the Access Denied site marker is available but is not pointing to any webpage. To fix this
issue:
1. Open the Portal Management app.
2. In the left pane, select Site Markers.
3. Find the Access Denied site marker record.
4. Update the Page field to point to an active Access Denied page of your portal.
The Access Denied site marker is pointing to a deactivated web page
This issue occurs when the Access Denied site marker is available, but is pointing to a deactivated webpage (root
or content page can be deactivated). To fix this issue:
1. Open the Portal Management app.
2. In the left pane, select Site Markers.
3. Find the Access Denied site marker record.
4. Update the Page field to point to an active Access Denied page of your portal.
Profile web form is not available for contact entity
Profile page is one of the common pages used in your portal for all profile related issues. This page shows a form
that can be used by users to update their profile. Form used on this page comes from the Profile Web Page main
form available in the Contact entity. This form is created in your Common Data Service environment when portal
is provisioned. This error is displayed when the Profile web form is either deleted or disabled in your portal. This
form is mandatory and deleting or disabling this form can break the whole website displaying runtime error on
portal. This is an irreparable state and requires portal to be reinstalled in the environment.
Published state is not available for this website
To fix this issue, ensure that the publishing state entity Published is available and active.
Published state is not visible
To fix this issue, ensure that the publishing state entity Published has the isVisible check box is selected.
List of entities with search result having invalid URL
To fix this issue, ensure that your entity has appropriate security permission.
List of entities with CMS security check failed
To fix this issue, ensure that your entity has proper search page.
Web file is not active
To fix this issue, ensure that the web file is in active state.
The partial URL of web file is misconfigured
To fix this issue, ensure that the partial URL is the file name with Home as the root page.
Web file doesn't have a file attachment
To fix this issue, add the corresponding CSS file in the notes section of the web file.
File attachment doesn't have content
To fix this issue, add the CSS file with entire content in the notes section of the web file.
MIME type of file is not text/css
To fix this issue, ensure that there are no plugins or flows which overrides the MIME type of the CSS file(s).
Legacy Adxstudio Portals v7 FAQ
1/23/2020 • 2 minutes to read • Edit Online

We have compiled a list of frequently asked questions about changes coming for legacy Adxstudio Portals v7.
Click here to download the FAQ.
What is Common Data Service?
3/14/2020 • 6 minutes to read • Edit Online

Common Data Service lets you securely store and manage data that's used by business applications. Data within
Common Data Service is stored within a set of entities. An entity is a set of records used to store data, similar to
how a table stores data within a database. Common Data Service includes a base set of standard entities that
cover typical scenarios, but you can also create custom entities specific to your organization and populate them
with data using Power Query. App makers can then use Power Apps to build rich applications using this data.

For information on purchasing a plan to use Common Data Service, see Pricing info.

Why use Common Data Service?


Standard and custom entities within Common Data Service provide a secure and cloud-based storage option for
your data. Entities let you create a business-focused definition of your organization's data for use within apps. If
you're not sure if entities are your best option, consider these benefits:
Easy to manage – Both the metadata and data are stored in the cloud. You don't need to worry about the
details of how they're stored.
Easy to secure – Data is securely stored so that users can see it only if you grant them access. Role-based
security allows you to control access to entities for different users within your organization.
Access your Dynamics 365 Data – Data from your Dynamics 365 applications is also stored within the
Common Data Service allowing you to quickly build apps which leverage your Dynamics 365 data and extend
your apps using Power Apps.
Rich metadata – Data types and relationships are leveraged directly within Power Apps.
Logic and validation – Define calculated fields, business rules, workflows, and business process flows to
ensure data quality and drive business processes.
Productivity tools – Entities are available within the add-ins for Microsoft Excel to increase productivity and
ensure data accessibility.

Dynamics 365 and Common Data Service


Dynamics 365 applications, such as Dynamics 365 Sales, Dynamics 365 Customer Service or Dynamics 365
Talent, also use the Common Data Service to store and secure data used by the applications. This enables you to
build apps using Power Apps and the Common Data Service directly against your core business data already used
within Dynamics 365 without the need for integration.
Build Apps against your Dynamics 365 Data – Build apps quickly against your business data within
Power Apps or using the Pro Developer SDK.
Manage reusable Business logic and rules – Business Rules and logic already defined in your Dynamics
365 entities are applied to your Power Apps to ensure data consistency regardless of how your users are
accessing the data or through which app.
Reusable skills across Dynamics 365 and Power Apps – Users with skills previously in Power Apps or
Dynamics 365 can now leverage those skills across the Common Data Service platform. Creating entities,
forms, charts, etc are now common across your applications.

NOTE
Finance and Operations apps currently requires the configuration of the Data Integrator to make your business data
from Finance and Operations apps available in Common Data Service.

Integrating Data into the Common Data Service


Building an app typically involves data from more than one source, while this can sometimes be done at the
application level, there are also cases where integrating this data together into a common store allows for an
easier app building experience, and a single set of logic to maintain and operate over the data. Common Data
Service allows data to be integrated from multiple sources into a single store which can then be used in Power
Apps, Power Automate, Power BI, and Power Virtual Agents along with data already available from the Dynamics
365 applications.
Scheduled integration with other systems – Data which is kept within another application can be regularly
synchronized with the Common Data Service to allow you to leverage other applications data in Power Apps.
Transform and import data using PowerQuery – Transforming data when importing into the Common
Data Service can be done through PowerQuery from many online data sources, a common tool used across
Excel and Power BI.
One time import of data – Simple import and export of Excel and CSV files can be used for a one time or
infrequent import of data into the Common Data Service.
For more information about integrating data into the Common Data Service, see Add data to an entity in
Common Data Service by using Power Query.

Interacting with entities


When you develop an app, you can use standard entities, custom entities, or both. Common Data Service provides
standard entities by default. These are designed, in accordance with best practices, to capture the most common
concepts and scenarios within an organization.
For a full list of entities, see the Entity reference.
You can extend the functionality of standard entities by creating one or more custom entities to store information
that's unique to your organization. For more information, see How to create a custom entity.

Logic and validation


Entities within Common Data Service can leverage rich server-side logic and validation to ensure data quality and
reduce repetitive code in each app that creates and uses data within an entity.
Business rules validate data across multiple fields and entities and provide warning and error messages,
regardless of the app used to create the data. For more information, see Create a business rule.
Business process flows guide users to ensure they enter data consistently and follow the same steps every
time. Business process flows are currently only supported for Model driven apps. For more information, see
Business process flows overview.
Workflows allow you to automate business processes without user interaction. For more information, see
Workflows overview.
Business logic with code supports advanced developer scenarios to extend the application directly through
code. For more information, see Apply business logic with code.

Security
Common Data Service has a rich security model to protect the data integrity and privacy of users while promoting
efficient data access and collaboration. You can combine business units, role-based security, record-based security,
and field-based security to define the overall access to information that users have in a Common Data Service
environment. More information: Security in Common Data Service

Developer capabilities
In addition to the features available through the Power Apps portal, Common Data Service also includes features
for developers to programmatically access metadata and data to create entities and business logic, as well as
interact with data. For more information, see Common Data Service Developer Overview

Next steps
To get started using Common Data Service:
Create a canvas app using a Common Data Service database.
Create a custom entity and then create a canvas app that uses the entity.
Create a model-driven app built on Common Data Service.
Use Power Query to connect to an online or on-premises data source and import the data directly into
Common Data Service.

Privacy notice
With the Microsoft Power Apps common data model, Microsoft collects and stores custom entity and field names
in our diagnostic systems. We use this knowledge to improve the common data model for our customers. The
entity and field names that app Creators create help us understand scenarios that are common across the
Microsoft Power Apps community and ascertain gaps in the service's standard entity coverage, such as schemas
related to organizations. The data in the database tables associated with these entities is not accessed or used by
Microsoft or replicated outside of the region in which the database is provisioned. Note, however, that the custom
entity and field names may be replicated across regions and are deleted in accordance with our data retention
policies. Microsoft is committed to your privacy as described further in our Trust Center.
Entity overview
12/2/2019 • 2 minutes to read • Edit Online

Entities are used to model and manage business data. When you develop an app, you can use standard entities,
custom entities, or both. Common Data Service provides standard entities by default. These are designed, in
accordance with best practices, to capture the most common concepts and scenarios within an organization.

See also
Create a custom entity
Types of entities
Create a custom entity
12/24/2019 • 6 minutes to read • Edit Online

In Power Apps, an entity defines information that you want to track in the form of records, which typically include
properties such as company name, location, products, email, and phone. You can then surface that data by
developing an app that refers to the entity. Power Apps offers standard "out-of-the-box" entities to cover typical
scenarios within an organization (such as tracking appointments), but there may be times when you need to
create custom entities to store data that's specific to your organization.
In this topic, you'll learn how to create a custom entity called Product Review that you can use to create an app
that displays ratings and comments for products that your company sells.

Prerequisites
To follow this procedure, you must have either a System Administrator or System Customizer security role within
Common Data Service.

Sign in to Power Apps


Sign in to Power Apps at https://make.powerapps.com.

Create an entity
1. In the navigation pane, click or tap Data to expand it, and then click or tap Entities.

2. in the command bar, click or tap New entity.


Before you create an entity, check out the entity reference for a description of available standard entities.
These entities cover typical scenarios. If one of these entities meets your requirements as is or after minor
changes, you can save time by starting with that entity.
3. In the New entity panel, do the following:
a. In the Display name box, enter Product review.
Observe that the following boxes are autopopulated as you enter a display name:
Plural display name - This box is autopopulated when you enter a display name, but you can
change it if needed. The plural display name is the name of the entity in the Common Data Service
WebAPI and is used when interacting with this entity from Power Apps or Flow.
Name - This box is also autopopulated when you enter a display name. The prefix was set up when
the environment was created and ensures that the entities you create can be exported and
imported into other environments without conflicting with other entity names. You can change this
prefix by updating the prefix on your Publisher for the Common Data Service Default Solution. To
keep existing apps from breaking, you cannot change the name after saving the entity.

NOTE
In order for the entity name to work with Dynamics 365 for Customer Service embedded knowledge search,
the maximum entity name length including the publisher prefix can’t exceed 24 characters.

b. In the Primary Field section, in the Display name box, replace Name with Product Review.
By default, every entity contains a Primary Field, which is used by lookup fields when establishing
relationships with other entities. Typically the primary field stores the name or primary description of the
data stored in the entity. You may update the name and display name of the primary field before saving
the entity for the first time.
Also, observe that the primary field also has its own Name box, which functions similarly to the entity
name described above. The primary field name is autopopulated when a display name is entered, uses the
same prefix as the entity, and cannot be changed after the entity is created.
c. Open the More settings section and expand the Description accordion. You may enter a description
for your entity if you wish (descriptions are helpful if other people will use this entity).
d. Select Activity entity option from the Choose entity type drop-down list to enable an entity as an
activity.
e. Ensure Display in Activity menus check box is selected. This option ensures the activity is made
available in the activity menu.

NOTE
Ensure to the Display in Activity menus option before you create the entity.

f. Expand Create and update settings and select the Enable quick create forms check box. This option
ensures, you can use the quick create form to crete a record.
g. When you're done, click Create.
4. On the entity details page, observe that the entity is now being provisioned in the background. Once
provisioning is completed, your entity will be saved and available for use in apps. Fields, relationships, and
keys can be added to your entity at any time (even while provisioning is still in progress), but views, forms,
charts, dashboards, and business rules can only be added to the entity after provisioning is completed.

5. Under the Fields tab, observe the Primary Field that you named in the previous step. Click or tap the
Primary Field field to open the Primary Field panel if you would like to make any additional
customizations to the field. Notice that the Name can no longer be changed, since the entity has already
been saved.
6. To add a field to the entity, do the following:
a. In the command bar, click or tap Add field to open the Field properties panel.
b. In the Display name box, enter Review Date.
c. From the Data type drop-down list, select Date Only.
d. Click or tap the Required check box.
e. Click or tap Done.
For more information, see Manage fields in an entity.

7. Repeat the previous step to add three more fields with the following configurations:
Display name = Product Rating; Data type = Whole Number; click or tap Required check box
Display name = Reviewer Name; Data type = Text
Display name = Reviewer Comment; Data type = Text
When you're done, you should have five fields listed on your entity details page.

Note that all entities have read-only system fields. By default, system fields are not shown in the list of
fields even though they exist in the entity. To see all fields, change the filter on the command bar from
Default to All. For more information on the metadata related to an entity, see Entity metadata.
8. Click Save Entity to save the latest changes to your entity.
The Product Review entity should appear in the list of entities in your database. If you don't see it, change
the filter in the command bar from Default to Custom.
Next steps
In this topic, you learned how to create a custom entity called Product Review that can be used to create an app
that displays ratings and comments for each product sold by a particular company. Next, learn how to define
relationships between entities (in this case between the standard Product entity and your custom Product Review
entity) so you can associate each product with the reviews and comments it receives.
Create a relationship

Privacy notice
With the Microsoft Power Apps common data model, Microsoft collects and stores custom entity and field
names in our diagnostic systems. We use this knowledge to improve the common data model for our customers.
The entity and field names that app Creators create help us understand scenarios that are common across the
Microsoft Power Apps community and ascertain gaps in the service’s standard entity coverage, such as schemas
related to organizations. The data in the database tables associated with these entities is not accessed or used by
Microsoft or replicated outside of the region in which the database is provisioned. Note, however, that the custom
entity and field names may be replicated across regions and are deleted in accordance with our data retention
policies. Microsoft is committed to your privacy as described further in our Trust Center.
Create a custom entity that has components in Power
Apps
12/3/2019 • 3 minutes to read • Edit Online

With Power Apps you tailor your app to closely fit your organization’s industry, nomenclature, and unique business
processes. Power Apps app development includes adding standard "out-of-box" entities or creating custom entities.
An entity defines the information you want to track in the form of records, which typically include properties such
as company name, location, products, email, and phone.
In this topic you create an entity and then add or customize key components such as fields, relationships, views,
and forms. You learn how to:
Create a custom entity
Add custom fields to your entity
Add an entity relationship
Customize a view
Customize a form
The topic will follow the company, Contoso, which is a pet grooming business that grooms dogs and cats. Contoso
needs an app for client and pet tracking that can be used by employees across a variety of devices.

Prerequisites
Sign in to Power Apps. If you don’t already have a Power Apps account, select the Get started free link from
powerapps.com.

Create a custom entity


1. On the left navigation pane expand Data, select Entities, and then select New entity.

2. In the right pane, enter the following values, and then select Next.
Display name: Pet
Description: Custom entity to track pet services
3. Select Save Entity.

Add and customize fields


1. In the list of entities, select the Pet entity that was created in the previous section.
2. On the Fields tab, select the Pet field.
3. In the right pane make the following changes to the Display name field:
Change the Display name from Pet to Pet Name
Select Searchable

3. Select Done.
4. On the Fields tab on the entity designer toolbar select Add field. On the Field properties pane, enter or select
the following values and options.
Display name. Species
Data type. Option Set
Option set. New option set
5. Create the option set
a. Select Add new item.
b. Replace New option with Dog.
c. Select Add new item.
d. Replace New option with Cat.
e. Select Save.

6. Select Searchable, and then select Done.


7. On the entity designer toolbar select Add field. On the Field properties pane, enter or select the following
values, and then select Done.
Display name. Breed
Data type. Text
Searchable. Yes
8. On the entity designer toolbar select Add field.
9. On the Field properties pane, enter or select the following values, and then select Done.
Display name. Appointment date
Data type. Date and time
10. Select Save Entity.

Add a relationship
1. Select the Relationships tab, on the entity designer toolbar select Add relationship, and then select Many-to-
one.
2. On the right pane, in the Related list select Account.
3. Select Done.
4. Select Save Entity.
Notice that when you add a many-to-one relationship, an Account field with the data type Lookup is
automatically added to your list of fields on the Fields tab.

Customize a view
1. Select the Views tab, and then select the Active Pets view. If you don't see the Active Pets view, select
Remove filter.
2. On the view designer select Add Columns, select the following columns, and then select OK.
Account
Appointment date
Breed
Species
3. Select the Created On column, select Remove, and then select OK to confirm the column removal.
4. To arrange the columns, select the column you want to move and then use the <- and -> arrow buttons until
your view looks like this.

5. On the view designer toolbar, select Save and Close.

Model-driven apps only: Customize the main form


Skip this step if you only want to use the Pet entity in a canvas app.
1. On the left navigation pane, expand Data, select Entities, and then select Pet.
2. Select the Forms tab, and then select Information next to the Main form type to open the form editor.
3. On the form editor, drag and drop the Species, Breed, Appointment date, and Account fields located on the
Field Explorer pane on to the General section of the form canvas until the form looks like this.

4. Select Save.
5. Select Publish.
6. Select Save and close to close the form designer.

Add the custom entity to an app


Now your entity is ready to be used to build either a canvas or model-driven app.

Next steps
In this topic, you learned how to create an entity that can be used to create a useful app.
To learn how to create a model-driven app, see Build your first model-driven app.
To learn how to create a canvas app, see Create an app from scratch.
Entities and metadata in Common Data Service
3/22/2019 • 5 minutes to read • Edit Online

Common Data Service is designed so that you can quickly and easily create a data model for your application.
Normally, you shouldn't have to concern yourself with some of the details about metadata that this topic will
introduce. But if you want to develop a deeper understanding about how apps that use Common Data Service
work or you are evaluating what is possible, understanding the metadata used by Common Data Service may
provide you insight.
Metadata means data about data. Common Data Service provides a flexible platform for you because it is
relatively easy to edit the definitions of the data that the environment will use. In Common Data Service, the
metadata is a collection of entities. Entities describe the kinds of data which is stored in the database. Each entity
corresponds to a database table and each field (also known as attribute) within an entity represents a column in
that table. Entity metadata is what controls the kinds of records you can create and what kind of actions can be
performed on them. When you use the customization tools to create or edit entities, fields, and entity relationships,
you are editing this metadata.
Different clients people use to interact with the data in your environment depend on the entity metadata and adapt
as you customize the metadata. But these clients also depend on other data to control what visual elements to
display, any custom logic to apply, and how to apply security. This system data is also stored within entities but the
entities themselves are not available for customization.
You can learn about standard entities, attributes, and entity relationships included by default in Common Data
Service by reviewing the Entity Reference.

TIP
The designers available to edit metadata cannot show all the details found in the metadata. You can install a model-driven
app called the Metadata Browser which will allow you to view all the entities and metadata properties that are found in the
system. More information: Browse the metadata for your environment.

Create new metadata or use existing metadata?


Common Data Service comes with a number of standard entities that support core business application
capabilities. For example, data about your customers or potential customers is intended to be stored using the
account or contact entities.
Each of these entities also contain a number of fields that represent common data that the system may need to
store for the respective entity.
For most organizations it is to your advantage to use the standard entities and attributes for the purposes they
were provided.
If you install a solution you can expect that the solution developer has leveraged the standard entities and
attributes. Creating a new custom entity that replaces a system entity or attribute will mean that any solutions
available may not work for your organization.
For these reasons, we recommend that you look for and use the provided standard entities, fields, and entity
relationships when they make sense for your organization. If they don’t make sense and can’t be edited to match
your need, you should evaluate if creating a new entity, field, or entity relationships is required.
Remember that you can change the display name of an entity so that it matches the nomenclature your
organization uses. For example, it is very common for people to change the display name of the Account entity to
Company or the name of the Contact entity to Individual. This can be done to entities or attributes without
changing the behavior of the entity. For more information about renaming entities, see Change the name of an
entity.
You can’t delete standard entities, fields, or entity relationships. They are considered part of the system solution
and every organization is expected to have them. If you want to hide a standard entity, change the security role
privileges for your organization to remove the read privilege for that entity. This will remove the entity from most
parts of the application. If there is a system field that you don’t need, remove it from the form and any views that
use it. Change the Searchable value in the field and entity relationship definitions so that they do not appear in
advanced find.

Limitations on creating metadata items


There is a limit to the number of entities you can create. You can find information about the maximum number in
the Settings > Administration > Resources In Use page. If you need more custom entities, contact technical
support. This upper limit can be adjusted.
Within each entity there is an upper limit on the number of fields you can create. This limit is based on the
technical limitations on the amount of data that can be stored in a row of a database table. It is difficult to provide a
specific number because each type of field can use a different amount of space. The upper limit depends on the
total space used by all the fields for the entity.
Most people do not create enough custom fields to reach the limit, but if you find yourself planning to add
hundreds of custom fields to an entity, you should consider if this is the best design. Do all the fields you plan to
add describe properties for a record for that entity? Do you really expect that people using your organization will
be able to manage a form that includes such a high number of fields? The number of fields you add to a form
increase the amount of data that has to be transferred each time a record is edited and will affect the performance
of the system. Take these factors into consideration when you are adding custom fields to an entity.
Option set fields provide a set of options that will be displayed in a drop-down control on a form or in picklist
control when using advanced find. Your environment can support thousands of options within an Option set, but
you shouldn’t consider this as the upper limit. Usability studies have shown that people have trouble using a
system where a drop-down control provides large numbers of options. Use option set field to define categories for
data. Don’t use option set fields to select categories that actually represent separate items of data. For example,
rather than maintain an option set field that stores each of hundreds of possible manufacturers of a type of
equipment, consider creating an entity that stores references to each manufacturer and use a lookup field instead
of an option set.

Next steps
Create or edit entities (record types)
Create and edit relationships between entities
Types of entities
2/12/2020 • 3 minutes to read • Edit Online

Before creating or editing entities in Common Data Service, you should understand that there are different types
of entities. Once a custom entity is created, these types cannot be changed. The two major divisions are based on
entity ownership and whether the entities are activity entities.

Entity ownership
There are four different types of entity ownership. When you create a custom entity the only options are user or
team owned or organization-owned, but you should be aware that other entities have different ownership
types.

OWNERSHIP DESCRIPTION

Business-owned Data in these entities belongs to the Business unit. Access to


the data can be controlled at the business unit level.

None Data not owned by another entity.

Organization-owned Data belongs to the organization. Access to the data is


controlled at the organization level.

User or Team Owned Data belongs to a user or a team. Actions that can be
performed on these records can be controlled on a user level.

IMPORTANT
After an entity is created, you can’t change the ownership. Before you create an entity, make sure that you choose the
correct type of ownership. If you later determine that your custom entity must be of a different type, you have to delete it
and create a new one.

Activity entities
An activity can be thought of as any action for which an entry can be made on a calendar. An activity has time
dimensions (start time, stop time, due date, and duration) that help determine when the action occurred or will
occur. Activities also contain data that helps determine what action the activity represents, for example, subject and
description. An activity can be opened, canceled, or completed. The completed status of an activity will have several
sub-status values associated with it to clarify the way that the activity was completed.
Activity entities can only be owned by a user or team, they can’t be owned by an organization.
The following table lists activity entities that are available in a default Common Data Service environment.

NAME DESCRIPTION DISPLAY IN ACTIVITY MENUS REFERENCE

Appointment Commitment representing a Yes Appointment


time interval with start/end
times and duration.
NAME DESCRIPTION DISPLAY IN ACTIVITY MENUS REFERENCE

Email Activity that is delivered Yes Email


using email protocols.

Fax Activity that tracks call Yes Fax


outcome and number of
pages for a fax and
optionally stores an
electronic copy of the
document.

Letter Activity that tracks the Yes Letter


delivery of a letter. The
activity can contain the
electronic copy of the letter.

Phone Call Activity to track a telephone Yes PhoneCall


call.

Recurring Appointment The master appointment of Yes RecurringAppointmentMaste


a recurring appointment r
series.

Task Generic activity representing Yes Task


work needed to be done.

You can create new custom activity entities. For example you might create a custom activity entity to record instant
message communications. Creating an activity entity is different from creating a non-activity entity because you
don’t specify a primary field. All activity entities have a Primary Field set to Subject and other common fields
that are defined by the Activity entity. This allows all types of activities to be shown in a view where just the
common fields are displayed.
To create a custom activity entity, open the More settings section in the New entity panel, select Activity entity
option from the Choose entity type drop-down list. After you select this, you’ll see that Display in Activity
Menus is selected. This setting allows people to create this type of activity in the activity menus. This isn’t selected
for activities that are typically associated with specific events and created behind using code or by a workflow. After
you save the entity, you can’t change these settings.
See also
Create or edit entities
Create and edit entities in Common Data Service
2/12/2020 • 3 minutes to read • Edit Online

Before you create a custom entity, evaluate whether using an existing entity will meet your requirements. More
information: Create new metadata or use existing metadata?
There are two designers you can use to create an entity:

DESIGNER DESCRIPTION

Power Apps portal Provides an easy streamlined experience, but some special
settings are not available.
More information:
Tutorial: Create a custom entity that has components in
Power Apps
Create and edit entities using Power Apps portal

Solution explorer Not as easy, but provides for more flexibility for less common
requirements.
More information Create and edit entities using solution
explorer

NOTE
You can also create entities in your environment using the following:
Import a solution that contains the definition of the entity.
Use Power Query to create new entities and fill them with data. More information: Add data to an entity in the
Common Data Service by using Power Query.
A developer can use Metadata services to write a program.

Entity options not available in the Power Apps portal


Information in this topic will help you choose which designer you can use. You can use the Power Apps portal to
create the entity unless you need to address any of the following requirements.
Control the customization prefix
Part of the name of any custom entity you create is the customization prefix. This is set based on the
solution publisher for the solution you’re working in. If you care about the customization prefix, make sure
that you are working in an unmanaged solution where the customization prefix is the one you want for this
entity. More information Change the solution publisher prefix.
Change the icons for a custom entity
By default, all custom entities in the model-driven apps have the same icons. You can create image web
resources for the icons you want for your custom entities. More information: Change icons for custom
entities.
Change any of the following properties that can only be enabled:
OPTION DESCRIPTION

Activities Associate activities to records for this entity.

Business process flows Create business process flows for this entity. More
information: Create a business process flow to
standardize processes

Connections Use the connections feature to show how records for this
entity have connections to records of other entities that
also have connections enabled.

Feedback Let customers write feedback for any entity record, or


rate entity records within a defined rating range. More
information: Enable an entity for feedback/ratings

Notes Append notes to records for this entity. Notes include the
ability to add attachments.

Queues Use the entity with queues. Queues improve routing and
sharing of work by making records for this entity available
in a central place that everyone can access.

Sending email Send emails using an email address stored in one of the
fields for this entity. If a Single Line of Text field with
format set to email doesn’t already exist for this entity, a
new one will be created when you enable sending email.

Change any of the following properties:

OPTION DESCRIPTION

Areas that display this entity In the web application choose one of the available
sitemap areas to display this entity. This does not apply to
model-driven apps.

Auditing When auditing is enabled for your organization, this


allows for changes to entity records to be captured over
time. When you enable auditing for an entity, auditing is
also enabled on all its fields. You can select or clear fields
that you want to enable auditing on.

Color Set a color to be used for the entity in model-driven apps.

Document management After other tasks have been performed to enable


document management for your organization, enabling
this feature allows for this entity to participate in
integration with SharePoint.

Enable for mobile Make this entity available to the Dynamics 365 for
phones and tablets apps. You also have the option to
make this entity Read-only in mobile.

If the forms for an entity require an extension not


supported in Dynamics 365 for phones and tablets apps
use this setting to ensure that mobile app users can’t edit
the data for these entities.
OPTION DESCRIPTION

Enable for phone express Make this entity available to the Dynamics 365 for
phones app.

Reading pane in Dynamics 365 for Outlook Whether the entity will be visible in the reading pane for
the Dynamics 365 for Outlook app.

Use custom Help When enabled, set a Help URL to control what page users
will see when they click the help button in the application.
Use this to provide guidance specific to your company
processes for the entity.

See also
Create and edit entities using solution explorer
Tutorial: Create a custom entity that has components in Power Apps
Edit an entity
Developer Documentation: Create a custom entity
Edit an entity
12/2/2019 • 6 minutes to read • Edit Online

You can edit any custom entity that you create. Standard entities or managed custom entities may have limitations
about changes you can make.

NOTE
Standard entities are common entities that are included with your environment that are not System or Custom entities.
Managed custom entities are entities that have been added to the system by importing a managed solution. The degree to
which you can edit these entities is determined by the managed properties set for each entity. Any properties that can’t be
edited will be disabled.

There are two ways to edit an entity using a designer:

DESIGNER DESCRIPTION

Power Apps portal Provides an easy streamlined experience, but some special
settings are not available.

Solution explorer Not as easy, but provides for more flexibility for less common
requirements.

In both the Power Apps portal and solution explorer you can perform the following:
Edit the entity fields. More information: Create and edit fields for Common Data Service
Edit the entity relationships. More information: Create and edit relationships between entities
Keys. Define alternate keys to reference records
You can also make changes to records that support the entity:
Business Rules. More information: Create business rules and recommendations to apply logic in a form
Views. More information: Create or edit a view
Forms. More information: Create and design forms
Dashboards. More information: Create or edit dashboards
Charts. Create or edit a system chart

Edit using Power Apps portal designer


Within the Power Apps portal designer there are only three entity properties you can edit:
Display name
Plural display name
Description
In the designer, select the entity you want to edit and click it to open the entity designer. To modify the entity
properties, click the Settings command to view the Edit entity form as shown below:
NOTE
The name of many standard entities may also be used in other text in the application. To locate and change text where this
name was used, see Edit standard entity messages

For any other changes to entity options, you must edit the entity using solution explorer.

Edit using Solution Explorer


When editing an entity using the solution explorer you need to find the unmanaged solution that you want to add
it to.
Navigate to an unmanaged solution
1. From the Power Apps portal select Solutions, and then on the toolbar, select Switch to classic.
2. In the All Solutions list select the unmanaged solution you want.

Change the name of an entity


Use the Display Name and Plural Name properties to change the name of the entity in the application.

NOTE
The name of many standard entities may also be used in other text in the application. To locate and change text where this
name was used, see Edit standard entity messages

Change the icons used for custom entities


By default, all custom entities in the web application have the same icons. You can create image web resources for
the icons you want for your custom entities. More information: Change icons for custom entities.
Entity options that can only be enabled
The following table lists the options that you can enable for an entity, but after these items are enabled, they can’t
be disabled:

OPTION DESCRIPTION

Activities Associate activities to records for this entity.

Business process flows Create business process flows for this entity. More
information: Create a business process flow to standardize
processes

Connections Use the connections feature to show how records for this
entity have connections to records of other entities that also
have connections enabled.

Feedback Let customers write feedback for any entity record, or rate
entity records within a defined rating range. More
information: Enable an entity for feedback/ratings

Notes Append notes to records for this entity. Notes include the
ability to add attachments.

Queues Use the entity with queues. Queues improve routing and
sharing of work by making records for this entity available in a
central place that everyone can access.

Sending email Send emails using an email address stored in one of the fields
for this entity. If a Single Line of Text field with format set to
email doesn’t already exist for this entity, a new one will be
created when you enable sending email.

Enable or disable entity options


The following table lists the entity options that you can enable or disable at any time.

OPTION DESCRIPTION

Access Teams Create team templates for this entity.

Allow quick create After you have created and published a Quick Create Form
for this entity, people will have the option to create a new
record using the Create button in the navigation pane. More
information: Create and design forms

When this is enabled for a custom activity entity, the custom


activity will be visible in the group of activity entities when
people use the Create button in the navigation pane.
However, because activities don’t support quick create forms,
the main form will be used when the custom entity icon is
clicked.

Areas that display this entity In the web application choose one of the available sitemap
areas to display this entity. This does not apply to model-
driven apps.
OPTION DESCRIPTION

Auditing When auditing is enabled for your organization, this allows for
changes to entity records to be captured over time. When
you enable auditing for an entity, auditing is also enabled on
all its fields. You can select or clear fields that you want to
enable auditing on.

Change Tracking Enables data synchronization in a performant way by


detecting what data has changed since the data was initially
extracted or last synchronized.

Color Set a color to be used for the entity in model-driven apps.

Description Provide a meaningful description of the purpose of the entity.

Document management After other tasks have been performed to enable document
management for your organization, enabling this feature
allows for this entity to participate in integration with
SharePoint.

Duplicate Detection If duplicate detection is enabled for your organization,


enabling this allows you to create duplicate detection rules for
this entity.

Enable for mobile Make this entity available to the Dynamics 365 for phones
and tablets apps. You also have the option to make this entity
Read-only in mobile.

If the forms for an entity require an extension not supported


in Dynamics 365 for phones and tablets apps use this setting
to ensure that mobile app users can’t edit the data for these
entities.

Enable for phone express Make this entity available to the Dynamics 365 for phones
app.

Mail merge People can use this entity with mail merge.

Offline capability for Dynamics 365 for Outlook Whether data in this entity will be available while the
Dynamics 365 for Outlook application is not connected to the
network.

Primary Image System entities that support images will already have an
Image field. You can choose whether to display data in this
field as the image for the record by setting this field to
[None] or Default Image.

For custom entities you must first create an image field. Each
entity can have only one image field. After you create one,
you can change this setting to set the primary image. More
information: Image fields

Reading pane in Dynamics 365 for Outlook Whether the entity will be visible in the reading pane for the
Dynamics 365 for Outlook app.
OPTION DESCRIPTION

Use custom Help When enabled, set a Help URL to control what page users will
see when they click the help button in the application. Use
this to provide guidance specific to your company processes
for the entity.

See also
Create an entity
Create and edit entities using solution explorer
Create and edit virtual entities that contain data from
an external data source
12/2/2019 • 7 minutes to read • Edit Online

A virtual entity is a custom entity in Common Data Service that has fields containing data from an external data
source. Virtual entities appear in your app to users as regular entity records, but contain data that is sourced from
an external database, such as an Azure SQL Database. Records based on virtual entities are available in all clients
including custom clients developed using the Common Data Service web services.
In the past, to integrate the disparate data sources you would need to create a connector to move data or develop
a custom plug-in, either client or server-side. However, with virtual entities you can connect directly with an
external data source at runtime so that specific data from the external data source is available in an environment,
without the need for data replication.
Virtual entities are made up of three main components, a data provider, a data source record, and a virtual entity.
The data provider consists of plug-ins and a data source entity. The data source is an entity record in Common
Data Service, which includes metadata that represents the schema of the connection parameters. Each virtual
entity references a data source in the entity definition.
Common Data Service includes an OData Data Provider that you can use to connect with an OData v4 web
service that accesses the external data.
Alternatively, developers can build their own data providers. Data providers are installed in an environment as a
solution. More Information: Developer Documentation: Get started with virtual entities
Virtual entity benefits
Developers can implement plugins to read external data using the Common Data Service web services and
Plug-in Registration tool.
System customizers use Power Apps solution explorer to configure the data source record and create virtual
entities that are used to access external data without writing any code.
End users work with the records created by the virtual entity to view the data in fields, grids, search results, and
Fetch XML -based reports and dashboards.

Add a data source to use for virtual entities


Developers create a custom plug-in to use as the data provider for a virtual entity. Alternatively, you can use the
provided OData v4 Data Provider. More information: OData v4 Data Provider configuration, requirements, and
best practices
1. Go to Settings > Administration > Virtual Entity Data Sources.
2. On the actions toolbar, select New.
3. On the Select Data Provider dialog box, select from the following data sources, and then select OK.

DATA PROVIDER DESCRIPTION

Custom data provider If you've imported a data provider plug-in, the data
provider will appear here. More Information Developer
Documentation: Get started with virtual entities

OData v4 Data Provider Common Data Service includes an OData Data Provider
that can be used with OData v4 web services. More
Information OData v4 Data Provider configuration,
requirements, and best practices

Add a secured field to a Data Source


You create fields for a Data Source in the same way as any other entity. For data that is encrypted or sensitive,
enable the Data Source Secret attribute on the custom field of the Data Source. For example, to secure a field that
contains a database connection string.

NOTE
The Data Source Secret attribute is only available with fields added to a Data Source form.
Create a virtual entity
You create a virtual entity just like any other entity in Common Data Service with the addition of a few extra
attributes described here. Virtual entities must be created using solution explorer.

NOTE
Although you can create a virtual entity by selecting None as the data source, to acquire data a virtual entity requires a data
source. More Information Add a data source to use for virtual entities

Open solution explorer


Part of the name of any virtual entity you create is the customization prefix. This is set based on the solution
publisher for the solution you’re working in. If you care about the customization prefix, make sure that you are
working in an unmanaged solution where the customization prefix is the one you want for this virtual entity. More
information: Change the solution publisher prefix
Navigate to an unmanaged solution
1. From the Power Apps portal select Solutions, and then on the toolbar, select Switch to classic.
2. In the All Solutions list select the unmanaged solution you want.
Create a virtual entity
1. In solution explorer, create a new entity. To do this, select Entities in the left navigation pane, and then select
New.
2. On the General tab of the Entity Definition, select Virtual Entity, and then in the Data Source drop
down list, select the data source that you want.
3. On the Entity Definition, complete the following required fields.

FIELD DESCRIPTION

External Name Enter the name of the table in the external data source
this entity maps to.

External Collection Name Enter the plural name of the table in the external data
source this entity maps to.

Here's an example of a virtual entity named Movie that uses a Azure Cosmos DB data provider to access
document files.

IMPORTANT
Several options, such as Access Teams, Queues, and Quick Create, aren't available with virtual entities. More
Information Considerations when you use virtual entities

Complete the additional required and optional properties, such as display and plural names, as necessary.
For more information about these properties, see Create and edit entities.
4. Create and add one or more fields for the virtual entity. In addition to the standard field properties required
to create a custom field, these optional properties are available for each custom field you create for a virtual
entity.

FIELD DESCRIPTION
FIELD DESCRIPTION

External Name This is typically the unique name to identify the data you
want to display in the field.

External Type Name If the field type you create is OptionSet: This property
maps to the external name of the set of values in the
external service for the option set. Typically, this can be an
enum or name of a string value class. The External Type
Name can be used when a fully qualified name is required.
For example, as the Type Name with OData where
parameters in a query need the fully qualified name, such
as [Type Name].[Value].

External Value If the field type you create is OptionSet: This property
maps to the corresponding value in the external data
source for the option set item. This value entered is used
to determine which option set item to display in the app.

Complete the additional properties as necessary. For more information about these properties, see Create
and edit fields.
5. Select Save and Close on the Field properties page.
6. On the solution explorer toolbar, select Save.
7. On the solution explorer toolbar, select Publish.
8. Close solution explorer.

Considerations when you use virtual entities


Virtual entities have these restrictions.
All virtual entities are read-only.
Existing entities cannot be converted to virtual entities.
By default, virtual entities contain only a Name and Id field. No other system managed fields, such as Status or
Created On/Modified On are supported.
Virtual entities don't support custom fields with the Currency, Image, or Customer data types.
Virtual entities don't support auditing.
Virtual entity fields can't be used in rollups or calculated fields.
A virtual entity can't be an activity type of entity.
Many features that affect entity table rows cannot be enabled with virtual entities. Examples include queues,
knowledge management, SLAs, duplicate detection, change tracking, mobile offline capability, field security,
Relevance Search, Portals for Dynamics 365 web portal solutions, and N:N relationships between virtual
entities.
Virtual entities are organization owned and don't support the row -level Common Data Service security
concepts. We recommend that you implement your own security model for the external data source.
We recommend that you target a single data source when you use virtual entities in Advanced Finds. For
example, creating an Advanced Find that ultimately creates a join between the Common Data Service native
data and the virtual entity external data isn't supported.
Field metadata properties that validate on update don’t apply to virtual entities. For example, a Whole Number
field on a virtual entity field may be set to have a minimum value of zero. However, since the value is coming
from an external data source, a query will return values less than zero when retrieved from a virtual entity. The
minimum value property is not implied in the query. You would still need to filter the values to be greater than
0 if that’s what is desired.
Virtual entities don't support change tracking and cannot be synchronized by using a Common Data Service
feature, such as the Data Export Service.
See also
OData v4 Data Provider requirements and best practices
Create and edit entities
Create and edit fields
OData v4 Data Provider configuration, requirements,
and best practices
11/4/2019 • 3 minutes to read • Edit Online

This topic describes how to configure the OData v4 Data Provider as well as the requirements and recommended
best practices for using the OData v4 data provider to connect with an OData v4 web service.

OData v4 data provider best practices


Common Data Service requires that all entities have an ID attribute, this ID is known as a unique identifier and
the value must be a guid. You can only map ID fields to external fields with the Edm.Guid data type. You can’t
map an Edm.Int32 data type to a Unique Identifier data type field in Common Data Service.
OData entities with nullable properties must be set to match the mapped field in the virtual entity. For example,
an OData entity property with Nullable=False must have the mapped field in Common Data Service Field
Requirement attribute set to Business Required.
For retrieve multiple queries, such as when you load data in to a grid, control the size of the dataset returned
from the external data source by using the select and filter query parameters.
If not already enabled, system administrators should enable plug-in tracing. Once enabled, all errors from the
OData endpoint are captured in the plug-in trace log. More information: Administrator Guide: System Settings
dialog box - Customization tab

Data type mapping


The following table lists the OData Entity Data Model (EDM ) data type mappings with Common Data Service data
types.

ODATA DATA TYPE COMMON DATA SERVICE DATA TYPE

Edm.Boolean Two Options

Edm.DateTime Date and Time

Edm.DateTimeOffset Date and Time

Edm.Decimal Decimal Number or Currency

Edm.Double Floating Point Number

Edm.Guid Unique Identifier

Edm.Int32 Whole Number

Edm.Int64 Whole Number

Edm.String Single Line of Text or Multiple Lines of Text

OData EDM data types that are not supported for mapping with virtual entities
Edm.Binary
Edm.Time
Edm.Float
Edm.Single
Edm.Int16
Edm.Byte
Edm.SByte

Add a data source using the OData v4 Data Provider


This procedure shows you how to use the out-of-box OData Data Provider to use as the virtual entity data source.
1. Go to Settings > Administration > Virtual Entity Data Sources.
2. On the actions toolbar, click New.
3. On the Select Data Provider dialog box, select from the following data sources, and then click OK.
OData v4 Data Provider. Common Data Service includes an Odata v4 data provider that can be used
to connect to data sources that support the OData v4 open standard.
Custom data provider. If you've imported a data provider plug-in, the data provider will appear here.
More information: Developer Documentation: Get started with virtual entities
4. On the New Data Source properties page, complete the following fields, and then save the record.
Name. Type a name that describes the data source.
Uri. If you are using the OData Data Provider, enter the uri for the OData web service. For example, if
you are using the OData provider to connect to a web service hosted in Azure, the URI can look similar
to https://contosodataservice.azurewebsites.net/odata/ .
Timeout in seconds. Enter the number of seconds to wait for a response from the web service before a
data request time-out. For example, enter 30 to wait a maximum of thirty seconds before a time-out
occurs.
Pagination mode. Select whether to use client-side or server-side paging to control how query results
are paged. The default value is client-side paging. With server-side paging, the server controls how
results are paged by using the $skiptoken parameter, which is added to the query string. More
information: Skip Token System Query Option ($skiptoken)
Return inline count. Returns the total number records in the result set. This setting is used to
enable next page functionality when you return data to a grid. Use a value of false if your OData
endpoint doesn't support the OData $inlinecount parameter. The default value is false.
Request Parameters. Optionally, you can add custom header or query string parameters used to
connect to the OData web service, such as authentication parameters to the external service. Click
Query String to toggle between header and query string parameter and value. Up to 10 header or
query strings can be added.
See also
Create and edit virtual entities that contain data from an external data source
TechNet Blog: Interact with data from external systems using the new virtual entities
Define alternate keys using Power Apps portal
2/12/2020 • 2 minutes to read • Edit Online

The Power Apps portal provides an easy way to view and create entity alternate keys with the Common Data
Service.
The portal enables configuring the most common options, but certain options can only be set using solution
explorer.
More information:
Define alternate keys to reference records
Define alternate keys using solution explorer

View alternate keys


1. From the Power Apps portal, select Data > Entities and select the entity that you want to view.
2. Select Keys to view a list of any alternate keys that are defined.

Create an alternate key


1. While viewing alternate keys, select Add key.
2. Use the panel to set a Display name and choose the fields to use to create the alternate key.
The Name field will be populated based on the display name.
3. Select Done to close the panel.
4. Click Save Entity to create the alternate key.

NOTE
The alternate key will not be immediately available. A system job is initiated when you save the entity to create database
indexes to support the alternate key.

Delete an alternate key


While viewing alternate keys, select the key you want to delete and choose Delete Key from the command bar.
See also
Define alternate keys to reference records
Define alternate keys using solution explorer
Developer Documentation: Define alternate keys for an entity
Define alternate keys using solution explorer
12/2/2019 • 2 minutes to read • Edit Online

Solution explorer provides one way to view and create alternate keys for Common Data Service.
The Power Apps portal enables configuring the most common options, but certain options can only be set using
solution explorer.
More information:
Define alternate keys to reference records
Define alternate keys using Power Apps portal

Open solution explorer


Part of the name of any alternate key you create is the customization prefix. This is set based on the solution
publisher for the solution you’re working in. If you care about the customization prefix, make sure that you are
working in an unmanaged solution where the customization prefix is the one you want for this entity. More
information: Change the solution publisher prefix
Navigate to an unmanaged solution
1. From the Power Apps portal select Solutions, and then on the toolbar, select Switch to classic.
2. In the All Solutions list select the unmanaged solution you want.

View alternate keys


1. With solution explorer open, under Components expand Entities and select the entity where you want to
view alternate keys.
2. Expand the entity and select Keys.

Create an alternate key


1. While viewing alternate keys, select New.
2. On the form, enter the Display Name. The Name field will be auto-populated based on the Display Name.
3. From the Available Attributes list, select each attribute and then Add > to move the attribute into the
Selected Attributes list.

4. Select OK to close the form.


(Optional) View the system job tracking creation of indexes
1. While viewing alternate keys after you have created a new alternate key you will see a row for the key you
created.
2. In the System Job column you will find a link to the system job that monitors the creation of the indexes to
support the alternate key.
This system job will have a name that follows this pattern: Create index for {0} for entity {1} where 0
is the Display Name of the alternate key and 1 is the name of the entity.
The link to the system job will not be displayed after the system job completes successfully. More
information: Monitor and manage system jobs

Delete an alternate key


While viewing alternate keys, select .
See also
Define alternate keys to reference records
Define alternate keys using Power Apps portal
Developer Documentation: Define alternate keys for an entity
Create and edit entities using Power Apps portal
2/12/2020 • 4 minutes to read • Edit Online

The Power Apps portal provides an easy way to create and edit entities for Common Data Service.
The portal enables configuring the most common options, but certain options can only be set using solution
explorer. More information:
Create and edit entities in Common Data Service
Create and edit entities using solution explorer

View entities
1. From the Power Apps portal, select Data > Entities.

You can filter the entities you see using the following views in a list:
VIEW DESCRIPTION

All Shows all the entities

Managed Shows only managed and standard entities

Custom Shows only custom entities

Default Shows only the standard entities

You can also select Group to group entities by the Tags applied to them.

Create an entity
While viewing entities, in the menu bar select New entity. This will open the New entity panel.

Enter data for the following fields

FIELD DESCRIPTION

Display name This is the singular name for the entity


that will be shown in the app. This can
be changed later.
FIELD DESCRIPTION

Plural display name This is the plural name for the entity
that will be shown in the app. This can
be changed later.

Name This field is pre-populated based on the


Display name you enter. It includes the
customization prefix for the Common
Data Service solution publisher. You
cannot change this after the entity is
saved.

Primary Name This is the only field visible at this point. Edit it if you want to change the
Display Nameor Name of the field.

Display name This is the main user-friendly text


identifier for your record (typically a
name or a number). The value of this
field is shown to users when they need
to select from a list of records.

Name This field is pre-populated based on the


Display name you enter. It includes the
customization prefix for the Common
Data Service solution publisher. You
cannot change this after the entity is
saved.

Select Enable Attachments to append notes and files to records for this entity.
Select More settings. These settings are optional for an entity.

FIELD DESCRIPTION

Description Provide a meaningful description of the purpose of the entity.

Entity type and ownership Switch the entity type to Activity Entity to create entities that
can manage tasks. The type of Ownership defines who can
perform operations on a record.

Collaboration Enable features to help users to more easily work together on


this entity.

Create and Update Settings You can enable quick create forms, giving your app a
streamlined data entry experience. Duplicate detection lets
you set duplicate detection policies and create duplicate
detection rules. Change tracking provides a way to keep data
synchronized in a performant way.

Dynamics 365 for Outlook Configure how this entity appears in Outlook.

Select Create to continue, this will close the New entity panel and display the list of fields.
The Primary Name field of the entity is displayed in the list of fields. Select the Primary Name field to edit it if
you want to change the Display Nameor Name of the field. The default values are shown below:
Edit an entity
While viewing entities, select the entity you want to edit.
Select Settings from the menu if you want to edit the Display name, Plural display name or Description for
the entity.

For other items choose from the tabs.


Fields
See Create and edit fields
Relationships
See Create and edit relationships between entities
Business rules
See Create business rules and recommendations to apply logic in a form
Views
See Create or edit a view
Forms
See Create and design forms
Dashboards
See Create or edit dashboards
Charts
See Create a system chart
Keys
See Define alternate keys to reference records
Data
View the data in the entity. Use the Select view menu to choose from available views for the entity or to show all
fields.

Use the Next Page and Previous Page commands at the bottom of the form to see more data.

Delete an entity
As someone with the system administrator security role, you can delete custom entities that aren’t part of a
managed solution.
IMPORTANT
When you delete a custom entity, the database tables that store data for that entity are deleted and all data they contain is
lost. Any associated records that have a parental relationship to the custom entity are also deleted. For more information
about parental relationships, see Create and edit relationships between entities.

NOTE
The only way to recover data from an entity that was deleted is to restore the database from a point before the entity was
deleted. More information: Backup and restore instances

While viewing entities, select the entity and select Delete entity from the menu.

If the entity has dependencies that prevent it from being deleted you will see an error message. To identify and
remove any dependencies, you will need to use the solution explorer. More information Identify entity
dependencies
See also
Create and edit entities in Common Data Service
Create and edit entities using solution explorer
Create and edit entities using solution explorer
2/29/2020 • 9 minutes to read • Edit Online

You can easily create an entity using the Power Apps portal for most common situations, but not all capabilities
are implemented there. When you need to meet the requirements described in Create and edit entities in
Common Data Service, you can achieve them by creating or editing entities using the Solution Explorer.

Open solution explorer


Part of the name of any entity you create is the customization prefix. This is set based on the solution publisher for
the solution you’re working in. If you care about the customization prefix, make sure that you are working in an
unmanaged solution where the customization prefix is the one you want for this entity. More information: Change
the solution publisher prefix
Navigate to an unmanaged solution
1. From the Power Apps portal select Solutions, and then on the toolbar, select Switch to classic.
2. In the All Solutions list select the unmanaged solution you want.

View entities
In the solution explorer Components node, select the Entities node.

Create an Entity
While viewing entities, select New to open the new entity form.
The new entity form has two tabs. The General tab is for entity options. The Primary Field tab is for options
about the special single line of text field that each entity has that defines the text shown when there is a link to
open the entity in a lookup field.
For information about each section see the following:
Configure the primary field
Configure required fields

NOTE
You can also make the entity a custom activity. This choice changes some of the default option values. More information:
Create a custom activity entity

After you have set the required options for the entity, click to create the custom entity.
Configure the primary field
In the Primary Field tab you can usually accept the default values for the primary field, but you have the
following options:

FIELD DESCRIPTION

Display Name Enter the localizable label that will be displayed for this field in
forms and lists. The default value is Name.

Name Set the name used in the system for this field. The default
value is <customization prefix>_name

Maximum Length Enter the maximum length for the field values. The default is
100.
NOTE
These options do not apply if the entity is an activity entity. More information: Create a custom activity entity

Configure required fields


In the General tab, some of the options are required before you can save the entity.

FIELD DESCRIPTION

Display Name This is the singular name for the entity that will be shown in
the app.
This can be changed later.

Plural Name This is the plural name for the entity that will be shown in the
app.
This can be changed later.

Name This field is pre-populated based on the display name you


enter. It includes the solution publisher customization prefix.

Ownership You can choose either user or team-owned or organization


owned. More information: Entity ownership

Edit an entity
While viewing entities, select the entity you want to edit, or continue editing a new entity you have just saved.

NOTE
Standard entities or custom entities that are part of a managed solution may have limitations on changes you can apply. If
the option is not available or is disabled, you are not allowed to make the change.

Set once options


The following options can be set once and cannot be changed after you set them. Take care to only set these
options when you need them.

OPTION DESCRIPTION

Activities Associate activities to records for this entity.

Business process flows Create business process flows for this entity. More
information: Create a business process flow to standardize
processes

Connections Use the connections feature to show how records for this
entity have connections to records of other entities that also
have connections enabled.

Feedback Let customers write feedback for any entity record, or rate
entity records within a defined rating range. More
information: Enable an entity for feedback/ratings

Notes Append notes to records for this entity. Notes include the
ability to add attachments.
OPTION DESCRIPTION

Queues Use the entity with queues. Queues improve routing and
sharing of work by making records for this entity available in
a central place that everyone can access.

Sending email Send emails using an email address stored in one of the fields
for this entity. If a Single Line of Text field with format set to
email doesn’t already exist for this entity, a new one will be
created when you enable sending email.

Options that you can change


The following properties can be changed at any time.

OPTION DESCRIPTION

Access Teams Create team templates for this entity.

Allow quick create After you have created and published a Quick Create Form
for this entity, people will have the option to create a new
record using the Create button in the navigation pane. More
information: Create and design forms

When this is enabled for a custom activity entity, the custom


activity will be visible in the group of activity entities when
people use the Create button in the navigation pane.
However, because activities don’t support quick create forms,
the main form will be used when the custom entity icon is
clicked.

Areas that display this entity In the web application choose one of the available sitemap
areas to display this entity. This does not apply to model-
driven apps.

Auditing When auditing is enabled for your organization, this allows for
changes to entity records to be captured over time. When
you enable auditing for an entity, auditing is also enabled on
all its fields. You can select or clear fields that you want to
enable auditing on.

Change Tracking Enables data synchronization in a performant way by


detecting what data has changed since the data was initially
extracted or last synchronized.

Color Set a color to be used for the entity in model-driven apps.

Description Provide a meaningful description of the purpose of the entity.

Document management After other tasks have been performed to enable document
management for your organization, enabling this feature
allows for this entity to participate in integration with
SharePoint.

Duplicate Detection If duplicate detection is enabled for your organization,


enabling this allows you to create duplicate detection rules for
this entity.
OPTION DESCRIPTION

Enable for mobile Make this entity available to the Dynamics 365 for phones
and tablets apps. You also have the option to make this entity
Read-only in mobile.

If the forms for an entity require an extension not supported


in Dynamics 365 for phones and tablets apps use this setting
to ensure that mobile app users can’t edit the data for these
entities.

Enable for phone express Make this entity available to the Dynamics 365 for phones
app.

Mail merge People can use this entity with mail merge.

Offline capability for Dynamics 365 for Outlook Whether data in this entity will be available while the
Dynamics 365 for Outlook application is not connected to the
network.

Primary Image System entities that support images will already have an
Image field. You can choose whether to display data in this
field as the image for the record by setting this field to
[None] or Default Image.

For custom entities you must first create an image field. Each
entity can have only one image field. After you create one,
you can change this setting to set the primary image. More
information: Image fields

Reading pane in Dynamics 365 for Outlook Whether the entity will be visible in the reading pane for the
Dynamics 365 for Outlook app.

Use custom Help When enabled, set a Help URL to control what page users will
see when they click the help button in the application. Use
this to provide guidance specific to your company processes
for the entity.

You can also make the following changes:


Create and edit fields for Common Data Service
Create and edit relationships between entities
Create and design forms
Create a business process flow to standardize processes

Delete an entity
As someone with the system administrator security role, you can delete custom entities that aren’t part of a
managed solution.

IMPORTANT
When you delete a custom entity, the database tables that store data for that entity are deleted and all data they contain is
lost. Any associated records that have a parental relationship to the custom entity are also deleted. For more information
about parental relationships, see Create and edit relationships between entities.
NOTE
The only way to recover data from an entity that was deleted is to restore the database from a point before the entity was
deleted. More information: Backup and restore instances

While viewing entities, click the command in the toolbar.


While viewing an entity use the delete command in the menu bar.

WARNING
Deleting an entity that contains data will remove all the data. This data can only be retrieved by backup of the database.

NOTE
If there are any entity dependencies you will get a Cannot Delete Component error with a Details link you can use to
discover information about why the entity cannot be deleted. In most cases, this will be because of a dependency that has
to be removed.
There may be more than one dependency blocking the deletion of an entity. This error message may only show the first
one. For an alternate way to discover dependencies, see Identify entity dependencies

Identify entity dependencies


You can identify dependencies that will prevent an entity from being deleted before you try to delete it.
1. In the solution explorer with the entity selected, click Show Dependencies in the command bar.
2. In the dialog window that opens, scroll the list to the right to view the Dependency Type column.

Published dependencies will block deleting an entity. Internal dependencies should be resolved by the system.
3. Remove these published dependencies and you should be able to delete the entity.

NOTE
A very common dependency is that another entity form has a lookup field for the entity you are deleting. Removing the
lookup field from the form will resolve the dependency.
Create custom activity entity
To create the entity as an activity entity, use the same steps described in this topic except select Define as an
activity entity.

An activity entity is a special kind of entity that tracks actions for which an entry can be made on a calendar. More
information: Activity entities.
When you set this option some entity properties are not compatible. An activity entity has to conform to standard
behaviors that all activity entities use.
The primary field Name and Display Name will be set to Subject and you cannot change this.
The following options are set by default and cannot be changed:
Feedback
Notes (includes attachments)
Connections
Queues
Offline capability for Dynamics 365 for Outlook
The following options cannot be set:
Areas that display this entity
Activities
Sending email
Mail Merge
Single record auditing
Multiple record auditing

Create a Virtual Entity


Some options are only used when creating a virtual entity.

OPTION DESCRIPTION

Virtual Entity Whether the entity is a virtual entity.

Data Source The data source for the entity.

More information: Create and edit virtual entities that contain data from an external data source
See also
Create and edit entities in Common Data Service
Tutorial: Create a custom entity that has components in Power Apps
Create a solution
Import or export data from Common Data Service
11/4/2019 • 4 minutes to read • Edit Online

To bulk import and export data from Microsoft Excel or CSV files, use the Get Data from Excel file and Export Data
features for updated Common Data Service environments.
There are two ways that you can import files into entities from Excel or CSV files.

Option 1: Import by creating and modifying a file template


Every entity has required fields that must exist in your input file. We recommend that you create a template. First,
export data from the entity. Use the same file (modified with your data) to import data into the entity. This template
saves time and effort. You won't have to account for the required fields for each entity.
1. Prepare the file template.
a. Export the entity data to the CVS file. Follow the steps in Export data to CSV.
b. Define a plan to make sure data is unique. Use either primary keys or Alternate Keys.
c. Refer to the next section for instructions to make sure data is unique before you import it into an entity.
2. Modify the file with your data.
Copy data from your Excel or CSV file into the template that you just created.
3. Import the file.
a. On powerapps.com, expand the Data section. Select Entities in the left navigation pane.
b. Select the entity that you want to import data into.
c. Select the ellipsis or menu at the top. Select Get Data. Select Get data from Excel.

NOTE
To import data into more than one entity, in the top menu, select Get Data. Select Get data from Excel. Then you
can choose multiple entities and select Next.

d. On the Import data screen, choose whether to import data from an Excel or a CSV file.
e. Select Upload.
f. Choose your file. Follow the prompts to upload your file.

g. After the file is uploaded and Mapping status is green, select Import in the top-right corner. Refer to the
next section to navigate and fix any mapping errors.
h. After the import finishes successfully, you'll see the total number of inserts and updates.

NOTE
Use the Upsert (Update or Insert) logic to either update the record, if it already exists, or to insert a new record.

Option 2: Import by bringing your own source file


If you're an advanced user and know the required fields for a given entity for Common Data Service entities, define
your own Excel or CSV source file. Follow the steps in Import the file.

Navigate mapping errors


If you get mapping errors after you upload your file, select Map status. Take the following steps to inspect and
rectify the field mapping errors.
1. Use the drop-down menu on the right, under Show, to walk through the Unmapped fields, Fields with
error, or Required Fields.

TIP
Depending on whether you get a Warning or an Error, inspect Unmapped fields or Fields with error through the
drop-down menu in Field Mappings.
2. After you resolve all the errors and warnings, select Save Changes in the top-right corner. You'll go back to
the Import Data screen.
3. When the Mapping Status column shows Completed in green, select Import in the top-right corner.
4. When you get the Import completed successfully message, it shows the total inserts and updates.

Ensure uniqueness when you import data into an entity from Excel or
CSV
Common Data Service entities use a primary key to uniquely identify records within a Common Data Service
entity table. The primary key for a Common Data Service entity is a globally unique identifier (GUID ). It forms the
default basis for record identification. Data operations, like importing data into Common Data Service entities,
surface the default primary keys.
Example:
The primary key for an Account entity is accountid.

Sometimes, a primary key might not work when you integrate data from an external source. Use Common Data
Service to define alternate keys that uniquely identify a record in place of the primary key.
Example:
For an Account entity, you might set transactioncurrencyid as an alternate key by using a natural key-based
identification. For example, use US Dollar instead of the GUID value 88c6c893-5b45-e811-a953-000d3a33bcb9
shown previously. You can also choose currency symbol or currency name as keys.

Users can still use primary keys as identifiers after they specify alternate keys. In the preceding sample, the first file
is still valid if GUIDs are valid data.

Export data to CSV


You can do a one-time data export from a standard entity or custom entity. And you can export data from more
than one entity at a time. If you export data from more than one entity, each entity is exported into its own
Microsoft CSV file.
1. On powerapps.com, expand the Data section. Select Entities in the left navigation pane.
2. Select the entity that you want to export data from.
3. Select the ellipsis or menu at the top. Select Export. Select Data.

NOTE
To export data from multiple entities, in the top menu, select Export. Select Data. You can choose multiple entities.

4. After the export finishes successfully, you can Download exported data. This download gives you a link to
the downloadable CSV file.

Unsupported data types


The following data types aren't currently supported.
Timezone
Multiselect option set
Image
Open entity data in Excel
2/12/2020 • 4 minutes to read • Edit Online

By opening entity data in Microsoft Excel, you can quickly and easily view and edit data by using the Microsoft
Power Apps Excel Add-in. The Power Apps Excel Add-in requires Microsoft Excel 2016.

To install the Power Apps Excel Add-in, see Microsoft PowerApps Office Add-in. For more information about how
to add or remove an Office Excel Add-in, see Add or remove add-ins in Excel.

Open entity data in Excel


1. On powerapps.com, expand the Data section and click or tap Entities in the left navigation pane. All the entities
are shown.
2. Click the ellipsis (...) to the right of the entity that you're interested in.
3. Click Open in Excel, and then open the workbook that is generated. This workbook has binding information
for the entity, a pointer to your environment, and a pointer to the Power Apps Excel Add-in.
4. In Excel, click Enable editing to enable the Power Apps Excel Add-in to run. The Excel Add-in runs in a pane on
the right side of the Excel window.
5. If this is the first time that you've run the Power Apps Excel Add-in, click Trust this Add-in to allow the Excel
Add-in to run.
6. If you're prompted to sign in, click Sign in, and then sign in by using the same credentials that you used on
powerapps.com. The Excel Add-in will use a previous sign-in context and automatically sign you in if it can.
Therefore, verify the user name in the upper right of the Excel Add-in.
The Excel Add-in automatically reads the data for the entity that you selected. Note that there will be no data in the
workbook until the Excel Add-in reads it in.
View and refresh data in Excel
After the Excel Add-in reads entity data into the workbook, you can update the data at any time by clicking Refresh
in the Excel Add-in.

Edit data in Excel


You can change entity data as you require and then publish it back by clicking Publish in the Excel Add-in.
To edit a record, select a cell in the worksheet, and then change the cell value.
To add a new record, follow one of these steps:
Click anywhere in the worksheet, and then click New in the Excel Add-in.
Click in the last row of the worksheet, and then press the Tab key until the cursor moves out of the last column
of that row, and a new row is created.
Click in the row immediately below the worksheet and start to enter data in a cell. When you move the focus
out of that cell, the worksheet expands to include the new row.
To delete a record, follow one of these steps:
Right-click the row number next to the worksheet row to delete, and then click Delete.
Right-click in the worksheet row to delete, and then click Delete > Table Rows.

Add or remove columns


You can use the designer to adjust the columns and entities that are automatically added to the worksheet.
1. Enable the data source designer of the Excel Add-in by clicking the Options button (the gear symbol) and then
selecting the Enable design check box.
2. Click Design in the Excel Add-in. All the data sources are listed.
3. Next to the data source, click the Edit button (the pencil symbol).
4. Adjust the list in the Selected fields field as you require:
To add a field from the Available fields field to the Selected fields field, click the field, and then click
Add. Alternatively, double-click the field.
To remove a field from the Selected fields field, click the field, and then click Remove. Alternatively,
double-click the field.
To change the order of fields, click the field in the Selected fields field, and then click Up or Down.
5. Apply your changes to the data source by clicking Update, and then click Done to exit the designer. If you
added a field (column), click Refresh to pull in an updated set of data.

NOTE
Make sure to always include the ID and required fields in your workbook, as you may receive errors when publishing.

NOTE
When adding look up fields, make sure to add both the ID and the Display fields.

Troubleshooting
There are a few issues that can be resolved through some easy steps.
Not all entities support editing and creation of new records, these entities will open in Excel and allow you to
view data but publishing will be disabled.
Look up fields must be edited using the add-in to ensure the correct record is referenced, updating these fields
via copy and past or typing directly into the field is not supported.
If you encounter an issue that isn't described here, contact us via the support pages.

Next steps
Manage fields in an entity
Define relationships between entities
Generate an app by using Common Data Service
Create an app from scratch using Common Data Service
Define alternate keys to reference records
12/2/2019 • 3 minutes to read • Edit Online

Alternate keys provide an efficient and accurate way of integrating data with external systems. It’s essential in
cases when an external system doesn’t store the Globally Unique Identifier (GUID ) IDs that uniquely identify
records in Common Data Service.
A data integration system will use alternate keys to uniquely identify records using one or more entity field values
that represent a unique combination. Each alternate key has a unique name.
For example, to identify an account record with an alternate key, you can use the account number or the account
number field in combination with some other fields which have values that should not change.

NOTE
While you can define alternate keys with Power Apps, they can only be used programmatically in code. To learn more about
using alternate keys programmatically, see:
Developer Documentation: Use an alternate key to create a record
Developer Documentation: Retrieve a record with the Web API using an alternate key

Some of the benefits of the alternate keys feature include:


Faster lookup of the records.
More robust bulk data operations.
Simplified programming with data imported from external systems without record IDs.

Creating an alternate key


There are two designers you can use to create alternate keys:

DESIGNER DESCRIPTION

Power Apps portal Provides an easy streamlined experience, but some options
are not available.
More information: Define alternate keys using Power Apps
portal

Solution explorer Not as easy, but provides for more flexibility for less common
requirements.
More information: Define alternate keys using solution
explorer

NOTE
You can also create an alternate key in your environment using the following:
Import a solution that contains the definition of the alternate key.
A developer can also write code to create them. More information: Developer Documentation: Define alternate keys for
an entity

Information in this topic will help you choose which designer you can use.
You should use the Power Apps portal to create alternate keys unless you need to address any of the following
requirements:
Create an alternate key within a solution other than the Common Data Service default solution
You want to easily track the system job created that tracks the progress of creating the supporting indexes

Limits in creating alternate keys


There are constraints on alternate key creation.
Fields that can be used for alternate keys
Only these kinds of fields can be used to create alternate keys:
Decimal
Whole Number (Integer)
Single line of Text (String)
Date and Time
Lookup
Option Set
Number of keys
You can define up to five different keys for an entity.
Valid key size
When a key is created, the system validates that the key can be supported by the platform, including that the total
key size does not violate SQL -based index constraints like 900 bytes per key and 16 columns per key. If the key
size doesn’t meet the constraints, an error message will be displayed.
Unicode characters in key value
If the data within a field that is used in an alternate key will contain one of the following characters < ,>,*,%,
& , : , / , \\ then patch or upsert actions will not work.

If you only need uniqueness then this approach will work, but if you need to use these keys as part of data
integration then it is best to create the key on fields that won't have data with these characters.

Track the status of the creation of the alternate key


When an alternate key is created it will initiate a system job to create indexes on the database tables to enforce
unique constraints on the fields used by the alternate key. The alternate key will not be in effect until these indexes
are created. Creating these indexes may take some time depending on the amount of data in the system.
The status of the system job determines the state of the alternate key. The alternate key can have the following
states:
Pending
In Progress
Active
Failed
When the system job is completed, the alternate key status is Active and it is available for use.
If the system job fails, locate the system job to view any errors. The system job will have a name that follows this
pattern: Create index for {0} for entity {1} where 0 is the Display Name of the alternate key and 1 is the
name of the entity.
NOTE
If you want to monitor the status of the system job you should use solution explorer to create the index. It will include a
link to the system job so you can monitor it. More information: (Optional) View the system job tracking creation of indexes

See also
Define alternate keys using Power Apps portal
Define alternate keys using solution explorer
Developer Documentation: Define alternate keys for an entity
Developer Documentation: Use an alternate key to create a record
Define status reason transitions for the Case or
custom entities
12/2/2019 • 2 minutes to read • Edit Online

You can specify status reason transitions for the Incident (Case) entity or a custom entity.

NOTE
Although the Incident (Case) entity isn't included in a default Common Data Service environment, it is used by Dynamics 365
for Customer Service and defined within the Common Data Model

Status reason transitions are an optional additional level of filtering to define what the status reason value can be
changed to for each status reason. Defining a limited list of valid options can make it easier for people to choose
the correct next status reason for a record when you have a large number of combinations for valid status reason
values.

What is the connection between Status and Status Reason fields?


Entities that can have different status values have two fields that capture this data:

DISPLAY NAME DESCRIPTION

Status Represents the state of the record. Typically Active or


Inactive. You cannot add new status options.

Status Reason Represents a reason that is linked to a specific status. Each


status must have at least one possible status reason. You can
add additional status reason options.

The metadata for the field defines what status values are valid for a given state. For example, for the Incident
(Case) entity, the default status and status reason options are:

STATUS STATUS REASON

Active In Progress
On Hold
Waiting for Details
Researching

Resolved Problem Solved


Information Provided

Canceled Canceled
Merged

Edit status reason transitions


You can modify the status reason field options for the Case entity and custom entities to define which other status
reason options people can choose. The only restriction is that each status reason option for an active status must
allow at least one path to an inactive status. Otherwise you could create a condition where it would not be possible
to resolve or cancel the case.

NOTE
Editing the status reason transitions requires using solution explorer. See Create and edit fields for Common Data Service
using Power Apps solution explorer for information about how to edit fields.

When you edit a status reason field the Edit Status Reason Transitions button is in the menu.

When you click this button the Status Reason Transitions dialog provides the option to choose Enable Status
Reason Transitions. When this option is selected you must define which other status reason values are allowed
for each status reason. To remove the filtering applied, remove the Enable Status Reason Transitions selection.
The transitions you have defined will be kept but not applied.
The screenshot below provides an example that meets the following requirements:
A case can be merged at any time. You will not be able to merge cases if a status reason transition does not
allow for it.
An active case can be canceled at any time.
A resolved or canceled case cannot be reactivated.
All cases must pass through the following stages: In Progress > On Hold > Waiting for Details >
Researching before they can be resolved. With this configuration, a case could not be set to an earlier status.

NOTE
This is not a good example for real work, but it demonstrates how stages of status can be enforced through status
reason transitions.

See Also
Create and edit fields for Common Data Service using Power Apps solution explorer
Entity metadata > Entity states
Define custom state model transitions
Delete a custom entity
12/3/2019 • 2 minutes to read • Edit Online

You can delete custom entities, but you can't delete standard entities.
1. On powerapps.com, expand the Data section and click or tap Entities in the left navigation pane.

2. In the list of entities, click or tap the entity to delete, and then click or tap the Delete entity option from the
command bar.
3. In the dialog box that appears, click or tap Delete to delete the entity.

NOTE
When you delete an entity, you delete both the entity definition and all data that the entity contains. Entities and the data
within them cannot be recovered if deleted.

NOTE
You might break an app or flow if you delete an entity that is used in that app.

NOTE
If entity A has lookup fields to entity B, you might have to delete entity B before you can delete entity A.
Display custom icons alongside values in list views
12/2/2019 • 5 minutes to read • Edit Online

Power Apps environment administrators and customizers can add graphics to a view and establish the logic used
to select a graphic based on the column value using JavaScript. The capability lets you customize list views that
display icons alongside text or numerical values.
This example displays custom icons in a view for the opportunity entity, which is available with certain apps, such
as Dynamics 365 Sales. You can display custom icons in views with other standard entities, such as the account or
contact entity, as well as custom entities.

Custom icons in list views can display in Unified Interface, legacy web client, mobile app, and App for Outlook.

Add custom graphics and JavaScript as web resources


1. Create the new graphic files needed for your customization. We recommend an icon size of 16x16 pixels
(larger images will be scaled down).
2. Write one or more JavaScript functions that establish which icons to show for which values (you'll typically
need one function for each column you want to customize). Each function must accept a row data object and
a language (LCID ) code as input and return an array containing an image name and tooltip text. For an
example function, see Sample JavaScript function, later in this article.
3. Sign into your environment as an administrator and open solution explorer.
4. The Default Solution pop-up window opens. Navigate to Components > Web Resources here.
5. Now, you'll upload your custom graphics, one at a time, as web resources. Select the New button in the
toolbar to create a new web resource. Another pop-up window opens to help you create the resource.
Follow these steps:
a. Give the new resource a meaningful Name. This is the name that you'll use to refer to each graphic
from your JavaScript code.
b. Set the Type to the graphic format you've used to save your graphic file (PNG, JPEG, or GIF ).
c. Select Choose File to open a file browser window. Use it to find and select your graphic file.
d. Add a Display Name and/or Description if you wish.
e. Select Save and then close the Web Resource window.
6. Repeat the previous step for each graphic file that you have.
7. Now, you'll add your JavaScript as the final web resource. Select New on the toolbar to create a new web
resource. Another pop-up window opens to help you create the resource. Do the following:
a. Give the new resource a meaningful Name.
b. Set the Type to Script (JScript).
c. Select Text Editor (next to the Type setting) to open a text-editor window. Paste your Javascript code
here and select OK to save it.
d. Add a Display Name and/or Description if you wish.
e. Select Save and then close the Web Resource window.
8. With the Default Solution pop-up window still open, expand the Components > Entities tree and locate
the entity that you want to customize.
9. Expand your entity and select its Views icon.
10. You now see a list of views for your selected entity. Select a view from the list. Then open the More Actions
drop-down list in the toolbar and select Edit.
11. A pop-up window opens with controls for editing your selected view. It shows each column that is part of
the view. Select the target column and then select the Change Properties in the Common Tasks box. The
Change Column Properties dialog opens; make the following settings here:
Web Resource: Specify the name of the web resource that you created to hold your Javascript
functions (select Browse to choose from a list).
Function Name: Type the name of the function that you wrote to modify the selected column and
view.
12. Select OK to close the Change Column Properties dialog.
13. Select Save and Close to save your view.
14. Repeat these steps for each entity, view, and column as needed.
15. When you're ready, select Publish All Customizations to publish your changes. Then, close the Default
Solution window.
Sample JavaScript function
The JavaScript function for displaying custom icons and tooltips expects the following two arguments: the entire
row object specified in layoutxml and the calling user’s Locale ID (LCID ). The LCID parameter enables you to
specify tooltip text in multiple languages. For more information about the languages supported by the
environment, see Enable languages and Install or upgrade language packs. For a list of locale ID (LCID ) values that
you can use in your code, see Locale IDs assigned by Microsoft.
Assuming you will be adding custom icons for an option-set type of attribute, which has a limited set of predefined
options, make sure you use the integer value of the options instead of label to avoid localization issues.
The following sample code displays icons and tooltips based on one of three values (1: Hot, 2: Warm, 3: Cold) in
the opportunityratingcode (Rating) attribute. The sample code also shows how to display localized tooltip text. For
this sample to work, you must create three image web resources with 16x16 images with the following names:
new_Hot, new_Warm, and new_Cold.

IMPORTANT
This sample requires the opportunity entity, which is available with Dynamics 365 Sales app.
function displayIconTooltip(rowData, userLCID) {
var str = JSON.parse(rowData);
var coldata = str.opportunityratingcode_Value;
var imgName = "";
var tooltip = "";
switch (parseInt(coldata,10)) {
case 1:
imgName = "new_Hot";
switch (userLCID) {
case 1036:
tooltip = "French: Opportunity is Hot";
break;
default:
tooltip = "Opportunity is Hot";
break;
}
break;
case 2:
imgName = "new_Warm";
switch (userLCID) {
case 1036:
tooltip = "French: Opportunity is Warm";
break;
default:
tooltip = "Opportunity is Warm";
break;
}
break;
case 3:
imgName = "new_Cold";
switch (userLCID) {
case 1036:
tooltip = "French: Opportunity is Cold";
break;
default:
tooltip = "Opportunity is Cold";
break;
}
break;
default:
imgName = "";
tooltip = "";
break;
}
var resultarray = [imgName, tooltip];
return resultarray;
}

Custom icon view display behavior


Primary fields
In the grid list view, custom icons applied to the entity primary field replace the default system-generated icon.
Other fields
In the grid list view, custom icons applied to a field that isn't the entity primary field display as a secondary icon in
addition to the default system-generated icon.

Card forms
Custom icons replace the default system-generated icon when the view is configured to use a card form.
See also
Understand model-driven app views
Edit system entity messages
12/2/2019 • 2 minutes to read • Edit Online

The default display name of some system entities is used in user interface text and error messages in Common
Data Service. If you change the display name, you should also update any messages that use the default display
name. For example, if you change the display name from Account to Company, you could still see an error
message using the old name.
You cannot edit system messages using the Power Apps portal, you must use solution explorer.
Navigate to an unmanaged solution
1. From the Power Apps portal select Solutions, and then on the toolbar, select Switch to classic.
2. In the All Solutions list select the unmanaged solution you want.
In the solution explorer, below the entity, if you see a Messages node you can edit certain text that includes
references to the original entity display name.

Editing this text is straightforward. Double-click the message to see a form with three fields:

FIELD DESCRIPTION

Default Display String Shows the original text.

Custom Display String Edit this text to change the display string.

Comment Optional. Include a comment about what you changed and


why.

Some of the message text may have placeholders in them. These placeholders are numbers with brackets on
either side. For example: {0} . These placeholders allow for text to be inserted in the message. If you edit
messages, make sure that you keep these placeholders.
Select to save your changes. Select Save and Close to close the form when you save.

NOTE
Although the UI exposed to edit system entity messages includes many references to entity names, it doesn't include all of
them. For a more comprehensive approach, see Updating localizable text in the base language

Programmatically update entity display strings


For developers looking for a way to work with these in code, the display strings are stored in the DisplayString
entity.
The DisplayString entity doesn’t contain the default display strings. The two attributes for this entity that contain
text are CustomDisplayString and PublishedDisplayString. By default, these attribute values are null unless the
display string has been customized and published. The PublishedDisplayString value is read-only and reflects the
currently published CustomDisplayString .

See also
Edit an entity
Translate localizable text for model-driven apps
Configure an entity for feedback/ratings
12/2/2019 • 2 minutes to read • Edit Online

Let customers or employees write feedback for any entity record, or rate entity records within a defined rating
range by enabling entities for feedback.
This capability is commonly used with a system that captures data from customers via a portal, or survey. Data
about service or product satisfaction can be applied with entities that represent that kind of data.
Feedback can also be used by employees to provide feedback on a collaborative effort.

NOTE
You will need to have the System Administrator or System Customizer security role or equivalent permissions to perform
these steps.

Enable feedback
Edit the entity to enable Feedback. More information: Edit an entity

Add a subgrid for feedback on the entity form


By default, users must go to the list of associated records of the record you want to add feedback to. To make it
easier for users to add feedback, you may want to add a feedback subgrid to the form of the entity you are
enabling feedback for.
More information: Sub-Grid properties overview

Add a rollup field to the entity form to show the ratings


Depending on how you want to calculate the rating for the entity, you can create a rollup field that calculates the
rating, and then add it to the form of the entity you're enabling for feedback. More information: Define rollup
fields that aggregate values
See also
Submit feedback or ratings for Dynamics 365 records
Preview feature: Azure Cosmos DB SQL API Data
Provider requirements
3/22/2019 • 4 minutes to read • Edit Online

This topic describes the requirements for the Azure Cosmos DB for SQL API data provider as well as how to
configure and recommended best practices when you use the Azure Cosmos DB for SQL API data provider with
virtual entities.

IMPORTANT
Preview features aren’t meant for production use and may have restricted functionality. These features are available
before an official release so that customers can get early access and provide feedback.
We expect changes to this feature, so you shouldn’t use it in production. Use it only in test and development
environments.
Microsoft doesn't provide support for this preview feature. Microsoft Dynamics 365 Technical Support won’t be able
to help you with issues or questions. Preview features aren't meant for production use and are subject to a separate
supplemental terms of use.

What is Azure Cosmos DB?


Azure Cosmos DB is Microsoft's globally distributed multi-model database service for mission-critical applications.
It provides rich and familiar SQL query capabilities with consistent low latencies over schema-less JSON data.
More information: Introduction to Azure Cosmos DB: SQL API

Requirements
Azure subscription that includes Azure Cosmos DB.
An Azure Cosmos DB SQL API collection.
The Azure Cosmos DB database type should be SQL.

Data type mapping


Suppose you have an Azure Cosmos DB document in a collection named Orders that has the following JSON
structure.
This table indicates the data type mappings for the SQL API document in the Orders collection with Common Data
Service.

SQL API DATA COMMON DATA SERVICE

id Primary Key

name Single Line of Text

quantity Whole Number

orderid Single line of text

ordertype Option Set

amount Decimal Number or Currency

delivered Two Options

datetimeoffset Date and Time


NOTE
Attributes with an underscore (_) prefix are generated by the SQL API.
Attributes that are configured as optional in the SQL API document and are mapped in Common Data Service as Business
Required will cause a runtime error.
id attribute values must be guids.
For more information about using dates in SQL API, see Working with Dates in Azure Cosmos DB.

Supported SQL query filtering


SQL query filtering supports the following operators.
Comparison operators: < , > , <= , >= , !=
Logical operators: and , or
Set operators: in , not in
String operators: like , contains , begins with , ends with

NOTE
Usage of the like operator is translated to the equivalent contains / begins with / ends with operators. The SQL API
does not support pattern arguments as described in the topic Like (Transact-SQL). The Azure Cosmos DB for SQL API Data
Provider can translate the single special case Like('[aA]%') to BeginsWith('a') OR BeginsWith('A') . Notice that
string comparison in the SQL API is case sensitive.

Add a data source using the Azure Cosmos DB for SQL API Data
Provider
1. Go to AppSource, select GET IT NOW, and follow the instructions to add the application to your
environment using v9x or later.
2. After the solution is installed, sign in to the environment and go to Settings > Administration > Virtual
Entity Data Sources.
3. On the Actions toolbar select NEW, and in the Select Data Provider dialog box select Azure Cosmos DB
for SQL API Data Provider, and then select OK.

4. Enter the following information, and then select SAVE & CLOSE.

FIELD DESCRIPTION

Name Type a name that describes the data source.


FIELD DESCRIPTION

Collection Name The name of the Azure Cosmos DB database containing


the collection you want to surface in a virtual entity.

Authorization Key The primary or secondary key for the Azure Cosmos DB
account. You can find the key from the Azure admin portal
under the Keys setting under your Azure Cosmos DB
account.

Uri The URI of the resource group where the Azure Cosmos
DB collection is located. The URI is formed similar to
https://contoso/documents.azure.com:443 . You can
find the URI from the Azure admin portal under the Keys
setting for the Azure Cosmos DB account.

Timeout in seconds Enter the number of seconds to wait for a response from
the Azure Cosmos DB service before a data request time-
out. For example, enter 30 to wait a maximum of thirty
seconds before a time-out occurs. The default timeout is
120 seconds.

Best practices and limitations


Notice the following when you use Azure Cosmos DB as a Data Source:
Each Azure Cosmos DB Data Source can only be associated with a single virtual entity.
You can connect multiple Data Sources to the same Collection in the Azure Cosmos DB.
You can’t segment the data in a collection by entity.
Azure Cosmos DB databases do not require a schema, however the data within the Azure Cosmos DB must be
structured using a predictable schema.
Although the Azure Cosmos DB for SQL API Data Provider implements query translation of projection,
filtering, and sorting operators, it does not support join operations.
You can only filter by a single column with SQL API.

See also
Create and edit virtual entities that contain data from an external data source
Virtual entity walkthrough using the OData v4 Data
Provider
11/4/2019 • 4 minutes to read • Edit Online

Imagine that you want to access ticket information from an external data source within your model-driven app. In
this simple walkthrough, you'll model a virtual entity with fields mapped to the external schema that retrieves ticket
data at runtime from an OData web service.

Data source details


Because the data source used for this walkthrough has an OData v4 web service, we can use the OData v4 Data
Provider included with your environment.
Web service url: https://contosowebservice.azurewebsites.net/odata/

IMPORTANT
The web service url used for this walkthrough isn't a functioning web service.

For this walkthrough, a single virtual entity that contains the following three fields is needed.

EX TERNAL FIELD NAME EX TERNAL DATA TYPE VIRTUAL ENTITY DATA TYPE PURPOSE

TicketID Edm.Guid Primary key Primary key for the entity

Title Edm.String Single Line of Text Title of the ticket

Severity Edm.Int32 Whole Number Number value of 0-4


indicating the severity of the
ticket

The OData metadata of the external data source Ticket entity:

<EntityType Name="Ticket">
<Key>
<PropertyRef Name="TicketID" />
</Key>
<Property Name="TicketID" Nullable="false" Type="Edm.Guid" />
<Property Name="Title" Type="Edm.String" />
<Property Name="Severity" Nullable="false" Type="Edm.Int32" />
</EntityType>

Create the Data Source


Create the data source for the OData v4 data provider that uses the OASIS Open Data Protocol (OData) sample
web service.
1. Go to Settings > Administration > Virtual Entity Data Sources.
2. Select NEW, select OData v4 Data Provider, and then select OK.
3. Enter or select the following information.

FIELD VALUE

Name Contoso Sample Data Source

URL https://contosowebservice.azurewebsites.net/odata

Timeout 30

Return Inline Count True

Leave the other fields as-is, and select SAVE & CLOSE.

TIP
When using your own web service, verify that the URL is valid by pasting it in to your web browser.

Open solution explorer


Part of the name of any custom entity you create is the customization prefix. This is set based on the solution
publisher for the solution you’re working in. If you care about the customization prefix, make sure that you are
working in an unmanaged solution where the customization prefix is the one you want for this entity. More
information: Change the solution publisher prefix
Navigate to an unmanaged solution
1. From the Power Apps portal select Solutions, and then on the toolbar, select Switch to classic.
2. In the All Solutions list select the unmanaged solution you want.

Create the virtual entity


1. In the left navigation pane of solution explorer, select Entities, and then select New from the main pane.
2. On the Entity: New form, select the Virtual Entity option, and then enter the following information:

FIELD VALUE

Data Source Contoso Sample Data Source

Display Name Ticket

Plural Name Tickets

Name new_ticket

External Name Ticket

External Collection Name Tickets

Notes (includes attachments) selected

Activities selected
3. Next to Areas that display this entity, select Service, and then select Save (but don’t close the entity
form).

Create the fields for the virtual entity


On the left navigation pane of the Entity: Ticket page, select Fields. As part of this walkthrough you will edit two
existing fields and add a third field.

IMPORTANT
External names are case sensitive. Refer to your web service metadata to make sure you use the correct name. A Nullable
value of false indicates that the attribute is required. Notice that primary key fields are always system required.

1. Open the new_ticketid field, and change the following attribute with the value indicated here: External
Name: TicketID
2. Select Save and Close.
3. Open the new_name field, and change the following attributes to have the values indicated here:
Display Name: Title
External Name: Title

4. Select Save and Close.


5. Select New, and on the Field: New for Ticket page enter the following information:
FIELD VALUE

Display Name Severity

Name new_severity

External Name Severity

Field Requirement Business Required

Data Type Whole Number

Minimum Value 0

Maximum Value 4

1. Select Save and Close.

Add the fields to the Main form


1. On the Ticket entity window, select Forms.
2. Open the main form, drag and drop the Severity field from the right pane onto the form in the General section
under the Title field.
3. On the Ticket entity window select Save and Close.

Configure the default view


1. On the left pane of the solution explorer, under the Ticket entity, select Views.
2. Open the All Tickets view.
3. In the Common Tasks pane select Add Columns.

4. Select Severity, and then select OK.


5. On the View: All Tickets window select Save and Close.
6. On the Solution Explorer window select Publish All Customizations.
7. After all customizations are published, close the Solution Explorer window.

View the virtual entity in action with Dynamics 365


1. Go to Service > Extensions > Tickets.

The All Tickets view displays. Notice that you may need to refresh your browser to view the entity from the
Service area.

2. Open a Ticket record to view the form that includes the Title and Severity fields for the given record.
See also
OData v4 Data Provider configuration, requirements, and best practices
Create and edit virtual entities that contain data from an external data source
Entity relationships overview
12/2/2019 • 2 minutes to read • Edit Online

Entity relationships define the ways that entity records can be associated with records from other entities or the
same entity. There are two types of entity relationships.
One-to-many relationships. In a one-to-many entity relationship, many referencing (related) entity records
can be associated with a single referenced (primary) entity record. The referenced entity record is sometimes
referred to as the ”parent” and records of the referencing entity are referred to as ”children.” A many-to-one
relationship is just the child perspective of a one-to-many relationship.
Many-to-many relationships. In a many-to-many entity relationship many entity records can be associated
with many other entity records. Records related using a many-to-many relationship can be considered peers
and the relationship is reciprocal.

See also
Create a relationship between entities
Create Many-to-many entity relationships in Common Data Service using Power Apps portal
Entity relationships overview
2/12/2020 • 8 minutes to read • Edit Online

Entity relationships define how records can be related to each other in the database. At the simplest level,
adding a lookup field to an entity creates a new 1:N (one-to-many) relationship between the two entities and
lets you put that lookup field in a form. With the lookup field, users can associate multiple child records of that
entity to a single parent entity record.
Beyond simply defining how records can be related to other records, 1:N entity relationships also provide data
to address the following questions:
When I delete a record should any records related to that record also be deleted?
When I assign a record, do I also need to assign all records related to that record to the new owner?
How can I streamline the data entry process when I create a new related record in the context of an existing
record?
How should people viewing a record be able to view the associated records?
Entities can also participate in a N:N (many-to-many) relationship where any number of records for two entities
can be associated with each other.

Decide whether to use entity relationships or connections


Entity relationships are metadata that make changes to the database. These relationships allow for queries to
retrieve related data very efficiently. Use entity relationships to define formal relationships that define the entity
or that most records can use. For example, an opportunity without a potential customer wouldn’t be very
useful. The Opportunity entity also has a N:N relationship with the Competitor entity. This allows for multiple
competitors to be added to the opportunity. You may want to capture this data and create a report that shows
the competitors.
There are other less formal kinds of relationships between records that are called connections. For example, it
may be useful to know if two contacts are married, or perhaps they are friends outside of work, or perhaps a
contact used to work for another account. Most businesses won’t generate reports using this kind of
information or require that it is entered, so it’s probably not worthwhile to create entity relationships. More
information: Configure connection roles

Types of entity relationships


When you look at the solution explorer you might think that there are three types of entity relationships.
Actually there are only two, as shown in the following table.

RELATIONSHIP TYPE DESCRIPTION

1:N (One-to-Many) An entity relationship where one entity record for the
Primary Entity can be associated to many other Related
Entity records because of a lookup field on the related
entity.

When viewing a primary entity record you can see a list of


the related entity records that are associated with it.

In the Power Apps portal, Current Entity represents the


primary entity.
RELATIONSHIP TYPE DESCRIPTION

N:N (Many-to-Many) An entity relationship that depends on a special


Relationship Entity, sometimes called an Intersect entity, so
that many records of one entity can be related to many
records of another entity.

When viewing records of either entity in a N:N relationship


you can see a list of any records of the other entity that are
related to it.

The N:1 (many-to-one) relationship type exists in the user interface because the designer shows you a view
grouped by entities. 1:N relationships actually exist between entities and refer to each entity as either a
Primary/Current Entity or Related Entity. The related entity, sometimes called the child entity, has a lookup
field that allows storing a reference to a record from the primary entity, sometimes called the parent entity. A
N:1 relationship is just a 1:N relationship viewed from the related entity.

Entity relationship behavior


Behaviors for related entities is important because it helps ensure data integrity and can automate business
processes for your company.
Preserve data integrity
Some entities exist to support other entities. They don't make sense on their own. They will typically have a
required lookup field to link to the primary entity they support. What should happen when the primary record
is deleted?
You can use the relationship behavior to define this according to the rules for your business. Two options are:
Prevent deleting the primary entity so that the related entity records can be reconciled, perhaps by
associating them with a different primary entity.
Allow the related entities to be deleted automatically with the deletion of the primary entity record.
If the related entity doesn't support a primary entity, you can allow the primary entity to be deleted and the
value of the lookup will be cleared.
Automate business processes
Let’s say that you have a new salesperson and you want to assign them a number of existing accounts currently
assigned to another salesperson. Each account record may have a number of task activities associated with it.
You can easily locate the active accounts you want to reassign and assign them to the new salesperson. But
what should happen for any of the task activities that are associated with the accounts? Do you want to open
each task and decide whether they should also be assigned to the new salesperson? Probably not. Instead, you
can let the relationship apply some standard rules for you automatically. These rules only apply to task records
associated to the accounts you are reassigning. Your options are:
Reassign all active tasks.
Reassign all tasks.
Reassign none of the tasks.
Reassign all tasks currently assigned to the former owner of the accounts.
The relationship can control how actions performed on a record for the primary entity record cascade down to
any related entity records.
Behaviors
There are several kinds of behaviors that can be applied when certain actions occur.
BEHAVIOR DESCRIPTION

Cascade Active Perform the action on all active related entity records.

Cascade All Perform the action on all related entity records.

Cascade None Do nothing.

Remove Link Remove the lookup value for all related records.

Restrict Prevent the primary entity record from being deleted when
related entity records exist.

Cascade User Owned Perform the action on all related entity records owned by
the same user as the primary entity record.

Actions
These are the actions that can trigger certain behaviors:

FIELD DESCRIPTION OPTIONS

Assign What should happen when the Cascade All


primary entity record is assigned to Cascade Active
someone else? Cascade User-owned
Cascade None

Reparent What should happen when the lookup Cascade All


value of a related entity in a parental Cascade Active
relationship is changed? Cascade User-owned
More information: Parental entity Cascade None
relationships

Share What should happen when the Cascade All


primary entity record is shared? Cascade Active
Cascade User-owned
Cascade None

Delete What should happen when the Cascade All


primary entity record is deleted? Remove Link
Restrict

Unshare What should happen when a primary Cascade All


entity record is unshared? Cascade Active
Cascade User-owned
Cascade None

Merge What should happen when a primary Cascade All


entity record is merged? Cascade None

Rollup View What is the desired behavior of the Cascade All


rollup view associated with this Cascade Active
relationship? Cascade User-owned
Cascade None
NOTE
Assign, Delete, Merge, and Reparent actions will not execute in the following situations:
If the original parent record and requested action contain the same values. Example: Attempting to trigger an Assign
and choosing a contact that is already the owner of the record
Attempting to perform an action on a parent record that is already running a cascading action

NOTE
When executing an assign, any workflows or business rules that are currently active on the records will automatically be
deactivated when the reassignment occurs. The new owner of the record will need to reactivate the workflow or business
rule if they want to continue using it.

Parental entity relationships


Each pair of entities that are eligible to have a 1:N relationship can have multiple 1:N relationships between
them. Yet usually only one of those relationships can be considered a parental entity relationship.
A parental entity relationship is any 1:N entity relationship where one of the cascading options in the Parental
column of the following table is true.

ACTION PARENTAL NOT PARENTAL

Assign Cascade All Cascade None


Cascade User-owned
Cascade Active

Delete Cascade All RemoveLink


Restrict

Reparent Cascade All Cascade None


Cascade User-owned
Cascade Active

Share Cascade All Cascade None


Cascade User-owned
Cascade Active

Unshare Cascade All Cascade None


Cascade User-owned
Cascade Active

For example, if you create a new custom entity and add a 1:N entity relationship with the account entity where
your custom entity is the related entity, you can configure the actions for that entity relationship to use the
options in the Parental column. If you later add another 1:N entity relationship with your custom entity as the
referencing entity you can only configure the actions to use the options in the Not Parental column.
Usually this means that for each entity pair there is only one parental relationship. There are some cases where
the lookup on the related entity may allow for a relationship to more than one type of entity.
For example, if an entity has a Customer lookup that can refer to either a contact or account entity. There are
two separate parental 1:N entity relationships.
Any activity entity has a similar set of parental entity relationships for entities that can be associated using the
regarding lookup field.
Limitations on behaviors you can set
Because of parental relationships there are some limitations you should keep in mind when you define entity
relationships.
A custom entity can’t be the primary entity in a relationship with a related system entity that cascades. This
means you can’t have a relationship with any action set to Cascade All, Cascade Active, or Cascade User-
Owned between a primary custom entity and a related system entity.
No new relationship can have any action set to Cascade All, Cascade Active, or Cascade User-Owned if
the related entity in that relationship already exists as a related entity in another relationship that has any
action set to Cascade All, Cascade Active, or Cascade User-Owned. This prevents relationships that
create a multi-parent relationship.
See also
Entities and metadata overview
Create and edit 1:N (one-to-many) or N:1 (many-to-one) relationships
Create Many-to-many (N:N ) entity relationships
Create one-to-many or many-to-one entity
relationships overview
12/2/2019 • 2 minutes to read • Edit Online

In Common Data Service 1:N (one-to-many) or N:1 (many-to-one) relationships define how two entities are
related to each other.
Before you create a custom entity relationship, evaluate whether using an existing entity relationship would meet
your requirements.
More information: Create new metadata or use existing metadata?
There are two designers you can use to create and edit 1:N (one-to-many) or N:1 (many-to-one) relationships:

DESIGNER DESCRIPTION

Power Apps portal Provides an easy streamlined experience, but some special
settings are not available.
More information: Create and edit 1:N (one-to-many) or N:1
(many-to-one) entity relationships in Power Apps portal

Solution explorer Not as easy, but provides for more flexibility for less common
requirements.
More information: Create and edit 1:N (one-to-many) or N:1
(many-to-one) entity relationships using solution explorer

NOTE
You can also create new entity relationship in your environment using the following:
In model-driven apps, select New Field from the form editor and create a Lookup field.
More information: Add a field to a form
Create a new Lookup field for the related entity.
More information: Create and edit fields
Import a solution that contains the definition of the entity relationship.
More information: Import, update, and export solutions
Use Power Query to create new entities and fill them with data.
More information: Add data to an entity in Common Data Service by using Power Query.
A developer can use Metadata services to write a program to create and update entity relationships.
More information: Customize entity relationship metadata

Information in this topic will help you choose which designer you can use.
You should use the Power Apps portal to create and edit 1:N (one-to-many) or N:1 (many-to-one) entity
relationships unless you need to address any of the following requirements:
Configure field mappings
Configure navigation pane options for model-driven app
Configure relationship behaviors
Define whether the relationship is hidden in advanced find.
Make a Hierarchical relationship
Community tools
Entity Relation Diagram Creator is a tool that XrmToolbox community developed for Common Data Service.
Please see the Developer tools for Common Data Service topic for more community developed tools.

NOTE
The community tools are not a product of Microsoft and does not extend support to the community tools. If you have
questions pertaining to the tool, please contact the publisher. More Information: XrmToolBox.

See also
Create and edit relationships between entities
Create and edit 1:N (one-to-many) or N:1 (many-to-one) entity relationships in Power Apps portal
Create and edit 1:N (one-to-many) or N:1 (many-to-one) entity relationships using solution explorer
Developer documentation: Customize entity relationship metadata
Developer documentation: Entity relationship eligibility
Create many-to-many entity relationships overview
12/2/2019 • 2 minutes to read • Edit Online

One-to-many (1:N ) entity relationships establish a hierarchy between records. With Many-to-many (N:N )
relationships there is no explicit hierarchy. There are no lookup fields or behaviors to configure. Records created
using Many-to-many relationships can be considered peers and the relationship is reciprocal.
With Many-to-many relationships a Relationship (or Intersect) entity stores the data that associates the entities.
This entity has a One-to-many entity relationship with both of the related entities and only stores the necessary
values to define the relationship. You can’t add custom fields to a relationship entity and it is never visible in the
user interface.
Creating a Many-to-many relationship requires choosing the two entities that you want to participate in the
relationship. For model-driven apps you can decide how you want the respective lists to be available within the
navigation for each entity. These are the same options used for the primary entity in 1:N entity relationships.
More information: Navigation Pane Item for Primary Entity
Not all entities can be used with Many-to-many relationships. If the entity isn't available to be chosen in the
designer, you can’t create a new Many-to-many relationship with this entity. More information: Developer
documentation: Entity relationship eligibility
There are two designers you can use to create and edit 1:N (one-to-many) or N:1 (many-to-one) relationships:

DESIGNER DESCRIPTION

Power Apps portal Provides an easy streamlined experience, but some special
settings are not available.
More information: Create Many-to-many entity relationships
in Common Data Service using Power Apps portal

Solution explorer Not as easy, but provides for more flexibility for less common
requirements.
More information: Create N:N (many-to-many) entity
relationships in Common Data Service using solution explorer

NOTE
You can also create new Many-to-many (N:N) entity relationship in your environment using the following:
Import a solution that contains the definition of the relationship. More information: Import, update, and export solutions
A developer can use Metadata services to write a program to create and update entity relationships. More information:
Developer documentation: Customize entity relationship metadata

Information in this topic will help you choose which designer you can use.
You should use the Power Apps portal to create and edit Many-to-many (N:N ) entity relationships unless you
need to address any of the following requirements:
Configure navigation pane options for model-driven apps.
Hide the relationship from Advanced find in model-driven apps.

See also
Create and edit relationships between entities
Create Many-to-many entity relationships in Common Data Service using Power Apps portal
Create N:N (many-to-many) entity relationships in Common Data Service using solution explorer
Developer documentation: Customize entity relationship metadata
Developer documentation: Entity relationship eligibility
Create a relationship between entities
2/1/2020 • 6 minutes to read • Edit Online

Data in one entity often relates to data in another entity. For example, you might have a Teachers entity and a
Class entity, and the Class entity might have a lookup relation to the Teachers entity to show which teacher
teaches the class. You can use a lookup field to show data from the Teachers entity. This is commonly referred to
as a lookup field.

Define a relationship
You can create several types of relationships from one entity to another (or between an entity and itself). Each
entity can have a relationship with more than one entity, and each entity can have more than one relationship to
another entity. Some common relationship types are:
Many-to-one - In this type of relationship, each record in entity A can match more than one record in entity
B, but each record in entity B can match only one record in entity A. For example, a class has a single
classroom. This is the most common type of relationship and is shown in the field list as a Lookup field
One-to-many - In this type of relationship, each record in entity B can match more than one record in entity
A, but each record in entity A can match only one record in entity B. For example, a single teacher, teaches
many classes.
Many-to-many - In this type of relationship, each record in entity A can match more than one record in entity
B, and vice versa. For example, students attend many classes, and each class can have multiple students.
Additionally, you can set advanced cascading behaviors on many-to-one and one-to-many relationships
whenever an action is taken on the parent entity.

Add a lookup field (Many-to-one relationship)


To add a lookup relation to an entity, create a relation under the Relationships tab and specify the entity with
which you want to create a relationship.
1. On powerapps.com, expand the Data section and click or tap Entities in the left navigation pane.
2. Click or tap an existing entity, or Create a new entity
3. Click Relationships
4. Click Add relationship, this will open a new panel for you to choose the entity you want to create a
relationship to. Select the entity from the Related entity drop down.
5. After selecting an entity the Look up fields will be shown on the Primary entity, they will default with the
entity's name (in this example Classroom) but you can change them if needed.

6. Click Done to add the relationship to your entity, and then click Save entity.
Add a One-to-many relationship
To add a One-to-many relationship, create a relation under the Relationships tab and specify the entity with
which you want to create a relationship.
1. On powerapps.com, expand the Data section and click or tap Entities in the left navigation pane.
2. Click or tap an existing entity, or Create a new entity
3. Click Relationships
4. Click the down arrow to the right of Add relationship, this will give you the choice of both types of
relationships. Click One-to-many this will open a new panel for you to choose the entity you want to
create a relationship to. Select the entity from the Related entity drop down.

5. After selecting an entity the Look up fields will be shown on the Primary entity, they will default with the
entities name (in this example Class) but you can change them if needed.
NOTE
In the case of a One-to-many relationships, the Look up field will be created on the related entity, not the entity you
currently have selected. If you need the lookup on the current entity, please create a Many-to-one relationship.

6. Click Done to add the relationship to your entity, and then click Save entity.

Add a Many-to-many relationship


To add a Many-to-many relationship, create a relation under the Relationships tab and specify the entity with
which you want to create a relationship.
1. On powerapps.com, expand the Data section and click or tap Entities in the left navigation pane.
2. Click or tap an existing entity, or Create a new entity
3. Click Relationships
4. Click the down arrow to the right of Add relationship, this will give you the choice of both types of
relationships. Click Many-to-many this will open a new panel for you to choose the entity you want to
create a relationship to. Select the entity from the Related entity drop down.
5. After selecting an entity, the names for the relationship and relationship entity will appear. They will default
with the names of the entities combined, but you can change them if needed.

6. Click Done to add the relationship to your entity, and then click Save entity.

Add advanced relationship behavior


While building a one-to-many or a many-to-one relationship, you can also set advanced behaviors.

These options are also referred to as cascading behaviors because they cascade down the hierarchy of related
entities. For example, it may be desirable to delete the related tests and homework of a student if a student is
removed from the system. This type of behavior is called a parental relationship.
On the other hand, you may decide that you don't want actions to cascade down the hierarchy. For example, in the
teacher to class relationship you may decide that the child entity (class) should not be deleted when a parent
(teacher) is deleted. This is called a referential relationship.
As you model your business data by creating custom entities or when using existing Common Data Model
entities, consider the behavior you require and the implications for the entire hierarchy of related entities and
choose between one of the following standard behaviors:
Referential, Remove Link: In a referential relationship between two entities, you can navigate to any
related records, but actions taken on one will not affect the other. For example, if you have a one-to-many
relationship between teachers and classes, deleting a teacher will have no impact on the related class.
Referential, Restrict Delete: In a referential, restrict delete relationship between two entities, you can
navigate to any related records. Actions taken on the parent record will not be applied to the child record,
but the parent record cannot be deleted while the child record exists. This is useful if you do not want child
records to become orphaned. This forces the user to delete all of the children before deleting the parent.

Parental: In a parental relationship between two entities, any action taken on a record of the parent entity
is also taken on any child entity records that are related to the parent entity record. For example, this would
cause all of the child records to be deleted when the parent is deleted.
Custom: In a custom relationship between two entities, you select the behavior associated with each of a
set of possible actions.

For more information on defaults and custom behaviors: Configure entity relationship behavior.

Use a lookup field in an app


If you create an app automatically from an entity that contains a lookup field, it appears as a Drop down control
that contains data from the Primary name field of the entity.

Add 1:N and N:N relationships for canvas apps


Use the Relate function to link two records through a one-to-many or many-to-many relationship in Common
Data Service. More information: Relate and Unrelate functions in Power Apps

Next steps
Generate an app by using a Common Data Service database
Create an app from scratch using a Common Data Service database
Create and edit One-to-many or Many-to-one entity
relationships using Power Apps portal
2/29/2020 • 3 minutes to read • Edit Online

The Power Apps portal provides an easy way to create and edit 1:N (one-to-many) or N:1 (many-to-one)
relationships for Common Data Service.
The portal enables configuring the most common options, but certain options can only be set using solution
explorer. More information:
Create and edit 1:N (one-to-many) or N:1 (many-to-one) relationships
Create and edit 1:N (one-to-many) or N:1 (many-to-one) entity relationships using solution explorer.

View entity relationships


1. From the Power Apps portal, select either Model-driven or Canvas design mode.
2. Select Data > Entities and select the entity that has the relationships you want to view.
3. With the Relationships tab selected, you can select the following views:

VIEW DESCRIPTION

All Shows all the relationships for the entity

Custom Shows only custom relationships for the entity

Default Shows only the standard relationships for the entity

Create relationships
While viewing entity relationships, in the command bar, select Add relationship and choose either Many-to-one
or One-to-many.
NOTE
For information about Many-to-many relationships see Create N:N (many-to-many) relationships

IMPORTANT
The portal uses different terminology than solution explorer. The solution explorer Primary entity is the Current entity in
the portal.

Depending on your choice you will see either:

TYPE PANEL

Many-to-one

One-to-many

Choose the Related entity for the relationship you want to create between the two entities.

NOTE
With either choice, a lookup field will be created on the current entity.

Once you select the entity you can edit the details of the relationship. In this example, multiple contact entity
records can be associated with a single account.
You can edit the default values provided before you save. Select More options to view the Relationship name
and Lookup field description values

FIELD DESCRIPTION

Lookup field display name The localizable text for the lookup field that will be created on
the related entity.
This can be edited later.

Lookup field name The name for the Lookup field that will be created on the
related entity.

Relationship name The name for the relationship that will be created.

Lookup field description The description for the lookup field. In model-driven apps this
will appear as a tooltip when people hover their mouse over
the field.
This can be edited later.

You can continue editing the entity. Select Save Entity to create the relationship you have configured.

Edit relationships
While viewing entity relationships, select the relationship you want to edit.
NOTE
Each relationship can be found within the primary entity or the related entity as a Many-to-one or One-to-many
relationship. Although it can be edited in either place, it is the same relationship.
The publisher of a managed solution can prevent some customizations of relationships that are part of their solution.

The only fields you can edit are Lookup field display name and Lookup field description. These can also be
edited in the properties of the lookup field in the related entity. More information: Edit a field

Delete relationships
While viewing entity relationships, select the relationship you want to delete.

You can use the Delete relationship command from the command bar or from the row context menu when you
click the ellipses (...).
Deleting the relationship will delete the lookup field on the related entity.

NOTE
You will not be able to delete a relationship that has dependencies. For example, if you have added the lookup field to a form
for the related entity, you must remove the field from the form before you delete the relationship.

See also
Create and edit relationships between entities
Create and edit 1:N (one-to-many) or N:1 (many-to-one) relationships
Create and edit 1:N (one-to-many) or N:1 (many-to-one) entity relationships using solution explorer
Edit a field
Create and edit 1:N (one-to-many) or N:1 (many-to-
one) entity relationships using solution explorer
12/2/2019 • 10 minutes to read • Edit Online

Solution explorer provides one way to create and edit 1:N (one-to-many) or N:1 (many-to-one) entity
relationships for Common Data Service.
The Power Apps portal enables configuring the most common options, but certain options can only be set using
solution explorer. More information:
Create 1:N (one-to-many) or N:1 (many-to-one) relationships
Create and edit 1:N (one-to-many) or N:1 (many-to-one) entity relationships in Power Apps portal

Open solution explorer


Part of the name of any custom relationship you create is the customization prefix. This is set based on the
solution publisher for the solution you’re working in. If you care about the customization prefix, make sure that
you are working in an unmanaged solution where the customization prefix is the one you want for this entity.
More information: Change the solution publisher prefix
Navigate to an unmanaged solution
1. From the Power Apps portal select Solutions, and then on the toolbar, select Switch to classic.
2. In the All Solutions list select the unmanaged solution you want.

View entity relationships


In solution explorer, expand Entities an select an entity. Within that entity, select either 1:N Relationships or N:1
Relationships
Create relationships
While viewing entity relationships, select either New 1-to-Many Relationship or New Many-to-1
Relationship from the command bar.

NOTE
If the commands are not available, the entity is not eligible to create a custom relationship.

Either option will open a form like the following. The difference is whether the Primary Entity or Related Entity
field is set.

With 1:N Relationship, the Primary Entity is set to the current entity
With N:1 Relationship, the Related Entity is set to the current entity
The following fields must be set in order to save the entity relationship:

REQUIRED FIELD DESCRIPTION

Primary Entity This entity will be the target type for the lookup field created
on the related entity.

Related Entity This entity will have a lookup field added to associate the
entity records with the primary entity record.
REQUIRED FIELD DESCRIPTION

Name The name of the relationship. A value will be generated based


on the primary and related entity values. This field will be
prefixed by the customization prefix of the solution publisher.

Lookup Field Display Name The localizable text for the lookup field that will be created for
the related entity. This is usually the same as the display
name for the primary entity.
This can be changed later.

Lookup Field Name The name of the lookup field that will be created on the
related entity. A value will be generated based on the Lookup
Field Display Name. This field will be prefixed by the
customization prefix of the solution publisher.

You can click to save the entity and continue editing. More information: Edit relationships

NOTE
If either the Name or Lookup Field Name values already exist in the system you will get an error when you save. Edit the
values so that they are unique and try again.

Edit relationships
While viewing entity relationships, select the entity you want to edit. The following entity relationship properties
can be edited after the relationship is created.

NOTE
The publisher of a managed solution can prevent some customizations of relationships that are part of their solution.

Entity relationship properties


These properties are about the relationship.

FIELD DESCRIPTION

Searchable Whether this relationship should be visible within Advanced


Find in model-driven apps. Select No if this is a relationship
that isn't important for your business.

Hierarchical This option is enabled only for self-referential relationships.


Whether the entity should be considered to define a
hierarchy for the entity.
Important: Once you set this property rollup fields,
processes, and views may be configured to depend on this
property. If you later change this value those capabilities that
depend on the hierarchy will not work.
More information: Define and query hierarchically related
data

Lookup field
These are the properties of the lookup field created on the related entity. The properties can be edited here or by
editing the lookup field directly. Some field properties are not editable from the relationship. More information:
Edit a field
FIELD DESCRIPTION

Display Name The localizable text for the lookup field that will be created for
the related entity.

Field requirement Whether the field must have data before a form in a model-
driven app can be saved. More information: Field
Requirement options

Description Enter instructions to the user about what the field is for.
These descriptions appear as tooltips for the user in model-
driven apps when they hover their mouse over the label of
the field.

Navigation Pane Item for Primary Entity


From the primary entity you can navigate to see related records. This data is used by model-driven apps to
control how the related entity records are displayed. These settings can also be edited using the form editor.

FIELD DESCRIPTION

Display Option How the related entity list should be displayed. More
information: Display Options

Custom Label Specify the localizable text to be used instead of the plural
name when you select Use Custom Label as the Display
Option .

Display Area Select one of the available groupings to display this list. The
available options are: Details (for the Common group),
Marketing, Sales, and Service.

Display Order Controls where the navigation item will be included within the
selected display area. The range of allowed numbers begins
with 10,000. Navigation pane items with a lower value appear
above other relationships with a higher value.

Display Options
These are the available display options:

OPTION DESCRIPTION

Do not Display Do not display the related entities for this relationship.

Use Custom Label When this option is chosen, the Custom Label field is
enabled so that you can specify the localizable text to be used
instead of the plural name.

Use Plural Name Use the plural display name defined for the related entity.

Relationship Behavior
This where you can define standard behaviors for related entities. This information is important because it helps
ensure data integrity and can automate business processes for your company.
Let’s look at an example.
Let’s say that you have a new salesperson and you want to assign them a number of existing opportunities
currently assigned to another salesperson. Each opportunity record may have a number of task activities
associated with it. You can easily locate the active opportunities you want to reassign and assign them to the new
salesperson. But what should happen for any of the task activities that are associated with the opportunities? Do
you want to open each task and decide whether they should also be assigned to the new salesperson? Probably
not. Instead, you can let the relationship apply some standard rules for you automatically. These rules only apply
to task records associated to the opportunities you are reassigning. Your options are:
Reassign all active tasks.
Reassign all tasks.
Reassign none of the tasks.
Reassign all tasks currently assigned to the former owner of the opportunity.
The relationship can control how actions performed on a record for the primary entity record cascade down to
any related entity records.
There are several kinds of behaviors that can be applied when certain actions occur.
Behaviors
These are the behaviors available to be configured.

BEHAVIOR DESCRIPTION

Cascade Active Perform the action on all active related entity records.

Cascade All Perform the action on all related entity records.

Cascade None Do nothing.

Remove Link Remove the lookup value for all related records.

Restrict Prevent the primary entity record from being deleted when
related entity records exist.

Cascade User Owned Perform the action on all related entity records owned by the
same user as the primary entity record.

Actions
These are the actions that can trigger certain behaviors:

FIELD DESCRIPTION OPTIONS

Assign What should happen when the primary Cascade All


entity record is assigned to someone Cascade Active
else? Cascade User-owned
Cascade None

Reparent What should happen when the lookup Cascade All


value of a related entity in a parental Cascade Active
relationship is changed? Cascade User-owned
More information: Parental entity Cascade None
relationships

Share What should happen when the primary Cascade All


entity record is shared? Cascade Active
Cascade User-owned
Cascade None
FIELD DESCRIPTION OPTIONS

Delete What should happen when the primary Cascade All


entity record is deleted? Remove Link
Restrict

Unshare What should happen when a primary Cascade All


entity record is unshared? Cascade Active
Cascade User-owned
Cascade None

Merge What should happen when a primary Cascade All


entity record is merged? Cascade None

Rollup View What is the desired behavior of the Cascade All


rollup view associated with this Cascade Active
relationship? Cascade User-owned
Cascade None

Type of Behavior options


Use the Type of Behavior field to choose between a set of standard behaviors or whether you want to configure
them independently.

OPTION DESCRIPTION

Parental Assign: Cascade All


Reparent: Cascade All
Share: Cascade All
Delete: Cascade All
Unshare: Cascade All
Merge: Cascade None
Rollup View: Cascade None | Cascade All

Referential Assign: Cascade None


Reparent: Cascade None
Share: Cascade None
Delete: Remove Link
Unshare: Cascade None
Merge: Cascade None
Rollup View: Cascade None | Cascade All

Referential, Restrict Delete Assign: Cascade None


Reparent: Cascade None
Share: Cascade None
Delete: Restrict
Unshare: Cascade None
Merge: Cascade None
Rollup View: Cascade None | Cascade All

Configurable Cascading You can configure the behavior you want for each action
depending on the options available
NOTE
You may not be able to choose the Parental option if either of the entities already participate in an parental entity
relationship. More information: Parental entity relationships
If you use Configurable Cascading to set the behaviors for the actions so that they match the behaviors for the actions
associated with another Type of Behavior, when you save the relationship, the Type of Behavior is automatically set to
the matching type.

Delete relationships
While viewing entity relationships, select the entity relationship you want to delete and click the command.
Deleting the relationship will delete the lookup field on the related entity.

NOTE
You will not be able to delete a relationship that has dependencies. For example, if you have added the lookup field to a
form for the related entity, you must remove the field from the form before you delete the relationship.

Parental entity relationships


Each pair of entities that are eligible to have a 1:N relationship can have multiple 1:N relationships between them.
Yet usually only one of those relationships can be considered a parental entity relationship.
A parental entity relationship is any 1:N entity relationship where one of the cascading options in the Parental
column of the following table is true.

ACTION PARENTAL NOT PARENTAL

Assign Cascade All Cascade None


Cascade User-owned
Cascade Active

Delete Cascade All RemoveLink


Restrict

Reparent Cascade All Cascade None


Cascade User-owned
Cascade Active

Share Cascade All Cascade None


Cascade User-owned
Cascade Active

Unshare Cascade All Cascade None


Cascade User-owned
Cascade Active

For example, if you create a new custom entity and add a 1:N entity relationship with the account entity where
your custom entity is the related entity, you can configure the actions for that entity relationship to use the options
in the Parental column. If you later add another 1:N entity relationship with your custom entity as the referencing
entity you can only configure the actions to use the options in the Not Parental column.
Usually this means that for each entity pair there is only one parental relationship. There are some cases where
the lookup on the related entity may allow for a relationship to more than one type of entity.
For example, if an entity has a Customer lookup that can refer to either a contact or account entity. There are two
separate parental 1:N entity relationships.
Any activity entity has a similar set of parental entity relationships for entities that can be associated using the
regarding lookup field.
Limitations on behaviors you can set
Because of parental relationships there are some limitations you should keep in mind when you define entity
relationships.
A custom entity can’t be the primary entity in a relationship with a related system entity that cascades. This
means you can’t have a relationship with any action set to Cascade All, Cascade Active, or Cascade User-
Owned between a primary custom entity and a related system entity.
No new relationship can have any action set to Cascade All, Cascade Active, or Cascade User-Owned if
the related entity in that relationship already exists as a related entity in another relationship that has any
action set to Cascade All, Cascade Active, or Cascade User-Owned. This prevents relationships that create
a multi-parent relationship.
See also
Create and edit relationships between entities
Create and edit 1:N (one-to-many) or N:1 (many-to-one) relationships
Create and edit 1:N (one-to-many) or N:1 (many-to-one) entity relationships in Power Apps portal
Create N:N (many-to-many) relationships
Create Many-to-many entity relationships in
Common Data Service using Power Apps portal
2/29/2020 • 2 minutes to read • Edit Online

The Power Apps portal provides an easy way to create and edit Many-to-many entity relationships for Common
Data Service.
The portal enables configuring the most common options, but certain options can only be set using solution
explorer. More information:
Create N:N (many-to-many) entity relationships
Create N:N (many-to-many) entity relationships in Common Data Service using solution explorer

View Many-to-many entity relationships


1. From the Power Apps portal, select either Model-driven or Canvas design mode.
2. Select Data > Entities and select the entity that has the relationships you want to view.
3. With the Relationships tab selected, you can select the following views:

VIEW DESCRIPTION

All Shows all the relationships for the entity

Custom Shows only custom relationships for the entity

Default Shows only the standard relationships for the entity

Many-to-many relationships will have a Relationship type of Many-to-many.

NOTE
The entity you view may have no Many-to-many relationships.
Create relationships
While viewing entity relationships, in the command bar, select Add relationship and choose Many-to-many.

In the Many-to-many panel, choose the entity you want related to the current entity.

Select More Options to view the Relationship Name and Relationship entity name fields.

The values for these fields are generated for you based on the entities chosen.

NOTE
If you create more than one Many-to-many relationship with the same two entities, you will need to edit the generated
Relationship Name and Relationship entity name fields so that they will be unique.

Select OK to close the Many-to-many panel. The relationship will be created when you save changes to the entity.
Once saved, there nothing that can be changed using Power Apps portal. To edit properties of the relationship for
model-driven apps use solution explorer.

Delete relationships
While viewing entity relationships, select the relationship you want to delete.

You can use the Delete relationship command from the command bar or from the row context menu when you
select the ellipses (...).
Deleting the Many-to-Many relationship will delete the relationship entity created. All data connecting entities
using the relationship will be lost.
See also
Create N:N (many-to-many) entity relationships
Create N:N (many-to-many) entity relationships in Common Data Service using solution explorer
Set managed properties for relationships
12/2/2019 • 2 minutes to read • Edit Online

Managed properties only apply when you include a field with a managed solution and import it into another
organization. These settings allow a solution maker to have some control over the level of customization that they
want to allow people who install their managed solution to have when they customize an entity relationship. To set
managed properties for a relationship, in solution explorer expand the entity, open the relationship, and then select
Managed Properties on the menu bar.
With relationships, the only managed property is Can Be Customized. This single setting controls all changes that
can be made to the entity relationship.

Next steps
Create and edit relationships between entities
Visualize hierarchical data with model-driven apps
11/4/2019 • 4 minutes to read • Edit Online

When an entity is configured to have a hierarchical self-referential relationship you can configure visualizations
using that hierarchy. More information: Define and query hierarchically related data
The entities that have visualizations available by default include Account, Position, and User. In the grid view of
these entities, you can see the icon depicting the hierarchy chart, to the left of the record name. The hierarchy icon
isn’t present for all records by default. The icon is shown for the records that are related using the hierarchical
relationship.

If you select the hierarchy icon, you can view the hierarchy, with the tree view on the left and the tile view on the
right, as shown below:

A few other entities can be enabled for a hierarchy. These entities include Contact and Team. All custom entities can
be enabled for a hierarchy.
Important things to remember when you create visualizations:
Only one (1:N ) self-referential relationship per entity can be set as hierarchical. In a self-referential relationship
the primary entity and the related entity must be of the same type.
A hierarchy or visualization is based on one entity only. You can depict the account hierarchy showing accounts
at multiple levels, but you can’t show accounts and contacts in the same hierarchy visualization.
The maximum number of fields that can be displayed in a tile is four. If you add more fields to the Quick Form
that is used for the tile view, only the first four fields will be displayed.

Hierarchy settings
To enable visualizations for a hierarchy you must connect the hierarchy to a quick view form. This can only be done
using solution explorer.
Navigate to an unmanaged solution
1. From the Power Apps portal select Solutions, and then on the toolbar, select Switch to classic.
2. In the All Solutions list select the unmanaged solution you want.
The hierarchy settings are associated to an entity in the solution explorer.
1. While viewing entities, select Hierarchy Settings.
2. If an existing hierarchy setting exists you can edit it. Otherwise click New to create a new one.

NOTE
If the hierarchy settings do not exist the entity is not eligible to have a hierarchy configured. There can be only one
hierarchy setting

3. Set the data in the following fields:

FIELD DESCRIPTION

Name Required. Add a unique name for the hierarchy settings. This
is typically just the name of the entity. This value will include
the solution publisher's customization prefix.

Default Quick View Form Required. Choose from an existing Quick View form or choose
Create New to open the Quick View form editor to create a
new one.

Hierarchical Relationship Required. If a hierarchical relationship is already defined for


the entity the value will be set here. If there is no value, select
Mark a relationship as enabled for hierarchies to open a
dialog to choose one of the available self-referential
relationships.

Description Include a description of the purpose for this hierarchy so that


future people customizing the system can understand why
this was done.

The same hierarchical settings for visualization are set once, but apply to both web and mobile clients. In tablets,
the visuals render in a modified format suitable for the smaller form factor. The customizable components required
for hierarchical visualization are solution aware, therefore, they can be transported between organizations like any
other customization. You can configure the attributes shown in the visualization by customizing a Quick Form
using the form editor.

Visualization walk through


Let’s look at an example of creating the visualization for a custom entity. We created a custom entity called
new_Widget , created a (1:N ) self-referential relationship new_new_widget_new_widget and marked it as hierarchical,
as shown here.

Next, in the Hierarchy Settings grid view, we selected the new_new_widget_new_widget hierarchical relationship. In
the form, we filled in the required fields. If you haven’t yet marked the (1:N ) relationship as hierarchical, the link on
the form will take you back to the relationship definition form, where you can mark the relationship as hierarchical.

IMPORTANT
Each entity can have only one hierarchical relationship at a time. Changing this to a different self-referential relationship can
have consequences. More information: Define hierarchical data

For the Quick View Form, we created a Quick Form called Widget Hierarchy Tile Form. In this form, we added
four fields to display in each tile.
After we completed the setup, we created two records: Standard Widget and Premium Widget. After making the
Premium Widget a parent of the Standard Widget by using the lookup field, the new_Widget grid view depicted the
hierarchy icons, as shown below:

NOTE
The hierarchy icons don’t appear in the record grid view until the records are related using the hierarchical relationship.

Choosing the hierarchy icon displays the new_Widget hierarchy with the tree view on the left and the tile view on
the right, showing two records. Each tile contains four fields that we provided in the Widget Hierarchy Tile
Form.
Based on your needs, you can choose between using a tree view, which shows the entire hierarchy, or a tile view,
which depicts a smaller portion of the hierarchy. Both views are shown side by side. You can explore a hierarchy by
expanding and contracting a hierarchy tree.
See also
Define and query hierarchically related data
Video: Hierarchy Visualization
Define and query hierarchically related data
11/4/2019 • 2 minutes to read • Edit Online

You can get valuable business insights by defining and querying hierarchically related data. The hierarchical
modelling and visualization capabilities give you a number of benefits:
View and explore complex hierarchical information.
View key performance indicators (KPIs) in the contextual view of a hierarchy.
Visually analyze key information across the web and the tablets.
Some standard entities already have hierarchies defined. Other entities, including custom entities, can be enabled
for a hierarchy and you can create the visualizations for them.

Define hierarchical data


With Common Data Service, hierarchical data structures are supported by self-referential one-to-many (1:N )
relationships of the related records.

NOTE
Self-referential means that the entity is related to itself. For example, the account entity has a lookup field to associate it with
another account entity record.

When a self-referential one-to-many (1:N ) relationship exists, in the relationship definition the Hierarchical option
is available to be set to Yes.

To query the data as a hierarchy, you must set one of the entity’s one-to-many (1:N ) self-referential relationships as
hierarchical. This can only be done using solution explorer.
Navigate to an unmanaged solution
1. From the Power Apps portal select Solutions, and then on the toolbar, select Switch to classic.
2. In the All Solutions list select the unmanaged solution you want.
To turn the hierarchy on:
1. While viewing 1:N relationships, select the self-referential relationship you want to edit.
2. In the Relationship definition, set Hierarchical to Yes.
NOTE
Some of the out-of the-box (1:N) relationships can’t be customized. This will prevent you from setting those relationships
as hierarchical.
You can specify a hierarchical relationship for the system self-referential relationships. This includes the 1:N self-referential
relationships of system type, such as the "contact_master_contact" relationship.

IMPORTANT
You can have multiple self-referential relationships, but only one relationship per entity can be defined as the hierarchical
relationship. If you try to change the setting once applied you will get a warning :
When disabling: If you turn off the hierarchy setting for this relationship, all rollup definitions, processes, and views that
use this hierarchy won't work. Do you want to continue?
When enabling: If you enable the hierarchy setting for this relationship, all rollup definitions that use the existing
hierarchy will become invalid. Do you want to continue?
Unless you are certain that there are no other dependencies on the existing hierarchy, you should review any documentation
about the deployment or confer with other customizers to understand how the existing hierarchical relationship is used
before continuing.

Query hierarchical data


Without a defined hierarchy, to retrieve hierarchical data, need to iteratively query for the related records. With a
defined hierarchy, you can query the related data as a hierarchy in one step. You are able to query records using the
Under and Not Under logic. The Under and Not Under hierarchical operators are exposed in Advanced Find and
the workflow editor. For more information about how to use these operators, see Configure workflow steps. For
more information about Advanced Find, see Create, edit, or save an Advanced Find search

NOTE
Developers will also be able to use these operators in code. More information Developer Documentation: Query hierarchical
data

The following examples illustrate scenarios for querying hierarchies:


Query account hierarchy
Query account hierarchy, including related activities

Query account hierarchy, including related opportunities


See also
Create and edit 1:N (one-to-many) or N:1 (many-to-one) entity relationships
Create and edit 1:N (one-to-many) or N:1 (many-to-one) entity relationships using solution explorer
Visualize hierarchical data with model-driven apps
Video: Hierarchical Security Modelling
Video: Hierarchy Visualization
Configure connection roles
2/12/2020 • 6 minutes to read • Edit Online

With Common Data Service you can define connections between entity records without creating an entity
relationship. In model-driven apps people can establish a named link between records to establish less a formal
relationship which doesn't justify creating an actual entity relationship. Some examples include friend, sibling,
spouse, attendee, and stakeholder. Some connections can also be reciprocal, such as child and parent, husband and
wife, or doctor and patient.
When people set a connection between two records, they can also add a description and additional information
such as start and end dates for the relationship. More information: Create connections to define and view
relationships between records
Anyone with write access to the Connection Role entity can establish which connection are available for people to
use.

IMPORTANT
For an entity to be available as a record type for a new or existing connection role, the Enable connections property must be
enabled for the entity.

Enable connection roles for an entity


1. Sign in to Power Apps.
2. Expand Data, and then select Entities.
3. Select the entity that you want to enable for connection roles, and then on the command bar select Settings.
4. In the Settings pane expand the Collaboration area, and then select Enable connections.

5. Select Done.
View connection roles
There are a number of standard connection roles already configured in Common Data Service.
1. Sign in to Power Apps, and then on the left pane select Solutions.
2. Open the unmanaged solution you want.
3. On the command bar, select Add existing, and then select Connection role. The list of available connection
roles are displayed.
4. Select Cancel to close the Add existing connection Roles dialog without adding a connection role to the
solution.

NOTE
If you want to distribute connection roles with a solution, make sure they are included in the solution you want to
distribute. More information: Add connection roles to a solution

View and edit connection roles using the classic experience


Most of the connection roles you can see in the Settings area are defined within the internal Default Solution
(not to be confused with the Common Data Services Default Solution). This internal Default Solution
contains all the customizations in the system. To view the Default Solution choose the All Solutions - Internal
view.

1. Sign in to Power Apps and than on the command bar select Settings , and then select Advanced
Settings.
2. Navigate to Settings > Business > Business Management and then select Connection Roles.

In this view you can see all the connection roles that are available for this environment and you can edit them here.

Add connection roles to a solution


Because connection roles are solution aware, which means that they can be included in a solution, you can also add
connection roles to a solution you distribute.
Generally it is not recommended to edit components in the internal Default Solution. Within the solution you
have created to work in, you can use the Add Existing command in the Solutions area to bring any of the active
connection roles into your solution.
Once you add the connection role to your solution, you can edit it wherever it is visible.

NOTE
The connection role status is not included with the connection role when it is exported from a solution. Therefore, when the
solution is imported into a target environment, the status will be set to active by default.

Create a connection role


IMPORTANT
If you intend to distribute a solution that includes new connection roles or changes to the existing connection roles you must
add them to the solution you will distribute. Editing or adding new connection roles using the Settings area will add these
connection roles to the internal Default Solution and will not include them in the solution you will distribute unless you first
add it to your solution. More information Add connection roles to a solution

1. Sign in to Power Apps and then on the left pane select Solutions.
2. Open the unmanaged solution your want, and then on the command bar select New > Other >
Connection role.
3. Complete the three steps on the form to Describe the connection role.
Describe the connection role
Set the following fields:

FIELD DESCRIPTION

Name (Required) The text describing the connection.

Connection Role Category A group describing the category of the connection. More
information: Connection Role Category values

Description Provide a definition for the role.

Connection Role Category values


The default Connection Role Category values are:
Business
Family
Social
Sales
Other
Stakeholder
Sales Team
Service
You can add new categories or modify existing ones by editing the Category global option set. More information:
Create and edit global option sets for Common Data Service (picklists)
Select record types
Select which record types should be available to connect.

NOTE
Although All is selected by default, make sure you consider which types are appropriate for the connection role you are
adding.

Matching connection roles


In this optional step, you can define any roles that be applied in a reciprocal manner. It is not required, but
connections are more meaningful if these are defined.
For example, people can set that Glen is a Friend to Mary, but does this mean that Mary is a Friend to Glen? We
hope so. But if Glen is the Father of Mary it doesn't mean that Mary is the Father of Glen. Establishing correct
reciprocity requires this extra step.
When people set a connection role that doesn't have a matching connection role, the role will only be displayed
when viewing the connection from the record that the connection was applied to. When viewed from the connected
record, the role will be empty unless a matching role is set.
For role definitions like Friend, Spouse, Colleague, or Sibling, it is best to assign the matching role to itself. If a
single matching connection role is configured, the single matching connection role will be applied in both
directions.

IMPORTANT
You will need to save a new connection role without this matching connection role before you can set the matching
connection role to itself.

You will find that some connection roles are already configured with matching connection roles. Former Employee
is matched with Former Employer and vice versa. This kind of one-to-one matching connection role is most
common.
You can configure multiple matching connection roles to describe complex relationships. If you create a connection
role such as Father, you could configure two more roles such as Daughter and Son and apply both of them as
matching connection roles to Father. In turn, both the Daughter and Son connection roles should be matched to
Father. Of course, then you should set up an equivalent role for Mother that is similarly matched with Daughter
and Son.

TIP
Before you create a complex set of connection roles, consider if a more simple set of roles will be enough. For example, rather
than creating a complex set of connection roles like Father, Mother, Son, and Daughter - consider if simply using Parent and
Child will work for you.

If more than one matching connection role is configured, those connection roles represent the only valid reciprocal
roles. The first one will be applied automatically as the default value. If the default value is not correct, people need
to manually edit the connection and choose between valid options defined in the configuration.
See also
Create connections to define and view relationships between records
Create and edit global option sets for Common Data Service (picklists)
Create and edit relationships between entities
Create Many-to-many entity relationships in
Common Data Service using Power Apps portal
2/29/2020 • 2 minutes to read • Edit Online

The Power Apps portal provides an easy way to create and edit Many-to-many entity relationships for Common
Data Service.
The portal enables configuring the most common options, but certain options can only be set using solution
explorer. More information:
Create N:N (many-to-many) entity relationships
Create N:N (many-to-many) entity relationships in Common Data Service using solution explorer

View Many-to-many entity relationships


1. From the Power Apps portal, select either Model-driven or Canvas design mode.
2. Select Data > Entities and select the entity that has the relationships you want to view.
3. With the Relationships tab selected, you can select the following views:

VIEW DESCRIPTION

All Shows all the relationships for the entity

Custom Shows only custom relationships for the entity

Default Shows only the standard relationships for the entity

Many-to-many relationships will have a Relationship type of Many-to-many.

NOTE
The entity you view may have no Many-to-many relationships.
Create relationships
While viewing entity relationships, in the command bar, select Add relationship and choose Many-to-many.

In the Many-to-many panel, choose the entity you want related to the current entity.

Select More Options to view the Relationship Name and Relationship entity name fields.

The values for these fields are generated for you based on the entities chosen.

NOTE
If you create more than one Many-to-many relationship with the same two entities, you will need to edit the generated
Relationship Name and Relationship entity name fields so that they will be unique.

Select OK to close the Many-to-many panel. The relationship will be created when you save changes to the
entity.
Once saved, there nothing that can be changed using Power Apps portal. To edit properties of the relationship for
model-driven apps use solution explorer.
Delete relationships
While viewing entity relationships, select the relationship you want to delete.

You can use the Delete relationship command from the command bar or from the row context menu when you
select the ellipses (...).
Deleting the Many-to-Many relationship will delete the relationship entity created. All data connecting entities
using the relationship will be lost.
See also
Create N:N (many-to-many) entity relationships
Create N:N (many-to-many) entity relationships in Common Data Service using solution explorer
Create N:N (many-to-many) entity relationships in
Common Data Service using solution explorer
12/2/2019 • 3 minutes to read • Edit Online

Solution explorer provides one way to create and edit N:N (many-to-many) for Common Data Service.
The Power Apps portal enables configuring the most common options, but certain options can only be set using
solution explorer. More information:
Create Many-to-many (N:N ) entity relationships
Create Many-to-many entity relationships in Common Data Service using Power Apps portal

Open solution explorer


Part of the name of any custom relationship you create is the customization prefix. This is set based on the
solution publisher for the solution you’re working in. If you care about the customization prefix, make sure that
you are working in an unmanaged solution where the customization prefix is the one you want for this entity.
More information: Change the solution publisher prefix
Navigate to an unmanaged solution
1. From the Power Apps portal select Solutions, and then on the toolbar, select Switch to classic.
2. In the All Solutions list select the unmanaged solution you want.

View entity relationships


In solution explorer, expand Entities an select an entity. Within that entity, select N:N Relationships.
Create relationships
While viewing entity relationships, select New Many-to-Many Relationship from the command bar.

NOTE
If the command is not available, the entity is not eligible to create a custom relationship.

In the Other Entity group, in the Entity Name field, choose the entity that you want to create the relationship
with. This will populate the Name and Relationship Entity Name fields in the Relationship Definition
group.
You can click to save the entity and continue editing. More information: Edit relationships

NOTE
If either the Name or Relationship Entity Name values already exist in the system you will get an error when you save.
Edit the values so that they are unique and try again.

Edit relationships
While viewing entity relationships, select the entity you want to edit.

NOTE
The publisher of a managed solution can prevent customizations of relationships that are part of their solution.

The following entity relationship properties can be edited after the relationship is created.

IMPORTANT
After you edit these properties you must publish customizations before they will take effect in model-driven apps.
Edit Display options
For both the Current Entity and the Other Entity, you can edit the display option fields which control how the
related entities are displayed for model-driven apps.

FIELD DESCRIPTION

Display Option How the related entity list should be displayed. More
information: Display Options

Custom Label Specify the localizable text to be used instead of the plural
name when you select Use Custom Label as the Display
Option .

Display Area Select one of the available groupings to display this list. The
available options are: Details (for the Common group),
Marketing, Sales, and Service.

Display Order Controls where the navigation item will be included within
the selected display area. The range of allowed numbers
begins with 10,000. Navigation pane items with a lower value
appear above other relationships with a higher value.

Display Options
These are the available display options:

OPTION DESCRIPTION

Do not Display Do not display the related entities for this relationship.

Use Custom Label When this option is chosen, the Custom Label field is
enabled so that you can specify the localizable text to be
used instead of the plural name.

Use Plural Name Use the plural display name defined for the related entity.

Searchable
You can hide the relationship from Advanced Find in model-driven apps by setting the Searchable field to No.

Delete relationships
While viewing entity relationships, select the entity relationship you want to delete and click the command.
Deleting the relationship will delete the relationship entity created. All data connecting entities using the
relationship will be lost.
See also
Create Many-to-many (N:N ) entity relationships
Create Many-to-many entity relationships in Common Data Service using Power Apps portal
Create and edit 1:N (one-to-many) or N:1 (many-to-one) entity relationships
Set managed properties for relationships
12/2/2019 • 2 minutes to read • Edit Online

Managed properties only apply when you include a field with a managed solution and import it into another
organization. These settings allow a solution maker to have some control over the level of customization that they
want to allow people who install their managed solution to have when they customize an entity relationship. To set
managed properties for a relationship, in solution explorer expand the entity, open the relationship, and then select
Managed Properties on the menu bar.
With relationships, the only managed property is Can Be Customized. This single setting controls all changes
that can be made to the entity relationship.

Next steps
Create and edit relationships between entities
Query and visualize hierarchically related data
12/2/2019 • 4 minutes to read • Edit Online

You can get valuable business insights by visualizing hierarchically related data. The hierarchical modelling and
visualization capabilities give you a number of benefits:
View and explore complex hierarchical information.
View key performance indicators (KPIs) in the contextual view of a hierarchy.
Visually analyze key information across the web and the tablets.
For some entities, such as account and user, the visualizations are provided out-of-the-box. Other entities, including
custom entities, can be enabled for a hierarchy and you can create the visualizations for them. Based on your needs,
you can choose between using a tree view, which shows the entire hierarchy, or a tile view, which depicts a smaller
portion of the hierarchy. Both views are shown side by side. You can explore a hierarchy by expanding and
contracting a hierarchy tree. The same hierarchical settings for visualization are set once, but apply to both web and
mobile clients. In tablets, the visuals render in a modified format suitable for the smaller form factor. The
customizable components required for hierarchical visualization are solution aware, therefore, they can be
transported between organizations like any other customization. You can configure the attributes shown in the
visualization by customizing a Quick Form using the form editor. There is no requirement to write code.

Query hierarchical data


With Common Data Service, hierarchical data structures are supported by self-referential relationships of the
related records. In the past, to view hierarchical data, you had to iteratively query for the related records. Presently,
you can query the related data as a hierarchy, in one step. You’ll be able to query records using the Under and Not
Under logic. The Under and Not Under hierarchical operators are exposed in Advanced Find and the workflow
editor. For more information about how to use these operators, see Configure workflow steps. For more
information about Advanced Find, see Create, edit, or save an Advanced Find search
The following examples illustrate various scenarios for querying hierarchies:
Query account hierarchy
Query account hierarchy, including related activities

Query account hierarchy, including related opportunities


To query the data as a hierarchy, you must set one of the entity’s one-to-many or many-to-one self-referential
relationships as hierarchical. To turn the hierarchy on:
1. On powerapps.com, expand the Data section and click or tap Entities in the left navigation pane.
2. Click or tap an existing entity, or Create a new entity
3. Click Relationships
4. Select a self-referential relationship.
5. In the relationship details panel, check Hierarchical.

NOTE
Some of the out-of the-box relationships can’t be customized. This will prevent you from setting those relationships as
hierarchical.
You can specify a hierarchical relationship for the system self-referential relationships. This includes self-referential
relationships of system type, such as the "contact_master_contact" relationship.

Visualize hierarchical data


The system entities that have visualizations available out-of-the-box include Account , Position , Product , and
User . In the grid view of these entities, you can see the icon depicting the hierarchy chart, to the left of the record
name. The hierarchy icon isn’t present for all records by default. The icon is shown for the records that have a
parent record, a child record, or both.
If you select the hierarchy icon, you can view the hierarchy, with the tree view on the left and the tile view on the
right, as shown below:

A few other out-of the-box system entities can be enabled for a hierarchy. These entities include Case , Contact ,
Opportunity , Order , Quote , Campaign , and Team . All custom entities can be enabled for a hierarchy.

TIP
If an entity can be enabled for a hierarchy:
In solution explorer, expand the entity that you want. You will see the entity component called Hierarchy Settings. The
entities that can’t be enabled for a hierarchy don’t have this component, with the exception of the Dynamics 365 Sales
Territory entity. Although Hierarchy Settings appears for the Sales Territory entity, the entity can’t be enabled for a
hierarchy.

Important things to remember when you create visualizations:


Only one (1: N ) self-referential relationship per entity can be set as hierarchical. In this relationship the
primary entity and the related entity must be of the same type, such as account_parent_account or
Widget_new_Widget_new_Widget.
Presently, a hierarchy or visualization is based on one entity only. You can depict the account hierarchy
showing accounts at multiple levels, but you can’t show accounts and contacts in the same hierarchy
visualization.
Maximum number of fields that can be displayed in a tile is four. If you add more fields to the Quick Form
that is used for the tile view, only the first four fields will be displayed.
Visualization example
Let’s look at an example of creating the visualization for a custom entity. We created a custom entity called
new_Widget, created a self-referential relationship and marked it as hierarchical, as shown here.

Next, in the Hierarchy Settings grid view, we selected the Widget_new_Widget_new_Widget hierarchical
relationship. In the form, we filled in the required fields. If you haven’t yet marked the relationship as hierarchical,
the link on the form will take you to the classic entity editor, where you can also mark the relationship as
hierarchical.
For the Quick View Form, we created a Quick Form called Widget Hierarchy Tile Form. In this form, we added
four fields to display in each tile.
After we completed the setup, we created two records: Standard Widget and Premium Widget. After making the
Premium Widget a parent of the Standard Widget by using the lookup field, the new_Widget grid view depicted
the hierarchy icons, as shown below:

TIP
The hierarchy icons don’t appear in the record grid view until the records are paired in the parent – child relationship.

Choosing the hierarchy icon displays the new_Widget hierarchy with the tree view on the left and the tile view on
the right, showing two records. Each tile contains four fields that we provided in the Widget Hierarchy Tile Form.

See also
Video: Hierarchical Security Modelling
Video: Hierarchy Visualization
Define and query hierarchically related data
11/4/2019 • 2 minutes to read • Edit Online

You can get valuable business insights by defining and querying hierarchically related data. The hierarchical
modelling and visualization capabilities give you a number of benefits:
View and explore complex hierarchical information.
View key performance indicators (KPIs) in the contextual view of a hierarchy.
Visually analyze key information across the web and the tablets.
Some standard entities already have hierarchies defined. Other entities, including custom entities, can be enabled
for a hierarchy and you can create the visualizations for them.

Define hierarchical data


With Common Data Service, hierarchical data structures are supported by self-referential one-to-many (1:N )
relationships of the related records.

NOTE
Self-referential means that the entity is related to itself. For example, the account entity has a lookup field to associate it
with another account entity record.

When a self-referential one-to-many (1:N ) relationship exists, in the relationship definition the Hierarchical
option is available to be set to Yes.

To query the data as a hierarchy, you must set one of the entity’s one-to-many (1:N ) self-referential relationships
as hierarchical. This can only be done using solution explorer.
Navigate to an unmanaged solution
1. From the Power Apps portal select Solutions, and then on the toolbar, select Switch to classic.
2. In the All Solutions list select the unmanaged solution you want.
To turn the hierarchy on:
1. While viewing 1:N relationships, select the self-referential relationship you want to edit.
2. In the Relationship definition, set Hierarchical to Yes.
NOTE
Some of the out-of the-box (1:N) relationships can’t be customized. This will prevent you from setting those relationships
as hierarchical.
You can specify a hierarchical relationship for the system self-referential relationships. This includes the 1:N self-
referential relationships of system type, such as the "contact_master_contact" relationship.

IMPORTANT
You can have multiple self-referential relationships, but only one relationship per entity can be defined as the hierarchical
relationship. If you try to change the setting once applied you will get a warning :
When disabling: If you turn off the hierarchy setting for this relationship, all rollup definitions, processes, and views that
use this hierarchy won't work. Do you want to continue?
When enabling: If you enable the hierarchy setting for this relationship, all rollup definitions that use the existing
hierarchy will become invalid. Do you want to continue?
Unless you are certain that there are no other dependencies on the existing hierarchy, you should review any
documentation about the deployment or confer with other customizers to understand how the existing hierarchical
relationship is used before continuing.

Query hierarchical data


Without a defined hierarchy, to retrieve hierarchical data, need to iteratively query for the related records. With a
defined hierarchy, you can query the related data as a hierarchy in one step. You are able to query records using
the Under and Not Under logic. The Under and Not Under hierarchical operators are exposed in Advanced
Find and the workflow editor. For more information about how to use these operators, see Configure workflow
steps. For more information about Advanced Find, see Create, edit, or save an Advanced Find search

NOTE
Developers will also be able to use these operators in code. More information Developer Documentation: Query hierarchical
data

The following examples illustrate scenarios for querying hierarchies:


Query account hierarchy
Query account hierarchy, including related activities

Query account hierarchy, including related opportunities


See also
Create and edit 1:N (one-to-many) or N:1 (many-to-one) entity relationships
Create and edit 1:N (one-to-many) or N:1 (many-to-one) entity relationships using solution explorer
Visualize hierarchical data with model-driven apps
Video: Hierarchical Security Modelling
Video: Hierarchy Visualization
Configure connection roles
2/12/2020 • 6 minutes to read • Edit Online

With Common Data Service you can define connections between entity records without creating an entity
relationship. In model-driven apps people can establish a named link between records to establish less a formal
relationship which doesn't justify creating an actual entity relationship. Some examples include friend, sibling,
spouse, attendee, and stakeholder. Some connections can also be reciprocal, such as child and parent, husband and
wife, or doctor and patient.
When people set a connection between two records, they can also add a description and additional information
such as start and end dates for the relationship. More information: Create connections to define and view
relationships between records
Anyone with write access to the Connection Role entity can establish which connection are available for people
to use.

IMPORTANT
For an entity to be available as a record type for a new or existing connection role, the Enable connections property must
be enabled for the entity.

Enable connection roles for an entity


1. Sign in to Power Apps.
2. Expand Data, and then select Entities.
3. Select the entity that you want to enable for connection roles, and then on the command bar select
Settings.
4. In the Settings pane expand the Collaboration area, and then select Enable connections.

5. Select Done.
View connection roles
There are a number of standard connection roles already configured in Common Data Service.
1. Sign in to Power Apps, and then on the left pane select Solutions.
2. Open the unmanaged solution you want.
3. On the command bar, select Add existing, and then select Connection role. The list of available connection
roles are displayed.
4. Select Cancel to close the Add existing connection Roles dialog without adding a connection role to the
solution.

NOTE
If you want to distribute connection roles with a solution, make sure they are included in the solution you want to
distribute. More information: Add connection roles to a solution

View and edit connection roles using the classic experience


Most of the connection roles you can see in the Settings area are defined within the internal Default Solution
(not to be confused with the Common Data Services Default Solution). This internal Default Solution
contains all the customizations in the system. To view the Default Solution choose the All Solutions - Internal
view.

1. Sign in to Power Apps and than on the command bar select Settings , and then select Advanced
Settings.
2. Navigate to Settings > Business > Business Management and then select Connection Roles.

In this view you can see all the connection roles that are available for this environment and you can edit them here.

Add connection roles to a solution


Because connection roles are solution aware, which means that they can be included in a solution, you can also
add connection roles to a solution you distribute.
Generally it is not recommended to edit components in the internal Default Solution. Within the solution you
have created to work in, you can use the Add Existing command in the Solutions area to bring any of the active
connection roles into your solution.
Once you add the connection role to your solution, you can edit it wherever it is visible.

NOTE
The connection role status is not included with the connection role when it is exported from a solution. Therefore, when the
solution is imported into a target environment, the status will be set to active by default.

Create a connection role


IMPORTANT
If you intend to distribute a solution that includes new connection roles or changes to the existing connection roles you
must add them to the solution you will distribute. Editing or adding new connection roles using the Settings area will add
these connection roles to the internal Default Solution and will not include them in the solution you will distribute unless
you first add it to your solution. More information Add connection roles to a solution

1. Sign in to Power Apps and then on the left pane select Solutions.
2. Open the unmanaged solution your want, and then on the command bar select New > Other >
Connection role.
3. Complete the three steps on the form to Describe the connection role.
Describe the connection role
Set the following fields:

FIELD DESCRIPTION

Name (Required) The text describing the connection.

Connection Role Category A group describing the category of the connection. More
information: Connection Role Category values

Description Provide a definition for the role.

Connection Role Category values


The default Connection Role Category values are:
Business
Family
Social
Sales
Other
Stakeholder
Sales Team
Service
You can add new categories or modify existing ones by editing the Category global option set. More information:
Create and edit global option sets for Common Data Service (picklists)
Select record types
Select which record types should be available to connect.

NOTE
Although All is selected by default, make sure you consider which types are appropriate for the connection role you are
adding.

Matching connection roles


In this optional step, you can define any roles that be applied in a reciprocal manner. It is not required, but
connections are more meaningful if these are defined.
For example, people can set that Glen is a Friend to Mary, but does this mean that Mary is a Friend to Glen? We
hope so. But if Glen is the Father of Mary it doesn't mean that Mary is the Father of Glen. Establishing correct
reciprocity requires this extra step.
When people set a connection role that doesn't have a matching connection role, the role will only be displayed
when viewing the connection from the record that the connection was applied to. When viewed from the
connected record, the role will be empty unless a matching role is set.
For role definitions like Friend, Spouse, Colleague, or Sibling, it is best to assign the matching role to itself. If a
single matching connection role is configured, the single matching connection role will be applied in both
directions.

IMPORTANT
You will need to save a new connection role without this matching connection role before you can set the matching
connection role to itself.

You will find that some connection roles are already configured with matching connection roles. Former Employee
is matched with Former Employer and vice versa. This kind of one-to-one matching connection role is most
common.
You can configure multiple matching connection roles to describe complex relationships. If you create a connection
role such as Father, you could configure two more roles such as Daughter and Son and apply both of them as
matching connection roles to Father. In turn, both the Daughter and Son connection roles should be matched to
Father. Of course, then you should set up an equivalent role for Mother that is similarly matched with Daughter
and Son.

TIP
Before you create a complex set of connection roles, consider if a more simple set of roles will be enough. For example, rather
than creating a complex set of connection roles like Father, Mother, Son, and Daughter - consider if simply using Parent and
Child will work for you.

If more than one matching connection role is configured, those connection roles represent the only valid reciprocal
roles. The first one will be applied automatically as the default value. If the default value is not correct, people need
to manually edit the connection and choose between valid options defined in the configuration.
See also
Create connections to define and view relationships between records
Create and edit global option sets for Common Data Service (picklists)
Create and edit relationships between entities
Fields overview
12/2/2019 • 2 minutes to read • Edit Online

Fields define the individual data items that can be used to store information in an entity. Create new fields to
capture data when existing standard entities don’t have fields that meet your requirements. After you create a new
field, be sure to include it on the appropriate forms and views for the entity so that they are available in your app.

See also
Types of fields
Types of fields
12/3/2019 • 11 minutes to read • Edit Online

The names used for types depends on the designer used. Power Apps portal uses a convention that includes the
way the data is formatted. The solution explorer type uses a name aligned with the database data type with a
format modifier. The following table includes the corresponding AttributeTypeDisplayName API type.

PORTAL DATA TYPE SOLUTION EXPLORER TYPE API TYPE

Big Integer Time Stamp BigIntType

Currency Currency MoneyType

Customer Customer CustomerType

Date and Time Date and Time DateTimeType


Date and Time Format

Date Only Date and Time DateTimeType


Date Only Format

Decimal Number Decimal Number DecimalType

Duration Whole Number IntegerType


Duration Format

Email Single Line of Text StringType


Email Format

File File FileType

Floating Point Number Floating Point Number DoubleType

Image Image ImageType

Language Whole Number IntegerType


Language Format

Lookup Lookup LookupType

Multi Select Option Set MultiSelect Option Set MultiSelectPicklistType

Multiline Text Multiple Lines of Text MemoType

Option Set Option Set PicklistType

Owner Owner OwnerType


PORTAL DATA TYPE SOLUTION EXPLORER TYPE API TYPE

Phone Single Line of Text StringType


Phone Format

Status Reason Status Reason StatusType

Status Status StateType

Text Area Single Line of Text StringType


Text Area Format

Text Single Line of Text StringType


Text Format

Ticker Symbol Single Line of Text StringType


Ticker Symbol Format

Timezone Whole Number IntegerType


Time Zone Format

Two Options Two Options BooleanType

Unique Identifier Unique Identifier or Primary Key UniqueidentifierType

URL Single Line of Text StringType


URL Format

Whole Number Whole Number IntegerType


None Format

For more descriptions for each type you can add or edit, see the topic for the corresponding designer:
Create and edit fields for Common Data Service using Power Apps portal: Field Data types
Create and edit fields for Common Data Service using Power Apps solution explorer: Field Data types
For more information about how field data types are defined in the API, see Attribute metadata

Field Types used by the system


There are some fields used by the system that you cannot add using the designer.

TYPE DESCRIPTION

Big Integer or Time Stamp Used by the system to capture a version number manage
updates to an entity.

Customer A lookup field that you can use to specify a customer, which
can be an account or contact.
Note: This attribute can be added using solution explorer
designer.

Owner A system lookup field that references the user or team that is
assigned a user or team owned entity record.
TYPE DESCRIPTION

Status Reason A system field that has options that provide additional detail
about the Status field. Each option is associated with one of
the available Status options. You can add and edit the
options.

You can also include custom state transitions to control which


status options are available for certain entities. More
information: Define status reason transitions for custom
entities

Status A system field that has options that generally correspond to


active and inactive status. Some system attributes have
additional options, but all custom attributes have only Active
and Inactive status options.

Unique Identifier A system field stores a globally unique identifier (GUID) value
for each record.

MultiSelect Option Set


You can customize forms (main, quick create, and quick view ) and email templates by adding multi-select fields.
When you add a Multi-Select Option Set field, you can specify multiple values that will be available for users to
select. When users fill out the form they can select one, multiple, or all the values displayed in a drop-down list.
For example, if an organization operates in multiple areas or countries, you can include multiple locations or
countries in an ‘Area of operation’ field. A user can then select one or more locations from the list of available
values.
Multi-select option set is only available in read-only grids, editable grids, and forms. Multi-select option set is not
supported in:
Workflows, Actions, Dialogs, Roll Ups, charts, and Calculated fields.
Reports, SLA, and Routing Rule.
Multi-select fields are supported in the following types of forms:

FORM TYPE AVAILABILITY

Turbo form Yes

Refresh form Read-only (field will available but cannot be edited)

Legacy form No

Bulk Edit form No

You can use global option sets that are defined in your organization to configure values for the multi-select option
sets.

Using the right type of number


When choosing the correct type of number field to use, the choice to use a Whole Number or Currency type
should be pretty straightforward. The choice between using Floating Point or Decimal numbers requires more
thought.
Decimal numbers are stored in the database exactly as specified. Floating point numbers store an extremely close
approximation of the value. Why choose extremely close approximation when you can have the exact value? The
answer is that you get different system performance.
Use decimals when you need to provide reports that require very accurate calculations, or if you typically use
queries that look for values that are equal or not equal to another value.
Use floating point numbers when you store data that represents fractions or values that you will typically query
comparing to another value using greater than or less than operators. In most cases, the difference between
decimal and float isn’t noticeable. Unless you require the most accurate possible calculations, floating point
numbers should work for you.

Using currency fields


Currency fields allow for an organization to configure multiple currencies that can be used for records in the
organization. When organizations have multiple currencies, they typically want to be able to perform calculations
to provide values using their base currency. When you add a currency field to an entity that has no other currency
fields, two additional fields are added:
A lookup field called Currency that you can set to any active currency configured for your organization.
You can configure multiple active currencies for your organization in Settings > Business Management
> Currencies. There you can specify the currency and an exchange rate with the base currency set for your
organization. If you have multiple active currencies, you can add the currency field to the form and allow
people to specify which currency should be applied to money values for this record. This will change the
currency symbol that is shown for the currency fields in the form.
Individuals can also change their personal options to select a default currency for the records they create.
A decimal field called Exchange Rate that provides the exchange rate for a selected currency associated
with the entity with respect to the base currency. If this field is added to the form, people can see the value,
but they can’t edit it. The exchange rate is stored with the currency.
For each currency field you add, another currency field is added with the suffix _Base on the name. This field
stores the calculation of the value of the currency field you added and the base currency. Again, if this field is
added to the form, it can’t be edited.
When you configure a currency field you can choose the precision value. There are three options as shown in the
following table.

OPTION DESCRIPTION

Pricing Decimal Precision This is a single organization precision to be used for prices
found in Settings > Administration > System Settings >
General Tab.

Currency Precision This option applies the precision defined for the currency in
the record.

Specific precision values These settings allow for defining a specific set precision using
values between 0 and 4.

Different types of lookups


When you create a new lookup field you are creating a new Many-to-One (N:1) entity relationship between the
entity you’re working with and the Target Record Type defined for the lookup. There are additional configuration
options for this relationship that are described in Create and edit relationships between entities. But all custom
lookups can only allow for a reference to a single record for a single target record type.
However, you should be aware that not every lookup behaves this way. There are several different types of system
lookups as shown here.

LOOKUP TYPE DESCRIPTION

Simple Allows for a single reference to a specific entity. All custom


lookups are this type.

Customer Allows for a single reference to either an account or a contact


record.

Owner Allows for a single reference to either a team or a user record.


All team or user-owned entities have one of these. More
information: Add the team entity as a lookup option in your
app

PartyList Allows for multiple references to multiple entities. These


lookups are found on the Email entity To and Cc fields.
They’re also used in the Phone and Appointment entities.

Regarding Allows for a single reference to multiple entities. These


lookups are found in the regarding field used in activities.

Image fields
Use image fields to display a single image per record in the application. Each entity can have one image field. You
can add an image field to custom entities but not to standard entities. Some standard entities have image fields
defined.
Even though an entity has an image field, displaying that image in a model-driven app requires that you enable
two settings.
The standard entity definition Primary Image property value must be set to Default Image. Custom entities
require a custom image field. Then, you can select that image field for the Primary Image value in the custom
entity definition.
The entity form where the image is to be displayed must have the Show image in the form property
enabled.
When image display is enabled for an entity, any records that don’t have an image will display a placeholder
image. For example:
People can choose the default image to upload a picture from their computer. Images must be less than 10 MB
and must be in one of the following formats:
jpg
jpeg
gif
tif
tiff
bmp
png
When the image is uploaded, it will be converted to a .jpg format and all downloaded images will also use this
format. If an animated .gif is uploaded, only the first frame is saved.
When an image is uploaded, it will be resized as a "thumbnail" image to a maximum size of 144 pixels by 144
pixels. People should resize or crop the images before they upload them so that they will display well using this
size. All images are cropped to be square. If both sides of an image are smaller than 144 pixels, the image will be
cropped to be a square with the dimensions of the smaller side.
Add image support for a form in a custom entity using solution explorer
1. Open solution explorer.
2. In the left navigation pane, expand Entities, expand the custom entity you want, and then select Fields.
3. On the toolbar, select New.
4. In the Type section in the Data Type dropdown list select Image.
5. Enter a Display Name, such as Custom entity image.
6. Complete the remaining fields as appropriate. Notice that the Name, Field Requirement, and
Searchable fields can’t be changed. Select Save and Close.
7. On the entity definition next to the Primary Image property make sure the value is set to the custom
image you created in the previous step. If it's not select it.
8. Open the form where you want image support, such as the entity main form.
9. On the form editor ribbon, select Form Properties.
10. On the Form Properties page, select the Display tab, select Show image in the form, and then select
OK.

11. On the form editor ribbon, select Save, and then select Publish. Close the form editor.
App users can now select the image to display on the form. When an app user opens the form for a record, they
can choose the image that they want displayed on the form.

IMPORTANT
If the record is a new record that hasn’t been saved the error Invalid Argument is returned when you try to change the
image.

Change the image for a record


Once an entity form has an image field, app users can change the image for a given record.
1. Open the app that includes the entity form, and then select the image on the form.

2. Select Upload image, browse and select the image you want displayed on the entity form, and then select
Change. The image appears on the record.

More information for developers working with image data:


Entity metadata > Entity images
Image attributes

File fields
[This topic is pre-release documentation and is subject to change.]
Currently, the file data type is only available to canvas apps and flows.
The File field is used for storing binary data. The primary intended use of this field is to store a single image, note,
or attachment. However, storage of other forms of binary data is also possible. One or more fields of this data
type can be added to an existing standard customizable entity or a custom entity.
The default Maximum file size is 32 MB and the largest size you can set is 128 MB. The file size limit can be set
individually for each field of file type added to an entity.
More information for developers working with file data: File attributes
Create and edit global option sets overview
12/2/2019 • 2 minutes to read • Edit Online

An option set (picklist) is a type of field that can be included in an entity. It defines a set of options. When an
option set is displayed in a form it uses a drop-down list control. When displayed in Advanced Find it uses a
picklist control. Sometimes option sets are called picklists by developers.
You can define an option set to use a set of options defined within itself (locally) or it can use a set of options
defined elsewhere (globally) which can be used by other option set fields.
Global option sets are useful when you have a standard set of categories that can apply to more than one field.
Maintaining two separate option sets with the same values is difficult and if they are not synchronized you can
see errors, especially if you are mapping entity fields in a one-to-many entity relationship. More information:
Mapping entity fields

NOTE
If you define every option set as a global option set your list of global option sets will grow and could be difficult to
manage. If you know that the set of options will only be used in one place, use a local option set.

There are two designers you can use to create or edit global option sets:

DESIGNER DESCRIPTION

Power Apps portal Provides an easy streamlined experience, but some special
settings are not available.
More information: Create an option set

Solution explorer Not as easy, but provides for more flexibility for less common
requirements.
More information: Create and edit global option sets for
Common Data Service using solution explorer

NOTE
You can also create global option sets in your environment using the following:
Import a solution that contains the definition of the global option sets.
A developer can write a program to create them.
More information: Developer documentation: Customize global option sets.

Information in this topic will help you choose which designer you can use.
You should use the Power Apps portal to work with global option sets unless you need to address any of the
following requirements:
Assign colors to options
Change the order of options
Create a global option set in a solution other than the Common Data Service Default solution
Set managed properties
Set properties used for virtual entities
View dependencies

See also
Create an option set
Create and edit global option sets for Common Data Service using solution explorer
Developer documentation: Customize global option sets
Autonumber fields
12/3/2019 • 3 minutes to read • Edit Online

Autonumber fields are fields that automatically generate alphanumeric strings whenever they are created. Makers
can customize the format of these fields to their liking, and then rely on the system to generate matching values
that automatically fill them in at runtime.
While autonumber fields are formally just text fields with additional functionality built on top of them, Power Apps
simplifies this concept by simply exposing Autonumber as a distinct data type under the Text category. It is
important to note that the classic solution explorer doesn't support creating or managing autonumber fields.
To create an autonumber field, follow the same steps to create a field and simply select Autonumber from the
Data type drop-down list box.
You may also activate autonumber functionality on an existing text field by opening the field and selecting
Autonumber from the Data type drop-down list box. Similarly, autonumber functionality can also be disabled at
any time by opening the field and selecting a different option in the Data type drop-down list box.

NOTE
Autonumber values are preselected by the database when the record is started. If a record is started but cancelled, the
number it was assigned is not used. If, during this time, another record is completed with the next sequential number, gaps
will be present in the autonumbering of records.

Autonumber types
In order to make the creation of autonumber fields easier, there are a few pre-defined default autonumber types to
capture the most common scenarios.
String prefixed number
The most common autonumber format is a simple string prefixed number. When this type is selected, the
autonumber will consist of an automatically incrementing number with an optional string constant prefix. For
example, a string prefixed number with the prefix Contoso would generate records such as Contoso -1000,
Contoso -1001, Contoso -1002, and so on.
Date prefixed number
Another common autonumber format is a date prefixed number. When this type is selected, the autonumber will
consist of an automatically incrementing number with a formatted date prefix. The date portion of the record will
reflect the current date and time at which the record was created in UTC time. We have provided a number of
various date formats to choose from. For example, a date prefixed number would generate records such as 2019 -
26 -02 -1000, 2019 -27 -02 -1000, 2019 -28 -02 -1000, and so on, depending on the current date and selected date
format.
Custom
For more advanced makers with specific use cases, we provide the option to fully customize the desired format of
an autonumber field. The format may consist of string constants, automatically incrementing numbers, formatted
dates, or random alphanumeric sequences. For detailed information about how to define custom formats, see
AutoNumberFormat options.

Seed values
The seed value of an autonumber field is the starting number that is used for the number portion of the format.
For example, if you want an autonumber field to generate records such as Contoso -1000, Contoso -1001, Contoso -
1002, and so on, then the desired seed value is 1000, because that is the value that your number sequence starts
with. Autonumber fields have a default seed value of 1000, but you may set a custom seed value if you wish.

IMPORTANT
Setting the seed only changes the current number value for the specified attribute in the current environment. The seed
value is not included in a solution when it's imported in a different environment.

Create an autonumber field


1. Sign in to the Power Apps portal.
2. On the left pane expand Data and select Entities.
3. Select the entity that you would like to add an autonumber field to and then select the Fields tab.
4. On the toolbar, select Add field.
5. On the right pane, enter a Display name and select Autonumber for the Data type.

6. Set optional fields as needed. More information: Create and edit fields
7. Select an autonumber type or keep the default String prefixed number option.
8. Customize a seed value or keep the default value of 1000.
9. Select Done.

See also
Create and edit fields for Common Data Service using Power Apps portal
Set managed properties for fields
12/2/2019 • 2 minutes to read • Edit Online

Managed properties only apply when you include fields in a managed solution and import the solution into
another environment. These settings allow a solution maker to have some control over the level of customization
that people who install their managed solution can have when they customize this field. To set managed properties
for a field, select Managed Properties on the menu bar.
The Can be customized option controls all the other options. If this option is False , none of the other settings
apply. When it is True , you can specify the other customization options.
If the field is customizable, you set the following options to True or False .
Display name can be modified
Can change requirement level
Can change Additional Properties
These options are self-explanatory. If you set all the individual options to False , you might as well set Can be
customized to False .

Next steps
Create and edit fields
Behavior and format of the Date and Time field
3/26/2020 • 6 minutes to read • Edit Online

In Common Data Service, the Date and Time data type is used in many standard entity fields. Depending on what
kind of date the field represents, you can choose different field behaviors: User Local, Date Only or Time-Zone
Independent.

Date and time field behavior and format


The following table contains information about the date and time field behavior and format.

BEHAVIOR FORMAT DESCRIPTION

User Local Date Only This is the default behavior of custom


- or - date and time fields.
Date and Time
The field values are displayed in the
current user's local time.
In Web services, these values are
returned using a common UTC time
zone format.

You can change this one time if you


select the default behavior. More
information Change User Local
Behavior

Date Only Date Only No Time zone conversion.

The time portion of the value is always


12:00AM.
The date portion of the value is stored
and retrieved as specified in the UI and
Web services.

Time-Zone Independent Date Only No Time zone conversion.


- or -
Date and Time The date and time values are stored
and retrieved as specified in the UI and
Web services.

Change User Local Behavior:


Unless the publisher of a managed solution prevents this, you can change the behavior of an existing custom Date
fields from User Local to Date Only or Time-Zone Independent. This is a one time change.
Changing the field behavior affects the field values that are added or modified after the field behavior was
changed. The existing field values remain in the database in the UTC time zone format. To change the behavior of
the existing field values from UTC to Date Only, you may need a help of a developer to do it programmatically.
More Information: Convert behavior of existing date and time values in the database.
WARNING
Before changing the behavior of an existing date and time field, you should review all the dependencies of the field, such as
business rules, workflows, calculated fields, or rollup fields, to ensure that there are no issues as a result of changing the
behavior. After changing the behavior of a date and time field, you should open each business rule, workflow, calculated field,
and rollup field dependent on the field that you changed, review the information, and save it, to ensure that the latest date
and time field's behavior and value are used.

Change behavior during a solution import


When you import a solution that contains a Date field using the User Local behavior you may have the option to
change the behavior to Date Only or Time Zone Independent.
Prevent changing behavior
If you are distributing a custom date field in a managed solution, you can prevent people using your solution from
changing the behavior by setting the CanChangeDateTimeBehavior managed property to False. More
information: Set managed properties for fields

Use cases
Consider the following use cases for Date Only and Time-Zone Independent behaviors.
Date Only scenario: birthdays and anniversaries
The Date Only behavior is good for cases when information about the time of the day and the time zone isn't
required, such as birthdays or anniversaries. With this selection, all app users around the world see the exact same
date value.
Time -Zone Independent scenario: hotel check-in
You can use this behavior when time zone information isn't required, such as the hotel check-in time. With this
selection, all app users around the world see the same date and time value.

Best practices for using time zone


For my Date/Time field I was expecting (UTC/Local) and I am seeing the opposite value
This is caused by a lack of parity between the entity field setting and the app form setting. When an entity field is
configured for Time Zone Independent or User Local, it determines if the time zone offset is honored or not when
the data is being retrieved from the store. However, the app form also has a setting of UTC or Local.
This tells the form how to interpret the data it receives from the Common Data Service. If the data retrieved from
the store is time zone independent, but the form is set to local, the UTC data will be displayed as user local time
based on the user’s time zone in their profile. The reverse is also true, a user local value from the store will be
displayed as UTC if the form is set to UTC. Fortunately, the form’s date time zone values can be modified without
disrupting the existing records.
I picked Date Only in my entity field, but my form is showing a time picker along with the date
This would happen if you chose a behavior of time zone independent or user local for your date only field. In the
Common Data Service it will store a time of 00:00:00 by default, but if you add the field to a form it will assume
you need to set the time as well. If you leave the time pickers in the form, users can enter a time and it will be
saved as something other than 00:00:00. How can you fix this
Edit the form and remove the time picker and associated formulas. This will save the time as 00:00:00 and will
still allow for time zone based date calculations.
If your field is currently set to user local, and you don’t need the date to be time zone calculated, you can
change it to date only. This is a permanent change and cannot be undone. This change cannot be made to time
zone independent behavior fields. Always be careful changing behaviors as other apps, plugins, or workflows
may be relying on the data.
I have a date only field, but it is showing the wrong date for some users
If this happens, check the behavior that is set up for the date only field. If the field is set to time zone independent
or user local, the included timestamp will cause the date to appear differently for different users. The form display
settings of UTC or Local will determine if the date displayed is calculated using the user’s time zone settings or if it
displays it as the UTC value. Changing the form values to UTC instead of user local will prevent time zone offset
calculations and will display the UTC date for the saved record. Alternately, if you need this to be a static date that
does not change and the field is currently user local, you can change the field behavior to Date Only. Be cautious
though, this is cannot be undone.
My (script/plug-in) is supposed to intercept the date submitted using the Universal Client before the user local
conversion occurs, but instead it is being treated as User Local data
The web client and universal client have slightly different behaviors when it comes to when data is translated
between UTC and User Local. In the web client, dates are entered into the client, passed to the API as provided,
and converted later into user local time. This allowed scripts/plug-ins to retrieve the data and take action before
data was passed to the platform services and translated into user local time. In the universal client, the translation
of a date into user local values happens before the data is passed to the API, because of this, the data provided will
not be a UTC date but rather a user local date based on the user who retrieved or posted it. To resolve this, a user
can either:
Change the form to time zone independent which will retain the UTC value. This only works if the user does
not need the form to display in user local time.
Modify their script to detect the time zone offset used, recalculate back to UTC within the script, then take
action.

Date and time query operators not supported for Date Only behavior
The following date and time related query operators are invalid for the Date Only behavior. An invalid operator
exception error is thrown when one of these operators is used in the query.
Older Than X Minutes
Older Than X Hours
Last X Hours
Next X Hours
See also
Create and edit fields
Define calculated fields to automate manual calculations
Field managed properties
Managed properties
Blog: Working with time zones in the Common Data Service
How to create and edit fields
12/2/2019 • 2 minutes to read • Edit Online

In Common Data Service fields define the individual data items that can be used to store data in an entity.
Fields are sometimes called attributes by developers.
Before you create a custom field, evaluate whether using an existing field would meet your requirements. More
information: Create new metadata or use existing metadata?
There are two designers you can use to create or edit fields:

DESIGNER DESCRIPTION

Power Apps portal Provides an easy streamlined experience, but some special
settings are not available.
More information: Create and edit fields for Common Data
Service using Power Apps portal

Solution explorer Not as easy, but provides for more flexibility for less
common requirements.
More information: Create and edit fields for Common Data
Service using Power Apps solution explorer

NOTE
You can also create fields in your environment using the following:
In model-driven apps, select New Field from the form editor.
Import a solution that contains the definition of the fields.
Use Power Query to create new entities and fill them with data.
More information: Add data to an entity in the Common Data Service by using Power Query.
A developer can use Metadata services to write a program to create and update fields.

Information in this topic will help you choose which designer you can use.
You should use the Power Apps portal to Create and edit fields for Common Data Service unless you need to
address any of the following requirements:
Create a Customer Lookup field.
More information: Different types of lookups
Create a field in a solution other than the Common Data Service Default solution.
More information: Solutions overview
Define status reason transitions.
More information: Define status reason transitions for the Case or custom entities
Edit multiple fields at once.
Enable Auditing.
More information: Auditing overview
Enable Field Level Security.
More information: Field security entities
Select whether the field appears in global filter in interactive experience.
More information: Configure model-driven app interactive experience dashboards
Select whether the field is sortable in interactive experience dashboards.
More information: Configure model-driven app interactive experience dashboards
Set a field Requirement Level as Business Recommended.
More information: Create business rules and recommendations to apply logic in a model-driven app
form
Set managed properties for a field.
More information: Set managed properties for fields

NOTE
You can create a Lookup field in the Power Apps portal or in solution explorer by creating a One-to-many relationship on
the entity. But only solution explorer offers the option to create this relationship while creating a field.

Community tools
Attribute Manager is a tool that XrmToolbox community developed for Common Data Service. Please see the
Developer Tools topic for more community developed tools.

NOTE
The community tools are not a product of Microsoft and does not extend support to the community tools. If you have
questions pertaining to the tool, please contact the publisher. More Information: XrmToolBox.

See also
Create and edit fields for Common Data Service using Power Apps portal
Create and edit fields for Common Data Service using Power Apps solution explorer
Types of fields and field data types
Developer Documentation: Work with attribute metadata
Manage custom fields in an entity
12/2/2019 • 5 minutes to read • Edit Online

You can create and update one or more custom fields in any entity. When you create a custom field, you specify a
set of properties, such as the field's name, its display name, and the type of data that it will contain. For more
information, see Entity attribute metadata.

NOTE
Every entity has system fields, such as fields that indicate when a record was last updated, and who updated it. In addition,
standard entities have standard (default) fields. You can't modify or delete system fields or standard fields. If you create a
custom field, it should provide functionality on top of these built-in fields.

Create a field
1. On powerapps.com, expand the Data section and click or tap Entities in the left navigation pane.

2. Click or tap an existing entity, or Create a new entity


3. Add a new field to your entity by clicking Add field.
4. In the New Field panel, enter the Display name for your field, Name will be automatically populated and
is used as the unique name for your field. The Displayname is used when presenting this field to your
users, the Name is used when building your app, in expressions and formulas.

NOTE
The Display name fields can be updated at anytime to display differently in your apps, the Name field cannot be
changed after your entity has been saved as this could result in breaking an existing app.
5. Select the Data type of your field, this controls the way the information is stored as well as how it is
presented in apps. For example, text is stored different to a decimal number or a URL. For more detailed
information of the data types available, see Entity attribute metadata.
If you're prompted, specify additional information for the data type that you specified. Depending on the
data type, different fields will be presented. If you're creating a field of type Option set or Multi Select
Option Set, you can select New Option Set and create a new Option Set while creating your field. For
more information, see Create Option set

6. Under Required, select the check box if you want to recommended this field as required in your apps. This
does not provide hard enforcement through all connections to the Common Data Service. If you need to
ensure the field is populated, create a Business Rule
7. Under Searchable, select the check box if you need this field to be available in Views, Charts, Dashboards
and Advanced Find. In most cases this checkbox should be checked.
8. Click or tap Done to close the Field panel and return to the entity. You can repeat steps 3-9 for each
additional field.
IMPORTANT
Your field is not yet saved and created, until you save the changes to the entity.

9. Click or tap Save entity to finalize your changes and save them to the Common Data Service.
You're notified when the operation is completed successfully. If the operation is unsuccessful, an error
message indicates the issues that occurred and how you can fix them.

Create a Calculated or Roll up field


Calculated fields let you automate manual calculations used in your business processes. For example, a
salesperson may want to know the weighted revenue for an opportunity which is based on the estimated revenue
from an opportunity multiplied by the probability. Or, they want to automatically apply a discount, if an order is
greater than $500. A calculated field can contain values resulting from simple math operations, or conditional
operations, such as greater than or if-else, and many others. Calculated fields can be created using the following
data types:
Single line of text
Option Set
Two Options
Whole Number
Decimal Number
Currency
Date and Time
For more details on the types of expressions supported and examples, see Define calculated fields

Update or delete a field


1. On powerapps.com, expand the Data section and click or tap Entities in the left navigation pane, and then
click or tap an entity.
2. In the list of fields for the entity that you selected, click or tap a field, and then follow one of these steps:
Change one or more properties of the field.
Delete the field by clicking or tapping the ellipsis (...) near the right edge of the field, and then clicking or
tapping Delete.
3. Click or tap Save entity to submit your changes.

IMPORTANT
Your changes will be lost if you don't save them before you open another page in the browser or exit the browser.

You're notified when the operation is completed successfully. If the operation is unsuccessful, an error
message indicates the issues that occurred and how you can fix them.

Best practices and restrictions


As you create and modify fields, keep these points in mind:
You can't modify or delete system fields or their values.
In a standard entity, you can't modify or delete a standard (default) field, add a field that requires data, or make
any other change that might break an app that relies on that entity.
In a custom entity, you should make sure that the changes that you make won't break any app that relies on
that entity.
You must give each custom field a name that's unique within the entity, and you can't rename a field after you
create it.

Next steps
Define relationships between entities
Create a business rule
Create an app using entities
Create an app from scratch using a Common Data Service database

Privacy notice
With the Microsoft Power Apps common data model we collect and store custom entity and field names in our
diagnostic systems. We use this knowledge to improve the common data model for our customers. The entity and
field names that Creators create help us understand scenarios that are common across the Microsoft Power Apps
community and ascertain gaps in the service’s standard entity coverage, such as schemas related to organizations.
The data in the database tables associated with these entities is not accessed or used by Microsoft or replicated
outside of the region in which the database is provisioned. Note, however, the custom entity and field names may
be replicated across regions and are deleted in accordance with our data retention policies. Microsoft is committed
to your privacy as described further in our Trust Center.
Create and edit fields for Common Data Service
using Power Apps portal
2/12/2020 • 11 minutes to read • Edit Online

The Power Apps portal provides an easy way to create and edit entity fields with the Common Data Service.
The portal enables configuring the most common options, but certain options can only be set using solution
explorer.
More information:
Create and edit fields for Common Data Service
Create and edit fields for Common Data Service using Power Apps solution explorer

View fields
1. From the Power Apps portal, select Data > Entities and select the entity that has the fields you want to
view.
2. With the Fields tab selected, you can select the following views:

VIEW DESCRIPTION

All Shows all the fields for the entity

Managed Shows only managed and standard fields for the entity

Custom Shows only custom fields for the entity

Default Shows only the standard fields for the entity

Create a field
While viewing fields, in the command bar, click Add field which will show the Field properties panel.
Initially, just three field properties are available:

PROPERTY DESCRIPTION

Display Name The text to be displayed for the field in the user interface.

Name The unique name across your environment. A name will be


generated for you based on the display name that you've
entered, but you can edit it before saving. Once a field is
created the name cannot be changed as it may be
referenced in your applications or code. The name will have
the customization prefix for your Common Data Service
Default Publisher prepended to it.

Data type Controls how values are stored as well as how they are
formatted in some applications. Once a field is saved, you
cannot change the data type with the exception of
converting text fields to autonumber fields.

Required A record can't be saved without data in this field.

Searchable This field appears in Advanced Find and is available when


customizing views.

Calculated or Rollup Use to automate manual calculations. Use values, dates, or


text.
PROPERTY DESCRIPTION

Advanced Options Add a description, and specify a maximum length and IME
mode for the field.

You can set additional options depending on your choice of Data type.

Field Data types


There are many different types of fields, but you can only create some of them. For more information about all
types of fields, see Types of fields and field data types.
When creating a field, Data type provides the following choices:
Text
Standard text fields can store up to 4,000 characters. The default Max Length option is set to a lower value you
can adjust.

DATA TYPE DESCRIPTION

Text A text value intended to be displayed in a single-line


textbox.

Text Area A text value intended to be displayed in a multi-line textbox.


If you require more than 4,000 characters, use a Multiline
Text data type.

Email A text value validated as an e-mail address and rendered as


a mailto link in the field.

URL A text value validated as a URL and rendered as a link to


open the URL.

Ticker Symbol A text value for a ticker symbol that will display a link that
will open to show a quote for the stock ticker symbol.

Phone A text value validated as a phone number rendered as link


to initiate a phone call by using Skype.

Autonumber A customizable combination of numbers and letters that is


automatically generated by the server whenever the record
is created. More information: Autonumber fields

Max Length
Fields that store text have an absolute maximum depending on the type. The Max Length option sets a value
lower than the maximum specific to your environment. You can increase this max length but you should not
lower it if you have data in the system that exceeds the lower value.
Whole Number
These fields store data as a number but include different presentation and validation options.

DATA TYPE DESCRIPTION

Whole Number A number value presented in a text box.


DATA TYPE DESCRIPTION

Duration A number value presented as a drop-down list that contains


time intervals. A user can select a value from the list or type
an integer value that represents the number of minutes.
The duration must be entered in the format: “x minutes”, “x
hours” or “x days”. Hours and days can also be entered
using decimals, for example, “x.x hours” or “x.x days”. The
values entered must be expressible in minutes, sub-minute
values will be rounded to the nearest minute.

Timezone A number value presented as a drop-down list that contains


a list of time zones.

Language A number value presented as a drop-down list that contains


a list of languages that have been enabled for the
environment. If no other languages have been enabled, the
base language will be the only option. The value saved is
the Locale Identifier (LCID) value for the language.

Date Time
Use these fields to store time values. You can store values as early as 1/1/1753 12:00 AM.

DATA TYPE DESCRIPTION

Date and Time A date and time value.

Date Only A date and time value that only displays a date. The time
value is stored as 12:00 AM (00:00:00) in the system.

You can also set specific Behavior for Date Time fields in the Advanced options.
User local : Displays values converted to in the current user’s local time zone. This is the default for new
fields.
Date only: This behavior is available for the Date Only type. Displays values without time zone
conversion. Use this for data like birthdays and anniversaries.
Time zone independent: Displays values without time zone conversion.
More information: Behavior and format of the Date and Time field
Other Data types
DATA TYPE DESCRIPTION

Currency A money value for any currencies configured for the


environment. You can set a level of precision or choose to
base the precision on a specific currency or a single
standard precision used by the organization.More
information: Using currency fields

Decimal Number A decimal value with up to 10 points of precision. More


information: Using the right type of number

File For storing binary data.

Floating Point Number A floating point number with up to 5 points of precision.


More information: Using the right type of number
DATA TYPE DESCRIPTION

Image Displays a single image per record in the application. Each


entity can have one image field. The Name you enter when
creating an image field will be ignored. Image fields are
always named 'EntityImage'.

Lookup Creates a reference to a single record for a single target


record type.

Multi Select Option Set Displays a list of options where more than one can be
selected.

Multiline Text A text value intended to be displayed in a multi-line textbox.


Limited to a maximum of 1,048,576 characters. You can also
set a lower Max Length.

Option Set Displays a list of options where only one can be selected.

Two Options Displays two options where only one can be selected. You
choose which labels are displayed for each option. The
default values are Yes and No.

Save new field


Once you have set the Display Name, Name and Data type properties you can click Done to close the
Field properties panel.
You can continue to edit the entity and add additional fields or return and continue editing this field. The fields
will not be created until you click Save Entity to save all the changes to the entity.

You can also click Discard to discard the changes you have made.

Edit a field
While viewing fields, select the field you want to edit. You can modify the Display Name but you cannot
change the Name and Data type if you have saved changes to the entity to add the field.
General Properties
Every field has the following properties you can change:

PROPERTY DESCRIPTION

Required When this is selected a record can't be saved without data


in this field.

Searchable De-select this for fields for the entity that you don’t use.
When a field is searchable it appears in Advanced Find and
is available when customizing views. De-selecting this will
reduce the number of options shown to people using
advanced find.

Description Found within Advanced Options. Enter instructions to the


user about what the field is for. These descriptions appear as
tooltips for the user in model-driven apps when they hover
their mouse over the label of the field.

NOTE
Making fields required: Be careful when you make fields required. People will resist using the application if they can’t
save records because they lack the correct information to enter into a required field. People may enter incorrect data
simply to save the record and get on with their work.
Set requirement dynamically: In model-driven apps you can use business rules or form scripts to change the
requirement level as the data in the record changes as people work on it. More information: Create business rules and
recommendations to apply logic in a form
Advanced Find availability: Advanced Find is currently only available for model-driven apps using the Web Client.
Advanced find is not currently available in Unified Interface clients.

Calculated or Rollup
You can set a custom field to be a Calculated or a Rollup field. Fields that are not calculated or rollup fields
are sometimes referred to as simple fields.
Calculated
With a calculated field you can enter a formula to assign a value to the field. These data types can be set to
calculated fields: Currency, Date and Time, Date Only, Decimal Number, Duration, Email, Language,
Multi Select Option Set, Option Set, Text, Text Area, Ticker Symbol, Timezone, Two Options, URL, and
Whole Number.
More information: Define calculated fields to automate manual calculations
Rollup
With a rollup field you can set aggregation functions that will run periodically to set a number value for the
field. These data types can be set to calculated fields: Currency, Date and Time, Date Only, Decimal
Number, Duration, Language, Timezone, and Whole Number.
More information: Define rollup fields that aggregate values

Number field options


Each type of number field has absolute minimum and maximum values. You can set appropriate Minimum
value and Maximum value within these absolute values. Do this to have Common Data Service validate the
values for the data you want to store in the field.
For Floating Point Number and Decimal Number data types, you can specify a number of Decimal
places.

Option Set field options


Fields that provide a set of options can include their own set of local options or refer to a common set of
global options that can be used by multiple fields.
Using a global option set is valuable when you find yourself creating the same set of options for multiple
fields. With a global option set, you only need to maintain the set of options in one place.
When you choose Multi Select Option Set or Option Set data type the designer will list a set of available
global option sets for you to choose from and provide the option to create a New option set.

If you choose New option set the default behavior is to create a new global option set.

NOTE
While you are editing options for a new global option set, the Display name and Name values are for the global option
set rather than for the field. The default values match the field values, but you can edit them while you edit the global
option set to be different from the field you are currently creating.

If you want to create a local option set you must click View more and choose Local option set.
NOTE
If you define every option set as a global option set your list of global option sets will grow and could be difficult to
manage. If you know that the set of options will only be used in one place, use a local option set.

WARNING
If you remove an option which has been used by an entity record the data for that record will become invalid after you
save your changes to the global option set.
Before you remove an option that has been used, you should change the data in any entity record that uses that option
to a valid value.

Delete a field
With the system administrator security role, you can delete any custom fields that aren’t part of a managed
solution. When you delete a field, any data stored in the field is lost. The only way to recover data from a field
that was deleted is to restore the database from a point before the field was deleted.

NOTE
Before you can delete a custom field, you must remove any dependencies that may exist in other solution components.

While viewing fields, if you select a custom field that can be deleted in the list, the Delete field command
appears and is enabled.
Use the Delete field command to delete the field. After deleting the field you must save the changes to the
entity.

NOTE
If you get an error related to dependencies, you must use solution explorer to detect dependencies. More information:
Check field dependencies

IME Mode
Any of the fields that provide direct text input have an IME Mode. The Input Method Editor (IME ) is used for
east asian languages like Japanese. IMEs allow the user to enter the thousands of different characters used in
east asian written languages using a standard 101-key keyboard.
See also
Create and edit fields for Common Data Service
Create and edit fields for Common Data Service using Power Apps solution explorer
Types of fields and field data types
Define calculated fields to automate manual calculations
Define rollup fields that aggregate values
Behavior and format of the Date and Time field
Create and edit fields for Common Data Service
using Power Apps solution explorer
12/2/2019 • 14 minutes to read • Edit Online

Solution explorer provides one way to Create and edit fields for Common Data Service.
The Power Apps portal enables configuring the most common options, but certain options can only be set using
solution explorer.
More information:
Create and edit fields for Common Data Service
Create and edit fields for Common Data Service using Power Apps portal

Open solution explorer


Part of the name of any custom field you create is the customization prefix. This is set based on the solution
publisher for the solution you’re working in. If you care about the customization prefix, make sure that you are
working in an unmanaged solution where the customization prefix is the one you want for this entity. More
information: Change the solution publisher prefix
Navigate to an unmanaged solution
1. From the Power Apps portal select Solutions, and then on the toolbar, select Switch to classic.
2. In the All Solutions list select the unmanaged solution you want.

View fields
With solution explorer open, under Components expand Entities and select the entity where you want to create
or edit the field.

You can select the following views:


VIEW DESCRIPTION

All Shows all the fields for the entity

Custom Shows only custom fields for the entity

Customizable Shows only the fields that can be edited

Create a field
While viewing fields, in the command bar, click New which will open the new field form. Some standard entities
or custom entities that are included in a managed solution might not allow you to add new fields.

NOTE
For model-driven apps you can also create a new field from the form editor. In the form editor, below the Field Explorer
click New Field to create a new field. More information: Add a field to a form

You must enter data and confirm default values set for the following properties before you save.

PROPERTY DESCRIPTION

Display Name The text to be displayed for the field in the user interface. You
can change this after you save, but the value you enter will
generate a value for the Name field.

Field Requirement Whether data is required in the field to save the record. More
information: Field Requirement options
PROPERTY DESCRIPTION

Name The unique name across your environment. A name will be


generated for you based on the display name that you've
entered, but you can edit it before saving. Once a field is
created the name cannot be changed as it may be referenced
in your applications or code. The name will have the
customization prefix for the current solution's publisher
prepended to it.

Searchable Set this to No for fields for the entity that you don’t use.
When a field is searchable it appears in Advanced Find in
model-driven apps and is available when customizing views.
De-selecting this will reduce the number of options shown to
people using advanced find.

Field Security Whether the data in the field is secured at a higher level than
the entity. More information: Field level security to control
access

Auditing Whether data for this field will be audited when the entity is
enabled for auditing. More information: Audit data and user
activity for security and compliance

Description Enter instructions to the user about what the field is for.
These descriptions appear as tooltips for the user in model-
driven apps when they hover their mouse over the label of
the field.

Appears in global filter in interactive experience More information: Configure interactive experience
dashboards

Sortable in interactive experience dashboard More information: Configure interactive experience


dashboards

Data type Controls how values are stored as well as how they are
formatted in some applications. Once a field is saved, you
cannot change the data type as it may impact the data in
your entity. More information: Field Data types

Field type Whether the field is Simple, Calculated, or Rollup. More


information: Field Type

Format How the field will be formatted. The available formatting


options depend on the Data type.

You can set additional options depending on your choice of Data type. More information: Field Data types

Field Requirement options


There are three field requirement options:
Optional: The record can be saved even if there is no data in this field.
Business Recommended: The record can be saved even if there is no data in this field. However, a blue
symbol appears next to the field to indicate it is important.
Business Required: The record can’t be saved if there is no data in this field.
NOTE
Be careful when you make fields business required. People will resist using the application if they can’t save records because
they lack the correct information to enter into a required field. People may enter incorrect data simply to save the record
and get on with their work. You can use business rules or form scripts to change the requirement level as the data in the
record changes as people work on it. More information Create business rules and recommendations to apply logic in a form

Field Data types


There are many different types of fields, but you can only create some of them. For more information about all
types of fields, see Types of fields and field data types.
When creating a field, Data type provides the following choices:

OPTION DESCRIPTION

Single Line of Text This field can contain up to 4,000 text characters. You can set
a maximum length to be less than this. This field has several
format options that will change the presentation of the text.
More information: Single line of text options

Option Set Displays a list of options where one can be selected. More
information: Option set field options

MultiSelect Option Set Displays a list of options where more than one can be
selected. More information: Option set field options

Two Options Displays a list of options where one of two can be selected.

Two option fields don’t provide format options at the field


level. But when you add one to the form you can choose to
display them as radio buttons, a check box, or a select list.

Image Displays a single image per record in the application. Each


entity can have one image field. Image fields are always
named EntityImage .

Whole Number Integers with a value between -2,147,483,648 and


2,147,483,647 can be in this field. This field has options that
change depending on how the field is presented. More
information: Whole number options

Floating Point Number Up to 5 decimal points of precision can be used for values
between -100,000,000,000 and -100,000,000,000 can be in
this field. You can specify the level of precision and the
maximum and minimum values. More information: Using the
right type of number

Decimal Number Up to 10 decimal points of precision can be used for values


between -100,000,000,000 and -100,000,000,000 can be in
this field. You can specify the level of precision and the
maximum and minimum values. More information: Using the
right type of number
OPTION DESCRIPTION

Currency Monetary values between -922,337,203,685,477 and


922,337,203,685,477 can be in this field. You can set a level
of precision or choose to base the precision on a specific
currency or a single standard precision used by the
organization. More information: Using currency fields

Multiple Lines of Text This field can contain up to 1,048,576 text characters. You
can set the maximum length to be less than this. When you
add this field to a model-driven app form, you can specify the
dimensions of the field.

Date and Time Use these fields to store time values. You can store values as
early as 1/1/1753 12:00 AM. More information: Date and
Time options

Lookup A field that allows setting a reference to a single record of a


specific type of entity. Some system lookup fields behave
differently. More information: Different types of lookups

Customer A lookup field that you can use to specify a customer, which
can be an account or contact. More information: Different
types of lookups

Single line of text options


The single line of text data type has the following format options:

FORMAT DESCRIPTION

Text A text value intended to be displayed in a single-line textbox.

Text Area A text value intended to be displayed in a multi-line textbox.


If you require more than 4,000 characters, use a Multiple
Lines of Text data type.

Email A text value validated as an e-mail address and rendered as a


mailto link in the field.

URL A text value validated as a URL and rendered as a link to


open the URL.

Ticker Symbol A text value for a ticker symbol that will display a link that will
open to show a quote for the stock ticker symbol.

Phone A text value validated as a phone number rendered as link to


initiate a phone call by using Skype.

You can also set a Maximum length to so that the system will not allow text values longer than you specify.
Option set field options
Fields that provide a set of options can include their own set of local options or refer to a common set of global
options that can be used by multiple fields.
Using a global option set is valuable when you find yourself creating the same set of options for multiple fields.
With a global option set, you only need to maintain the set of options in one place.
When you choose Multi Select Option Set or Option Set data type the solution explorer designer will provide
the option for a local option set by default.

Configure local options


To define options, in the Options area click to add an option.
For each option you can add the following property values

PROPERTY DESCRIPTION

Label The localizable text for the option.

Value The number value for the option. This is prefixed with a value
defined in the solution publisher for the solution you are
working in. This prefix helps ensure that the value will be
different from option values that can be defined in another
solution and imported into your environment.

External Value This value is used for virtual entities to map a value in an
external data source with this option.

Description A place to record the purpose for this option. This value is
not displayed to application users.

Color Specifies a color to use in charts for this option.


Tip: Use a site like w3schools.com HTML Color Picker to find
the hex code values for colors.

Use the other icons in the options toolbar to perform the following operations:

ICON OPERATION

Remove the selected option

Move the selected option up

Move the selected option down

Sort the options by label in ascending order

Sort the options by label in descending order

Use Existing Option Set


If you to choose Use Existing Option Set the designer will display a list of existing global option sets and
include an Edit and New buttons to configure the global options that this field should use.

You can also configure global option sets separately. More information: Create and edit global option sets for
Common Data Service (picklists)

NOTE
If you define every option set as a global option set your list of global option sets will grow and could be difficult to
manage. If you know that the set of options will only be used in one place, use a local option set.

Whole number options


Whole number fields have the following format choices:

FORMAT DESCRIPTION

None A number value presented in a text box.

Duration A number value presented as a drop-down list that contains


time intervals. A user can select a value from the list or type
an integer value that represents the number of minutes.

Timezone A number value presented as a drop-down list that contains


a list of time zones.

Language A number value presented as a drop-down list that contains


a list of languages that have been enabled for the
environment. If no other languages have been enabled, the
base language will be the only option. The value saved is the
Locale Identifier (LCID) value for the language.

You can also restrict the maximum or minimum allowed values.


Date and Time options
Date and Time fields have the following options:
FORMAT DESCRIPTION

Date and Time A date and time value.

Date Only A date and time value that only displays a date. The time
value is stored as 12:00 AM (00:00:00) in the system.

You can also set specific Behavior for Date Time fields in the Advanced options.
User local : Displays values converted to in the current user’s local time zone. This is the default for new
fields.
Date only: This behavior is available for the Date Only type. Displays values without time zone conversion.
Use this for data like birthdays and anniversaries.
Time zone independent: Displays values without time zone conversion.
More information: Behavior and format of the Date and Time field

Field Type
You can set a custom field Field Type to be a Simple, Calculated, or a Rollup field.
Simple
Simple means that the field is not a calculated or rollup field.
Calculated
With a calculated field you can enter a formula to assign a value to the field. These data types can be set to
calculated fields: Currency, Date and Time, Decimal Number, Multi Select Option Set, Option Set, Single
line of text, Two Options, and Whole Number.
More information: Define calculated fields to automate manual calculations
Rollup
With a rollup field you can set aggregation functions that will run periodically to set a number value for the field.
These data types can be set to calculated fields: Currency, Date and Time, Decimal Number, and Whole
Number.
More information: Define rollup fields that aggregate values

Save new field


Once you have configured the field, use one of three commands in the command bar:

COMMAND DESCRIPTION

Save Save the field definition and leave the form window open.

Save and Close Save the field definition and close the window.

Save Create New Save the field definition and open a new form to create a new
field.

Edit a field
While viewing fields, click the field you want to edit. Some standard fields or custom fields that are included in a
managed solution might not allow you to edit them.
NOTE
When editing a form, for any field already added to the form you can double-click the field to display the Field Properties.
On the Details tab, click Edit. More information: Add a field to a form

After you make changes to a field, you must publish customizations.


To publish your changes for one entity, under Components, select Entities, and then select the entity that
you made changes to. On the Actions toolbar, select Publish.
To publish all changes you have made to multiple entities or components, on the Actions toolbar, select
Publish All Customizations.

NOTE
Installing a solution or publishing customizations can interfere with normal system operation. We recommend that you
schedule a solution to be published when it’s least disruptive to users.

Edit multiple fields


To edit one or more fields, select the field or fields (using the Shift key) you want to modify and then on the
Actions toolbar, select Edit.
When you select multiple fields to edit, the Edit Multiple Fields dialog box appears. You can edit Field
Requirement, Searchable, and Auditing.

Delete a field
With the system administrator security role, you can delete any custom fields that aren’t part of a managed
solution. When you delete a field, any data stored in the field is lost. The only way to recover data from a field that
was deleted is to restore the database from a point before the field was deleted.

NOTE
Before you can delete a custom field, you must remove any dependencies that may exist in other solution components.

1. While viewing fields, select a custom field that can be deleted in the list and click the button in the
command bar.
2. In the Confirm Deletion dialog, select Delete.

TIP
You can select multiple custom fields to be deleted in one operation.

Check field dependencies


Select the field in the list. In the More Actions menu, select Show Dependencies.
Dependencies are any related use of the field that would prevent it from being deleted. For example, if the field is
used in a form or view, you must first remove references to the field in those solution components.
If you delete a lookup field, the 1:N entity relationship for it will automatically be deleted.

IME Mode
Any of the fields that provide direct text input have an IME Mode. The Input Method Editor (IME ) is used for east
asian languages like Japanese. IMEs allow the user to enter the thousands of different characters used in east
asian written languages using a standard 101-key keyboard.
See also
Create and edit fields for Common Data Service
Create and edit fields for Common Data Service using Power Apps portal
Types of fields and field data types
Define calculated fields to automate manual calculations
Define rollup fields that aggregate values
Behavior and format of the Date and Time field
Create an Option set
11/4/2019 • 2 minutes to read • Edit Online

Option sets allow you to include drop down lists of fixed values to a user within your app to ensure data
consistency, sometimes referred to as picklists or choice fields in other applications. Similar to entities, there are
both standard Option sets, and the ability to create custom Option sets to use within your app.
Option sets can be created in two ways, either from the Option set list within the portal or directly within an entity
while creating a field. For more information on how to create an entity, see Create an entity.

Creating an Option set while adding a field.


1. On powerapps.com, expand the Data section and click or tap Entities in the left navigation pane.

2. Click or tap an existing entity, or Create a new entity


3. Add a new field to your entity by clicking Add field.
4. In the new field panel, enter the Display name for your field, Name will be automatically populated and is
used as the unique name for your field. The Display name is used when presenting this field to your
users, the Name is used when building your app, in expressions and formulas.
5. Click the Data type drop down and select Option set, or Multi select Option set.
6. Click the Option set drop down and select New Option set

NOTE
If an existing option set could be used for your entity, you can select it from this list without creating a new one.

7. A new panel will open to create the Option set, the Display name and Name will default from the name
of the field but can be changed if needed. Click Add new item to start creating your list of options. Repeat
this step until all your items are created.
8. Once you've entered your items, click Save to create your Option set.

9. Click Done to close the field panel, and then Save entity to save your entity to the Common Data Service.

NOTE
You can select one of your items as the Default for this field, and it will be selected by default when users are
creating new records in your entity.
Creating an Option set from the Option set list
1. On powerapps.com, expand the Data section and click or tap Option sets in the left navigation pane.

2. Click New Option set


3. A new panel will open to create the Option Set, enter the Display name and Name. Click Add new item
to start creating your list of options. Repeat this step until all your items are created.
4. Once you've entered your items, click Save to create your Option set.

5. You can now use this option set by creating new field on an entity.

Global and Local Option sets


By default, Option sets are created as Global Option sets which allows them to be reused across multiple entities.
Under the View more option when creating a new Option set you can chose to make an Option set Local. This
option is only available when Creating an Option set while adding a field, and not through the Option set list.
Local option sets can only be used by the entity and field they are created against, and cannot be reused on other
entities. This approach is only recommended for advanced users that a specific need for a local option set.
IMPORTANT
Once an option set is created as local or global, this cannot be changed.
Create and edit global option sets for Common Data
Service using solution explorer
3/25/2020 • 4 minutes to read • Edit Online

Solution explorer provides one way to Create and edit global option sets for Common Data Service.
The Power Apps portal enables configuring the most common options, but certain options can only be set using
solution explorer.
More information:
Create and edit global option sets for Common Data Service
Create an option set

Open solution explorer


Part of the name of any global option set you create is the customization prefix. This is set based on the solution
publisher for the solution you’re working in. If you care about the customization prefix, make sure that you are
working in an unmanaged solution where the customization prefix is the one you want for this global option set.
More information: Change the solution publisher prefix
Navigate to an unmanaged solution
1. From the Power Apps portal select Solutions, and then on the toolbar, select Switch to classic.
2. In the All Solutions list select the unmanaged solution you want.

View global option sets


With solution explorer open, under Components select Option Sets.
NOTE
Some system global option sets are not customizable. These options may change with updates or new versions so we
recommend you don’t use them unless you are certain that your requirements align with the way that Common Data
Service uses these values.

Create a global option set


NOTE
You do not need to create a global option set before you use it within a custom field. When you create a new option set field
you have the option to create a new global option set or use an existing one. See Option set field options

While viewing global option sets, click New to open a form to define the global option set.

Type a Display name that will be visible to people with the system administrator or customizer role who will
choose this global option set when defining new fields that use it. This name will not be visible to people using
your apps.
A Name field value will be generated for you based on the Display name you enter. It will include the
customization prefix for the Solution publisher in the context of the solution you are working in. You can change
the generated portion of the Name field value before you save.
Type a Description for the global option set.
TIP
Use the Description to explain the purpose of this global option set. This value is not visible to users of the application, it is
for other people with the system administrator or customizer role who may want to know why this particular global option
set was created.

Configure options
To define options, in the Options area click to add an option.
For each option you can add the following property values

PROPERTY DESCRIPTION

Label The localizable text for the option.

Value The number value for the option. This is prefixed with a value
defined in the solution publisher for the solution you are
working in. This prefix helps ensure that the value will be
different from option values that can be defined in another
solution and imported into your environment.

External Value This value is used for virtual entities to map a value in an
external data source with this option.

Description A place to record the purpose for this option. This value is not
displayed to application users.

Color Specifies a color to use in charts for this option.


Tip: Use a site like w3schools.com HTML Color Picker to find
the hex code values for colors.

Use the other icons in the options toolbar to perform the following operations:

ICON OPERATION

Remove the selected option

Move the selected option up

Move the selected option down

Sort the options by label in ascending order

Sort the options by label in descending order

Edit a global option set


While viewing global option sets, select the option set you want to edit to open the panel to edit it.
Except for changing the Name field value or the number Value assigned to an option, you can make any of the
changes you can when creating the global option set.
NOTE
You cannot edit an option set if it is part of a managed solution. To edit managed solution option sets, you will have to
contact the solution owner.

WARNING
If you remove an option which has been used by an entity record the data for that record will become invalid after you save
your changes to the global option set.
Before you remove an option that has been used, you should change the data in any entity record that uses that option to a
valid value.

Delete a global option set


To delete a global option set, while viewing the list select the command in the command bar.

IMPORTANT
If the global option set has been used by a field, you will not be able to delete it until that field is deleted.

See also
Create and edit global option sets for Common Data Service
Create an option set
Create and edit fields
Developer documentation: Customize global option sets
Define calculated fields to automate manual
calculations
12/3/2019 • 11 minutes to read • Edit Online

Use calculated fields to automate manual calculations used in your business processes.
For example, a salesperson may want to know the weighted revenue for an opportunity which is based on the
estimated revenue from an opportunity multiplied by the probability. Or, they want to automatically apply a
discount, if an order is greater than $500. A calculated field can contain values resulting from simple math
operations, or conditional operations, such as greater than or if-else, and many others. You can accomplish all this
by using Power Apps, no need to write code.

Capabilities
Calculated fields use the fields from the current entity or related parent entities.
The expression support is available on the current entity and the related parent entity fields in the Condition
sections and the Action sections. The built-in functions include:
ADDHOURS, ADDDAYS, ADDWEEKS, ADDMONTHS, ADDYEARS, SUBTRACTHOURS,
SUBTRACTDAYS, SUBTRACTWEEKS, SUBTRACTMONTHS, SUBTRACTYEARS, DIFFINDAYS,
DIFFINHOURS, DIFFINMINUTES, DIFFINMONTHS, DIFFINWEEKS, DIFFINYEARS, CONCAT,
TRIMLEFT, and TRIMRIGHT.
A rich conditional support provides branching and multiple conditions. The logical operations include AND
and OR operators.
The visual editing capabilities include modern user interface and intellisense in the ACTION section.
A seamless integration of the calculated fields with the forms, views, charts, and reports is available in real
time.
You can configure calculated fields to use custom controls.

Scenarios
Weighted Revenue: Estimated revenue multiplied by probability
Net Worth: Assets subtracted by the liabilities for a given account
Cost of Labor: Base rate up to 40 hours, plus additional overtime
Contact Number: Phone number for an opportunity based on account or contact
Lead Score: Single field that provides insights to the quality of a given lead
Follow Up By: Follow up on an activity by a specified number of days based on priority

IMPORTANT
To create a calculated field you must have the Write privilege on the Field Security Profile entity. If the calculated field uses
the secured fields in a calculation, you should consider securing the calculated field as well, to prevent users from accessing
data for which they don’t have sufficient permissions. The calculated field editor gives you a warning if you are creating a
calculated field that uses secured fields in a calculation, suggesting you secure the calculated field. More information: Field
level security to control access.

Create a calculated field


Use the field editor to specify a calculated field. In this example we will use Power Apps but the steps are similar
using solution explorer. More information: Create and edit fields
1. Open Power Apps
2. Expand Data > Entities.
3. Select the entity you want and choose Fields. Choose Add Field.
4. Provide the required information for the field, including the Display name, Name and Data type.
5. If the data type is one of types that support calculated fields, you can make the field a calculated field by
selecting Add > Calculation.

These are the types of fields that support calculations:


Text
Option Set
Two Options
Whole Number
Decimal Number
Currency
Date Time
6. Selecting Calculation requires that you save the changes to the entity. Click Save in the Pending
changes dialog to proceed.
7. This will open the calculated field definition editor, where the new calculated field has been created, but no
formula has been set. The calculated field definition consists of two sections: CONDITION and ACTION.
In the Condition section, you can specify an entity, field, operator, type, and value. In the dropdown box for the
Entity, you can choose a current entity or a related entity. In the Field dropdown box, you have a selection of
all available fields for the entity. Depending on the operator you choose, you may need to provide type and
value. You can specify multiple conditions using the AND or OR operators.
In the Action section, you provide the formula for the calculated field.

NOTE
You can use data from Lookup records within your Action. You first have to select the Lookup field and then type a period.
After that, you can select one of the fields available on the related entity. For example, in the case of
<LookupFieldName>.<RelatedFieldName> , you can select: ParentAccountId.AccountNumber .

Note that field level security will be ignored on the related entity, so if there is sensitive data in the accessed field we suggest
securing your calculated field as well.

Examples
Let’s take a look at calculated field examples in more detail.
Weighted revenue of opportunity
In this example, we are using the fields of the opportunity entity to calculate the weighted revenue based on the
opportunity’s probability. In the field editor for an opportunity entity, we create a field called Weighted Revenue
and specify the field type as Calculated and the data type is Currency.
In the calculated field definition editor, in the Condition section, we specify the opportunity with the Status =
Open. In the ACTION, the formula calculates the weighted revenue based on the opportunity estimated revenue
multiplied by the probability of the opportunity. The following screenshots show step-by-step how to define the
Weighted Revenue calculated field.
Set the condition on the opportunities:
Provide the formula for the weighted revenue:

Altogether:

Follow-up date of opportunity


In this example, we are using the fields of the originated lead of an opportunity to calculate the appropriate date
when to follow up on the opportunity.
In the field editor for an opportunity entity, we create a field called Follow-up date and specify the type as
Calculated and the data type is Date and Time.
In the calculated field definition editor, in the Condition section, we specify two conditions the purchase time
frame and the estimated value of the lead.
In the ACTION, we provide two formulas:
To follow up in one week on the immediate opportunity
To follow up in one month if the opportunity is not likely to happen right away.
The following screenshots show step-by-step how to define the Follow-up date calculated field.
Set the two conditions on the originating lead:

Provide the formula to follow up in one week:


Provide the formula to follow up in one month:

Altogether:
Days from a record creation
In this example, we are using the DIFFINDAYS function, to compute the difference in days from the time when a
record was created to the current date.
Create a new Whole Number field called Calculated difference in days.
Provide the formula for computing the difference in days

Altogether:
Functions syntax
The following table contains information about the syntax for the functions provided in the ACTION section of
the calculated field.

TIP
The function names are specified in uppercase letters.

FUNCTION SYNTAX DESCRIPTION RETURN TYPE

ADDDAYS (whole number, date and Returns a new date and time that is Date and Time
time) equal to the given date and time, plus
the specified number of days.

ADDHOURS (whole number, date and Returns a new date and time that is Date and Time
time) equal to the given date and time, plus
the specified number of hours.

ADDMONTHS (whole number, date Returns a new date and time that is Date and Time
and time) equal to the given date and time, plus
the specified number of months.

ADDWEEKS (whole number, date and Returns a new date and time that is Date and Time
time) equal to the given date and time, plus
the specified number of weeks.

ADDYEARS (whole number, date and Returns a new date and time that is Date and Time
time) equal to the given date and time, plus
the specified number of years.

SUBTRACTDAYS (whole number, date Returns a new date and time that is Date and Time
and time) equal to the given date and time,
minus the specified number of days.

SUBTRACTHOURS (whole number, Returns a new date and time that is Date and Time
date and time) equal to the given date and time,
minus the specified number of hours.

SUBTRACTMONTHS (whole number, Returns a new date and time that is Date and Time
date and time) equal to the given date and time,
minus the specified number of months.
FUNCTION SYNTAX DESCRIPTION RETURN TYPE

SUBTRACTWEEKS (whole number, Returns a new date and time that is Date and Time
date and time) equal to the given date and time,
minus the specified number of weeks.

SUBTRACTYEARS (whole number, Returns a new date and time that is Date and Time
date and time) equal to the given date and time,
minus the specified number of years.

DIFFINDAYS (date and time, date and Returns the difference in days between Whole Number
time) two Date and Time fields. If both
dates and times fall on the same day,
the difference is zero.

DIFFINHOURS (date and time, date Returns the difference in hours Whole Number
and time) between two Date and Time fields.

DIFFINMINUTES (date and time, date Returns the difference in minutes Whole Number
and time) between two Date and Time fields.

DIFFINMONTHS (date and time, date Returns the difference in months Whole Number
and time) between two Date and Time fields. If
both dates and times fall on the same
month, the difference is zero.

DIFFINWEEKS (date and time, date and Returns the difference in weeks Whole Number
time) between two Date and Time fields. If
both dates and times fall on the same
week, the difference is zero.

DIFFINYEARS (date and time, date and Returns the difference in years between Whole Number
time) two Date and Time fields. If both
dates and times fall on the same year,
the difference is zero.

CONCAT (single line of text, single line Returns a string that is the result of String
of text, … single line of text) concatenating two or more strings.

TRIMLEFT (single line of text, whole Returns a string that contains a copy of String
number) a specified string without the first N-
characters.

TRIMRIGHT (single line of text, whole Returns a string that contains a copy of String
number) a specified string without the last N-
characters.

NOTE
All DIFF functions require that the first Date and Time field and the second Date and Time field have the same behavior:
User Local, Date Only or Time-Zone Independent. If the behavior of the second field doesn’t match the behavior of the
first field, the error message is shown, indicating that the second field can’t be used in the current function. More
information: Behavior and format of the Date and Time field.
NOTE
You cannot enter a date, such as 01/01/2015, as the Date value in a calculated field. Date and DateTime values can only be
set or compared using other DateTime fields.

In the CONCAT function, you can use literal strings as single lines of text, entity fields that contain a single line of
text, or a combination of both. For example: CONCAT (FirstName, LastName, "is a manager."). If a literal string
contains quotation marks, precede each mark with the backslash (\) escape character, like this:
This string contains the \"quotation marks.\" This ensures that the quotation marks inside the string aren’t
treated as special characters that separate the strings.
The following examples show how to use the TRIMLEFT and TRIMRIGHT functions. They contain the initial
strings and the resulting strings, returned by the TRIMLEFT and TRIMRIGHT functions:
TRIMLEFT ("RXX10-3456789", 3), returns the string 10-3456789
TRIMRIGHT ("20-3456789RXX", 3), returns the string 20-3456789

Considerations
You should be aware of certain conditions and limitations when working with calculated fields:
Saved queries, charts, and visualizations can have a maximum of 10 unique calculated fields.
The calculated field values are not displayed in the Outlook Client Offline mode in the tile views or on entity
main forms.
A maximum number of chained calculated fields is 5.
A calculated field can’t refer to itself or have cyclic chains.
If you change one of the condition operators in a multiple condition clause, all of the condition operators will
update to that condition. For example, in the clause IF (x > 50) OR (y ==10) OR (z < 5) , if you change the OR
operator to the AND operator, then all OR operators in the clause will become AND operators.
You can access parental fields via the Lookup field to the parent entity, such as <LookupFieldName>.<FieldName> .
This is not possible with multi-entity lookup fields like Customer which can be Account or Contact. However,
some entities have individual Lookup fields for a specific entity, such as ParentAccountid. <FieldName> or
ParentContactid. <FieldName> .
Sorting is disabled on:
A calculated field that contains a field of a parent record.
A calculated field that contains a logical field (for example, address field)
A calculated field that contains another calculated field.
Calculated fields can span two entities only.
A calculated field can contain a field from another entity (spanning two entities – current entity and
parent record).
A calculated field can’t contain a calculated field from another entity that also contains another field
from a different entity (spanning three entities):
(Current Entity) Calculated Field ← (Parent Record) Calculated Field 1 ← (Parent Record) Calculated
Field 2.
You can’t trigger workflows or plug-ins on calculated fields.
You can’t change an existing simple field to a calculated field. If your current application is using JavaScript or
plug-ins to calculate a field, you would not be able to use the calculated fields feature without creating a new
field.
Duplicate detection rules are not triggered on calculated fields.
A rollup can't reference a calculated field that uses another calculated field, even if all the fields of the other
calculated field are on the current entity.
See also
Create and edit fields
Define rollup fields that aggregate values
Video: Rollup and calculated fields
Define rollup fields that aggregate values
1/23/2020 • 12 minutes to read • Edit Online

Rollup fields help users obtain insights into data by monitoring key business metrics. A rollup field contains an
aggregate value computed over the records related to a specified record. This includes regular entities and activity
entities such as emails and appointments.
In more complex scenarios, you can aggregate data over the hierarchy of records. As an administrator or
customizer, you can define rollup fields by using the customization tools in Power Apps, without needing to write
code.

Rollup fields benefits and capabilities


The benefits and capabilities of rollup fields include the following:
Visual editing is easy. You can create rollup fields by using the Field Editor, just like you do when you create a
regular field.
Wide selection of aggregate functions. You can aggregate data by using the following functions: SUM , COUNT ,
MIN , MAX and AVG .
Full filter support for aggregation. You can set various filters for the source entity or related entity while
setting multiple conditions.
Seamless integration with the user interface. You can include the rollup fields in forms, views, charts and
reports.
Rollup fields are solution components. You can easily transport the rollup fields as components between
environments and distribute them in solutions.
Rollup fields and the calculated fields are complementary to each other. You can use a rollup field as a part of
the calculated field, and vice versa.
You can configure rollup fields to use custom controls.
Some examples of rollup fields include:
Total estimated revenue of open opportunities of an account
Total estimated revenue of open opportunities across all accounts in a hierarchy
Total estimated revenue of an opportunity including child opportunities
Total estimated value of qualified leads generated by a campaign
Number of high priority open cases across all accounts in a hierarchy
Earliest created time of all high priority open cases for an account
Each Rollup field creates two accessory fields with <fieldname> _date and <fieldname> _state suffix pattern.
The _date field contains DateTime data and _state field contains Integer data. The _state field has the
following values:

VALUE STATE DESCRIPTION

0 NotCalculated The field value is yet to be calculated.

1 Calculated The field value has been calculated per


the last update time in _date field.
VALUE STATE DESCRIPTION

2 OverflowError The field value calculation resulted in


overflow error.

3 OtherError The field value calculation failed due to


an internal error. The following run of
the calculation job will likely fix it.

4 RetryLimitExceeded The field value calculation failed


because the maximum number of retry
attempts to calculate the value was
exceeded due to high number of
concurrency and locking conflicts.

5 HierarchicalRecursionLimitReached The field value calculation failed


because the maximum hierarchy depth
limit for the calculation was reached.

6 LoopDetected The field value calculation failed


because a recursive loop was detected
in the hierarchy of the record.

Rollup calculations
The rollups are calculated by scheduled system jobs that run asynchronously in the background. You have to be
an administrator to view and manage the rollup jobs.
View Rollup jobs
To view rollup jobs:
1. While viewing the Common Data Services Default Solution edit the URL, removing everything after
dynamics.com and refresh the page.
2. In the Settings area, select System > System Jobs.

3. In the view selector, choose Recurring System Jobs.


4. To quickly find a relevant job, you can filter by the System Job type: Mass Calculate Rollup Field or
Calculate Rollup Field.
Mass Calculate Rollup Field
Mass Calculate Rollup Field is a recurring job, created per a rollup field. It runs once, after you created or
updated a rollup field. The job recalculates the specified rollup field value in all existing records that contain this
field. By default, the job will run 12 hours after you created or updated a field. After the job completes, it is
automatically scheduled to run in the distant future, approximately, in 10 years. If the field is modified, the job
resets to run again in 12 hours after the update. The 12-hour delay is needed to assure that the Mass Calculate
Rollup Field runs during the non-operational hours of the environment. It is recommended that an
administrator adjusts the start time of a Mass Calculate Rollup Field job after the rollup field is created or
modified, in such a way that it runs during non-operational hours. For example, midnight would be a good time
to run the job to assure efficient processing of the rollup fields.
Calculate Rollup Field
Calculate Rollup Field is a recurring job that does incremental calculations of all rollup fields in the existing
records for a specified entity. There is only one Calculate Rollup Field job per entity. The incremental
calculations mean that the Calculate Rollup Field job processes the records that were created, updated, or
deleted after the last Mass Calculate Rollup Field job finished execution. The default maximum recurrence
setting is one hour. The job is automatically created when the first rollup field on an entity is created and deleted
when the last rollup field is deleted.

Online recalculation option


The rollup field on the form displays a calculator image, rollup value, and the time of the last calculation. To
recaclulate, select the calculator image, and then select the Recalculate button that appears.

There are a few considerations you should keep in mind when using the online recalculation option (manual
refresh on the form):
You must have Write privileges on the entity and Write access rights on the source record on which you are
requesting the Refresh. For example, if you are calculating the estimated revenue from the open opportunities
of an account, you don’t have to have Write privileges on the opportunity entity, only on the account entity.
This option is only available in the online mode. You can’t use it while working offline.
The maximum number of records during the rollup refresh is limited to 50,000 records. In case of the
hierarchical rollup, this applies to the related records across the hierarchy. If the limit is exceeded, you see an
error message: Calculations can’t be performed online because the calculation limit of 50,000 related records
has been reached. This limit does not apply when the rollup is automatically recalculated by the system jobs.
The maximum hierarchy depth is limited to 10 for the source record. If the limit is exceeded, you see an error
message: Calculations can’t be performed online because the hierarchy depth limit of 10 for the source record
has been reached. This limit does not apply when the rollup is automatically recalculated by the system jobs.

Modify rollup job recurrence


As a system administrator, you can modify the rollup job recurrence pattern, postpone, pause, or resume the
rollup job. However, you can’t cancel or delete a rollup job.
To pause, postpone, resume, or modify the recurrence pattern, you must view the system jobs. More information
View Rollup jobs
On the nav bar, choose Actions and select the action you want.
For the Mass Calculate Rollup Field job, the available selections are: Resume, Postpone, and Pause.
For the Calculate Rollup Field job, the available selections are: Modify Recurrence, Resume, Postpone, and
Pause.

Examples
Let’s take a look at several rollup field examples. We’ll aggregate data for a record from the related records with
and without using a hierarchy. We’ll also aggregate data for a record from related activities and activities
indirectly related to a record via the ActivityParty entity. In each example, we define the rollup field by using the
Field Editor. To open the Field Editor, open solution explorer and expand Components > Entities. Select the
entity you want and select Fields. Choose New. In the editor, provide the required information for the field,
including the Field Type and Data Type. In the Field Type, select Rollup, after you have selected the data type.
The data types include decimal or whole numbers, currency, and date/time. Choose the Edit button next to the
Field Type. This takes you to the rollup field definition editor. The rollup field definition consists of three sections:
Source entity, Related entity and Aggregation.
In the Source entity section, you specify the entity for which the rollup field is defined and whether or not
you aggregate over a hierarchy. You can add filters with multiple conditions to specify the records in the
hierarchy you want to use for rollup.
In the Related entity section, you specify the entity over which you aggregate. This section is optional
when you choose to rollup over the hierarchy on the source entity. You can add filters with multiple
conditions to specify which related records to use in the calculation. For example, you include the revenue
from the open opportunities with an annual revenue greater than $1000.
In the Aggregate section, you specify the metric you want to compute. You can choose available
aggregate functions, such as SUM, COUNT, MIN, MAX or AVG.
Aggregate data for a record from related records
In this example, a hierarchy is not used. The total estimated revenue is calculated for an account, from the related
open opportunities.
Aggregate data for a record from the child records, over the hierarchy
In this example, we calculate the total estimated revenue of an opportunity including the child opportunities, over
the hierarchy.

Aggregate data for a record from the related records, over the hierarchy
In this example, we calculate the total estimated revenue of open opportunities across all accounts, over the
hierarchy.
Aggregate data for a record from all related activities
In this example, we calculate the total time spent and billed from all activities related to an account. This may
include time spent on the phone, at appointments, or on custom activities.
In earlier releases, you could define a rollup field for an individual activity, such as a phone call, fax, or
appointment. But, to achieve the result of the example shown below, you had to total the data by using the
calculated fields. Now, you can do it all in one step by defining one rollup field for the Activity entity.

Aggregate data for a record from all related activities and activities indirectly related via the Activity Party
entity
In this example, we count the total number of emails sent to an account, where the account is listed on the email’s
“To Recipient” line or “Cc Recipient line. This is done by specifying the Participation Type in FILTERS for the
Activity Party entity in the rollup field definition. If you don’t use filtering, then all available participation types for
an activity are used in the calculation.
For more information about the Activity Party entity and participation types available for a particular activity, see
ActivityParty entity.

Aggregate data for a record from related records using the AVG operator
In this example, we calculate an average estimated revenue from all opportunities related to an account.

The following example shows how to calculate an average estimated revenue from related opportunities over a
hierarchy of accounts. An average estimated revenue can be seen at each level in the hierarchy.
Rollup field considerations
You should be aware of certain conditions and restrictions when working with rollup fields:
You can define a maximum of 100 rollup fields for the organization and up to 10 rollup fields per entity.
A workflow can’t be triggered by the rollup field updates.
A workflow wait condition cannot use a rollup field.
A rollup over the rollup field is not supported.
A rollup can't reference a calculated field that uses another calculated field, even if all the fields of the other
calculated field are on the current entity.
The rollup can only apply filters to the source entity or related entities, simple fields or non-complex calculated
fields.
A rollup can be done only over related entities with the 1:N relationship. A rollup can’t be done over the N:N
relationships.
A rollup can’t be done over the 1:N relationship for the Activity entity or the Activity Party entity.
The business rules, workflows or calculated fields always use the last calculated value of the rollup field.
A rollup field is aggregated under the system user context. All users are able to see the same rollup field value.
You can control the rollup field visibility with the field level security (FLS ), by restricting who can access the
rollup field. More information Field level security to control access.
Precision rounding
If the precision of the aggregated field is greater than the precision of the rollup field, the aggregated field
precision is rounded down to the precision of the rollup field, before the aggregation is performed. To illustrate
this behavior, let’s look at a specific example. Let’s say that the rollup field on the account entity, for calculating the
total estimated revenue of the related opportunities, has a precision of two decimal points. The Est. Revenue field
on the opportunity entity is the aggregated field with the precision of four decimal points. In our example, the
account has two related opportunities. The aggregated sum of the estimated revenue is calculated as follows:
1. Est. Revenue for the first opportunity: $1000.0041
2. Est. Revenue for the second opportunity: $2000.0044
3. Aggregated sum of Est. Revenue: $1000.00 + $2000.00 = $3000.00
As you can see, the precision rounding to two decimal points on the aggregated field is done before the
aggregation is performed.
Different behavior from Associated grids
Certain entity forms, such as Account or Contact, out-of-the-box, contain the associated grids. For example, an
Account form includes Contacts, Cases, Opportunities and other grids. Some of the records shown in the Account
form grids are directly related to the account record; others, indirectly, through the relationships with other
records. In comparison, the rollup field aggregation uses only direct relationships explicitly defined in the rollup
field definition. No other relationships are considered. To illustrate the difference in behavior, let’s look at the
following example.
1. The account A1 has a primary contact, P1. The case C1 is associated with the account A1 (C1.Customer field =
A1) and the case C2 is associated with the contact P1 (C2.Customer field = P1).
2. The Cases grid on the Account form for the A1 record, shows two cases, C1 and C2.
3. The rollup field on the account entity, called Total Number of Cases, is used to count the cases associated with
the account.
4. In the account rollup field definition, we specify the cases that have the Customer relationship with the
account. After aggregation, the Total Number of Cases is equal to 1 (case C1). The case C2 is not included in
the total, as it is directly related to the contact, not to the account, and can’t be explicitly defined in the account
rollup field definition. As a result, the total number of cases returned by rollup operation doesn’t match the
number of cases shown in the Cases grid.
See also
Create and edit fields
Define calculated fields
Behavior and format of the Date and Time field
Define and query hierarchically related data
Video: Rollup and Calculated Fields
Video: Using Power BI
Map entity fields
12/2/2019 • 4 minutes to read • Edit Online

You can map attributes between entities that have an entity relationship. This lets you set default values for a
record that is created in the context of another record.

Easier way to create new records in model-driven apps


Let’s say that people want to add a new contact record for a person who is an employee for a specific account.
They can do this in two different ways:
The hard way
People could just navigate in the app to create a new contact record from scratch. But then they need to set the
parent account and enter several items of information (such as address and phone information) which are
probably the same as the parent account. This can be time consuming and introduces opportunities for errors.
The easier way
The easier way is to start with the account entity and, using the Contacts subgrid on the form, select + to add a
contact. It will first guide people to look up any existing related contacts so they don’t accidentally create a
duplicate record. If they don’t find an existing record, they can select New and create a new contact record.
The new contact record form will include any of the mapped attribute values from the account (such as address
and phone information) as the default values. People can edit these values before they save the record.

How this works


When you map entity fields for a 1:N entity relationship certain items of data from the primary entity record will
be copied into the new related entity form to set default values that people can edit before saving.

NOTE
These mappings only set default values to a record before it is saved. People can edit the values before saving. The data that
is transferred is the data at that point in time. It isn’t synchronized if the source data later changes.
These mappings aren’t applied to related records created using a workflow or dialog process. They aren’t automatically
applied to new records created using code, although developers can use a special message called InitializeFrom
(InitializeFrom Function or InitializeFromRequest Class) to create a new record using available mappings.

Open solution explorer


The only way to map entity fields is to use solution explorer.
Navigate to an unmanaged solution
1. From the Power Apps portal select Solutions, and then on the toolbar, select Switch to classic.
2. In the All Solutions list select the unmanaged solution you want.
Mapping fields is done in the context of a 1:N or N:1 entity relationship, so first you need to view 1:N or N:1 entity
relationships.

View mappable fields


Field mappings aren’t actually defined within the entity relationships, but they are exposed in the relationship user
interface. Not every 1:N entity relationship has them. When you view a list of 1:N (or N:1) entity relationships for
an entity, you can filter the relationships shown by type. You can select either All, Custom, Customizable, or
Mappable. Mappable entity relationships provide access to allow mapping entity fields.

When you open a mappable entity relationship, select Mappings in the left navigation.

Delete mappings
If there are any mappings that you do not want to apply, you can select them and click the icon.

Add new mappings


To create a new mapping click New in the toolbar. This will open the Create Field Mapping dialog.
Select one source entity field and one target entity fields with values you want to map.

Then select OK to close the dialog.


The following rules show what kinds of data can be mapped.
Both fields must be of the same type and the same format.
The length of the target field must be equal to or greater than the length of the source field.
The target field can’t be mapped to another field already.
The source field must be visible on the form.
The target field must be a field that a user can enter data into.
Address ID values can’t be mapped.
If you map to or from a field that isn’t displayed on a form, the mapping won't be done until the field is added
to a form.
If the fields are option sets, the integer values for each option should be identical.

NOTE
If you need to map option set fields, we recommend you configure both fields to use the same global option set. Otherwise,
it can be difficult to keep two separate sets of options synchronized manually. If the integer values for each option aren’t
mapped correctly you can introduce problems in your data. More information: Create and edit global option sets for
Common Data Service (picklists)

Automatically generate field mappings


You can also generate mappings automatically by selecting Generate Mappings from the More Actions menu.
You should use care when doing this with system entities. Use this when you create custom entities and want to
leverage mapping.

WARNING
This removes any existing mappings and replaces them with suggested mappings that are based only on the fields that have
similar names and data types. If you use this on a system entity, you could lose some expected mappings. For custom
entities, it helps save time because you can more easily delete any mappings you don’t want and add any others that the
generate mappings action didn’t create.

Publish customizations
Because field mappings are not metadata, you must publish them before changes take effect.
See also
Create and edit 1:N (one-to-many) or N:1 (many-to-one) entity relationships using solution explorer
Developer Documentation: Customize entity and attribute mappings
Developer Documentation: Web API Create a new entity from another entity
Delete fields
12/2/2019 • 2 minutes to read • Edit Online

As someone with the system administrator security role, you can delete any custom fields that aren’t part of a
managed solution. When you delete a field, any data stored in the field is lost. The only way to recover data from a
field that was deleted is to restore the database from a point before the field was deleted.
Before you can delete a custom entity, you must remove any dependencies that may exist in other solution
components. Open the field and use the Show Dependencies button in the menu bar to view any Dependent
Components. For example, if the field is used in a form or view, you must first, remove references to the field in
those solution components.
If you delete a lookup field, the 1:N entity relationship for it will automatically be deleted.

Next steps
Delete a custom entity
Apply business logic in Common Data Service
12/21/2019 • 2 minutes to read • Edit Online

There are several choices available for applying business logic in Common Data Service.

Business rules
You can create business rules and recommendations to apply logic and validations without writing code or creating
plug-ins. Business rules provide a simple interface to implement and maintain fast-changing and commonly used
rules.
Define business rules for an entity that apply to all the entity forms and at the server level. Business rules defined
for an entity apply to both canvas apps and model-driven apps if the entity is used in the app. More information:
Create a business rule for an entity

NOTE
To define a business rule that applies to a form in a model-driven app, see Create business rules for a model-driven app form

Power Automate
Power Automate has several different flows you can use to create automated workflows within Common Data
Service or between Common Data Service and another app or service than can be used to synchronize files, get
notifications, collect data, and more.

FLOW TYPE DESCRIPTION MORE INFORMATION

Business process flows Define a set of steps that runs in a Learn more
Power Apps model-driven app for
people to follow to take them to a
desired outcome.

Automated flows Create a flow that performs one or Learn more


more tasks automatically after it's
triggered by an event.

Button flows Run repetitive tasks from anyplace, at Learn more


any time, via a flow app on your mobile
device.

Scheduled flows Create a flow that performs one or Learn more


more tasks on a schedule.

UI flows Record and automate the playback of Learn more


manual steps on legacy software.

Classic Common Data Service processes


You can also use the classic Common Data Service processes, which are workflows and actions. More information:
Power Automate: Use Workflow processes and Power Automate: Actions overview.
See also
Apply business logic in model-driven apps
Create a business rule for an entity
12/3/2019 • 5 minutes to read • Edit Online

You can create business rules and recommendations to apply logic and validations without writing code or
creating plug-ins. Business rules provide a simple interface to implement and maintain fast-changing and
commonly used rules.

IMPORTANT
Business rules defined for an entity apply to both canvas apps and model-driven apps if the entity is used in the app. Not
all business rule actions are available on canvas apps at this time. More information: Differences between canvas and model-
driven apps

To define a business rule that applies to a form in a model-driven app, see Create business rules to apply logic in a model-
driven app form.

By combining conditions and actions, you can do any of the following with business rules:
Set field values
Clear field values
Set field requirement levels
Show or hide fields
Enable or disable fields
Validate data and show error messages
Create business recommendations based on business intelligence.

Differences between canvas and model-driven apps


Model driven apps can use all actions available on business rules, however not all business rule actions are
available for canvas apps at this time. The following actions are not available on Canvas apps :
Show or hide fields
Enable or disable fields
Create business recommendations based on business intelligence.

Prerequisites
To follow this topic, you must switch to an environment in which you can create and edit entities.

Create a business rule


1. Sign in to Power Apps, and then click or tap the down arrow for Data near the left edge.
2. In the list that appears, click or tap Entities.
3. Open the entity you want to create the business rule for (for example, open the Account entity), and then
click the Business Rules tab.
4. Click New.
The Business Rule designer window opens with a single condition already created for you. Every rule starts
with a condition. The business rule takes one or more actions based on that condition.

TIP
If you want to modify an existing business rule, you must deactivate it before you can modify it.

5. Add a description, if you want, in the description box in the upper-left corner of the window.
6. Set the scope, according to the following:

If you select this item... The scope is set to...

Entity Model Driven forms and server

All Forms Model Driven forms

Specific form (Account form, for example) Just that Model Driven form

TIP
If you're building a Canvas app, you must use Entity as the scope.

7. Add conditions. To add more conditions to your business rule:


a. Drag the Condition component from the Components tab to a plus sign in the designer.

b. To set properties for the condition, click the Condition component in the designer window, and then
set the properties in the Properties tab on the right side of the screen. As you set properties, the
Common Data Service creates an expression at the bottom of the Properties tab.
c. To add an additional clause (an AND or OR ) to the condition, click New in the Properties tab to
create a new rule, and then set the properties for that rule. In the Rule Logic field, you can specify
whether to add the new rule as an AND or an OR.
d. When you're done setting properties for the condition, click Apply.
8. Add actions. To add an action:
a. Drag one of the action components from the Components tab to a plus sign next to Condition
component. Drag the action to a plus sign next to a check mark if you want the business rule to take
that action when the condition is met, or to a plus sign next to an x if you want the business rule to
take that action if the condition is not met.

b. To set properties for the action, click the Action component in the designer window, and then set the
properties in the Properties tab.
c. When you're done setting properties, click Apply.
9. Add a business recommendation. (Model Driven only) To add a business recommendation:
a. Drag the Recommendation component from the Components tab to a plus sign next to a
Condition component. Drag the Recommendation component to a plus sign next to a check mark
if you want the business rule to take that action when the condition is met, or to a plus sign next to
an x if you want the business rule to take that action if the condition is not met.
b. To set properties for the recommendation, click the Recommendation component in the designer
window, and then set the properties in the Properties tab.
c. To add more actions to the recommendation, drag them from the Components tab, and then set
properties for each action in the Properties tab.

NOTE
When you create a recommendation, the Common Data Service adds a single action by default. To see all the
actions in a recommendation, click Details on the Recommendation component.

d. When you're done setting properties, click Apply.


10. To validate the business rule, click Validate on the action bar.
11. To save the business rule, click Save on the action bar.
12. To activate the business rule, select it in the Solution Explorer window, and then click Activate. You can't
activate the business rule from the designer window.

TIP
Here are a few tips to keep in mind as you work on business rules in the designer window:
To take a snapshot of everything in the Business Rule window, click Snapshot on the action bar. This is useful, for
example, if you want to share and get comments on the business rule from a team member.
Use the mini-map to navigate quickly to different parts of the process. This is useful when you have a
complicated process that scrolls off the screen.
As you add conditions, Actions, and business recommendations to your business rule, Common Data Service
builds the code for the business rule at the bottom of the designer window. This code is read only.
Localize error messages used in business rules
If you have more than one language provisioned for your organization, you will want to localize any error
messages that you have set. Each time you set a message, a label is generated by the system. If you export the
translations in your organization, you can add localized versions of your messages and then import those labels
back into the Common Data Service, so that people using languages other than your base language can view the
translated messages.
Solutions overview
1/22/2020 • 6 minutes to read • Edit Online

In Power Apps, solutions are leveraged to transport apps and components from one environment to another or
to apply a set of customizations to existing apps. A solution can contain one or more apps as well as other
components such as site maps, entities, processes, web resources, option sets, and more. You can get a solution
from AppSource or from an independent software vendor (ISV ).
More information: Whitepaper: Solution Lifecycle Management

NOTE
If you’re an ISV creating an app that you will distribute, you’ll need to use solutions. For more information about using
solutions, see Developer Guide: Introduction to solutions.

Components
A component represents something that you can potentially customize. Anything that can be included in a
solution is a component. To view the components included in a solution, in solution explorer go to Settings >
Solutions and then open the solution you want. The components are listed in the Components list. Notice that
you can't edit components contained in a managed solution.

To view a list of component types that can be added to any solution, see ComponentType Options.
Some components are nested within other components. For example, an entity contains forms, views, charts,
fields, entity relationships, messages, and business rules. Each of those components requires an entity to exist. A
field can’t exist outside of an entity. We say that the field is dependent on the entity. There are actually twice as
many types of components as shown in the preceding list, but most of them are not nested within other
components and not visible in the application.
The purpose of having components is to keep track of any limitations on what can be customized using managed
properties and all the dependencies so that it can be exported, imported, and (in managed solutions) deleted
without leaving anything behind.
Managed and unmanaged solutions
There are managed and unmanaged solutions. A managed solution cannot be modified and can be
uninstalled after it is imported. All the components of that solution are deleted by uninstalling the solution.
When you import an unmanaged solution, you add all the components of that solution into your environment.
You can’t delete the components by uninstalling the solution.
When you import an unmanaged solution that contains components that you have already customized, your
customizations will be overwritten by the customizations in the imported unmanaged solution. You can’t undo
this.

IMPORTANT
Install an unmanaged solution only if you want to add all the components to your environment and overwrite any existing
customizations.

Even if you don’t plan on distributing your apps or customizations, you may want to create and use an
unmanaged solution to have a separate view that only includes those parts of the application that you have
customized. Whenever you customize something, just add it to the unmanaged solution that you created.
To create a managed solution, you choose the As managed option when you export the solution. If you create a
managed solution, you can’t import it back into the same environment you used to create it. You can only import
it into a different environment.
How solutions are applied
All solutions are evaluated as layers to determine what your app will actually do. The following diagram shows
how managed and unmanaged solutions are evaluated and how changes in them will appear in your
environment.

Starting from the bottom and working up to top:


System Solution
The system solution is like a managed solution that every environment has. The system solution is the definition
of all the out-of-the box components in the system.
Managed Solutions
Managed solutions can modify the system solution components and add new components. If multiple managed
solutions are installed, the first one installed is below the managed solution installed later. This means that the
second solution installed can customize the one installed before it. When two managed solutions have conflicting
definitions, the general rule is “Last one wins”. If you uninstall a managed solution, the managed solution below it
takes effect. If you uninstall all managed solution, the default behavior defined within the system solution is
applied.
Unmanaged Customizations
Unmanaged customizations are any change you have made to your environment through an unmanaged
solution. The system solution defines what you can or can't customize by using managed properties. Publishers
of managed solutions have the same ability to limit your ability to customize solution components that they add
in their solution. You can customize any of the solution components that do not have managed properties that
prevent you from customizing them.
Application Behavior
This is what you actually see in your environment. The default system solution plus any managed solutions, plus
any unmanaged customizations you have applied.

Managed properties
Some components can’t be customized. These components in the system solution have metadata that prevents
you from customizing them. These are called managed properties. The publisher of a managed solution can
also set the managed properties to prevent you from customizing their solution in ways they don’t want you to.

Solution dependencies
Because of the way that managed solutions are layered, some managed solutions can be dependent on solution
components in other managed solutions. Some solution publishers will take advantage of this to build solutions
that are modular. You may need to install a “base” managed solution first and then you can install a second
managed solution that will further customize the components in the base managed solution. The second
managed solution depends on solution components that are part of the first solution.
The system tracks these dependencies between solutions. If you try to install a solution that requires a base
solution that isn’t installed, you won’t be able to install the solution. You will get a message saying that the
solution requires another solution to be installed first. Similarly, because of the dependencies, you can’t uninstall
the base solution while a solution that depends on it is still installed. You have to uninstall the dependent solution
before you can uninstall the base solution.

Solution publisher prefix


By default, the solution you will work with in Power Apps will be the Common Data Services Default
Solution which is associated with the Common Data Service Default Publisher. The default customization
prefix will be randomly assigned for this publisher, for example it could be cr8a3 . This means that the name of
every new item of metadata created for your organization will have this prepended to the names used to
uniquely identify the items.
We recommend that you change the solution publisher prefix so that it will be more meaningful. More
information: Change the solution publisher prefix
Next steps
Import, update, and export solutions
Navigate to a specific solution
Use solutions in Power Apps
2/1/2020 • 4 minutes to read • Edit Online

Within Power Apps, you can view a list of solutions by selecting Solutions in the left navigation. You can then
select a solution to view all of its components.

NOTE
The solutioning experience is available only online and for environment version 9.1.0.267 and later. To check your version,
please go to …Power Apps admin center> Environments > select your environment > Details tab. For earlier version
environments, selecting a solution opens it in the classic experience.

You can browse through all the components in a solution by scrolling through the items. If there are more then
100 items in the list you can select Load the next 100 items to see more.

Search and filter in a solution


You can also search for a specific component by its name.
Or filter all items in the list by the component type.

Contextual commands
As you select each component, the actions available in the command bar will change depending on the type of the
component you have selected and if the solution is the default or a managed one.

When you don't select any component, the command bar will show actions applied to the solution itself.
Create components in a solution
With solutions that are unmanaged or the default one, you can use the New command to create different types of
components. This takes you to a different create experience depending on the component type that you choose.
After you finish creating the component, it will be added to the solution.

Add an existing component to a solution


With solutions that are unmanaged and not the default one, you can use the Add existing command to bring in
components that aren’t already in the solution.
With solutions that are managed, only certain commands are available and you’ll see the message as shown
below. You’ll need to add it to another unmanaged solution that you’ve created to customize the component. The
component might not be customizable. More information: Managed properties

Many of the customizations you’ll want to do will involve entities. You can use the Entity filter to show a list of all
the entities in the current solution that can be customized in some way. Once you drill into an entity, you can see
the components that are part of the entity as shown with the account entity in the following screenshot.
Classic solution explorer
In Power Apps, you can view the classic solution explorer by selecting Solutions in the left navigation pane, and
then selecting Switch to classic in the command bar. Classic solution explorer is the one that was previously
available through the Settings > Advanced customizations area in Power Apps.

Known limitations
The following limitations apply to the use of canvas apps, flows, and custom connectors in solutions.
Canvas app button triggered flows are currently not supported in solutions. Create the app and flow outside of
a solution, and export the .msapp file to migrate canvas apps with an embedded button triggered flow.
If a canvas app is packaged in a managed solution, it can't be edited and re-published in the target environment.
Use unmanaged solutions if the apps require editing in the target environment.
Connections require authentication and consent, which requires an interactive user session and therefore
cannot be transported via solutions. After importing your solution, play the app to authenticate connections.
You can also create the connections in the target environment prior to importing the solution.
Canvas apps shared as co-owner to an Azure Active Directory (AAD ) security group can't be added to solutions.
Unshare the app before adding it to a solution.
Canvas apps won't display in the classic solution explorer. Use the modern experience.
Canvas app access (CRUD and security) is managed entirely in Power Apps and not in the Common Data
Service database.
Database operations such as backup, restore, and copy are not supported for canvas apps and flows. These
operations can corrupt canvas apps and flows.
Deleting a managed solution does not rollback to a different canvas app version. Instead, all versions of the app
are deleted.
Importing a solution containing a flow will not automatically create or associate required connections. The flow
must be edited to fix the connections.
If using managed solutions, this creates an active customization in the unmanaged layer. Therefore
subsequent solution updates to the flow will not be reflected.
Flows created from solutions will not be displayed in the "Team Flows" list. They must be accessed through a
solution.
Button triggered flows are not available in solutions.
Flows triggered from Microsoft 365 applications such as Excel are not available in solutions.
Flows that connect to SharePoint are not available in solutions.
Flows in solutions don't support delegated authentication. For example, access to a flow is not automatically
granted based on having access to the SharePoint list the flow was created from.
Custom connectors created outside solutions cannot be added to solutions at this time.
For details about customizing the individual components in a solution, see the following topics:
For entity, entity relationships, field and message customizations, see Metadata.
For entity forms see Forms.
For processes, see Processes.
For business rules, see Business Rules.
Use a solution to customize
2/29/2020 • 3 minutes to read • Edit Online

We recommend that you create a solution to manage your customizations. With a custom solution, you can easily
find just the solution components you’ve customized, consistently apply your solution publisher prefix, and export
your solution for distribution to other environments.
If you don’t use a custom solution, you'll be working in a default solution in the unmanaged layer. There are two
default solutions in every Common Data Service environment:
Common Data Service Default Solution. This is a base solution that is available for makers to use by default for
their customizations in an environment. The Common Data Service Default Solution is useful when you want to
evaluate or learn Power Apps.
Default Solution. This is a special solution that contains all components in the system. The default solution is
useful for discovering all of the components and configurations in your system.

Why you shouldn’t use the default solutions to manage customizations


There are a few reasons why you shouldn’t create apps and make customizations in either of the default solutions:
The Default Solution contains all components and customizations from all solutions in the environment.
By default, all enabled users in an environment can create apps and customize components in the Common
Data Services Default Solution.
It is difficult to locate or identify the customizations you have made in the environment using either default
solution.
Using either default solution, when creating components will also use the default publisher assigned to it. This
may result in the wrong publisher prefix being applied to some components.
The Default Solution can’t be exported. Therefore, you can’t distribute the Default Solution to another
environment.

Privacy notices
By enabling a solution, you consent to share your data with an external system. Data that is imported from external
systems into Microsoft Dynamics 365 (online) is subject to Microsoft Privacy and Cookies.
You can import and export solutions to and from Microsoft Dynamics 365 (online). When you do so, the solutions,
which may contain personal information, are transferred over a secure connection between your computer and
Microsoft servers. In turn, third-party code imported to Dynamics 365 (online) could eventually transmit Customer
Data to an external system (i.e. InsideView ) or configure/expand entities that get synchronized (i.e. exported) to
other external systems that are controlled by a party other than Microsoft.

If a solution to be imported is meant to transmit Customer Data outside of the security boundaries of Dynamics
365 (online), Administrators are invited to verify the types of Customer Data that will be called by the
service/software/application prior to uploading third-party code to their Dynamics 365 (online) instance.
Extraction of Customer Data by third party services/software/applications or solutions is controlled by the
customer, not Microsoft. The final destiny and privacy policies applicable to the data points extracted by these
external solutions are controlled by the Administrator; adequate review of the policies applicable by the third
parties operating these services/software/apps is recommended.
See also
Create a solution
Understand model-driven app components
Solution publisher overview
2/27/2020 • 2 minutes to read • Edit Online

Every app you create or customization you make is part of a solution. Every solution has a publisher. You
specify the publisher when you create a solution.

The solution publisher indicates who developed the app. For this reason, you should create a solution publisher
that is meaningful. You can view the solution publisher for a solution by selecting Settings from the Solutions
area in Power Apps.

Solution publisher prefix


A solution publisher includes a prefix. The prefix can help determine which publisher is responsible for the
component. For example, the Contoso solution displayed here includes a solution publisher prefix that's
contoso.
NOTE
When you change a solution publisher prefix, you should do it before you create any new apps or metadata items. You
can't change the names of metadata items.

Common Data Services Default Solution


The default solution in Power Apps is the Common Data Services Default Solution, which is associated with the
Common Data Service Default Publisher. The default publisher prefix will be randomly assigned for this
publisher, for example it could be cr8a3. This means that the name of every new item of metadata created in
the default solution will have this prepended to the names used to uniquely identify the items. If you create a
new entity named Animal, the unique name used by Common Data Service would be cr8a3_animal. The same
is true for any new fields (attributes), relationships, or optionset options. If you will be customizing the default
solution, consider changing the publisher prefix.

Create a solution publisher


1. In the Power Apps portal, select Solutions.
2. On the command bar, select New solution, in the right pane select the Publisher drop down list, and then
select + Publisher.
3. In the New Publisher form, enter the required and optional information:
Display Name. Enter the display name for the publisher.
Name. Enter the unique name for the publisher.
Prefix. Enter the publisher prefix you want.
Option Value Prefix. This field generates a number based on the publisher prefix. This number is used
when you add options to option sets and provides an indicator of which solution was used to add the option.
Contact Details. Optionally, you can add contact and address information.
4. Select Save and Close.

Change a solution publisher


You can change a solution publisher for an unmanaged solution by following these steps:
1. In the Power Apps portal, select Solutions, select … next to the solution you want, and then select Settings.
2. In the Solution settings pane, select Edit publisher.
3. Edit the Display name and Prefix fields to the values you want. The Option Value Prefix field generates a
number based on the publisher prefix. This number is used when you add options to option sets and
provides an indicator of which solution was used to add the option.
4. In addition to the prefix, you can also change the solution publisher display name, contact information, and
address in the Contact Details section.
5. Select Save and Close.
See also
Create a solution
Use segmented solutions
3/5/2020 • 4 minutes to read • Edit Online

Use solution segmentation so that you only include entity components that are updated when you distribute
solution updates. With solution segmentation, you export solution updates with selected entity assets, such as
entity fields, forms, and views, rather than entire entities with all the assets. To create a segmented solution, you use
the Solutions area in Power Apps.
You can segment a solution when you select from the following options to add an existing entity to the solution:
Include no components. When you don’t select any components or metadata, the minimal entity
information is added to the solution. Therefore, apart from the friendly name, entity attributes (metadata) or
components will not be included.
Select components. You can segment your solution by individually selecting each component that’s
associated with the entity, such as fields, relationships, business rules, views, forms, and charts. Use this
option to select only the components that have been added or changed with the entity, such as a new
custom field or adding a form.
Include entity metadata. This option includes no components, such as related entities, but does include all
the metadata associated with the entity. Metadata includes the entity attributes, such as auditing, duplicate
detection, or change tracking.
Include all components. This option includes all components and metadata associated with the entity. It
can include other entities or entity components such as business process flows, reports, connections, and
queues. You should only use this option when you are distributing an unmanaged entity that doesn't exist in
the target environment.

WARNING
Don't add components to your solution that you didn't intend to. When your update is imported to the target
environment a solution with unintended components can cause unexpected behavior to the existing components
that now lay below the layer you introduced with your solution update. For example, if you add a view for an entity
that is not updated and the view in the existing layer has customizations, the existing customizations may become
inactive. For more information, see Solution layers.

Create a segmented solution with entity assets


To create a segmented solution, start with creating an unmanaged solution and add only the components that
you've updated. The wizard-like setup takes you step by step through the process of adding entity assets.
For example, imagine that you've created a new custom entity that doesn't exist in any other environment named
Custom entity and also added a new field named topten for the account entity. To create a segmented solution,
follow these steps.
1. Go to the Power Apps portal and then select Solutions.
2. Select New solution and create a solution. Enter information in the required fields. Select Create.
3. Open the solution you created. On the command bar, select Add Existing, and then select Entity.
4. In the Add existing entities pane, select one or more entities you want to add to the solution. For example,
select Account and Custom entity. Select Next.
5. In the Select entities pane, you can choose from the assets to include:
Include all components. This option includes all components and metadata associated with the
entity. It can include other entities or entity components such as business process flows, reports,
connections, and queues.
Include entity metadata. This option includes only the metadata associated with the entity.
Metadata includes the entity attributes, such as auditing, duplicate detection, or change tracking.
Select components. This option lets you individually select each component that’s associated with
the entity, such as fields, relationships, business rules, views, forms, and charts.
Don't include any components.
For this example, because Custom entity has never been imported into the target environment, next
to Custom entity select Include all components. Under Account, choose Select components.

6. Since only the topten custom field is new to the account entity, select Top Ten, and then select Add.
7. Select Add to add the components to the solution.
Create a segmented solution using solution explorer
The following illustrations provide an example of creating a segmented solution by choosing entity assets from the
Account , Case , and Contact entities.

NOTE
The case entity is included with some Dynamics 365 applications, such as Dynamics 365 Customer Service.

Start by opening an unmanaged solution you created. Choose the Entity component.

Then, select the solution components.


Follow the wizard. In Step 1, starting in alphabetical order, select the assets for the first entity, the Account entity,
as shown here.

Open the Fields tab and select the Account Number field.
In Step 2, for the Case entity, add all assets.

In Step 3, add the Anniversary field for the Contact entity.


As a result, the segmented solution that’s created contains three entities, Account , Case , and Contact . Each entity
contains only the assets that were chosen.

See also
Solutions overview
Understand how managed solutions are merged
2/28/2020 • 4 minutes to read • Edit Online

When you prepare your managed solution to be installed, remember that an environment may have multiple
solutions installed or that other solutions may be installed in the future. Construct a solution that follows best
practices so that your solution will not interfere with other solutions.
The processes that Common Data Service uses to merge customizations emphasize maintaining the functionality
of the solution. While every effort is made to preserve the presentation, some incompatibilities between
customizations may require that the computed resolution will change some presentation details in favor of
maintaining the customization functionality.

Merge form customizations


The only form customizations that have to be merged are those that are performed on any entity forms that are
already in the environment. Typically, this means that form customizations only have to be merged when your
solution customizes the forms that were included for entities created when Common Data Service was installed.
One way to avoid form merging is to provide new forms for any Common Data Service entities. Forms for custom
entities will not require merging unless you are creating a solution that updates or modifies an existing managed
solution that created the custom entities and their forms.
When a solution is packaged as a managed solution the form definitions stored in FormXML are compared to the
original FormXML and only the differences are included in the managed solution. When the managed solution is
installed in a new environment, the form customization differences are then merged with the FormXML for the
existing form to create a new form definition. This new form definition is what the user sees and what a system
customizer can modify. When the managed solution is uninstalled, only those form elements found in the managed
solution are removed.
When you add new elements to a form that is to be merged, we recommend that you include your new elements
within new container elements (tabs or sections). Additions to any container will be appended to the end of the
container. For example, fields added to a section will be positioned at the end of the section. It is expected that a
customizer installing a solution will then modify the form to rearrange elements after it is installed.
Managed solutions that contain forms that use new security roles depend on those roles. You should include these
security roles with your managed solution. If there are security roles associated with a form that are not in the
environment that the managed solution is being installed on, the installation will not fail but the forms may not be
associated with any security roles. When the managed solution is uninstalled, any security roles included with it will
be removed. Any forms outside the managed solution can no longer be associated with those security roles.

NOTE
When a managed solution entity contains multiple forms and the environment entity form also contains multiple forms, the
new forms are not appended to the bottom of the list of available forms – they are interleaved with the original entity forms.

Merge navigation (SiteMap) customizations


When a solution is packaged as managed the SiteMap XML is compared to the original SiteMap XML and any
other customizations made to the SiteMap. Only the differences are included in the managed solution. These
differences include items that are changed, moved, added, or removed. When the managed solution is installed in a
new environment, the SiteMap changes are merged with the SiteMap XML found for the environment where the
managed solution is being installed. A new SiteMap definition is what people see.
At this point, a customizer can export the SiteMap to an unmanaged solution and that SiteMap definition will
include all the elements of the active SiteMap. A customizer can then modify the SiteMap and reimport it as an
unmanaged customization. Later, if the managed solution is uninstalled, the SiteMap XML that was imported with
the managed solution will be referenced to remove the changes introduced with that managed solution. A new
active SiteMap is then calculated.
Whenever a new visible element is added to the SiteMap, it appears at the bottom of whatever container it belongs
in. For example, a new area appears at the bottom of the Navigation area. To position the elements that have been
added, you must export the SiteMap, edit it to set the precise position and then import it again as an unmanaged
solution.

NOTE
Only one SiteMap customization can be applied between publishing. Any unpublished SiteMap customizations will be lost
when a new SiteMap definition is imported.

Merge option set options


Each new option set option is initialized with an integer value assigned that includes an option value prefix. The
option value prefix is a set of five digits prepended to the option value. An option value prefix is generated based
on the solution publishers customization prefix but may be set to any value. The option value prefix helps
differentiate new option set options created in the context of a specific solution publisher and reduces the
opportunity for collisions of option values. Using the option value prefix is recommended but not required.
A managed solution usually updates or adds options for option sets that are already in the environment, for
example, the account Category or Industry option sets. When a managed solution modifies the options available in
an option set, all the options defined in the managed solution are available in the environment. When the managed
solution is uninstalled, the option set options will be returned to their original state.
See also
Solutions overview
Export solutions
Create a model-driven app site map using the site map designer
Use solution checker to validate your model-driven
apps in Power Apps
12/3/2019 • 9 minutes to read • Edit Online

To deliver on complex business requirements, model-driven app makers often can end up with highly advanced
solutions that customize and extend the Common Data Service platform. With advanced implementations comes
an increased risk where performance, stability, and reliability issues become introduced, which can negatively
impact the user experience. Identifying and understanding how to resolve these issues can be complicated and
time consuming. With the solution checker feature, you can perform a rich static analysis check on your solutions
against a set of best practice rules and quickly identify these problematic patterns. After the check completes, you
receive a detailed report that lists the issues identified, the components and code affected, and links to
documentation that describes how to resolve each issue.
The solution checker analyzes these solution components:
Common Data Service plug-ins
Common Data Service custom workflow activities
Common Data Service web resources (HTML and JavaScript)
Common Data Service configurations, such as SDK message steps
Solution checker works with unmanaged solutions that can be exported from an environment.

NOTE
This topic explains how to run solution checker from the Power Apps maker portal. A PowerShell module is also available
that you can use to interact directly with the service. The Microsoft.PowerApps.Checker.PowerShell module can be used
for analysis of managed and unmanaged solutions for supported versions of on-premises and online environments, or to
automate and integrate the service into your build and release pipelines. More information:
Microsoft.PowerApps.Checker.PowerShell Overview
Solution checker doesn't work with solutions that contain JavaScript using ECMAScript 6 (2015) or later versions. When
JavaScript using one of these versions is detected, a JS001 syntax issue for the web resource is reported.

Enable the solution checker


The Solution checker is enabled by default in every Common Data Service environment. A Solution checker
menu item is available when you select an unmanaged solution in the Solutions area of Power Apps. If the Run
option is not available in the Solution checker menu, you can enable it by installing the Power Apps checker
solution. To install it, follow these steps:
1. Sign in to Power Apps and select the Common Data Service environment where you want to enable the
solution checker.
2. On the left navigation pane, select Solutions.
3. On the toolbar, select Solution checker and then select Install – this opens the Microsoft AppSource page.
You need to allow pop-up windows if your browser blocks the page from opening.
4. Select Free Trial on the AppSource page.
5. If you agree, accept the terms and conditions and select the environment to install the Power Apps checker
solution.
6. When the installation is complete, refresh the Solution list on the Power Apps site to verify that the
solution checker is available.
7. To check a solution, Run the solution checker.

Run the solution checker


After you install the Power Apps checker in your environment, a Solution checker menu item is available when
you select an unmanaged solution in the Solutions area of Power Apps.
1. Sign in to Power Apps.
2. In the left pane, select Solutions.
3. Next to the unmanaged solution that you want to analyze, select ..., point to Solution checker, and then
select Run.

4. The status pane located on the upper right of the Solutions page displays Solution checker running.
Note the following:
The solution checker can take a few minutes to complete the analysis.
During this time you will notice a Running… state in the Solution check column of the Solution
list.
You'll receive an email notification and a notification in the Notifications area of the Power Apps
site when the check is completed.
5. View the report when the check is completed.

Cancel a check
After you submit a solutions check in your environment, the check can be canceled through the status pane on the
upper right area of the Solutions page.
When you cancel a check, the solution check stops running and the solution check status returns to the previous
state.

Solution checker states


When you install the solution checker in your environment, the Solution check column becomes available in the
Solutions list. This column displays the solution analysis states for a solution.

STATE DESCRIPTION

Hasn’t been run The solution has never been analyzed.

Running The solution is being analyzed.

Couldn’t be completed Solution analysis was requested but the analysis did not
complete successfully.

Results as of date and time Solution analysis completed and results are available for
download.

Couldn’t be completed. Result as of date and time The latest analysis request did not complete successfully. The
last successful results can be downloaded.

Checked by Microsoft This is a Microsoft-managed solution. Solution analysis is not


permitted on these solutions.

Checked by Publisher This is a third-party-managed solution. Currently, solution


analysis is not available for these solutions.

Review the solution checker report


When a solution check is completed, you can view the analysis report in the portal or you can download the report
from your web browser. In the portal, you have options to filter, group results by Issue, Location or by Severity
and view detailed information for issues detected in your solution.
1. In the left pane, select Solutions.
2. Next to the unmanaged solution where you want to view the solution checker report, select ..., point to
Solution checker, and then select View results.
3. Select an Issue to view the details and guidance on how to resolve.

The solution check results are also available for download. The solution checker zip file is downloaded to the folder
specified by your web browser.The download report is in Excel format and contains several visualizations and
columns that assist you in identifying the impact, type, and location of each issue detected in your solution. A link
to detailed guidance about how to resolve the issue is also provided.
1. In the left pane, select Solutions.
2. Next to the unmanaged solution where you want to download the solution checker report, select ..., point to
Solution checker, and then select Download results.
3. The solution checker zip file is downloaded to the folder specified by your web browser.
Here's a summary of each column in the report.

REPORT FIELD DESCRIPTION APPLIES-TO COMPONENT

Issue The title of the issue identified in the All


solution.

Category The categorization of the issue All


identified, such as Performance,
Usage, or Supportability.

Severity Represents the potential impact of the All


issue identified. Available impact types
are High, Medium, Low, and
Informational.

Guidance Link to article detailing the issue, All


impact, and recommended action.

Component The solution component where the All


issue was identified.
REPORT FIELD DESCRIPTION APPLIES-TO COMPONENT

Location The location and/or source file of the All


component where the issue that was
identified occurred, such as the
assembly or JavaScript file name.

Line # The line number reference of the issue Web resources


in the impacted web resource
component.

Module Module name where the issue identified Plug-in or custom workflow activity
in the assembly was detected.

Type Type of the issue identified in the Plug-in or custom workflow activity
assembly.

Member Member of the issue identified in the Plug-in or custom workflow activity
assembly.

Statement The code statement or configuration All


that resulted in the issue.

Comments Details about the issue that include All


high-level resolution steps.

Best practice rules used by solution checker


SOLUTION COMPONENT RULE NAME RULE DESCRIPTION

Plug-in or workflow activity il-specify-column Avoid selecting all columns via Common
Data Service query APIs.

Plug-in or workflow activity meta-remove-dup-reg Avoid duplicate Common Data Service


plug-in registrations.

Plug-in or workflow activity il-turn-off-keepalive Set KeepAlive to false when interacting


with external hosts in a Common Data
Service plug-in.

Plug-in or workflow activity il-avoid-unpub-metadata Avoid retrieving unpublished Common


Data Service metadata.

Plug-in or workflow activity il-avoid-batch-plugin Avoid using batch request types in


Common Data Service plug-ins and
workflow activities.

Plug-in or workflow activity meta-avoid-reg-no-attribute Include filtering attributes with


Common Data Service plug-in
registrations.

Plug-in or workflow activity meta-avoid-reg-retrieve Use caution with Common Data Service
plug-ins registered for Retrieve and
RetrieveMultiple messages.
SOLUTION COMPONENT RULE NAME RULE DESCRIPTION

Plug-in or workflow activity meta-remove-inactive Remove inactive configurations in


Common Data Service.

Plug-in or workflow activity il-meta-avoid-crm2011-depr-message Don't use Microsoft Dynamics CRM


2011 deprecated messages.

Plug-in or workflow activity meta-avoid-crm4-event Don't use Microsoft Dynamics CRM 4.0
plug-in registration stage.

Plug-in or workflow activity il-avoid-specialized-update-ops Don't use specialized update operation


requests in Common Data Service.

Plug-in or workflow activity il-use-autonumber-feature Use the auto number feature instead of
a custom auto numbering solution.

Plug-in or workflow activity il-avoid-parallel-plugin The usage of parallel patterns should be


avoided within plug-ins.

Plug-in or workflow activity il-avoid-lock-plugin Avoid lock of static members in plug-


ins.

Plug-in or workflow activity meta-avoid-retrievemultiple-annotation Avoid registering a plugin on


RetrieveMultiple of annotation.

Web Resources web-use-async Interact with HTTP and HTTPS


resources asynchronously.

Web Resources meta-remove-invalid-form-handler Correct or remove invalid Common


Data Service form event registrations.

Web Resources meta-remove-orphaned-form-element Correct or remove orphaned Common


Data Service form event registrations.

Web Resources web-avoid-modals Avoid using modal dialogs.

Web Resources web-avoid-crm2011-service-odata Don't target the Microsoft Dynamics


CRM 2011 OData 2.0 endpoint.

Web Resources web-avoid-crm2011-service-soap Don't target the Microsoft Dynamics


CRM 2011 SOAP services.

Web Resources web-avoid-browser-specific-api Don't use Internet Explorer legacy APIs


or browser plug-ins.

Web Resources web-avoid-2011-api Don't use the deprecated Microsoft


Dynamics CRM 2011 object model.

Web Resources web-use-relative-uri Don't use absolute Common Data


Service endpoint URLs.

Web Resources web-use-client-context Use client contexts.

Web Resources web-use-dialog-api-param Use dialog API parameters.


SOLUTION COMPONENT RULE NAME RULE DESCRIPTION

Web Resources web-use-org-setting Use organization settings.

Web Resources web-use-grid-api Use the grid APIs.

Web Resources web-avoid-isActivityType Replace Xrm.Utility.isActivityType


method with new
Xrm.Utility.getEntityMetadata and don't
use in ribbon rules.

Web Resources meta-avoid-silverlight Silverlight web resource usage is


deprecated.

Web Resources web-remove-debug-script Avoid including debug script in non-


development environments.

Web Resources web-use-strict-mode Use strict mode when possible.

Web Resources web-use-strict-equality-operators Use strict equality operators.

Web Resources web-avoid-eval Don't use the 'eval' function or its


functional equivalents.

See also
Best practices and guidance for the Common Data Service
Best practices and guidance for model-driven apps
Common issues and resolutions for Solution Checker
Common issues and resolutions for solution checker
3/20/2020 • 11 minutes to read • Edit Online

This article lists some common issues that you might encounter while using solution checker. Where applicable,
workarounds are provided.

You're unable to use solution checker to run analysis or download


results
Shortly after submitting a solution checker request to run an analysis or download results the operation doesn't
complete and an error message is displayed, such as:

"We weren't able to run the check on [Solution Name] solution. Try running it again."

Whenever possible, solution checker attempts to return a specific error message with a link to details about the
potential cause and resolution steps. Select 'Learn more' for details.

Failures that occur during background processing of the analysis will fail with 'Couldn't be completed' status
and return an error message in the Power Apps portal as well as send email notification to the requestor.

Selecting the portal notification will link to this page of common issues for further troubleshooting. If one of the
provided common issues does not resolve the problem, a reference number is also returned. Provide this reference
number to Microsoft Support for further investigation.

Solution checker fails due to unsupported version of Power Apps


Checker
Solution checker is a feature enabled by the Power Apps Checker app. If you have installed a Power Apps Checker
app version earlier than version 1.0.0.47, solution checker runs may fail to complete successfully. You should
upgrade your Power Apps Checker version from the Dynamics 365 admin center.
However, if you have a Power Apps Checker version earlier than version 1.0.0.45 installed, we recommend that
you delete the solution and install it again. Due to recent schema changes, upgrade of Power Apps Checker from
versions earlier than version 1.0.0.45 may fail.
If you want to keep the past results from solution checker, export the results from a previous run or export all
solution checker data using Export data to Excel to export the data from the following entities:
Analysis Component
Analysis Job
Analysis Result
Analysis Result Detail
How to uninstall Power Apps Checker
To uninstall the Power Apps Checker solution:
1. As a System Administrator or as a System Customizer, open the Power Apps portal by going to
https://make.powerapps.com/environments.
2. Select Solutions.
3. Select Power Apps Checker, and then on the solutions toolbar select Delete.
How to install Power Apps Checker
To install Power Apps Checker back into your Common Data Service environment:
1. As a System Administrator or as a System Customizer, open up your Power Apps portal by going to
https://make.powerapps.com/environments.
2. Select Solutions.
3. On the solution toolbar select Solution checker, and then select Install.

Solution Checker can't access organizations in Administration Mode


Organizations that have been placed into Administration Mode purposely restrict access to only users with System
Administrator and System Customizer roles. Because the Power Apps Checker application identity has neither of
these roles assigned by default, it can't access organizations operating in this mode.
In order to use solution checker in this organization, Adminstration Mode must be disabled.
How to disable administration mode
To disable administration mode for an organization instance:
1. Open the Dynamics 365 instance picker: https://port.crm.dynamics.com/G/Instances/InstancePicker.aspx.
2. Select the organization instance that has issues running solution checker.
3. Select ADMIN.

4. Clear Enable administration mode, and then select Save.


5. Run solution checker again.

Solution checker fails due to missing security roles


The application user for Solution Checker requires two security roles assigned in order to provide the necessary
privileges to communicate with the Common Data Service organization. If either of these roles are not assigned to
the user 'Power Apps Checker', attempts to run analysis, download results, and run cancelation will fail. This
occurs most often when customers have automation in place that removes security roles from unexpected users.
The following security roles contain minimum required permissions:
Export Customizations
Solution Checker
How to assign missing security roles
To assign missing security roles to the Power Apps Checker user:
1. Open your Common Data Service organization and navigate to Settings > Security > Users.
2. Select the 'Power Apps Checker' user from the list of users.
3. Select MANAGE ROLES on the command bar.
4. Select 'Export Customizations' and 'Solution Checker' role checkboxes, and then select OK.

5. Run solution checker again.


Solution Checker fails due to restricted access mode
The application user for solution checker requires an access mode of 'Non-Interactive' or 'Read-Write' in order
to communicate with the Common Data Service organization. If the access mode has been changed to another
value such as 'Administrative', then attempts to run analysis, download results, and run cancelation will fail.
To resolve this issue, you must update the 'Power Apps Checker' application user with 'Non-interactive' access
mode.
How to update user access mode
To update the access mode for the Power Apps Checker user:
1. Open your Common Data Service organization and navigate to Settings > Security > Users.
2. Select the 'Power Apps Checker' user from the list of users and double-click to open the user form.
3. Scroll to the 'Administration' > 'Client Access License (CAL ) Information' section of the form.
4. Select 'Non-interactive' in the Access Mode drop-down control.

5. Save and close the user form.


6. Run solution checker again.

Solution Checker fails due to disabled application user


The Power Apps Checker application user in the Common Data Service organization containing solutions to be
analyzed must be enabled. If the application user becomes disabled, requests to analyze solutions in the same
organization will fail. If receiving this error message, first verify that the Power Apps Checker application user is
indeed disabled. Then follow the mitigation steps provided below.

How to enable the Power Apps Checker application user


1. In the Power Platform Admin center, select the environment and go to Settings > User's + Permissions >
Users.
2. In the Application Users view, select the checkmark next to the Power Apps Checker Application user.
3. On the Actions toolbar, select Enable

4. In the Confirm User Activation message, select Activate.


5. An alternative approach is to open the application user form and select Enabled status in the form footer. Save
the change.
Common plugin conditions that cause solution checker to fail
When solution checker receives and processes analysis requests, it must call the Common Data Service endpoint
to retrieve/update relevant job data and export the selected solution(s). Each interaction made by the solution
checker service with the Common Data Service could potentially trigger one or more plugin steps that have been
registered on message submitted in the request. These plugins may in turn introduce conditions that prevent the
message from being handled as expected by the Common Data Service and interrupt the ability of solution
checker to process the requested analysis job. Similar situations can occur when downloading solution checker job
results or canceling an in-progress analysis job.
Typical Common Data Service operations requested by solution checker:
Retrieve solution, systemuser, and organization entity data
Create, update, and retrieve analysis job, analysis component, and analysis result entity data
Export solutions
Plugin step registered to execute in context of a unlicensed user
When solution checker fails due to an "unlicensed user" exception, it is often caused by a triggered plugin step
configured to execute in the context of a specific systemuser that is currently unlicensed. Ensure that any plugin
steps that could be triggered by solution checker execute in context of a licensed user.

IMPORTANT
It is highly recommended that plugin steps be configured to execute in context of the calling user rather than specific users
which are subject to assigned license being revoked.

Plugin step performs operations that require privileges not granted to Power Apps Checker application user
When solution checker fails due to Common Data Service denying access based on a missing privilege, it is often
caused by a triggered plugin step that performs operations that require privileges not currently granted to the
Power Apps Checker application user. Either reconfigure the plugin step to not execute on the operation invoked
by solution checker or grant the Power Apps Checker application user the necessary privileges to execute the
custom plugin step.
Plugin step unexpectedly interrupts execution by throwing InvalidPluginExecutionException
When solution checker fails due to the error "ISV aborted code", a plugin step was triggered that explicitly
interrupted execution by throwing an InvalidPluginExcecutionException. Either reconfigure the plugin step to not
execute on the operation invoked by solution checker or adjust the plugin implementation not to interrupt
execution based on the conditions presented by solution checker.

Solution checker fails due to disabled first-party application in AAD


The first-party enterprise application identity used by solution checker (PowerApps-Advisor) should not be
disabled in Azure Active Directory (AAD ). If disabled, the identity cannot authenticate when requesting bearer
tokens for Common Data Service and other required resource providers on-behalf of the requesting user.
Follow the below steps to verify that the application identity hasn't been disabled in AAD and if necessary enable
the application.
How to verify and/or modify application enabled status
To verify and/or modify the enabled status of the PowerApps-Advisor enterprise application identity
1. Access your tenant in the Azure Active Directory (AAD ) Portal.
2. Navigate to Enterprise Applications.
3. Select All Application and search for 'PowerApps-Advisor'.

4. Select 'PowerApps-Advisor' to view the app details.


5. Select Properties.
6. Check the state of Enabled for users to sign-in. If 'No', then the application has been disabled.

7. Select the radio control to switch the value to 'Yes'. This enables the application.

8. Select Save. The application is now enabled. You may need to wait a few minutes for change to propagate.
9. Run solution checker again.

IMPORTANT
You must have administrator privileges in Azure Active Directory (AAD) in order to edit enterprise applications.

Solution checker fails to export solutions with draft Business Process


Flow components
If a solution contains a business process flow component in draft state that has never been previously activated,
then Solution Checker will fail to export the solution for analysis. This error is not unique to Solution Checker and
is caused by the business process flow having a dependency on a backing (custom) entity component that doesn't
get created until the business process flow is activated for the first time. This issue can also occur if a business
process flow is activated from within Solution Explorer.
Reference KB Article #4337537: Invalid Export - Business Process Entity Missing for details about the issue and
steps to resolve.

Solution Checker fails to export patched solutions


If a solution has had a patch applied, Solution Checker will fail to export the solution for analysis. When a solution
has had a patch applied, the original solution becomes locked and it can't be changed or exported as long as there
are dependent patches that exist in the organization that identify the solution as the parent solution.
To resolve this issue, clone the solution so that all patches related to the solution are rolled into the newly-created
solution. This unlocks the solution and allows the solution to be exported from the system. For more information,
see Clone a Solution.

Solution checker will not analyze empty solutions


If Solution Ccecker exports a solution that contains no components to analyze, it will terminate further processing
and consider the run a failure. Ensure that the selected solution submitted for a Solution Checker analysis contains
at least one component.

Solution Checker fails to export large solutions


The primary scenario for failure to export a large solution from the Common Data Service environment involves a
timeout exception on the export request. This will occur if the request exceeds 20 minutes. Large solutions, such as
the Default Solution, may fail to get exported within this time frame, and the check will not complete successfully. If
solution checker encounters a timeout during export, it will retry three times before it fails to process the job, so it
may take over an hour before you receive a failure notification.
The workaround is to create smaller solutions with fewer components to be analyzed. If the large file size of the
solution is due to many plug-in assembly components, please see guidance to Optimize custom assembly
development.

IMPORTANT
To minimize false positives, ensure you add dependent customizations. When you create a solution and add these
components, include the following:
When you add plug-ins, include the SDK Message Processing Steps for the plug-in.
When you add entity forms, include the JavaScript web resources attached to the form events.
When you add JavaScript web resources, include any dependent JavaScript web resources.
When you add HTML web resources, include any dependent scripts that are defined within the HTML web resource.
When you add custom workflows, include the assembly used within the workflow.

Line number references for issues in HTML resources with embedded


JavaScript are not correct
When HTML web resources are processed within solution checker, the HTML web resource is processed
separately than the JavaScript within the HTML web resource. Due to this, the line number of the violation found
within <script> of the HTML web resource will not be correct.

Web-unsupported-syntax issue for web resources


ECMAScript 6 (2015) or later versions are not currently supported for solution checker. When solution checker
analyzes JavaScript using ECMAScript 6 or later, a web-supported-syntax issue for the web resource is reported.

Multiple violations reported for plug-ins and workflow activities based


on call scope
For plug-in and workflow activity rules where the issue is only relevant in the calling context, the solution checker
tool starts its analysis at the IPlugin interface implementation and traverses a call graph to detect issues within the
scope of that implementation. In some cases, many call paths may arrive at the same location where the issue is
detected. Since the issue is relevant to the call scope, the tool may report based on that scope to provide a better
picture of impact rather than on distinct locations. As a result, multiple issues may reference a single location that
should be fixed.

See also
Best practices and guidance for the Common Data Service
Best practices and guidance for model-driven apps
Best practices when working with solutions
3/5/2020 • 2 minutes to read • Edit Online

This topic describes best practices when you work with solutions.

Use a single managed solution to manage a model-driven app


To update the app that was included in the managed solution, use update or patch solutions. Don’t install different
managed solutions into an environment that have the same model-driven app. More information: Update solutions
and Use segmented solutions and patches to export selected entity assets

Use security roles to manage app access


Model-driven apps should have security roles assigned to control user access. More information: Share a model-
driven app with Power Apps

Delete the managed solution to delete a model-driven app


To delete a model-driven app that was installed in the default solution as part of a managed solution, delete the
managed solution.
Don’t directly delete an app or app’s site map from the default environment that was installed as part of a managed
solution. Doing so can lead to failure of a solution upgrade or solution updates for the solution used to install the
app. An example of directly deleting a model-driven app would be opening the default solution in Solution Explorer
and going to Model-driven Apps, selecting the app, and then selecting Delete.
See also
Solutions overview
Create solution patches
3/25/2020 • 4 minutes to read • Edit Online

You can create a patch for a parent solution and export it as a minor update to the base solution. When you clone a
solution, the system rolls up all related patches into the base solution and creates a new version.

WARNING
Using clone a patch and clone solution to update a solution isn't recommended because it limits team development and
increases complexity when storing your solution in a source control system. For information about how to update a solution,
see Upgrade or update a solution.

Creating updates using clone solution and clone to patch


When you’re working with patches and cloned solutions, keep the following information in mind:
A patch represents an incremental minor update to the parent solution. A patch can add or update
components and assets in the parent solution when installed on the target system, but it can’t delete any
components or assets from the parent solution.
A patch can have only one parent solution, but a parent solution can have one or more patches.
A patch is created from an unmanaged solution. You can’t create a patch from a managed solution.
When you import a patch into a target system, you should export it as a managed patch. Don’t use
unmanaged patches in production environments.
The parent solution must be present in the target system to install a patch.
You can delete or update a patch.
If you delete a parent solution, all child patches are also deleted. The system gives you a warning message
that you can’t undo the delete operation. The deletion is performed in a single transaction. If one of the
patches or the parent solution fails to delete, the entire transaction is rolled back.
After you have created the first patch for a parent solution, the solution becomes locked, and you can’t make
any changes in this solution or export it. However, if you delete all of its child patches, the parent solution
becomes unlocked.
When you clone a base solution, all child patches are rolled up into the base solution and it becomes a new
version. You can add, edit, or delete components and assets in the cloned solution.
A cloned solution represents a replacement of the base solution when it’s installed on the target system as a
managed solution. Typically, you use a cloned solution to ship a major update to the preceding solution.
When you clone a solution, the version number you specify includes the major and minor positions.
When you clone a patch, the version number you specify includes the build and revision positions.

For more information about version numbers, see Clone solution and clone patch version numbers in this article.

Create a solution patch


A patch contains changes to the parent solution, such as adding or editing components and assets. You don’t have
to include the parent’s components unless you plan to edit them.
Create a patch for an unmanaged solution
1. Go to the Power Apps portal, and then select Solutions.
2. In the solutions list, select an unmanaged solution to create a patch for. On the command bar, selectClone,
and then select Clone a Patch. The right pane that opens contains the base solution’s name and the patch
version number. Select Save.

3. In the solutions list, find and open the newly created patch. Notice that the unique name of the solution has
been appended with Patchhexnumber. Just like with the base solution, add the components and assets you
want.
Create a patch using solution explorer
The following illustrations provide an example of creating a patch for an existing solution. Start by selecting Clone
a Patch (in the compressed view, the Clone a Patch icon is depicted as two small squares, as shown below ).
In the Clone To Patch dialog box you see that the version number for the patch is based on the parent solution
version number, but the build number is incremented by one. Each subsequent patch has a higher build or revision
number than the preceding patch.

The following screenshot shows the base solution SegmentedSolutionExample, version 1.0.1.0, and the patch
SegmentedSolutionExample_Patch, version 1.0.2.0.

In the patch, we added a new custom entity called Book , and included all assets of the Book entity in the patch.
Clone a solution
When you clone an unmanaged solution, the original solution and all patches related to the solution are rolled up
into a newly created version of the original solution. After cloning, the new solution version contains the original
entities plus any components or entities that are added in a patch.

IMPORTANT
Cloning a solution merges the original solution and associated patches into a new base solution and removes the original
solution and patches.

1. Go to the Power Apps portal, and then select Solutions.


2. In the solutions list, select an unmanaged solution to create a clone. On the command bar, select Clone, and
then select Clone Solution. The right pane displays the base solution’s name and the new version number.
Select Save.

Clone solution and clone patch version numbers


A patch must have a higher build or revision number than the parent solution. It can’t have a higher major or minor
version. For example, for a base solution with version 3.1.5.7, a patch could be a version 3.1.5.8 or version 3.1.7.0,
but not version 3.2.0.0. A cloned solution must have the version number greater than or equal to the version
number of the base solution. For example, for a base solution version 3.1.5.7, a cloned solution could be a version
3.2.0.0, or version 3.1.5.7. When you clone a solution or patch, you set the major and minor version values for a
cloned solution, and the build or revision values for a patch.
See also
Upgrade or update a solution
Create a solution
3/24/2020 • 3 minutes to read • Edit Online

To locate and work with just the components you’ve customized, create a solution and do all your customization
there. Then, always remember to work in the context of the custom solution as you add, edit, and create
components. This makes it easy to export your solution for import to another environment or as a backup.
For more information about solution concepts, see Working with solutions.
1. Sign in to Power Apps and select Solutions from the left navigation.
2. Select New solution and then complete the required fields for the solution.

FIELD DESCRIPTION

Display Name The name shown in the list of solutions. You can change
this later.

Name The unique name of the solution. This is generated using


the value you enter in the Display Name field. You can
edit this before you save the solution, but after you save
the solution, you can’t change it.

Publisher You can select the default publisher or create a new


publisher. We recommend that you create a publisher for
your organization to use consistently across your
environments that you will use the solution in. More
information: Solution publisher overview

Version Enter a number for the version of your solution. This is


only important if you export your solution. The version
number will be included in the file name when you export
the solution.

3. Select Save.
After you save the solution, you may wish to add information to fields that aren’t required. These steps are
optional. Use the Description field to describe the solution and choose an HTML web resource as a
Configuration Page for the solution. The configuration page is typically used by ISVs who distribute solutions.
When this is set, a new Configuration node appears below the Information node to display this web resource.
Developers will use this page to include instructions or controls to allow you to set configuration data or launch
their solution.

Add solution components


After you’ve created your solution, it won’t contain any solution components. You can create new solution
components or use the Add Existing button in the list menu to add any solution components from the default
solution.
When you do this you may see a Missing Required Components dialog.
This dialog alerts you that the solution component has dependencies on other solution components. If you select
No, do not include required components, the solution may fail if you import it into another organization
where all those required components do not exist. If the solution import succeeds, the behavior in the other
solution may not be identical as the original organization because the components are configured differently than
those in the source solution.
When you select entity components, we recommend that you use solution segmentation so that you only include
entity components that are new or updated when you distribute solution updates. With solution segmentation,
you work in a solution with selected entity assets, such as entity fields, forms, and views, rather than entire entities
with all the assets. More information: Use segmented solutions
If you don’t intend to export the solution, or if you only intend to export it as an unmanaged solution and import
it back into the same organization, it isn’t necessary to include required components. If you ever export the
solution you’ll see another warning indicating that some required components are missing. If you are only going
to import this solution back into the same organization, it is OK to disregard this warning. The steps to edit
application navigation or the ribbon without using a third-party editing tool expect that you’ll export the solution
back into the same organization.

Publish changes
Certain customizations that make changes to the user interface require that they be published before people can
use them in the application.
Publish your customizations
1. Select Solutions from the left navigation.
2. Select the solution that you want to publish to open it.
3. From the list of commands, select Publish all customizations.

IMPORTANT
Preparing customizations may take some time. If you see a message that the browser page has become unresponsive, wait
for the page to become responsive, and don't close it.
See also
Use solutions
Upgrade or update a solution
3/19/2020 • 3 minutes to read • Edit Online

There are times when you need to update an existing managed solution. To update the solution, follow these
steps:
1. Open the unmanaged solution in your development environment and create new or add and remove the
existing components that you want.
2. Increment the version number when you export the solution as a managed solution. More information:
Understanding version numbers for updates

3. Apply the upgrade or update in the target environment

Apply the upgrade or update in the target environment


The procedure to import the updated solution is similar to installing a new managed solution, except you will get
some different options. If you are updating a solution you got from someone else, you should get guidance from
the solution publisher about which options you should choose.
1. Sign into Power Apps, select the target environment you want, and then select Solutions from the left
navigation.
2. On the command bar, select Import.
3. On the Select Solution Package page, select Browse to locate the compressed (.zip or .cab) file that
contains the solution you want to update.
4. Select Next.
5. You can view information about the solution before you choose Next. This page will display a yellow bar
displaying This solution package contains an update for a solution that is already installed.
6. Select from the following solution action options:
Upgrade (recommended) This option upgrades your solution to the latest version and rolls up all
previous patches in one step. Any components associated to the previous solution version that are
not in the newer solution version will be deleted. This is the recommended option as it will ensure
that your resulting configuration state is consistent with the importing solution including removal of
components that are no longer part of the solution.
Stage for Upgrade This option upgrades your solution to the higher version, but defers the
deletion of the previous version and any related parches until you apply a solution upgrade later.
This option should only be selected if you want to have both the old and new solutions installed in
the system concurrently so that you can do some data migration before you complete the solution
upgrade. This will delete the old solution and any components that are not included in the new
solution.
Update (not recommended) This option replaces your solution with this version. Components
that are not in the newer solution won't be deleted and will remain in the system. This option is not
recommended as your destination environment will differ in configuration from your source
environment and could cause issues that are difficult to reproduce and diagnose.
7. Select from the following customization options:
Maintain customizations (recommended)
Selecting this option will maintain any unmanaged customizations performed on components but
also implies that some of the updates included in this solution will not take effect.
Overwrite Customizations (not recommended)
Selecting this option will overwrite or remove any unmanaged customizations previously
performed on components included in this solution. This option does not affect components that
support merge behavior (forms, sitemap, ribbon, app modules). Components that have other
managed solutions on top of the existing solution you are replacing do also still remain on top and
are not affected by this option.
8. Decide whether to enable the following option for post import actions:
Enable any SDK message processing steps included in the solution
Selecting this option will enable plugins and workflows that are included in the solution.
9. Select Next.
10. You may need to wait a few moments while the solution import completes. If it's successful, you can view
the results and select Close.
If you have imported any changes that require publishing, you must publish customizations before they'll be
available.
Completing Solution Upgrade If you chose to stage for upgrade, or if the system had an issue completing an
upgrade, you will see that you have the original solution still installed in your system as well as a new solution
that has the same solution name as the base solution suffixed with _Upgrade. To complete the upgrade, select the
base solution in the solution list and select Apply Solution Upgrade. This will uninstall all previous patches and
the base solution then rename the _Upgrade solution to be the same name as the previous base solution. Any
components that were in the original solution and patches that are not present in the _Upgrade solution will be
deleted as part of this process.

Understanding version numbers for updates


A solution’s version has the following format: major.minor.build.revision. An update must have a higher major,
minor, build or revision number than the parent solution. For example, for a base solution version 3.1.5.7, a small
update could be a version 3.1.5.8 or a slightly more signficant update could have version 3.1.7.0. A substantially
more signficant update could be version 3.2.0.0.
See also
Add solution components
Export solutions
Import solutions
Import solutions
2/4/2020 • 2 minutes to read • Edit Online

You can import solutions manually using the steps below. Only import solutions that you've obtained from a
trusted source. Customizations might include code that can send data to external sources.
1. Sign into Power Apps and select Solutions from the left navigation.
2. On the command bar, select Import.

3. On the Select Solution Package page, select Browse to locate the compressed (.zip or .cab) file that
contains the solution you want to import.
4. Select Next.
5. Information about the solution is displayed. Select Import.
6. You may need to wait a few moments while the import completes. View the results and then select Close.
If you have imported any changes that require publishing, you must publish customizations before they are
available.
If the import isn’t successful, you will see a report showing any errors or warnings that were captured. Select
Download Log File to capture details about what caused the import to fail. The most common cause for an
import to fail is that the solution did not contain some required components.
When you download the log file, you will find an XML file that you can open using Office Excel to view the
contents.

NOTE
You can’t edit an active routing rule set. Therefore, if you’re importing a solution that includes an active routing rule set
into an environment where the rule already exists with the same ID, the import will fail. More information: Create rules to
automatically route cases

See also
Update solutions
Export solutions
Export solutions
2/4/2020 • 5 minutes to read • Edit Online

We recommend that you create an unmanaged solution to use for exporting your customizations. Then, export
your customizations periodically so that you have a backup in case anything happens. You cannot export managed
solutions. You can either export solutions from Power Apps or you can export using the classic experience.

IMPORTANT
Exporting the Default Solution is not supported.

Export from Power Apps


1. Sign into Power Apps and select Solutions from the left navigation.
2. In the list of solutions, select the unmanaged solution you want to export, and then select Export. Notice
that you can't export managed solutions.
3. The Before you export right pane appears. Choose from the following options, and then select Next:
Publish all changes. Solution components must be published before they can be exported.
Check for issues. Run the solution checker against the solution to detect performance and stability
issues.
4. The Export this solution right pane appears. Enter or select from the following options, and then select
Export:
Version number: Power Apps automatically increments your solution version while displaying the
current version. You can accept the default version or enter your own.
Export as: Select the package type, either Managed or Unmanaged.
The export can take several minutes to complete. Once finished, the export .zip file is available in the download
folder specified by your web browser.

Export from the classic experience


1. Select Solutions from the left navigation and then select Switch to classic.
2. In the list select the solution you want to export and then select Export.
3. In the Publish Customizations step you will be reminded that only published customizations are
exported and you will have the option to Publish All Customizations before you select Next.
4. If your solution contains any missing required components you will see the Missing Required
Components step. You can disregard this warning only if you intend to import this as an unmanaged
solution back into the original environment. Otherwise, follow the instructions in the dialog to cancel the
export and add the required components.
5. In the Export System Settings (Advanced) step you can choose certain system settings to include in
your solution. If your solution depends on any of the groups of system settings, select them and select
Next.
See Settings options for solution export below for details about the settings that will be included with
each option.
6. In the Package Type step, you must choose whether to export the solution as an Unmanaged or
Managed solution.
7. The next step allows you to choose a target solution for a specific version. This option is typically used by
ISVs who may want to export a solution that is compliant with a previous version. Unless you intend to
import this solution into an environment that is not upgraded to the same version as the environment
version you are using, accept the default.
8. Select Export to download the solution file.
The exact behavior for downloading files varies between web browsers.
Settings options for solution export
If you export the solution from Power Apps, please disregard this section. The following table shows the options
available when you export a solution from the classic experience.

GROUP SETTING DESCRIPTION

Auto-numbering Campaign Prefix Prefix used for campaign numbering.

Case Prefix Prefix to use for all cases throughout


the app.

Contract Prefix Prefix to use for all contracts


throughout the app.

Invoice Prefix Prefix to use for all invoice numbers


throughout the app.

Article Prefix Prefix to use for all articles in the app.

Order Prefix Prefix to use for all orders throughout


the app.

Unique String Length Number of characters appended to


invoice, quote, and order numbers.

Calendar Calendar Type Calendar type for the system. Set to


Gregorian US by default

Date Format Code Information about how the date is


displayed throughout Common Data
Service

Date Separator Character used to separate the month,


the day, and the year in dates
throughout the app.

Max Appointment Duration Maximum number of days an


appointment can last.

Show Week Number Information that specifies whether to


display the week number in calendar
displays throughout the app.
GROUP SETTING DESCRIPTION

Time Format Code Information that specifies how the time


is displayed throughout the app.

Week Start Day Code Designated first day of the week


throughout the app.

Customization Is Application Mode Enabled Indicates whether loading of the app in


a browser window that does not have
address, tool, and menu bars is
enabled.

Email-tracking Allow Unresolved Address Email Send Indicates whether users are allowed to
send email to unresolved parties
(parties must still have an email
address).

Ignore Internal Email Indicates whether incoming email sent


by app users or queues should be
tracked.

Max Tracking Number Maximum tracking number before


recycling takes place.

Render Secure Frame For Email Flag to render the body of email in the
webform in an IFRAME with the
security='restricted' attribute set. This is
additional security but can cause a
credentials prompt.

Tracking Prefix History list of tracking token prefixes.

Tracking Token Base Base number used to provide separate


tracking token identifiers to users
belonging to different deployments.

Tracking Token Digits Number of digits used to represent a


tracking token identifier.

General Block Attachments Prevent upload or download of certain


attachment types that are considered
dangerous.

Currency Format Code Information about how currency


symbols are placed throughout the
app.

Currency Symbol Currency Symbol

Full Name Display Order Order in which names are to be


displayed throughout the app.

Presence Enabled Information on whether IM presence is


enabled.
GROUP SETTING DESCRIPTION

Negative Format Information that specifies how negative


numbers are displayed throughout the
app.

Number Format Specification of how numbers are


displayed throughout the app.

Pricing Decimal Precision Number of decimal places that can be


used for prices.

Share To Previous Owner On Assign Information that specifies whether to


share to previous owner on assign.

Marketing Allow Automatic Response Creation Indicates whether automatic response


creation is allowed

Allow Automatic Unsubscribe Indicates whether automatic


unsubscribe is allowed.

Allow Automatic Unsubscribe Indicates whether automatic


Acknowledgement unsubscribe acknowledgement email is
allowed to send.

Allow Marketing Email Execution Indicates whether marketing emails


execution is allowed.

Outlook Synchronization Allow Address Book Synchronization Indicates whether background address
book synchronization in Microsoft
Office Outlook is allowed.

Allow Offline Scheduled Indicates whether background offline


Synchronization synchronization in Outlook is allowed.

Allow Scheduled Synchronization Indicates whether scheduled


synchronizations to Outlook are
allowed.

Email Send Polling Frequency Normal polling frequency used for


sending email in Outlook.

Min Address Synchronization Normal polling frequency used for


Frequency address book synchronization in
Outlook.

Min Offline Synchronization Frequency Normal polling frequency used for


background offline synchronization in
Outlook.

Min Synchronization Frequency Minimum allowed time between


scheduled Outlook synchronizations.

Auto-Tag Max Cycles Maximum number of aggressive polling


cycles executed for email auto-tagging
when a new email is received.
GROUP SETTING DESCRIPTION

Auto-Tag Interval Normal polling frequency used for


email auto-tagging in Outlook.

ISV Config Service Calendar Appearance You can define visual styles for service
Configuration calendars.

More information: Service Calendar Appearance Configuration


See also
Import solutions
Update solutions
Preview: Environment variables overview
2/11/2020 • 3 minutes to read • Edit Online

[This topic is pre-release documentation and is subject to change.]


Apps and flows often require different configuration settings across environments. Environment variables as
configurable input parameters allow management of data separately compared to hard-coding values within your
customization or using additional tools. Because they're solution components, performance is much better than
importing configuration data as record data.
Benefits of using environment variables:
No need to manually edit configurable values in a production environment.
Configure one or more variables in one place and reference like a parameter across multiple solution
components.
Update values without a code change.
Granular level security managed by Common Data Service.
Unlimited number of variables (max solution size is 29 MB ).
Service the definitions and the values independently or together.
Supported by SolutionPackager and DevOps tools enable continuous integration and continuous delivery
(CI/CD ).
Support for localization.
Can be used to control feature flags and other application settings.

IMPORTANT
This is a preview feature.
Preview features aren’t meant for production use and may have restricted functionality. These features are available
before an official release so that customers can get early access and provide feedback.

How do they work?


Environment variables can be created and managed through the modern solution interface or by using code. A
separate JSON file is created within your solution package for the values, which can also be managed in source
control and modified in a build pipeline. Export to and import from Excel is supported. After creating environment
variables, you can use them as inputs within plug-ins, flows, and other components.
Create an environment variable in Power Apps
1. Sign in to Power Apps, and then on the left panes select Solutions.
2. On the command bar, select New and then select Environment variable.
3. On the left pane, complete the following fields, and then select Save:
Display name. Enter a name for the environment variable.
Name. The unique name is automatically generated from the Display name, but you can change it.
Data Type. Select from Decimal number, Text, JSON, or a Two option field.
Default Value. This field is part of the environment variable definition entity and is not required. Set
a default value for the production environments or when the values don't need to be changed for
different environments.
Current Value. Also known as the override value. This field is optional and is a part of the
environment variable value entity. Set the value when you'd like to override the default value in your
current environment. Remove the value from your solution if you don't want to use it in the next
environment. The values are also separated into a separate JSON file within the solution.zip file that is
exported.
Separation of default value and current value allows you to service the definition and the default
value separately from the current value. It also allows us to extend the functionality in the future to
support multiple values scoped to a specific run time context.

NOTE
A value can't exist without a definition. The interface only allows creation of one value per definition.

Notifications
A notification is displayed when the environment variables do not have any values. This is a reminder to set the
values so that components dependent on variables do not fail. It also allows partners to ship variables without
values and the customer is prompted to input the values.

NOTE
We recommend partners build their own interfaces requiring the customers to provide the values. Notifications help prevent
failures if this step is skipped.

Security
Both the environmentvariabledefinition and environmentvariablevalue entities are user or team owned. When
creating an application that uses environment variables, be sure to assign users the appropriate level of permission.
More information: Security in Common Data Service.

Current limitations
Caching. Plugins will need to run a query to fetch the values.
Canvas apps and flows can consume environment variables just like entity record data.
Azure Key Vault integration for secret management. Currently environment variables should'nt be used to store
secure data such as passwords and keys.
Data types are validated in the modern solution interface only, but not currently on the server during the
preview.
Dependencies are not enforced for certain component types.
If using Excel to import environment variables, be sure to pre-pend the publisher prefix to the SchemaName.
See also
Power Apps Blog: Environment variables available in preview! Use plug-ins to extend business processes
Web API samples
Create Canvas app from scratch using Common Data Service.
Create a flow with Common Data Service
Solution layers
3/10/2020 • 2 minutes to read • Edit Online

Managed and unmanaged solutions exist at different levels within a Common Data Service environment. In
Common Data Service, there are two distinct layer levels:
Unmanaged layer. All imported unmanaged solutions and unmanaged customizations exist at this layer. The
unmanaged layer is a single layer.
Managed layers. All imported managed solutions and the system solution exist at this level. When multiple
managed solutions are installed, the last one installed is above the managed solution installed previously. This
means that the second solution installed can customize the one installed before it. When two managed
solutions have conflicting definitions, the runtime behavior is either “Last one wins” or a merge logic is
implemented. If you uninstall a managed solution, the managed solution below it takes effect. If you uninstall all
managed solutions, the default behavior defined within the system solution is applied. At the base of the
managed layers level is the system layer. The system layer contains the entities and components that are
required for the platform to function.

Solution merge behavior


When you prepare your managed solution for distribution, remember that an environment may have multiple
solutions installed or that other solutions may be installed in the future. Construct a solution that follows best
practices so that your solution will not interfere with other solutions.
The processes that Common Data Service uses to merge customizations emphasize maintaining the functionality
of the solution. While every effort is made to preserve the presentation, some incompatibilities between
customizations may require that the computed resolution will change some presentation details in favor of
maintaining the customization functionality. More information: Understand how managed solutions are merged

View the solution layers for a component


The solution layers feature allows you to view all component changes that occur due to solution changes over
time. Within a solution layer, you can drill down to view specific changed and unchanged property details for a
component. You can access solution layers from the Components list or from the Dependency Details dialog
box in solution explorer.
The solution layers feature:
Lets you see the order in which a solution changed a component.
Lets you view all properties of a component within a specific solution, including the changes to the component.
Can be used to troubleshoot dependency or solution-layering issues by displaying change details for a
component that was introduced by a solution change.
1. To view solution layers from the Components list, open solution explorer. In the Components list, select a
component, such as Account, and then select Solution Layers on the toolbar.

2. The solution layer page appears. It displays each layer for the component, such as the Account entity
displayed here, with the most recent layer at the top. To view the details for a solution layer, select it.

3. In the Solution Layer dialog box, the Changed Properties tab displays only those properties that were
modified as part of the specific solution layer.
4. Select the All Properties tab to view all properties, including changed and unchanged properties, for the
solution layer.
See also
Solutions overview
View the history of a solution
12/2/2019 • 2 minutes to read • Edit Online

You can view details about solution operations from the Solutions area of a model-driven app. An operation can
be a solution import, export, or delete. The solution history displays information such as solution version, solution
publisher, type of operation, operation start and end time, and operation status.

View solution history


1. Select Settings, and then select Solutions History.

NOTE

To get to the Settings area from a Power Apps unified interface model-driven app, select Settings on the app
toolbar, and then select Advanced Settings.

2. By default, the Custom Solutions History view is displayed. The following views are available from the
Solutions History area.
All Solutions History. Displays solution history for both internal system and custom solutions.
Custom Solutions History. Displays solution history for only custom solutions.
Internal Solutions History. Displays solution history for only internal system solutions.
Each solution history record is read-only and includes the following properties:
Start Time. The time in which the operation started.
End Time: The time in which the operation ended.
Solution Version. The version of the solution.
Publisher Name. The name of the publisher that is associated with the operation. More information: Change
the solution publisher prefix
Operation. The operation, such as import, export, or delete. More information: Import, update, and export
solutions
Suboperation: Denotes the type of operation, such as a new solution import or an update to an existing
solution.
Status. The current status of the operation, such as Completed or Not completed.
Result. The result of the operation, such as Success or Failure.
Error Code: Error code returned from the operation. An error code of 0 means the operation was successfully
completed.
View solution operation error details
When a solution operation includes a failure you can select it to display a page with additional error details.

The details page contains information including the Exception Message that can help diagnose the underlying
cause for the operation failure. Some errors, including solution dependency errors, may also include links to
solution layers to make it easier for you to diagnose the issue. The Activity Id can be useful in cases where you
need to contact Microsoft Customer Support.

See also
View solution layers
Solutions overview
Set managed properties in Common Data Service
metadata
3/6/2020 • 3 minutes to read • Edit Online

You can control which of your managed solution components are customizable by using managed properties. ISVs
should allow customization for solution components where it makes sense. This lets organizations customize your
solution to their unique requirements. Limit or eliminate customization of critical solution components that provide
the core functionality of your solution so that you can predictably support and maintain it. For most non-ISV
development environments, we recommend that you don't allow customization for your managed solution
components.
Managed properties are intended to protect your solution from modifications that may cause it to break. Managed
properties do not provide digital rights management (DRM ), or capabilities to license your solution or control who
may install it.
You apply managed properties when the solution is unmanaged in the unmanaged layer of your development
environment. The managed properties will take effect after you package the managed solution and install it in a
different environment. After the managed solution is imported, the managed properties can't be updated except by
an update of the solution by the original publisher.
Most solution components have a Managed properties menu item available when viewing a list of solution
components. When you import the managed solution that contains the components, you can view but not change
their managed properties.

View and edit entity managed properties


1. Sign in to Power Apps and select Solutions from the left pane.
2. Open the solution that you want.
3. From the list of components in the solution, select … next to the entity that you want to view the managed
properties, and then select Managed properties.

The managed properties page is displayed.


Entities have more managed properties than any other type of solution component. If the entity is customizable,
you can set the following options:

OPTION DESCRIPTION

Allow customizations Controls all the other options. If this option is False , none of
the other settings apply. When it is True , you can specify the
other customization options. When False , it is equivalent to
setting all other options to false.

Display name can be modified Whether the entity display name can be modified.

Can Change Additional Properties Applies to anything not covered by other options.

New forms can be created Whether new forms can be created for the entity.

New charts can be created Whether new charts can be created for the entity.

New views can be created Whether new views can be created for the entity.

Can Change Hierarchical Relationship Whether Hierarchical Relationships settings can be changed.
More information: Define and query hierarchically related data

Can Change Tracking Be Enabled Whether the entity Change Tracking property can be
changed.

Can Enable sync to external search index Whether the entity can be configured to enable relevance
search. More information: Configure Relevance Search to
improve search results and performance
View and edit field managed properties
Next to a custom field in a solution select … and then select Managed properties.
This opens the Managed Properties pane.

The Allow customizations option controls all the other options. If this option is disabled, none of the other
settings apply. When it is enabled, you can specify the other customization options.
If the field is customizable, you can enable the following options.
Display name can be modified
Can change additional properties: This property controls any other customizations that do not have a
specific managed property.
New forms can be created
New charts can be created
New views can be created
Can change hierarchical relationship
Can change tracking be enabled
Can enable sync to external search index
Disabling all the individual options is equivalent to disabling Allow customizations.
Apply your choices and select Done to close the pane.

NOTE
If this field is a Date and Time field, an additional Can change date and time behavior property is available. More
information: Behavior and format of the Date and Time field

See Create and edit fields for Common Data Service using Power Apps solution explorer for information about
how to edit fields.
View and edit other component managed properties
You can view and edit managed properties for many other solution components, such as a web resource, process,
chart, or dashboard. Next to the component in a solution select … and then select Managed properties.

View and edit relationship managed properties


While viewing entity relationships in solution explorer, select a relationship from an unmanaged solution and then
choose More Actions > Managed Properties on the menu bar.
With relationships, the only managed property is Can Be Customized. This single setting controls all changes that
can be made to the entity relationship.
See also
Export solutions
Solutions overview
Create solution patches
3/25/2020 • 4 minutes to read • Edit Online

You can create a patch for a parent solution and export it as a minor update to the base solution. When you clone a
solution, the system rolls up all related patches into the base solution and creates a new version.

WARNING
Using clone a patch and clone solution to update a solution isn't recommended because it limits team development and
increases complexity when storing your solution in a source control system. For information about how to update a solution,
see Upgrade or update a solution.

Creating updates using clone solution and clone to patch


When you’re working with patches and cloned solutions, keep the following information in mind:
A patch represents an incremental minor update to the parent solution. A patch can add or update
components and assets in the parent solution when installed on the target system, but it can’t delete any
components or assets from the parent solution.
A patch can have only one parent solution, but a parent solution can have one or more patches.
A patch is created from an unmanaged solution. You can’t create a patch from a managed solution.
When you import a patch into a target system, you should export it as a managed patch. Don’t use
unmanaged patches in production environments.
The parent solution must be present in the target system to install a patch.
You can delete or update a patch.
If you delete a parent solution, all child patches are also deleted. The system gives you a warning message
that you can’t undo the delete operation. The deletion is performed in a single transaction. If one of the
patches or the parent solution fails to delete, the entire transaction is rolled back.
After you have created the first patch for a parent solution, the solution becomes locked, and you can’t make
any changes in this solution or export it. However, if you delete all of its child patches, the parent solution
becomes unlocked.
When you clone a base solution, all child patches are rolled up into the base solution and it becomes a new
version. You can add, edit, or delete components and assets in the cloned solution.
A cloned solution represents a replacement of the base solution when it’s installed on the target system as a
managed solution. Typically, you use a cloned solution to ship a major update to the preceding solution.
When you clone a solution, the version number you specify includes the major and minor positions.
When you clone a patch, the version number you specify includes the build and revision positions.

For more information about version numbers, see Clone solution and clone patch version numbers in this article.

Create a solution patch


A patch contains changes to the parent solution, such as adding or editing components and assets. You don’t have
to include the parent’s components unless you plan to edit them.
Create a patch for an unmanaged solution
1. Go to the Power Apps portal, and then select Solutions.
2. In the solutions list, select an unmanaged solution to create a patch for. On the command bar, selectClone,
and then select Clone a Patch. The right pane that opens contains the base solution’s name and the patch
version number. Select Save.

3. In the solutions list, find and open the newly created patch. Notice that the unique name of the solution has
been appended with Patchhexnumber. Just like with the base solution, add the components and assets you
want.
Create a patch using solution explorer
The following illustrations provide an example of creating a patch for an existing solution. Start by selecting Clone
a Patch (in the compressed view, the Clone a Patch icon is depicted as two small squares, as shown below ).
In the Clone To Patch dialog box you see that the version number for the patch is based on the parent solution
version number, but the build number is incremented by one. Each subsequent patch has a higher build or revision
number than the preceding patch.

The following screenshot shows the base solution SegmentedSolutionExample, version 1.0.1.0, and the patch
SegmentedSolutionExample_Patch, version 1.0.2.0.

In the patch, we added a new custom entity called Book , and included all assets of the Book entity in the patch.
Clone a solution
When you clone an unmanaged solution, the original solution and all patches related to the solution are rolled up
into a newly created version of the original solution. After cloning, the new solution version contains the original
entities plus any components or entities that are added in a patch.

IMPORTANT
Cloning a solution merges the original solution and associated patches into a new base solution and removes the original
solution and patches.

1. Go to the Power Apps portal, and then select Solutions.


2. In the solutions list, select an unmanaged solution to create a clone. On the command bar, select Clone, and
then select Clone Solution. The right pane displays the base solution’s name and the new version number.
Select Save.

Clone solution and clone patch version numbers


A patch must have a higher build or revision number than the parent solution. It can’t have a higher major or
minor version. For example, for a base solution with version 3.1.5.7, a patch could be a version 3.1.5.8 or version
3.1.7.0, but not version 3.2.0.0. A cloned solution must have the version number greater than or equal to the
version number of the base solution. For example, for a base solution version 3.1.5.7, a cloned solution could be a
version 3.2.0.0, or version 3.1.5.7. When you clone a solution or patch, you set the major and minor version values
for a cloned solution, and the build or revision values for a patch.
See also
Upgrade or update a solution
Self-service data prep with dataflows
12/6/2019 • 6 minutes to read • Edit Online

As the volume of data continues to grow, so does the challenge of shaping that data into well-structured, actionable
information. You want data that’s ready for apps, AI workloads, or analytics so that you can quickly turn volumes of
data into actionable insights. With self-service data prep in the Power Apps portal, you can transform and load
data to Common Data Service or your organization’s Azure Data Lake Storage Gen2 account with just a few clicks.
Dataflows were introduced to help organizations unify data from disparate sources and prepare it for consumption.
You can easily create dataflows using familiar, self-service tools to ingest, transform, integrate, and enrich big data.
When creating a dataflow, you will define data source connections, ETL (extract, transform, load) logic, and
destination to load the resulting data to. Once created, you can configure a dataflow's refresh schedule to indicate
how frequently it should run. In addition, the new model-driven calculation engine makes the process of data
preparation more manageable, more deterministic, and less cumbersome for dataflow customers. With dataflows,
tasks that once required a data IT organization to create and oversee (and many hours or days to complete) can
now be handled with a few clicks by individuals who aren’t even data scientists, such as app creators, business
analysts and report creators.
Dataflows store data in entities. An entity is a set of records used to store data, similar to how a table stores data
within a database. Customers can define custom entity schema or leverage the Common Data Model’s standard
entities. The Common Data Model is a shared data language for business and analytical applications to use. The
Common Data Model metadata system enables consistency of data and its meaning across applications and
business processes such as Power Apps, Power BI, some Dynamics365 apps (model-driven apps), and Azure,
which store data in conformance with the Common Data Model. A dataflow’s resulting entities can then be stored
in either of the following:
Common Data Service. Lets you securely store and manage data that's used by business applications built
using Power Apps and Power Automate.
Azure Data Lake Storage Gen2. Lets you collaborate with people in your organization using Power BI,
Azure Data, and AI services or custom-built line-of-business applications that read data from the lake.
Dataflows that load data to an Azure Data Lake Storage Gen2 account store data in Common Data Model
folders. Common Data Model folders contain schematized data and metadata in a standardized format to
facilitate data exchange and to enable full interoperability across services that produce or consume data
stored in an organization’s Azure Data Lake Storage account as the shared storage layer.
You can use dataflows to ingest data from a large and growing set of supported on-premises and cloud-based data
sources including Excel, Azure SQL Database, SharePoint, Azure Data Explorer, Salesforce, Oracle database, and
more.
After selecting the data source, you can use the Power Query low -code/no-code experience to transform the data
and map it to standard entities in the Common Data Model or create custom entities. Advanced users can directly
edit a dataflow’s M -language to fully customize dataflows, similar to the Power Query experience that millions of
Power BI Desktop and Excel users already know.
Once you’ve created and saved a dataflow, you will need to run it in the cloud. You can choose to trigger a dataflow
to run manually or schedule the frequency for the Power Platform Dataflow service to run it for you. When a
dataflow completes a run, its data is available to use. To get dataflow data loaded into Common Data Service, the
Common Data Service connector can be used in Power Apps, Power Automate, Excel, and all other applications
that support the Common Data Service connector. To get from dataflows stored in your organization’s Azure Data
Lake Storage Gen2 account, you can used the Power Platform Dataflow connector in Power BI Desktop or access
the files directly in the lake.

How to use dataflows


The previous section provided background on dataflows technology. In this section, you get a tour of how
dataflows can be used in an organization.

NOTE
You must have a paid Power Apps plan to use dataflows, but you are not charged separately for using dataflows.

Load data to Common Data Service


Dataflows can be used to populate entities in the Common Data Service that are then used in Power Apps
applications. With a few clicks, you can integrate data from online and on-premises sources data sources.
Extend the Common Data Model for your business needs
For organizations that want to extend and build upon the Common Data Model, dataflows enable business
intelligence professionals to customize the standard entities or create new ones. This self-service approach to
customizing the data model can then be used with dataflows to build Power BI dashboards that are tailored to an
organization.
Extend your capabilities with Azure Data and AI services
Power Platform dataflows can be configured to store dataflow data in your organization’s Azure Data Lake Storage
Gen2 account. When an environment is connected to your organization's data lake, data scientists and developers
can leverage powerful Azure products such as Azure Machine Learning, Azure Databricks, Azure Data Factory, and
more.
For more information about Azure Data Lake Storage Gen2 and dataflows integration, including how to create
dataflows that reside in your organization's Azure Data Lake, see Connect Azure Data Lake Storage Gen2 for
dataflow storage.

Summary of self-service data prep for big data in Power Apps


There are multiple scenarios and examples where dataflows can enable you to get better control—and faster
insights—from your business data. Other people in your organization can leverage dataflows either via Common
Data Service, the Power Platform Dataflow connector in Power BI, or via direct access to Dataflow’s Common
Data Service folder in your organization’s Azure Data Lake Storage Gen2 account. Using a standard data model
(schema) defined by the Common Data Model, business applications can depend on an entity’s schema, and be
abstracted from how the data was created or from which data source. When a dataflow completes a scheduled run,
the data is ready for modeling and creation of apps, flows, or BI insights in a very short period... in what used to
take months, or longer, to create.
The standardized format of the Common Data Model allows people in your organization to create apps that
generate quick, easy, and automatic visuals and reports. Those include, but aren’t limited to:
Mapping your data from various sources to standard entities in the Common Data Model to unify data and
leverage the known schema to drive out-of-the-box applications.
Creating your own custom entities to unify data across your organization.
Creating Power BI reports and dashboards that leverage dataflow data.
Creating integration with Azure Data and AI services via your organization’s Azure Data Lake Storage Gen2
account.
Next steps
This article provided an overview of self-service data prep in the Power Apps portal, and the ways you can use it.
The following topics go into more detail about common usage scenarios for dataflows:
Creating and using dataflows in Power Apps
Add data to an entity in Common Data Service
Connect Azure Data Lake Storage Gen2 for dataflow storage
Using dataflows with on-premises data sources
For more information about Power Query and scheduled refresh, you can read these articles:
Query overview in Power BI Desktop
Configuring scheduled refresh
For more information about the Common Data Model, you can read its overview article:
Common Data Model - overview
Create and use dataflows in Power Apps
1/8/2020 • 7 minutes to read • Edit Online

With advanced data preparation available in Power Apps, you can create a collection of data called a dataflow,
which you can then use to connect with business data from various sources, clean the data, transform it, and then
load it to Common Data Service or your organization’s Azure Data Lake Gen2 storage account.
A dataflow is a collection of entities (entities are similar to tables) that are created and managed in environments in
the Power Apps service. You can add and edit entities in your dataflow, as well as manage data refresh schedules,
directly from the environment in which your dataflow was created.
Once you create a dataflow in the Power Apps portal, you can get data from it using the Common Data Service
connector or Power BI Desktop Dataflow connector, depending on which destination you chose when creating the
dataflow.
There are three primary steps to using a dataflow:
1. Author the dataflow in the Power Apps portal. You select the destination to load the output data to, the
source to get the data from, and the Power Query steps to transform the data using Microsoft tools that are
designed to make doing so straightforward.
2. Schedule dataflow runs. This is the frequency in which the Power Platform Dataflow should refresh the data
that your dataflow will load and transform.
3. Use the data you loaded to the destination storage. You can build apps, flows, Power BI reports, and
dashboards or connect directly to the dataflow’s Common Data Model folder in your organization’s lake
using Azure data services like Azure Data Factory, Azure Databricks or any other service that supports the
Common Data Model folder standard.
The following sections look at each of these steps so you can become familiar with the tools provided to complete
each step.

Create a dataflow
Dataflows are created in one environment. Therefore, you will only be able to see and manage them from that
environment. In addition, individuals who want to get data from your dataflow must have access to the
environment in which you created it.

NOTE
Creating dataflows is currently not available with Power Apps Community Plan licenses.

1. Sign in to Power Apps, and verify which environment you're in, find the environment switcher near the right
side of the command bar.

2. On the left navigation pane, select the down arrow next to Data.
3. In the Data list, select Dataflows and then select New dataflow.

4. On the Select load target page, select the destination storage where you want entities to be stored.
Dataflows can store entities in Common Data Service or in your organization's Azure Data Lake storage
account. Once you select a destination to load data to, enter a Name for the dataflow, and then select
Create.
IMPORTANT
There is only one owner of any dataflow—the person who created it. Only the owner can edit the dataflow.
Authorization and access to data created by the dataflow depend on the destination you loaded data to. Data loaded
into Common Data Service will be available via the Common Data Service Connector and requires the person
accessing the data to be authorized to Common Data Service. Data loaded into your organization’s Azure Data Lake
Gen2 storage account is accessible via the Power Platform Dataflow connector and access to it requires membership
within the environment it was created in.

5. On the Choose data source page, select the data source where the entities are stored, and then select
Create. The selection of data sources displayed allows you to create dataflow entities.

6. After you select a data source, you’re prompted to provide the connection settings, including the account to
use when connecting to the data source.

7. Once connected, you select the data to use for your entity. When you choose data and a source, the Power
Platform Dataflow service will subsequently reconnect to the data source in order to keep the data in your
dataflow refreshed, at the frequency you select later in the setup process.

Now that you've selected the data to use in the entity, you can use the dataflow editor to shape or transform that
data into the format necessary for use in your dataflow.

Use the dataflow editor to shape or transform data


You can shape your data selection into a form that works best for your entity using a Power Query editing
experience, similar to the Power Query Editor in Power BI Desktop. To learn more about Power Query, see Query
overview in Power BI Desktop.
If you want to see the code that Query Editor is creating with each step, or if you want to create your own shaping
code, you can use the advanced editor.

Dataflows and the Common Data Model


Dataflows entities include new tools to easily map your business data to the Common Data Model, enrich it with
Microsoft and third-party data, and gain simplified access to machine learning. These new capabilities can be
leveraged to provide intelligent and actionable insights into your business data. Once you’ve completed any
transformations in the edit queries step described below, you can map columns from your data source tables to
standard entity fields as defined by the Common Data Model. Standard entities have a known schema defined by
the Common Data Model.
For more information about this approach, and about the Common Data Model, see The Common Data Model.
To leverage the Common Data Model with your dataflow, select the Map to Standard transformation in the Edit
Queries dialog. In the Map Entities screen that appears, select the standard entity that you want to map.

When you map a source column to a standard field, the following occurs:
1. The source column takes on the standard field name (the column is renamed if the names are different).
2. The source column gets the standard field data type.
To keep the Common Data Model standard entity, all standard fields that are not mapped get Null values.
All source columns that are not mapped remain as is to ensure that the result of the mapping is a standard entity
with custom fields.
Once you’ve completed your selections and your entity and its data settings are complete, you’re ready for the next
step, which is selecting the refresh frequency of your dataflow.

Set the refresh frequency


Once your entities have been defined, you’ll want to schedule the refresh frequency for each of your connected
data sources.
1. Dataflows use a data refresh process to keep data up to date. In the Power Platform Dataflow authoring
tool, you can choose to refresh your dataflow manually or automatically on a scheduled interval of your
choice. To schedule a refresh automatically, select Refresh automatically.
2. Enter the dataflow refresh frequency, start date, and time, in UTC.
3. Select Create.

Using dataflows stored in Azure Data Lake Storage Gen2


Some organizations might want to use their own storage for creation and management of dataflows. You can
integrate dataflows with Azure Data Lake Storage Gen2 if you follow the requirements to set up the storage
account properly. More information: Connect Azure Data Lake Storage Gen2 for dataflow storage

Troubleshooting data connections


There might be occasions when connecting to data sources for dataflows runs into issues. This section provides
troubleshooting tips when issues occur.
Salesforce connector. Using a trial account for Salesforce with dataflows results in a connection failure
with no information provided. To resolve this, use a production Salesforce account or a developer account
for testing.
SharePoint connector. Make sure you supply the root address of the SharePoint site, without any
subfolders or documents. For example, use a link similar to
https://microsoft.sharepoint.com/teams/ObjectModel.
JSON File connector. Currently you can connect to a JSON file using basic authentication only. For
example, a URL similar to https://XXXXX.blob.core.windows.net/path/file.json?sv=2019 -01 -
01&si=something&sr=c&sig=123456abcdefg is currently not supported.
Azure SQL Data Warehouse. Dataflows do not currently support Azure Active Directory authentication
for Azure SQL Data Warehouse. Use basic authentication for this scenario.

Next steps
The following articles are useful for further information and scenarios when using dataflows:
Add data to an entity in Common Data Service
Using dataflows with on-premises data sources
Connect Azure Data Lake Storage Gen2 for dataflow storage
For more information about the Common Data Model:
Common Data Model - overview
Learn more about the Common Data Model schema and entities on GitHub
Add data to an entity in Common Data Service by
using Power Query
2/5/2020 • 2 minutes to read • Edit Online

In this procedure, you'll create an entity in Common Data Service and fill that entity with data from an OData feed
by using Power Query. You can use the same techniques to integrate data from these online and on-premises
sources, among others:
SQL Server
Salesforce
IBM DB2
Access
Excel
Web APIs
OData feeds
Text files
You can also filter, transform, and combine data before you load it into a new or existing entity.
If you don't have a license for Power Apps, you can sign up for free.

Prerequisites
Before you start to follow this topic:
Switch to an environment in which you can create entities.
You must have a Power Apps per user plan or Power Apps per app plan.

Specify the source data


1. Sign in to Power Apps, and then click or tap the down arrow for Data near the left edge.

2. In the list that appears, click or tap Data Integration, and then click or tap New Project near the upper-
right corner of the window.
3. In the list of data sources, click or tap OData.
4. Under Connection settings, type or paste this URL, and then select Next:
https://services.odata.org/V4/Northwind/Northwind.svc/

5. In the list of tables, select the Customers check box, and then click or tap Next.

6. (optional) Modify the schema to suit your needs by choosing which columns to include, transforming the
table in one or more ways, adding an index or conditional column, or making other changes.
7. In the lower-right corner, click or tap Next.

Specify the target entity


1. Under Load settings, select Load to new entity.
You can give the new entity a different name or display name, but leave the default values to follow this
tutorial exactly.
2. In the Primary name field list, click or tap ContactName, and then click or tap Next in the lower-right
corner.
You can specify a different primary-name field, map a different column in the source table to each field in
the entity that you're creating, or both. You can also specify whether Text columns in your query output
should be created as either Multiline Text or Single-Line Text in the Common Data Service. To follow this
tutorial exactly, leave the default column mapping.
3. When the Load status is Completed, select Done in the lower-right corner.
4. Under Data (near the left edge), select Entities to show the list of entities in your database.
The Customers entity that you created from an OData feed appears as a custom entity.

WARNING
If you use Power Query to add data to an existing entity, all data in that entity will be overwritten.

If you select Load to existing entity, you can specify an entity into which you add data from the Customers
table. You could, for example, add the data to the Account entity with which the Common Data Service ships.
Under Source column, you can further specify that data in the ContactName column from the Customers table
should be added to the Name column in the Accounts entity.
We're excited about this functionality and eager to hear your feedback. Please send us your suggestions and
feedback about this feature!
If an error message about permissions appears, talk to your administrator.

WARNING
There is a limit of 500,000 rows per run and per project that can be loaded using this feature.
Connect Azure Data Lake Storage Gen2 for dataflow
storage
12/6/2019 • 6 minutes to read • Edit Online

You can configure dataflows to store their data in your organization’s Azure Data Lake Storage Gen2 account. This
article describes the general steps necessary to do so, and provides guidance and best practices along the way.

IMPORTANT
Dataflow with Analytical entities feature utilizes the Export to data lake service, which may offer varying levels of compliance,
privacy, security, and data location commitments. For more information about the Export to data lake service, see the blog
article.

There are some advantages to configuring dataflows to store their definitions and datafiles in your data lake,
including the following:
Azure Data Lake Storage Gen2 provides an enormously scalable storage facility for data.
Dataflow data and definition files can be leveraged by your IT department's developers to leverage Azure data
and artificial intelligence (AI) services as demonstrated in the GitHub samples from Azure data services.
It enables developers in your organization to integrate dataflow data into internal applications and line-of-
business solutions, using developer resources for dataflows and Azure.

Requirements
To use Azure Data Lake Storage Gen2 for dataflows, you need the following:
A Power Apps environment. Any Power Apps plan will allow you to create dataflows with Azure Data Lake
Storage Gen2 as a destination. You'll need to be authorized in the environment as a maker.
An Azure subscription. You need an Azure subscription to use Azure Data Lake Storage Gen2.
A resource group. Use a resource group you already have, or create a new one.
An Azure storage account. The storage account must have the Data Lake Storage Gen2 feature enabled.

TIP
If you don't have an Azure subscription, create a free trial account before you begin.

Prepare your Azure Data Lake Storage Gen2 for Power Platform
Dataflows
Before you configure your environment with an Azure Data Lake Storage Gen2 account, you must create and
configure a storage account. Here are the requirements for Power Platform Dataflows:
1. The storage account must be created in the same Azure Active Directory tenant as your Power Apps tenant.
2. We recommend that the storage account is created in the same region as the Power Apps environment you
plan to use it in. To determine where your Power Apps environment is, contact your environment admin.
3. The storage account must have the Hierarchical Name Space feature enabled.
4. You must be granted an Owner role on the storage account.
The following sections walk through the steps necessary to configure your Azure Data Lake Storage Gen2 account.

Create the storage account


Follow the steps in Create an Azure Data Lake Storage Gen2 storage account.
1. Make sure you select the same region as your environment and set your storage as StorageV2 (general
purpose v2).
2. Make sure you enable the hierarchical namespace feature.
3. We recommend that you set the replication setting to Read-access geo-redundant storage (RA-GRS ).

Connect your Azure Data Lake Storage Gen2 to Power Apps


Once you've set up your Azure Data Lake Storage Gen2 account in the Azure portal, you are ready to connect it to
a specific dataflow or a Power Apps environment. Connecting the lake to an environment allows other makers and
admins in the environment to create dataflows that store their data in your organization's lake as well.
To connect your Azure Data Lake Storage Gen2 account with the dataflow, follow these steps:
1. Sign in to Power Apps, and verify which environment you're in. The environment switcher is located on the
right side of the header.
2. On the left navigation pane, select the down arrow next to Data.

3. In the list that appears, select Dataflows and then on the command bar select New dataflow.
4. Select the analytical entities you want. These entities indicate what data you want to store in your
organization's Azure Data Lake Store Gen2 account.

Select the storage account to use for dataflow storage


If a storage account has not yet been associated with the environment, a Link to data lake dialog box appears.
You'll need to sign in and find the data lake you created in the previous steps. In this example, no data lake is
associated with the environment and so a prompt occurs to add one.
1. Select storage account.
The Select Storage Account screen appears.
2. Select the Subscription ID of the storage account.
3. Select the Resource group name in which the storage account was created.
4. Enter the Storage account name.
5. Select Save.
Once these steps are successfully completed, your Azure Data Lake Storage Gen2 account is connected to Power
Platform Dataflows and you can continue to create a dataflow.

Considerations and limitations


There are a few considerations and limitations to keep in mind when working with your dataflow storage:
Linking an Azure Data Lake Store Gen2 account for dataflow storage is not supported in the default
environment.
Once a dataflow storage location is configured for a dataflow, it can't be changed.
By default, any member of the environment can access dataflow data using the Power Platform Dataflows
Connector. However, only the owners of a dataflow can access its files directly in Azure Data Lake Storage
Gen2. To authorize additional people to access the dataflows data directly in the lake, you must authorize them
to the dataflow’s CDM Folder in the data lake or the data lake itself.
When a dataflow is deleted, its CDM Folder in the lake will also be deleted.

IMPORTANT
You shouldn't change files created by dataflows in your organization’s lake or add files to a dataflow’s CDM Folder. Changing
files might damage dataflows or alter their behavior and is not supported. Power Platform Dataflows only grants read access
to files it creates in the lake. If you authorize other people or services to the filesystem used by Power Platform Dataflows,
only grant them read access to files or folders in that filesystem.

Privacy notice
By enabling the creation of dataflows with Analytical entities in your organization, via the Export to data lake
service, details about the Azure Data Lake storage account, such as the name of the storage account, will be sent to
and stored in the Export to data lake service, which is currently located outside the PowerApps compliance
boundary and may employ lesser or different privacy and security measures than those typically in PowerApps.
Note that you may remove the data lake association at any time to discontinue use of this functionality and your
Azure Data Lake storage account details will be removed from the Export to data lake service. Further
information about Export to data lake, is available in this article.

Frequently asked questions


What if I had previously created dataflows in my organization’s Azure Data Lake Storage Gen2 and would like to
change their storage location?
You can't change the storage location of a dataflow after it was created.
When can I change the dataflow storage location of an environment?
Changing the environment's dataflow storage location is not currently supported.

Next steps
This article provided guidance about how to connect an Azure Data Lake Storage Gen2 account for dataflow
storage.
For more information about dataflows, the Common Data Model, and Azure Data Lake Storage Gen2, see these
articles:
Self-service data prep with dataflows
Creating and using dataflows in Power Apps
Connect Azure Data Lake Storage Gen2 for dataflow storage
Add data to an entity in Common Data Service
For more information about Azure storage, see this article:
Azure Storage security guide
For more information about the Common Data Model, see these articles:
Common Data Model - overview
Common Data Model folders
CDM model file definition
You can ask questions in the Power Apps Community.
Using an on-premises data gateway in Power
Platform Dataflows
12/6/2019 • 3 minutes to read • Edit Online

Install an on-premises data gateway to transfer data quickly and securely between a Power Platform dataflow and
a data source that isn't in the cloud, such as an on-premises SQL Server database or an on-premises SharePoint
site. You can view all gateways for which you have administrative permissions and manage permissions and
connections for those gateways.
With a gateway, you can connect to on-premises data through these connections:
SharePoint
SQL Server
Oracle
Informix
Filesystem
DB2

Prerequisites
A Power Apps account. Don't have one? Sign up for 30 days free.
Administrative permissions on a gateway. These permissions are provided by default for gateways you
install. Administrators can grant other people permissions for gateways.
A license that supports accessing on-premises data using an on-premises gateway. For more information,
see the “Connect to your data and systems” section of the Find the right Power Apps plan page.
Gateways and on-premises connections can only be created and used in the user's default environment.
More information: Working with environments and Microsoft Power Apps.

Install a gateway
1. In the left navigation pane of powerapps.com, select Gateways.

2. Select a gateway from the list. If you don't have administrative permissions for a gateway, select Install a
gateway now, and then follow the prompts in the wizard.
For details about how to install a gateway, see Understand on-premises data gateways.

Use an on-premises data source in a dataflow


1. Select an on-premises data source from the data sources list.

2. Provide the connection details for the enterprise gateway that will be used to access the on-premises data.
You must select the gateway itself, and provide credentials for the selected gateway. Only gateways for
which you are an administrator appear in the list.

You can change the enterprise gateway used for a given dataflow and change the gateway assigned to all of your
queries using the dataflow authoring tool.
NOTE
The dataflow will try to find or create the required data sources using the new gateway. If it cannot do so, you won't be able
to change the gateway until all needed dataflows are available from the selected gateway.

View and manage gateway permissions


1. In the left navigation pane of powerapps.com, select Gateways and then select the gateway you want.
2. To add a user to a gateway, select Users, specify a user or group, and then specify a permission level:
Can use. Users with this permission can create connections on the gateway to use for apps and
flows, but can't share the gateway. Use this permission for users who will run apps but not share
them.
Can use + share. Users with this permission can create a connection on the gateway to use for apps
and flows, and automatically share the gateway when sharing an app. Use this permission for users
who need to share apps with other users or with the organization.
Admin. Admins have full control of the gateway, including adding users, setting permissions,
creating connections to all available data sources, and deleting the gateway.
For Can use and Can use + share permission levels, select the data sources that the user can connect to
over the gateway.

View and manage gateway connections


1. In the left navigation bar of powerapps.com, select Gateways, and then choose the gateway you want.
2. Perform the action that you want:
To view details, edit the settings, or delete a gateway, select Connections and then select a
connection.
To share a connection, select Share and then add or remove users.

NOTE
You can only share some types of connections, such as a SQL Server connection. For more information, see
Share canvas-app resources in Power Apps.
For more information about how to manage a connection, see Manage canvas-app connections in Power
Apps.

Limitations
There are a few known limitations when using enterprise gateways and dataflows.
Each dataflow can use only one gateway. As such, all queries should be configured using the same gateway.
Changing the gateway impacts the entire dataflow.
If several gateways are needed, the best practice is to build several dataflows (one for each gateway) and
use the compute or entity reference capabilities to unify the data.
Dataflows are only supported using enterprise gateways. Personal gateways will not be available for
selection in the drop-down lists and settings screens.
For information about troubleshooting issues with gateways, or configuring the gateway service for your network,
see Understand on-premises data gateways.

Next steps
Create and use dataflows in Power Apps
Add data to an entity in Common Data Service by using Power Query
Connect Azure Data Lake Storage Gen2 for dataflow storage
License requirements for entities
3/20/2020 • 4 minutes to read • Edit Online

IMPORTANT
For the latest information on licensing requirements for entities, see the Power Apps licensing guide.

App makers can use most of the entities available within Common Data Service (including custom entities and
entities that are part of the Common Data Model) to create apps and flows for users who have a Power Apps Plan
1 or Power Automate Plan 1 license. In some cases, entities contain complex business logic or are tied to Dynamics
365 applications that require app users to have a specific license.

ENTITY DESCRIPTION REQUIREMENT

Entities with complex business logic These are entities that use complex Power Apps Plan 2 or Flow Plan 2
server-side business logic. For example,
any entity that uses a real-time
workflow or code plug-in.

Restricted entities These are entities that are not standard A Dynamics 365 plan
with Common Data Service but are
included in a model-driven app available
in Dynamics 365 (such as Dynamics 365
Sales or Dynamics 365 Customer
Service) or a third-party solution. For
example, the knowledge article, goal,
and entitlement entities.

NOTE
Apps and flows that use these entities require the app and flow user to be licensed appropriately-not the maker or developer
of the app or flow.

Entities with complex business logic


Entities that include the following complex server-side logic require users of an app or flow that uses these entities
to have a Power Apps Plan 2 or Power Automate Plan 2 license:
Code plug-ins (for more information, see Plug-in development)
Real-time workflows (for more information, see Workflow processes)

NOTE
Only workflows that are converted to a real-time workflow are considered real-time and synchronous. Workflows that
are run in the background can still be used with the appropriate Power Apps plan and do not require additional
licenses.

To know whether or not you added complex business logic to your entities, review the list of plug-in assemblies
and workflows configured in your environment. For the list of entities which may contain server side logic after
installing a model-driven application in Dynamics 365 (such as Dynamics 365 Sales or Dynamics 365 Customer
Service), see Complex entities requiring Power Apps Plan 2 licenses
Impacting license requirements when adding complex business logic
App makers can add code plug-ins and real-time workflows to entities within Common Data Service, but doing so
could change the license requirements for users of apps already deployed. App makers should be cautious when
adding complex business logic to an entity and should first check which apps use the entity and whether users of
those apps have the appropriate licenses.

Restricted entities
Certain entities that are tied to the functionality of Dynamics 365 applications require app users to have the
corresponding license for that application if they want to create, update, or delete records within the entities. For a
full list of restricted entities, see Restricted entities requiring Dynamics 365 licenses.

Licensing examples
Barb and Isaac are creating apps in Power Apps using Common Data Service to store their data.
Barb is creating two canvas apps:
App 1 – uses the Appointment entity along with a custom entity that stores related information
App 2 – uses the Appointment entity along with the Incident entity, which is a restricted entity
Isaac is creating two model-driven apps:
App 3 – uses the Appointment entity along with a custom entity that stores related information
App 4 – uses the Appointment entity along with the Incident entity, which is a restricted entity
Barb and Isaac need the following licenses:
Barb needs a Power Apps Plan 1 license to create canvas apps using Common Data Service. If she needs to
create a database or create a custom entity, she would need a Power Apps Plan 2 license.
Isaac needs a Power Apps Plan 2 license to build model- driven apps.
App users need the following licenses:
App 1 users only need a Power Apps Plan 1 or Plan 2 license, since the app doesn't contain any entities with
complex business logic or restricted entities.
App 2 users need a Dynamics 365 Customer Service, Enterprise edition license (or a Dynamics 365 or
Dynamics 365 Customer Engagement plan), since the app includes a restricted entity.
App 3 users need a Power Apps Plan 2 license, since it's a model-driven app.
App 4 users need a Dynamics 365 for Customer Service, Enterprise edition license (or a Dynamics 365 or
Dynamics 365 Customer Engagement plan), since the app includes a restricted entity.
The Dynamics 365 for Customer Service plan includes a Power Apps Plan 2 license, which allows users to
run model-driven apps.
Now, let's see what happens when Isaac adds a real-time workflow to the custom entity that both Barb and Isaac
are using in their apps.
Barb and Isaac need the following licenses:
Barb still needs a Power Apps Plan 1 license to create canvas apps using Common Data Service.
Isaac still needs a Power Apps Plan 2 license to build model-driven apps.
App users need the following licenses:
App 1 users now need a Power Apps Plan 2 license, since the app contains an entity with a real-time
workflow.
App 2 users still need a Dynamics 365 for Customer Service, Enterprise edition license (or a Dynamics 365
or Dynamics 365 Customer Engagement plan), since the app includes a restricted entity.
App 3 users still need a Power Apps Plan 2 license, since it's a model-driven app.
App 4 users still need a Dynamics 365 for Customer Service, Enterprise edition license (or a Dynamics 365
or Dynamics 365 Customer Engagement plan), since the app includes a restricted entity.
The Dynamics 365 for Customer Service plan includes a Power Apps Plan 2 license, which allows users to
run model-driven apps.
The only app impacted by this change is App 1, which previously required a Power Apps Plan 1 license, but now
requires a Power Apps Plan 2 license, since it contains an entity with complex business logic.

More about licensing


For more information about Power Apps and Dynamics 365 licenses, see Licensing overview.
Complex entities and licensing
3/20/2020 • 2 minutes to read • Edit Online

IMPORTANT
Complex entities are only applicable for Power Apps Plan 1 and Plan 2 licenses and not for Power Apps per app and Power
Apps per user plans. For the latest information on licensing requirements for entities, see the Power Apps licensing guide.

Entities that include the following complex server-side logic require users of an app or flow that uses these entities
to have a Power Apps Plan 2 or Power Automate Plan 2 license:
Code plug-ins. More information: Plug-in development
Real-time workflows. More information: Workflow processes

IMPORTANT
Only workflows that are converted to a real-time workflow are considered real-time and synchronous. Workflows
that are run in the background can still be used with the appropriate Power Apps plan and do not require additional
licenses.

To know whether or not you've added complex business logic to your entities, review the list of plug-in assemblies
and workflows configured in your environment.

Complex entities installed with Dynamics 365 apps


The following table lists entities that contain complex server-side logic out-of-the-box as part of the installation of
model-driven applications in Dynamics 365, such as Dynamics 365 Sales and Dynamics 365 Customer Service.
This list is intended as a guide. Depending on which Dynamics 365 apps and versions are installed in your
environment, the list of complex entities may vary.

NOTE
If you are using the Common Data Service and have not installed a Dynamics 365 application or third-party solution, your
environment will not have entities containing complex server side logic.

Account
Agreement
Agreement Booking Date
Agreement Booking Incident
Agreement Booking Product
Agreement Booking Service
Agreement Booking Service Task
Agreement Booking Setup
Agreement Invoice Date
Agreement Invoice Product
Agreement Invoice Setup
Agreement Sub-Status
Bookable Resource
Bookable Resource Booking
Bookable Resource Booking Header
Bookable Resource Category
Bookable Resource Category Assn
Bookable Resource Characteristic
Bookable Resource Group
Booking Alert
Booking Alert Status
Booking Status
Characteristic
Competency Requirement (Deprecated)
Competitor
Contact
Customer Asset
Delegation
Expense
Field Computation
Field Service Price List Item
Filter
Follow
Incident Type
Incident Type Product
Incident Type Service
Incident Type Service Task
Integration Job
Integration Job Detail
Inventory Adjustment
Inventory Adjustment Product
Inventory Transfer
Invoice
Invoice Frequency
Invoice Line
Invoice Line Detail
Journal
Journal Line
Lead
Note
OData v4 Data Source
Opportunity
Opportunity Line
Opportunity Line Detail
Order
Order Invoicing Product
Order Invoicing Setup
Order Line
Payment
Payment Detail
Post Configuration
Post Rule Configuration
Postal Code
Price List
Price List Item
Product
Project
Project Approval
Project Contract Line Detail
Project Contract Line Milestone
Project Contract Line Resource Category
Project Contract Line Transaction Category
Project Parameter
Project Stages
Project Task Status User
Project Team Member Sign-Up
Purchase Order
Purchase Order Bill
Purchase Order Product
Purchase Order Receipt
Purchase Order Receipt Product
Purchase Order Sub Status
Queue Item
Quote
Quote Booking Incident
Quote Booking Product
Quote Booking Service
Quote Booking Service Task
Quote Booking Setup
Quote Invoicing Product
Quote Invoicing Setup
Quote Line
Quote Line Detail
Quote Line Milestone
Quote Line Resource Category
Quote Line Transaction Category
Quote Project Price List
Rating Model
Rating Value
Requirement Characteristic
Requirement Resource Category
Requirement Resource Preference
Requirement Status
Resource Request
Resource Requirement
Resource Requirement Detail
RMA
RMA Product
RMA Receipt
RMA Receipt Product
RMA Sub-Status
Role competency requirement
Role Price
RTV
RTV Product
RTV Sub-Status
Tax Code
Tax Code Detail
Time Entry
Time Group
Time Group Detail
Time Off Request
Transaction Category Price
User
View
Wall View
Warehouse
Work Order
Work Order Incident
Work Order Product
Work Order Service
Work Order Service Task
Work Order Sub-Status
Work template

Licensing
For more information about Power Apps and Dynamics 365 licenses, see Licensing overview page.
Restricted entities requiring Dynamics 365 licenses
3/20/2020 • 5 minutes to read • Edit Online

IMPORTANT
For the latest information on licensing requirements for entities, see the Power Apps licensing guide.

App makers can use most of the entities available within Common Data Service to create apps and flows for users
who have only a Power Apps Plan 1 license. However, some entities contain complex business logic that requires
app users to have a Power Apps Plan 2 or Power Automate Plan 2 license (for more information, see Entity license
requirements). An even smaller set of entities tied to Dynamics 365 products requires canvas and model-driven
app users to have a license for the corresponding Dynamics 365 product if they need to create, update, or delete
records within the entities. These are referred to as restricted entities.
Entities may be restricted to a Dynamics 365 license for the following reasons:
The entity is used to store and maintain product-specific configuration data that is typically not used outside of
the application.
The entity is accompanied by advanced logic that creates and maintains data in a specific way when used within
a Dynamics 365 product.
If an app or flow only reads information from an entity, a Dynamics 365 license is not required and an appropriate
Power Apps or Power Automate license is all that's needed.

Restricted entities for create, update, and delete operations


The following table lists the restricted entities and the associated Dynamics 365 licensing requirements for Power
Apps and Power Automate app users who create, update, or delete data stored within the entities.

ENTITY LOGICAL NAME LICENSE REQUIRED

Actual msdyn_actual Dynamics 365 for Field Service


or Dynamics 365 for Project Service
Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Agreement Business Process msdyn_bpf_baa0a411a239410cb8bded Dynamics 365 for Field Service


8b5fdd88e3 or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Booking journal msdyn_bookingjournal Dynamics 365 for Field Service


or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan
ENTITY LOGICAL NAME LICENSE REQUIRED

Booking Setup Metadata msdyn_bookingsetupmetadata Dynamics 365 for Field Service


or Dynamics 365 for Project Service
Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Booking timestamp msdyn_bookingtimestamp Dynamics 365 for Field Service


or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Case incident Dynamics 365 for Customer Service,


Enterprise edition
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Case to Work Order Business Process msdyn_bpf_989e9b1857e24af18787d5 Dynamics 365 for Field Service
143b67523b or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Configuration msdyn_configuration Dynamics 365 for Field Service


or Dynamics 365 for Project Service
Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Entitlement entitlement Dynamics 365 for Customer Service,


Enterprise edition
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Estimate Line msdyn_estimateline Dynamics 365 for Project Service


Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Estimate msdyn_estimate Dynamics 365 for Project Service


Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Fact msdyn_fact Dynamics 365 for Project Service


Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan
ENTITY LOGICAL NAME LICENSE REQUIRED

Field service setting msdyn_fieldservicesetting Dynamics 365 for Field Service


or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Field Service System Job msdyn_fieldservicesystemjob Dynamics 365 for Field Service
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Goal goal Dynamics 365 for Sales Professional,


or Dynamics 365 for Sales, Enterprise
edition,
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Inventory Journal msdyn_inventoryjournal Dynamics 365 for Field Service


or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Invoice Process msdyn_bpf_d8f9dc7f099f44db9d641dd Dynamics 365 for Project Service


81fbd470d Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Journey journey Dynamics 365 for Marketing


or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Knowledge article knowledgearticle Dynamics 365 for Customer Service,


Enterprise edition
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Organizational Unit msdyn_organizationalunit Dynamics 365 for Field Service


or Dynamics 365 for Project Service
Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Product Inventory msdyn_productinventory Dynamics 365 for Field Service


or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Project Parameter msdyn_projectparameter Dynamics 365 for Project Service


Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan
ENTITY LOGICAL NAME LICENSE REQUIRED

Project Stages msdyn_bpf_665e73aa18c247d886bfc5 Dynamics 365 for Project Service


0499c73b82 Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Project Task Dependency msdyn_projecttaskdependency Dynamics 365 for Project Service


Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Project Task msdyn_projecttask Dynamics 365 for Project Service


Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Project Team Member msdyn_projecteam Dynamics 365 for Project Service


Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Purchase Order Business Process msdyn_bpf_2c5fe86acc8b414b8322ae5 Dynamics 365 for Field Service
71000c799 or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Resource Assignment Detail msdyn_resourceassignmentdetail Dynamics 365 for Project Service


(Deprecated) Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Resource Assignment msdyn_resourceassignment Dynamics 365 for Project Service


Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Resource Restriction (Deprecated) msdyn_workorderresourcerestriction Dynamics 365 for Field Service


or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Routing rule set routingrule Dynamics 365 for Customer Service,


Enterprise edition
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan
ENTITY LOGICAL NAME LICENSE REQUIRED

Schedule Board Setting msdyn_scheduleboardsetting Dynamics 365 for Field Service


or Dynamics 365 for Project Service
Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Scheduling Parameter msdyn_schedulingparameter Dynamics 365 for Field Service


or Dynamics 365 for Project Service
Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

SLA sla Dynamics 365 for Customer Service,


Enterprise edition
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

System User Scheduler Setting msdyn_systemuserschedulersetting Dynamics 365 for Field Service
or Dynamics 365 for Project Service
Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Transaction Connection msdyn_transactionconnection Dynamics 365 for Project Service


Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Transaction Origin msdyn_transactionorigin Dynamics 365 for Project Service


Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Transaction Type msdyn_transactiontype Dynamics 365 for Project Service


Automation
or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Unique Number msdyn_uniquenumber Dynamics 365 for Field Service


or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Work Order Business Process msdyn_bpf_d3d97bac8c294105840e99 Dynamics 365 for Field Service
e37a9d1c39 or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan
ENTITY LOGICAL NAME LICENSE REQUIRED

Work Order Details Generation Queue msdyn_workorderdetailsgenerationque Dynamics 365 for Field Service
(Deprecated) ue or Dynamics 365 Customer
Engagement plan
or Dynamics 365 plan

Licensing
For more information on Power Apps and Dynamics 365 licenses, see Licensing overview page.
SharePoint, OneNote, and OneDrive integration with
Common Data Service
8/5/2019 • 2 minutes to read • Edit Online

Common Data Service provides support for SharePoint, OneDrive, and OneNote integration. Integration with
these services requires that you first enable SharePoint integration.

OFFICE 365 SERVICE DESCRIPTION MORE INFORMATION

SharePoint Lets app users manage common Manage your documents using
document types, such as Word, Excel, SharePoint
PowerPoint, OneNote, and create
folders to save and manage those Set up SharePoint integration
documents that are seamlessly stored in
SharePoint from within Common Data
Service apps.

OneDrive for Business App users can create and manage Enable OneDrive for Business
private documents that can be accessed
from within Common Data Service apps.

OneNote App users can use OneNote to take or Set up OneNote integration
review notes from within Common Data
Service records.
Create a Power BI report
12/3/2019 • 3 minutes to read • Edit Online

Common Data Service allows you to connect directly to your data using Power BI Desktop to create reports and
publish them to Power BI. From Power BI, reports can be used in dashboards, shared to other users and accessed
cross platform on Power BI mobile apps.

Prerequisites
To use Power BI with the Common Data Service, you need the following:
Download and install Power BI Desktop, which is a free application that runs on your local computer. You can
download Power BI desktop here.
Common Data Service environment with maker permissions to access the portal and read permissions to
access data within entities.

Finding your Common Data Service Environment URL


1. Open Power Apps and select the environment you're going to connect to and click the settings gear in the
top right corner, and click Advanced customizations
2. Click Resources under the Developer resources section which will open a new tab.

3. Copy the root of the URL in the new tab, this is the unique URL for your environment. The URL will be in
the format of https://yourenvironmentid.crm.dynamics.com/ make sure not to copy the rest of the
URL. Keep this somewhere handy so you can use it when creating your PowerBI report.

Connecting to Common Data Service from Power BI Desktop


1. Launch Power BI Desktop, if it's your first time you may be prompted with a Welcome screen or taken
straight to a blank canvas - either way, click Get Data and select More to open the full list of data sources
available for Power BI Desktop.
2. Click Online Services and Common Data Service (Beta) from the list of connectors. Click Connect.

3. Paste in your Common Data Service Environment URL into the Server URL field and click Ok. If this is
your first time, you'll be prompted to log in using the same credentials you use to connect to Power Apps
and Common Data Service.
4. The Navigator will show you all entities available for your environment grouped into three folders. Expand
the Common Data Model folder.
Common Data Model - these are standard entities which are commonly used and available in all
environments as part of the Common Data Model.
Custom Entities - are entities that you have created or imported in your environment.
System - contains all entities in your environment, including the Common Data Model and Custom
entities.

5. Select the Account entity to see a preview of your data in the right pane, and click Load.
6. Your entity is now loaded into your report, and you can begin building reports, or repeat this process to add
additional entities.

7. Click the Name field in Field panel to add a new visualization to your report canvas. You can now repeat this
process and change visualizations to build your report.
Using Option sets
Options sets are used in entities to provide a drop down list of values to a user in apps and flows. When using the
Power BI connector option set fields will be presented as two columns to show both the unique value, and the
display value.
As an example, if you had an option set on your entity called ApprovalStatus, you would see two fields in Power BI:
ApprovalStatus - This will show a unique integer value for each item in your option set, this is help when
applying filters so they will not be impacted if you make future changes to the display name.
ApprovalStatus_display - This will show the friendly display name of the item and is most commonly used
when presenting the option in a table or chart.

APPROVALSTATUS APPROVALSTATUS_DISPLAY

1 Submitted

2 In Review

3 Approved

4 Rejected

Navigating Relationships
Relationships in Common Data Service require you to create a relationship within PowerBI desktop between the
two entities using a GUID field, this is a system generated unique identifier that ensures relationships are created
for the create records where ambiguity or duplication may exist with other fields. You can read more about
managing relationships in Power BI desktop here.
While some relationships may be automatically created, you can still review and ensure the correct relationships
are established when creating your report :
The lookup field on the entity will contain the GUID of the record in the related entity.
The related entity will have a field in the format "[EntityName]id" which contains the GUID, for example
Accountid or MyCustomEntityid
Using the PowerBI desktop Manage Relationships feature, you would create a new relationship between your
lookup field, and the id field on the related entity.

Next steps
Manage fields in an entity
Define relationships between entities
Translate customized entity and field text into other
languages
12/2/2019 • 2 minutes to read • Edit Online

After you create customized entity and field text, you may want to translate it into other languages.
1. Open solution explorer.
2. In the solution explorer, on the Actions toolbar, selectExport Translations.
3. After completing the export, open or save the compressed (.zip) file that contains the exported labels to your
local computer or network.
4. Extract the XML file from the compressed (.zip) file and translate it.

Community tools
Easy Translator is a tool that XrmToolBox community developed for Power Apps. Use Easy Translator to export and
import translations with contextual information.

NOTE
The community tools are not supported by Microsoft. If you have questions about the tool, please contact the publisher.
More Information: XrmToolBox.

Next steps
Import translated entity and field text
Import translated entity and field text back into an
app
2/12/2020 • 2 minutes to read • Edit Online

If you have customized entity or field text, such as field labels or drop-down list values, you can provide the users
in your organization who are not working with the base language version of your environment with this
customized text in their own languages. To do so, you export the text strings for all your customizations so that
they can be translated into the languages you use in your organization.
After the translation, you need to import the translated text strings into your environment before users can take
advantage of the changes.

IMPORTANT
The file that you import must be a compressed file that contains the CrmTranslations.xml and the [Content_Types].xml file
at the root.
You can’t import translated text that is over 500 characters long. If any of the items in your translation file are longer than
500 characters, the import process will fail. If the import process fails, review the line in the file that caused the failure,
reduce the number of characters, and try to import again. Also note that after you import translated text, you must
republish customizations.

1. Sign in to Power Apps at https://make.powerapps.com.


2. Select Solutions, and select the unmanaged solution from which to import the translated text.
3. In the solution explorer, on the Actions toolbar, selectTranslations, and then select Import translations.
4. In the Import Translated Text dialog box, specify the file that contains the translated text, and then select
Import.
5. When the import is complete, select Close.

NOTE
Publishing customizations can interfere with normal system operation. We recommend you schedule publishing when it’s
least disruptive to users.

Community tools
Easy Translator is a tool that XrmToolBox community developed for Power Apps. Use Easy Translator to export and
import translations with contextual information.

NOTE
The community tools are not supported by Microsoft. If you have questions about the tool, please contact the publisher.
More Information: XrmToolBox.

Next steps
Export customized entity and field text for translation
Export entity data to Azure Data Lake Storage Gen2
3/12/2020 • 7 minutes to read • Edit Online

The Export to Data Lake service is a pipeline to continuously export data from Common Data Service to Azure
Data Lake Storage Gen2. The Export to Data Lake service is designed for enterprise big data analytics by delivering
scalable high availability with disaster recovery capabilities. Data is stored in the Common Data Model format,
which provides semantic consistency across apps and deployments.

Export to Data Lake provides these features:


Linking or unlinking the Common Data Service environment to Data Lake Storage Gen2 in your Azure
subscription.
Continuous replication of entities to Data Lake Storage Gen2.
Initial write, followed by incremental writes for data and metadata.
Replication of both standard and custom entities.
Replication of create, update, and delete (CrUD ) transactions.
Continuous snapshot updates for large analytics scenarios.
Facilitated metadata discovery and interoperability between data producers and consumers such as Power BI,
Azure Data Factory, Azure Databricks, and Azure Machine Learning.

How data and metadata are exported


The Export to Data Lake service supports initial and incremental writes for entity data and metadata. Any data or
metadata changes in Common Data Service are automatically pushed to the data lake without any additional
action. This is a push, rather than pull, operation. Changes are pushed to the destination without your needing to
set up refresh intervals.
Both standard and custom entities can be exported. Notice that the change tracking entity attribute in Common
Data Service is used to keep the data synchronized in an efficient manner by detecting what data has changed since
it was initially extracted or last synchronized.
All create, update, delete operations are exported from Common Data Service to the data lake. For example, when
a user deletes an Account entity record in Common Data Service, the transaction is replicated to the destination
data lake.
Prerequisites
Before you can export Common Data Service data to a data lake, you must create and configure an Azure Storage
v2 (general-purpose v2) storage account.
Follow the steps in theCreate an Azure Storage accountarticle, and note these requirements:
You must be granted an owner role on the storage account.
Set your storage type as Storagev2 (general purpose v2).
The storage account must have the Hierarchical namespace feature enabled.
We recommend that you set replication to read-access geo-redundant storage (RA-GRS ). More information: Read-
access geo-redundant storage

NOTE
The storage account must be created in the same Azure Active Directory (Azure AD) tenant as your Power Apps tenant.
The storage account must be created in the same region as the Power Apps environment you'll use the feature in.
To link the Common Data Service environment to Azure Data Lake Storage Gen2, you must be a Common Data Service
administrator.
Only entities that have change tracking enabled can be exported.

Select and export Common Data Service entity data to Azure Data Lake
Storage Gen2
1. Sign in to Power Apps, expand Data, and then select Entities.
2. On the command bar, select Export to data lake, and then on the Export to data lake page, select New
link to data lake.
3. Select each of the following settings, and then select Next:
Subscription. Select your Azure subscription.
Resource group. Select the resource group that contains the Storage v2 (general-purpose v2) storage
account.
Storage account. Select the Storage v2 (general-purpose v2) storage account to use for the export.

NOTE
As part of linking the Common Data Service environment to a data lake, you grant the Export to Data Lake service
access to your storage account. Ensure that you followed the prerequisites of creating and configuring the Azure data
lake storage account, and granting yourself an owner role on the storage account. Additionally, you grant the Power
Platform Dataflows service access to your storage account. More information: Self-service data prep with dataflows.

4. Select the entities that you want to export to the data lake, and then select Save. Only entities with change
tracking enabled can be exported. More information: Enable change tracking

Your Common Data Service environment is linked to the Azure Data Lake Storage Gen2 account. The file system in
the Azure storage account is created with a folder for each entity selected to be replicated to the data lake.

Manage entity data to the data lake


After you've set up data export to Azure Data Lake Storage Gen2 in your subscription, you can manage the export
of entity data to the data lake in one of two ways:
On the Power Apps maker portal Export to data lake area, select Manage entities on the command bar
to add or remove one or more linked entities.
On the Power Apps maker portal Entities area, select … next to an entity, and then select the linked data
lake where you want to export entity data.

To unlink all linked entities, on the Power Apps maker portal Export to data lake area, select Unlink data lake.
View your data in Azure Data Lake Storage Gen2
1. Sign in to Azure, select the storage account, and then in the leftmost navigation pane, select Storage Explorer.
2. Expand File Systems, and then select commondataservice-environmentName-org-Id.
The model.json file, along with its name and version, provides a list of entities that have been exported to the data
lake. The model.json file also includes the initial sync status and sync completion time.
A folder that includes snapshot comma-delimited (CSV format) files is displayed for each entity exported to the
data lake.

Continuous snapshot updates


Common Data Service data can continuously change through create, update, and delete transactions. Snapshots
provide a read-only copy of data that's updated at regular intervals, in this case every hour. This ensures that at any
given point, a data analytics consumer can reliably consume data in the lake.

When entities are added as part of the initial export, the entity data is written to the entity.csv files under the
corresponding folders in the data lake. This is the T1 interval, where a snapshot read-only file named entity-T1.csv
—for example, Account-T1.csv or Contacts-T1.csv—is created. Additionally, the model.json file is updated to point
to these snapshot files. Opening model.json, you can view the snapshot details.
Here's an example of an Account.csv partitioned file and snapshot folder in the data lake.
Changes in Common Data Service are continuously pushed to the corresponding CSV files by using the trickle
feed engine. This is the T2 interval, where another snapshot is taken. Entity-T2.csv—for example, Accounts-T2.csv
or Contacts-T2.csv (assuming there are changes for the entity) —and model.json are updated to the new snapshot
files. Any new person who views snapshot data from T2 onward is directed to the newer snapshot files. This way,
the original snapshot viewer can continue to work on the older snapshot T1 files while newer viewers can read the
latest updates. This is useful in scenarios that have longer-running downstream processes.
Here's an example of the model.json file, which always points to the latest time-stamped account snapshot file.

Transporting an Export to Data Lake configuration across environments


In Power Apps, solutions are used to transport apps and components from one environment to another, or to apply
a set of customizations to existing apps. To make the Export to Data Lake configurations solution-aware, import the
Export to Data Lake Core solution into the environment. This enables basic application lifecycle management
(ALM ) abilities such as distribution, and backup and restore of the Export to Data Lake configuration.
Import the Export to Data Lake Core solution
1. From the Power Apps maker portal, select the environment where you want to distribute the Export to Data
Lake configuration.
2. On the leftmost navigation pane, select Solutions, select Open AppSource, search for the solution named
Export to Data Lake Core, and then import the solution.
Add an Export to Data Lake configuration to a solution

IMPORTANT
Before you can add an Export to Data Lake configuration, you must install the Export to Data Lake Core solution described
earlier.

1. From the Power Apps maker portal, select the environment where you want to distribute the Export to Data
Lake configuration, and then on the leftmost navigation pane, select Solutions.
2. Select New solution, provide a name, select a publisher, and then specify a version number.
3. Open the solution you created in the previous step, select Add existing > Other > Export to data lake
config.
4. Select the linked data lake configurations that you want, and then select Add.
5. In the Solutions area, select the solution, and then on the command bar, select Export.
6. In the Before you export pane, select Publish to publish all changes before you export, and then select Next.
Import the solution that contains the Export to Data Lake configuration
In the environment where you want to import your solution, in the Power Apps maker portal Solutions area,
import the solution.
Verify the Export to Data Lake configuration
From the Power Apps maker portal in the environment where you imported the Export to Data Lake configuration,
verify that you can see your linked data lake in addition to the entities that you transported from your other
environment.

See also
Blog: Exporting CDS data to Azure Data Lake
Common Data Service API limits overview
3/6/2020 • 3 minutes to read • Edit Online

Common Data Service API limits help ensure service levels, availability and quality. Common Data Service API
limits are part of the Power Platform Request limits and allocations. This topic will introduce limits specifically for
Common Data Service applicable for model-driven apps in Dynamics 365 (such as Dynamics 365 Sales and
Dynamics 365 Customer Service), Power Apps, and Power Automate connecting to Common Data Service/model-
driven apps in Dynamics 365.
For information about limits for all areas within Power Platform, see Power Platform Request limits and allocations.
There are two categories of limits that apply for Common Data Service: Entitlement and Service protection limits.

Entitlement limits
These limits represent the number of requests users are entitled to make each day. The allocated limit depends on
the type of license assigned to each user.
If any user exceeds their request entitlement the administrator would be notified and would be able to assign
Power Apps and Power Automate request capacity to that user. Users will not be blocked from using apps for
occasional and reasonable overages at this point of time.
For Common Data Service, API requests include all data operations that interact with entity records where records
are created, retrieved, updated, or deleted (CRUD ). Special operations such as share and assign are included
because they are considered updates. These requests can be from any client or application and using any endpoint.
These include, but are not limited to, operations performed by plug-ins, async workflows, custom controls, and
$batch (ExecuteMultiple) operations. There are a small set of system internal operations that are excluded, like
login, logout, and system metadata operations.

IMPORTANT
Power Platform API request allocations include use of Power Automate, AI Builder, and Connector APIs. All requests through
a connector that result in a Common Data Service request will represent 1 Power Platform request.

For details on these entitlement limits, see Microsoft Power Platform requests allocations based on licenses.
For information about viewing and allocating capacity add-ons, see Capacity add-ons.
For information about purchasing individual capacity add-ons see the Power Apps and Power Automate Licensing
Guide.

Service protection limits


To ensure consistent availability and performance for everyone we apply some limits to how APIs are used with
Common Data Service. Service protection API limits help ensure that users running applications cannot interfere
with each other based on resource constraints. The limits will not affect normal users of the platform. Only
applications that perform a large number of API requests may be affected. The limits provide a level of protection
from random and unexpected surges in request volumes that threaten the availability and performance
characteristics of the Common Data Service platform.
We limit the number of concurrent connections per user account, the number of API requests per connection, and
the amount of execution time that can be used for each connection. These are evaluated within a five minute sliding
window. When one of these limits is exceeded, an exception will be thrown by the platform.

NOTE
Service protection limits apply to all external web service requests, not only the CRUD operations on entities counted against
entitlement limits.
Service protection API limits are not applied against API calls made within workflows, custom workflow activities, or plug-in
code. These operations are invoked internally.

Because service protection limits are usually only encountered by applications that perform a high volume of data
operations, we recommend that developers building those applications apply patterns to re-try operations after a
period of time when these exceptions are returned. This will allow the application to respond to exceptions the
service sends and reduce the total number of requests and achieve the highest possible throughput.
For information about the specific errors that can be returned and how developers can apply patterns to respond to
these errors, see Service Protection API Limits.
See also
Administer Power Platform / Licensing and license management / Requests limits and allocations
Developer / Work with data using code / Service Protection API Limits
Common Data Service Developer Guide
3/20/2020 • 2 minutes to read • Edit Online

Power Apps offers users, businesses, independent software vendors (ISVs), and systems integrators (SIs) a
powerful platform for building line-of-business apps. Common Data Service is the underlying data platform for
Power Apps that contains the core functionality such as server-side logic (plug-ins and workflows), business
process flows, a highly sophisticated security model, and an extensible platform for developers to build apps.
There are many aspects to how developers can contribute to creating apps that use Common Data Service. While
it is possible to build an application with code using Common Data Service as your data source, most projects will
use either model-driven apps or canvas apps to generate the experience that people will use.

Working with model-driven apps


Model-driven apps are built on Common Data Service, and can only connect to a Common Data Service
environment. All the data that defines a model-driven app is stored within Common Data Service.
Model-driven apps share the method of distributing customizations and extensions used by Common Data Service
using Solutions.
Model driven apps also have a number of points for developers to write code to extend. For information on what
developers can do with model-driven apps, see Model-driven apps Developer Guide.
Some examples of model-driven apps available from Microsoft are Dynamics 365 Customer Service, Dynamics
365 Field Service, and Dynamics 365 Marketing.

Understand when to write code


Because Common Data Service includes many capabilities for people to configure custom business logic without
writing code, the most common scenarios for developers to contribute involve filling spaces in-between where
existing features may not provide functionality you need to meet a requirement. Fortunately, Common Data
Service provides many points for developers to extend the common functionality using code.
For a developer who will contribute to projects it is important that they understand what can be done without
writing code. You should familiarize yourself with these capabilities. More information: What is Common Data
Service?

Content for on-premises deployments


Common Data Service is not available for on-premise deployments at this time. Content in this guide does not
include information about options that are only available for on-premises or internet facing deployments (IFD ). For
information related to these options, see the Developer Guide for Dynamics 365 Customer Engagement (on-
premises).
Get started
See also
Power Apps for developers
Model-driven apps Developer Guide
Use AI Builder in Power Apps
12/2/2019 • 2 minutes to read • Edit Online

AI Builder is a new Power Platform capability for teams with the business expertise to easily automate processes
and predict outcomes to improve business performance. AI Builder is a turnkey solution that brings the power of
Microsoft AI through a point-and-click experience and is directly integrated into Power Apps and Power Automate.
More information: What is AI Builder?
You can build AI models by using the new AI Builder option in the left navigation pane of make.powerapps.com.
More information: AI model types

You can use AI models created using AI Builder in canvas and model-driven apps to add intelligence to your apps.
More information: Use AI Builder in Power Apps
Power Apps webinar listing
12/3/2019 • 3 minutes to read • Edit Online

These webinars can help you to leverage the features and functions of Microsoft Power Apps. Webinars are
available on-demand after the live broadcast. Please note that, in some cases, you'll need to re-enter registration
details, and then you'll be sent a link to the recording via email.

Beginner Webinar Series


Top 5 Tips for Designing Apps that Mean Business
by Audrie Gordon Watch now
Get started with gallery controls
by Audrie Gordon Register and watch now
Get started with formulas in Power Apps
by Audrie Gordon Register and watch now
Get started with forms in Power Apps
by Audrie Gordon Watch now
Getting started with Power Apps Controls
by Audrie Gordon Watch now
Power Apps Community Opportunities & Rewards
by Audrie Gordon & Mackenzie Lyng Watch Now
Overview of Power Apps Feature Releases for 2017
by Darshan Desai Watch now
Exploring Office Graph Templates
by Emma Cooper Watch now
New Office Graph Templates (Part 2)
by Emma Cooper Watch now

Intermediate Webinar Series


Application Lifecycle with the new Save and publish options in Power Apps
by Karthik Bharathy Watch now
Power Apps Focus on Using the Lookup Function
by Audrie Gordon Watch now
Using Power Apps and Flow to create Line of Business “portals”
by Vishwas Lele Watch Now
Laura Rogers from IWMentor Shares Best Practices for Production Apps
by Laura Rodgers Watch Now
Connector Series | Microsoft StaffHub (Shift Planning) Apps with Power Apps
by Marc-André Lépine Watch Now
Power Apps Administration | Frequently Asked Questions
by Manas Maheshwari Watch Now
Inside the Universal Audit App: See what Power Apps and Flow are capable of by Paul Culmsee
by Paul Culmsee Watch Now

Advanced Webinar Series


Power Apps formulas
by Greg Lindhorst Watch now
Building Server Patching Solutions with Power Apps by Brian Blanchard
by Brian Blanchard & Audrie Gordon Watch now
Building Server Patching Solutions with Power Apps by Brian Blanchard (Part 2)
by Brian Blanchard & Audrie Gordon Watch now
Click-Through Power Apps Analytics by Vivek Bavishi
by Vivek Bavishi & Audrie Gordon Watch now
Using Power Apps for Business Process Management (BPM ) by Dawid van Heerden
by Dawid van Heerden Watch now
Connector Series
Optimizing Connectors in Power Apps and Power Automate
by Theresa Palmer-Boroski Watch now
Teams + Power Apps Tips and Tricks
by Audrie Gordon Watch now
Tips for Connecting to Excel on OneDrive for Business from Power Apps
by Audrie Gordon Watch now
Connecting to on-premises data from Power Apps
by Archana Nair and Dimah Zaidalkilani Watch now
Working with Connectors: Using the Planner Connector
by Audrie Gordon Watch Now
The Power of Office Graph with Power Apps
by Audrie Gordon Watch now
Working with Connectors: Project Online (PWA )
by Audrie Gordon Watch now

SharePoint Series
Rapidly build applications with Power Apps Studio
by Karthik Bharathy Watch now
Rebuilding an InfoPath Designer form in Power Apps
by Daniel Christian Watch now
Tips for InfoPath Designers Transitioning to Power Apps - Part 1
by Audrie Gordon Watch now
Tips for Transitioning from InfoPath to Power Apps - Part 2
by Audrie Gordon Watch now
Introducing List Forms in SharePoint Online
by Ankit Saraf Watch now

Model Driven Series


Model Driven App Components | Introduction to Model Driven Apps
by Charles Sterling & Adrian Orth Watch now
Model Driven App Components | Getting Started with Templates
by Charles Sterling & Casey Burke Watch now
Model Driven App Series Part 1 | Managing Entities and Data Imports
by Audrie Gordon & Clay Wesener Watch now
Model Driven App Series Part 2 | Creating Forms and Views
by Audrie Gordon & Anees Ansari Watch now
Model Driven App Series Part 3 | Exploring Charts and Dashboards
by Audrie Gordon & Casey Burke Watch now

App Designer Series


Building Apps for Adoption and Usability
by Veronica Ward Watch now
Building Dialogs or Pop-up Messages in Power Apps
by Veronica Ward Watch now
Look behind the curtain with one of the Power Apps Developers - A closer look at templates: Marie
Hoeger
by Audrie Gordon Watch now
Optimize canvas-app performance in Power Apps
12/3/2019 • 6 minutes to read • Edit Online

Microsoft is working hard to improve the performance of all apps that run on the Power Apps platform. But you
can follow the best practices in this topic to boost the performance of apps that you create.
When a user opens an app, it goes through these phases of execution before showing any user interface:
1. Authenticates the user - Prompts the user, if that person has never opened the app before, to sign in with
credentials for whatever connections the app needs. If the same user opens the app again, that person might be
prompted again, depending on the organization’s security policies.
2. Gets metadata - Retrieves metadata such as the version of the Power Apps platform on which the app runs
and the sources from which it must retrieve data.
3. Initializes the app - Performs any tasks specified in the OnStart property.
4. Renders screens - Renders the first screen with controls that the app has populated with data. If the user opens
other screens, the app renders them by using the same process.

Limit data connections


Don’t connect to more than 30 data sources from the same app. Apps prompt new users to sign in to each
connector, so every additional connector increases the amount of time that the app needs to start. As an app runs,
each connector requires CPU resources, memory, and network bandwidth when the app requests data from that
source.
You can quickly measure your app’s performance by turning on Developer Tools in Microsoft Edge or Google
Chrome while running the app. Your app is more likely to take longer than 15 seconds to return data if it frequently
requests data from more than 30 data sources, such as Common Data Service, Azure SQL, SharePoint, and Excel
on OneDrive.

Limit the number of controls


Don’t add more than 500 controls to the same app. Power Apps generates an HTML DOM to render each
control. The more controls you add, the more generation time Power Apps needs.
You can, in some cases, achieve the same result and have the app start faster if you use a gallery instead of
individual controls. In addition, you might want to reduce the number of control types on the same screen. Some
controls (such as PDF viewer, data table, and combo box) pull in large execution scripts and take longer to render.

Optimize the OnStart function


Use the ClearCollect function to cache data locally if it doesn’t change during the user session. Also, use the
Concurrent function to load data sources simultaneously.
As this reference topic demonstrates, you can use Concurrent to cut the amount of time an app needs to load data
in half.
Without the Concurrent function, this formula loads each of four tables one at a time:
ClearCollect( Product, '[SalesLT].[Product]' );
ClearCollect( Customer, '[SalesLT].[Customer]' );
ClearCollect( SalesOrderDetail, '[SalesLT].[SalesOrderDetail]' );
ClearCollect( SalesOrderHeader, '[SalesLT].[SalesOrderHeader]' )

You can confirm this behavior in the Developer Tools for your browser:

You can enclose the same formula in the Concurrent function to reduce the overall time that the operation needs:

Concurrent(
ClearCollect( Product, '[SalesLT].[Product]' ),
ClearCollect( Customer, '[SalesLT].[Customer]' ),
ClearCollect( SalesOrderDetail, '[SalesLT].[SalesOrderDetail]' ),
ClearCollect( SalesOrderHeader, '[SalesLT].[SalesOrderHeader]' ))

With this change, the app fetches the tables in parallel:

Cache lookup data


Use the Set function to cache data from lookup tables locally to avoid repeatedly retrieving data from the source.
This technique optimizes performance if the data probably won’t change during a session. As in this example, the
data is retrieved from the source once and then referenced locally after that until the user closes the app.

Set(CustomerOrder, Lookup(Order, id = “123-45-6789”));


Set(CustomerName, CustomerOrder.Name);
Set(CustomerAddress, CustomerOrder.Address);
Set(CustomerEmail, CustomerOrder.Email);
Set(CustomerPhone, CustomerOrder.Phone);

Contact information doesn’t change frequently, and neither do default values and user information. So you can
generally use this technique with the Defaults and User functions also.

Avoid controls dependency between screens


To improve performance, the screens of an app are loaded into memory only as they are needed. This optimization
can be hampered if, for example, screen 1 is loaded and one of its formulas uses a property of a control from
screen 2. Now screen 2 must be loaded to fulfill the dependency before screen 1 can be displayed. Imagine screen
2 has a dependency on screen 3, which has another dependency on screen 4, and so on. This dependency chain can
cause many screens to be loaded.
For this reason avoid formula dependencies between screens. In some cases you can use a global variable or
collection to share information between screens.
There is an exception. In the previous example imagine that the only way to display screen 1 is by navigating from
screen 2. Then screen 2 would have already been loaded in memory when screen 1 was to be loaded. No
additional work is needed to fulfill the dependency for screen 2 and therefore there's no performance impact.

Use delegation
Where possible, use functions that delegate data processing to the data source instead of retrieving data to the
local device for processing. If an app must process data locally, the operation requires much more processing
power, memory, and network bandwidth, especially if the data set is large.
As this list shows, different data sources support delegation from different functions:

For example, SharePoint lists support delegation from the Filter function but not the Search function. So you
should use Filter instead of Search to find items in a gallery if the SharePoint list contains more than 500 items.
For more tips, see Working with large SharePoint lists in Power Apps (blog post).

Use Delayed Load


Turn on the experimental feature for Delayed Load if your app has more than 10 screens, no rules, and many
controls that are on multiple screens and that are directly bound to the data source. If you build this type of app
and don’t enable this feature, app performance may suffer because the controls in all screens must be populated
even on screens that aren’t open. Also, all screens of the app must be updated whenever the data source changes,
such as when the user adds a record.

Working with large data sets


Use data sources and formulas that can be delegated to keep your apps performing well while users can access all
the information they need, and avoid hitting the data row limit of 2000 for non-delegable queries. For data-record
columns on which users can search, filter, or sort data, those indexes of columns are designed well as these docs
describe for SQL Server and SharePoint.

Republish apps regularly


Republish your apps (blog post) to get performance improvements and additional features from the Power Apps
platform.

Avoid repeating the same formula in multiple places


If multiple properties run the same formula (especially if it's complex), consider setting it once and then referencing
the output of the first property in subsequent ones. For example, don't set the DisplayMode property of controls
A, B, C, D and E to the same complex formula. Instead, set A's DisplayMode property to the complex formula, set
B's DisplayMode property to the result of A's DisplayMode property, and so on for C, D, and E.

Enable DelayOutput on all Text input controls


If you have multiple formulas or rules that reference the value of a Text input control, set the DelayedOutput
property of that control to true. The Text property of that control will be updated only after keystrokes entered in
quick succession have ceased. The formulas or rules won't run as many times, and app performance will improve.

Avoid using Form.Updates in rules and formulas


If you reference a user-input value in a rule or a formula by using a Form.Updates variable, it iterates over all the
form’s data cards and creates a record each time. To make your app more efficient, reference the value directly from
the data card or the control value.

Next steps
Review the coding standards for maximizing app performance and keeping apps easier to maintain.
Common issues and resolutions for Power Apps
1/21/2020 • 10 minutes to read • Edit Online

This article lists some common issues that you might encounter while using Power Apps. Where applicable,
workarounds are provided.
1. Camera images when imported via Edge are flipped (January 20, 2020)
When using the camera and the Edge browser, the image may be flipped. This is due to an Edge defect. To
mitigate this issue, please use the new Edge Chromium or a different browser.
2. Camera images do not contain meta-data information (January 20, 2020)
When using the camera control, the image does not contain meta-data information. This is due to a
limitation of how we take images with the camera. To mitigate this, use the Add Picture control.
3. Images added from iOS do not contain meta-data information (January 20, 2020)
When using the Add Picture control on iOS, images imported by using the camera or gallery do not contain
meta-data.
4. Sign-in issue on certain Android mobile devices when using authenticator (August 21, 2019)
In certain devices and scenarios, you may experience sign-in failures when using authenticator. This is due to
the OEM limiting this functionality. For more details on the error and possible mitigations, see here.
5. Camera issue on Android mobile devices (Jan. 1, 2019)
If the camera control stops working on an Android device, republish your app, and reopen it on the device.
The camera control was updated in response to a change in the Android operating system, and your app will
benefit from the update when you republish.
6. Scrolling in flexible-height galleries (Nov. 27, 2018)
If you run into a limitation when you scroll with your finger, lift it and start to scroll again.
7. Drawing with mouse or touch input is not smooth in Power Apps for Windows (Sep. 24, 2018)
The pen control only has partial support for drawing using mouse or touch input in the Windows app.
Strokes might be intermittent. For smooth drawing, use a pen or run the app in a browser.
8. Multiple media controls in Power Apps Mobile (Aug. 2, 2018)
Power Apps Mobile runs on various types of devices, and some of them have limitations that are specific to
that platform:
You can play videos in multiple Video controls at the same time on all platforms except for iPhone
devices.
You can record audio with multiple Microphone controls at the same time on all platforms except for
the web player.
9. Republishing apps (Aug. 2, 2018)
If you haven't updated your app in several months, republish it to sync with the most recent version of
Power Apps, which includes performance improvements and other fixes.
10. Browser running out of memory (July 23, 2018)
If you run out of memory while using Power Apps, please consider downloading a 64-bit version of
Chrome, Microsoft Edge, or Internet Explorer.
11. Launching a website from an embedded app (May 10, 2018)
Internet Explorer and Microsoft Edge browsers might block the launch of a URL or website that’s in
protected mode or a lower security zone than the website in which the app is loaded. To resolve this issue,
change the security and privacy settings for your browser.
12. Combo box controls in galleries (May 3, 2018)
When you use a Combo box control inside a gallery, its selections are not maintained when the user scrolls
the gallery. This is not an issue if you use a Combo box control inside a gallery that doesn't scroll. A
workaround is not currently available.
13. Using a custom image as an app icon (April 11, 2018)
In Power Apps Studio for Windows version 3.18043, you cannot upload a custom image to use as an app
icon. To work around this issue, use Power Apps Studio for web to upload a custom image. Alternatively, you
can use one of the icons included with Power Apps Studio for Windows and customize the background
color.
14. Copying and pasting screens across apps (April 4, 2018)
Copying and pasting screens across apps is not currently supported. To work around this, add a new screen
to your target app, copy the controls from the screen in your source app, and then paste them into the
screen of your target app.
15. Changing the layout of SharePoint forms (March 7, 2018)
While customizing a SharePoint list form in certain languages, if you try to change the layout from portrait
(default) to landscape, the app may show multiple errors (yellow triangles in controls). To resolve these
errors and retain the landscape layout, click Undo.
16. Data Table control
If you copy and paste a Data Table control for which the Items property is set to a formula that contains a
Filter function, the formula for the Items property on the new Data Table control ends up with field names
that contain a _1 suffix. This makes the field names invalid and results in no data showing up in the data
table. To work around this issue, before you copy the control, confirm that the Filter function doesn't
reference any field in the data source that has the same name as a column in the Data Table control. If it
does, rename the column in the Data Table control. Alternatively, remove the _1 suffix from the invalid field
names so they match the names in the entity.
17. Camera controls in Power Apps Studio for Windows
Power Apps Studio for Windows may crash if you add a camera control or open an app that uses a camera
control. To avoid this problem, use Power Apps Studio for web when adding or using a camera control.
18. Release 2.0.700 on Android devices
If you install release 2.0.700 on an Android device and then can't open apps (or an app stops responding),
uninstall Power Apps, restart the device, and then reinstall Power Apps.
19. "Empty" gallery when opening an app
If you generate an app automatically from data, save the app, and then reopen it, the browse gallery might
not immediately show any data. To resolve this issue, type at least one character in the search box, and then
delete the text that you typed. The gallery will then show data as expected.
20. Upgrading Power Apps on Windows 8.1
If you install Power Apps on a computer that’s running Windows 8 or Windows 8.1, keep the Windows
Store app open and active, use the Settings charm to check for updates, and then install them.
21. Custom connectors and the Common Data Service
If an app created using Power Apps build 2.0.540 or earlier relies on a database in the Common Data
Service and at least one custom connector in a different environment, you’ll need to deploy the connector to
the same environment as the database and update the app to use the new connector. Otherwise, a dialog
box will notify users that the API was not found. For more information, see the overview of environments.
22. Running an app on Windows 8.1
If you install this update for Windows 8.1, you can't run apps that you open in Power Apps Studio on that
operating system. However, you can still run apps that you open in powerapps.com or using Power Apps
Mobile.
23. Column names with spaces
If you're using a SharePoint list or an Excel table in which a column name contains a space, Power Apps will
replace it with "_x0020_". For example, "Column Name" in SharePoint or Excel will appear as
"Column_x0020_Name" in Power Apps when displayed in the data layout or used in a formula.
24. Changing a flow in a shared app
If you add a flow to an app, share it, and then add a service or change a connection in the flow, you must
remove the flow from the shared app, re-add the flow, and reshare the app. Otherwise, users who trigger the
flow will get an authentication failure.
25. Using a localized version.
If you're running release 2.0.531 on Windows 8.1, you can't type in a Text input control if the device is set to
a language that requires an IME window.
26. Camera control on a Windows Phone
An app that contains a camera control might crash if you open the app on a Windows Phone that's running
build 10.0.10586.107. To avoid this problem, upgrade to the most recent build (for example, by running the
Upgrade Advisor).
27. Opening an app from a template.
If you're running release 2.0.500 or older, an error message appears when you try to create an app from a
template. You must upgrade to be able to use this feature.
If you're running release 2.0.510 or later, an warning might appear when you try to create an app from a
template. However, you can close the message and create the app.
28. Scanning a barcode
For information about limitations and best practices when you use a Barcode control, see Scan a barcode.
29. Creating and modifying apps in a browser
You can do many, but not all, of the same things in Power Apps Studio for web as you can in Power Apps
Studio for Windows. For more information, see Create an app in a browser.
30. Changing a Title field in an entity
If you change the Title field for an entity that other entities reference through one or more lookups, an error
will occur when you try to save the change. To work around this issue, remove any lookups to the entity for
which you want to change the Title field, make the change, and then recreate the lookups. For more
information about lookups, see Build a relationship between entities.
31. Apps that connect to on-premises SharePoint
If you share an app that relies on connections that aren’t automatically shared (for example, an on-premises
SharePoint site), users who open the app in a browser will see a dialog box with no text when they click or
tap Sign in. To close the dialog box, click or tap the close (X) icon in the upper-right corner. The dialog box
doesn’t appear if you open the app in Power Apps Studio or Power Apps Mobile. For more information
about shared connections, see Share app resources.
32. When Power Apps generates an app from data, the field used for sorting and searching isn't
automatically configured.
To configure this field, edit the Items formula for the gallery, as the sections for filtering and sorting in Add
a gallery describe.
33. For apps that are created from data, only the first 500 records of a data source can be accessed.
In general, Power Apps works with any size data source by delegating operations to the data source. For
operations that can't be delegated, Power Apps will give a warning at authoring time and operate on only
the first 500 records of the data source. See the Filter function article for more details about delegation.
34. Excel data must be formatted as a table.
For information about limitations when you use Excel as a data source, see Cloud-storage connections.
35. SharePoint custom lists are supported but not libraries, some types of list columns, or columns
that support multiple values or selections.
For more information, see SharePoint Online.
36. Co-authoring isn't supported. One author at a time, please.
You can corrupt an app or over-write others’ changes if more than one person modifies the same app at the
same time. Close the app before someone else edits it.
37. It can sometimes take a moment before a newly shared app can be used.
In some cases, a newly shared app won't be immediately available. Wait a few moments, and it should
become available.
38. In the Form control, you can't change data by using a custom card.
The stock custom card is missing the Update property, which is required to write back changes. To work
around this:
Select the form control, and insert a card by using the right-hand pane based on the field that you want
the card to show.
Unlock the card, as described in Understanding data cards.
Remove or rearrange controls within the card as you see fit, just as you would with the custom card.
39. An app that's running on Android 5.0, Nexus 6 with Webview versions v48 or v49 may crash.
Users can fix this problem by updating to a lower version of Webview (3x) or update to Android 6.0.
40. Camera usage may be temporarily disabled if memory is low.
If your mobile device is low on memory, the camera is temporarily disabled to avoid crashing the device.
41. Office 365 Video connector isn't supported.
42. Card gallery is deprecated.
Existing apps that use this feature will continue to run for the time being, but you can't add a card gallery.
Please replace card galleries with the new Edit form and Display form controls.
Get a session ID or a canvas-app ID
12/3/2019 • 2 minutes to read • Edit Online

If you encounter a problem with a canvas app that was created in Power Apps, you can help Microsoft troubleshoot
the problem much more effectively if you provide them with a session ID, an app ID, or both for that problem.

Get the session ID


When editing an app
1. In the upper-left corner, select File.
2. Select Account.
3. Under Diagnostics, select Session details.

When running an app in a browser


1. In the upper-right corner, select the gear icon.
2. Select Session details.

When running an app on a phone or a tablet


1. Swipe right.
2. Tap Session details.
When running an embedded app or form
1. Perform one of these steps:
While holding down the Alt key, right-click the app or form.
Tap the app or form with two fingers for 1-2 seconds, and then release.
2. Select Session details.

Get an app ID
1. Sign in to Power Apps.
2. Near the left edge, select Apps.
3. Select the ellipsis ( . . . ) for the app you're troubleshooting, and then select Details.
The app ID appears at the bottom of the Details pane for that app.
Troubleshooting startup issues for Power Apps
12/3/2019 • 4 minutes to read • Edit Online

This troubleshooting topic helps fix the following two common configuration problems that prevent Power Apps
from starting:
When you receive a “Hmmm … We couldn’t sign you in” error message and identifier that resembles the
following image:

When you try to create an app from a SharePoint list, you receive the following "abnormal termination"
error message

WebAuthoring abnormal termination.

Client date/time: <Client Time>Thh:mm:ss.sssZ


Version: 2.0.602
Session ID: xxxx-xxxxx-xxxxxxx--xxxxxxxx
description: {"error":{"detail":{"exception":
{}},"colno":0,"filename":"https://paaeuscdn.azureedge.net/v2.0.602.0/studio/openSource/modified/winjs/js
/base.js?v=39de0f2edf1...",
"lineno":0,"message":"Script error","initErrorEvent":"
[function]","bubbles":false,"cancelBubble":false,"cancelable":false,"currentTarget":"
[window]","defaultPrevented":true,
"eventPhase":2,"isTrusted":true,"srcElement":"[window]","target":"
[window]","timeStamp":1490711965955,"type":"error","initEvent":"[function]","preventDefault":"
[function]",
"stopImmediatePropagation":"[function]","stopPropagation":"
[function]","AT_TARGET":2,"BUBBLING_PHASE":3,"CAPTURING_PHASE":1},"errorLine":0,"errorCharacter":0,
"errorUrl":"https://paaeuscdn.azureedge.net/v2.0.602.0/studio/openSource/modified/winjs/js/base.js?
v=39de0f2edf1... error","setPromise":"[function]","exception":{}}
stack: null
errorNumber: 0
errorMessage: Script error

If you experience one of the issues that's described in this section, check out the common errors matrix later, and
then try one of the resolutions listed later to resolve the problem.

Common error matrix


MICROSOFT INTERNET
ERROR IDENTIFIER EXPLORER 11 MICROSOFT EDGE GOOGLE CHROME

UserInterventionNeeded_Co Enable storage of local data Enable storage of local data Enable storage of local data
okiesBlocked
UserInterventionNeeded_Sto
rageBlocked

UserInterventionNeeded_Na Possible network problem Configure Trust Zones Possible network problem
vigateToAadTimeout

UserInterventionNeeded_Na Configure Trust Zones Configure Trust Zones Not applicable


vigateToAadDenied
UserInterventionNeeded_Sto
rageLost

AadError Azure Active Directory Errors Azure Active Directory Errors Azure Active Directory Errors

Resolution 1: Enable storage of local data in your browser


Power Apps stores some data locally in your browser, including user identity and preferences. Power Apps can’t
function if the browser is configured to disallow this.
Instructions for Internet Explorer 11
Option 1: Enable local data for all sites
1. Close all Internet Explorer and Edge windows.
2. Select OK to close the Internet Options dialog box.
3. Select OK.
4. Remove any entries for powerapps.com.
5. In the Settings section, select Sites.
6. Select OK.
7. Select Accept for third-party cookies.
8. Select Accept for first-party cookies.
9. In the Settings section, select Advanced.
10. Select the Privacy tab.
11. Select Internet Options.
12. On the browser toolbar, select the gear icon.
13. Open Internet Explorer.
Option 2: Create exceptions to enable local data for Power Apps and associated services
1. Open Internet Explorer.
2. On the browser toolbar, select the gear icon.
3. Select Internet Options.
4. Select the Privacy tab.
5. In the Settings section, select Sites.
6. Add an entry to “Allow” powerapps.com.
7. Select OK.
8. Select OK to close the Internet Options dialog box.
9. Close all Internet Explorer and Edge windows.
Instructions for Edge
1. Open Edge.
2. On the Edge toolbar, select More > Settings.
3. Near the bottom of the panel, select View advanced settings.
4. Near the bottom of the panel, find the Cookies drop-down options list.
5. Select Don’t block cookies.
6. Close all Internet Explorer and Edge windows.
Instructions for Chrome
Option 1: Enable local data for all sites
1. On your browser toolbar, select More.
2. Select Settings.
3. Near the bottom of the page, select Show advanced settings.
4. In the "Privacy" section, select Content settings.
5. Select Allow local data to be set (recommended).
6. Make sure that Block third-party cookies and site data is not selected.
7. Select Manage exceptions and make sure that there are no exceptions for
https://create.powerapps.com, https://*.create.powerapps.com, https://make.*.powerapps.com,
https://make.powerapps.com, and https://login.microsoftonline.com. If there are such exceptions,
remove them by clicking on the x sign for the corresponding rows.
8. Select Done.
Option 2: Create exceptions to allow local data for Power Apps and associated services
1. On the browser toolbar, select More.
2. Select Settings.
3. Near the bottom of the page, select Show advanced settings.
4. In the Privacy section, select Content settings.
5. Select Manage exceptions and create exceptions to “Allow” data storage for
https://create.powerapps.com, https://*.create.powerapps.com, https://make.*.powerapps.com,
https://make.powerapps.com, and https://login.microsoftonline.com.
6. Select Done.

Resolution 2: Configure Trust Zones for Internet Explorer and Edge


Internet Explorer and Edge use Trust Zones. Problems can occur if services on which Power Apps relies are in
different Trust Zones in your browser settings. While these settings apply to both Internet Explorer and Edge, the
easiest way to access them is from Internet Explorer. (You might need assistance from your IT administrator to
change some of these settings.)
Option 1: Add the required Power Apps domains to the Trusted Sites zone
1. On the browser toolbar, select the gear icon.
2. Select Internet Options.
3. Select the Security tab.
4. Select Trusted sites.
5. Select Sites.
6. Add the following sites by typing the address and selecting Add for each:
https://login.microsoftonline.com
https://create.powerapps.com
https://*.create.powerapps.com (the asterisk is part of the address, don't replace it)
https://make.powerapps.com
https://make.*.powerapps.com (the asterisk is part of the address, don't replace it)
https://*.powerapps.com (the asterisk is part of the address, don't replace it)
7. Select Close.
8. Select OK.
9. Close all Internet Explorer and Edge windows.
Option 2: Remove all the Power Apps domains from the Trusted Sites zone
1. On the browser toolbar, select the gear icon.
2. Select Internet Options.
3. Select the Security tab.
4. Select Trusted sites.
5. Select Sites.
6. Remove all existing entries for the following sites:
https://login.microsoftonline.com
https://create.powerapps.com
https://*.create.powerapps.com
https://make.powerapps.com
https://make.*.powerapps.com
Any other address that ends in powerapps.com or create.powerapps.com.
7. Select Close.

Resolution 3: Azure Active Directory Errors


Azure Active Directory (Azure AD ) is the technology on which the Power Apps ecosystem relies for user
authentication and authorization.
The error page that you see might contain additional information that can help diagnose and fix the problem.
To resolve Azure AD errors, you might need assistance from your IT department.
Troubleshoot Power Query
12/2/2019 • 3 minutes to read • Edit Online

When you use Power Query for Excel to create a custom entity that contains data from external sources, this error
might appear:

"Your Azure Active Directory administrator has set a policy that prevents you from using this feature. Please
contact your administrator, who can grant permissions for this feature on your behalf."

The error appears if Power Query can't access the organization's data in Power Apps or Common Data Service.
This situation arises under two sets of circumstances:
An Azure Active Directory (Azure AD ) tenant administrator has disallowed users' ability to consent to apps that
access company data on their behalf.
Using an unmanaged Active Directory tenant. An unmanaged tenant is a directory without a global
administrator that was created to complete a self-service signup offer. To fix this scenario, users must first
convert to a managed tenant and then follow one of the two solutions to this issue. The solutions are described
in the next section.
To resolve this issue, the Azure Active Directory administrator must follow either of the procedures that are
presented later in this article.

Allow users to consent to apps that access company data


This approach is perhaps easier than the next, but it allows for broader permissions.
1. In the Azure portal, open the Azure Active Directory pane, and then select User settings.
2. Next to Users can consent to apps accessing company data on their behalf, select Yes, and then select
Save.

Allow Power Query to access company data


As an alternative, the tenant administrator can give consent to Power Query without modifying tenant-wide
permissions.
1. Install Azure PowerShell.
2. Run the following PowerShell commands:
Login-AzureRmAccount (and sign in as the tenant admin)
New -AzureRmADServicePrincipal -ApplicationId f3b07414-6bf4-46e6-b63f-56941f3f4128
The advantage of this approach (versus the tenant-wide solution) is that this solution is very targeted. It provisions
only the Power Query service principal, but no other permission changes are made to the tenant.

Update personal data


Users can update mashups and other information (such as query names and mashup metadata) through the
Query Editor and through the Options dialog box that's accessible from the Query Editor.
In Power Apps, you access the Query Editor by doing the following:
1. Go to the Data pane, expand it, and then select Entities.
2. Select the ellipsis (...), and then select Edit Queries.
3. In the ribbon, select the Options button, and then select the Export Diagnostics button.

Delete personal data


Most data is deleted automatically within 30 days. For data and metadata around mashups, users must remove all
their mashups through Power Apps. All of the associated data and metadata will be deleted within 30 days.
To remove mashups from Power Apps:
1. Remove the Data Integrator projects, which can be removed from the namesake tab.
2. Select the ellipsis (...), and then select the Delete option.
If you created a mashup through the "New entities from data (Technical Preview )" feature, you can remove it by
doing the following:
1. Select the ellipsis (...), and then select Edit queries.
2. In the ribbon, select the Options button.
3. Select the Remove all queries button.
After you confirm that you want to delete your queries, they are deleted.

Export personal data


To export personal data, users can do the following:
1. Open the Query Editor.
2. In the ribbon, select the Options button.
3. Select the Export Diagnostics button.
In Power Apps, you can access the Query Editor by doing the following:
1. Go to the Data pane, expand it, and then select Entities.
2. Select the ellipsis (...), and then select Edit Queries.
3. In the ribbon, select the Options button, and then select the Export Diagnostics button.
System-generated logs about user actions on the user interface (UI) can be accessed in the Azure portal.

You might also like