Professional Documents
Culture Documents
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.
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.
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.
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
.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:
or
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.
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.
Key features
Create and run apps Yes. You can create unlimited apps
Share apps* No
Connectivity
Use premium connectors like Salesforce, DB2 and many more Yes
Create custom connectors to connect to your own systems Yes. You can create unlimited custom connectors
Management
*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.
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.
CAPACITY
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
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.
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
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
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
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
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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:
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.
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.
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.
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.
Time Zone Select the time zone that you want to display for your region.
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.
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.
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.
offline filters Choose a subset of Dynamics 365 data that you want to work
with when you go offline with Dynamics 365 for Outlook.
Default view
Current Formats
Format preview Shows the current region and its formats for Number,
Currency, Time, and Date.
On the command bar, select New and enter values for the
template.
On the command bar, select New and enter values for the
signature.
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
Options:
Configure Folder Tracking Rules Set up folders to automatically track incoming email.
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.
OPTIONS DESCRIPTION
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
NOTE
You must have the latest Windows 10 Update installed to have all of the accessibility features available for charts.
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
Save Ctrl+S
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
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
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
Navigate to and open the lookup record Enter when the focus is on (→) icon
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
Move to the next item within a dashboard element Down (↓) arrow key
Move to the previous item within a dashboard element Up (↑) arrow key
Move to the previous tree view node Down (↓) arrow key
Perform the default action for the tree view node Enter
Activate the Sort by field button and open flyout Enter Or Spacebar Or Down (↓) arrow key
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 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
Open the date picker flyout Enter Or Spacebar Or Down (↓) arrow key
Move from the list of available views to search results Left (←) arrow key
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.
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
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.
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
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.
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.
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.
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
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.
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
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.
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.
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.
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*.
IMPORTANT
The Change View option will not be visible if your administrator hasn't configured the option to appear in your views.
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.
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.
2. From the list of records, select the records that you want to reassign and then select the assign option.
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.
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.
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.
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.
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 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.
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.
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.
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
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.
Shared with me Documents that others shared with you that are associated
with this record
5. After you select a location, you'll see the documents saved in that location.
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
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
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.
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.
3. Select Document Location, and change the location to Documents on Default Site 1.
4. Select New, and then choose Folder.
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.
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.
NOTE
Multi-entity Quick Find is also called Categorized Search.
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
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.
Start a search
1. From the top nav bar, select Search.
2. Enter your search words in the search box, and then select Search.
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.
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
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.
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.
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.
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 Country/Region
Email Address
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.
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.
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.
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.
Text, Ticker Symbol, Phone, Options set, and Look Up Shows as Text and option set becomes drop-down list
Currency Shows as Number and does not include dollar sign ($)
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
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.
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.
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.
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.
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
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.
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.
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.
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.
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
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
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.
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
Connections Canvas
Gateways 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 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.
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).
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.
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
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.
Microsoft Internet Explorer 11 (with Compatibility View off) Windows 7 SP1, 8.1, and 10
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
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
Required services
This list identifies all services to which Power Apps Studio talks and their usages. Your network must not block
these services.
management.azure.com https RP
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.
NOTE
Shortcuts might vary based on keyboard layout.
File
SHORTCUT ACTION
Ctrl+S Save the app with the same name or for the first time.
Ribbon
SHORTCUT ACTION
Tab Move between commands on the selected tab and then to the
next tab.
Editing
SHORTCUT ACTION
Ctrl+X Cut.
SHORTCUT ACTION
Ctrl+C Copy.
Ctrl+V Paste.
Preview
SHORTCUT ACTION
Canvas
SHORTCUT ACTION
Tree view
NOTE
These shortcuts require the Tree view pane to have focus.
SHORTCUT ACTION
F2 Rename a control.
Resize
SHORTCUT ACTION
Text format
SHORTCUT ACTION
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.
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.
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).
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.
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.
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.
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.
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.
TIP
When you're done, it will look like this:
16. Select Import, and then wait until the process is complete.
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.
TIP
You don’t need to type it manually; you can select it in the drop-down lists.
TIP
You don’t need to type it manually; you can select it in the drop-down lists.
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.
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.
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.
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.
TIP
When you are done, it will look like this.
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.
TIP
You don’t need to type it manually, you can choose it in the dropdown lists.
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.
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
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
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.
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_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.
NOTE
If you don't want to use the admin app, you can edit these same properties by editing the SharePoint lists manually.
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.
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.
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.
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
),
"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')),
5. Select PresenceStatus.
6. Select Apply.
7. Select the PresenceStatus column.
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.
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.
7. Add the lists from your own SharePoint site. Start by searching for SharePoint in the search bar.
10. Select all SharePoint lists and libraries, and then select Connect.
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.
LOGICAL NAME IN
FIELD NAME SHAREPOINT PURPOSE EXAMPLE
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.
NOTE
Teams notification and push notification are currently not supported in GCC.
Set up links
1. Go to Links.
2. Select Create new link.
3. Complete the form.
List schema:
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).
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.
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.
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.
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.
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.
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.
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.
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.
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. 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.
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
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.
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.
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.
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.
c. Update one or more fields, and then select the checkmark icon to save your changes.
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
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.
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.
3. If the Welcome to Power Apps Studio dialog box appears, select Skip.
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.
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))
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).
2. Ensure that the property list shows Text and then, in the formula bar, replace Accounts with Browse
(retaining the double quotation marks).
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.
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.
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.
2. On the Advanced tab of the right-hand pane, select the lock icon to unlock the card.
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.
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.
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))
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.
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.
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)
4. On the FormScreen, set the OnSelect property of the cancel icon to this formula:
ResetForm(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)
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
Excel Microsoft
Translator
Oracle Power BI
** 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.
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.
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.
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:
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:
'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:
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.
Po l ym o r ph i c w i t h Fi l t er an d Pat c h
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:
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.
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:
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:
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.
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.
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.
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.
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.
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.
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.
3. In the right-hand pane, click the eye icon for each field to hide it.
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
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
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()
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
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
Output properties
None.
Detect
Detect language: Detects source language of given text
Input properties
Output properties
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
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
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})
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:
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.
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})
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.
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.
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
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.
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.
Manager Retrieves user profile for the manager of the specified user.
MyProfile
Get my profile: Retrieves the profile for the current user.
Input properties
None.
Output properties
UserProfile
Get user profile: Retrieves a specific user profile.
Input properties
Output properties
Manager
Get manager: Retrieves user profile for the manager of the specified user.
Input properties
Output properties
DirectReports
Get direct reports: Get direct reports.
Input properties
Output properties
SearchUser
Search for users: Retrieves search results of user profiles.
Input properties
Output properties
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.
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.
9. In the list of tables, click or tap the table that you want to use.
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.
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
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.
GetAlerts List the alerts that you have set up in the Power BI service
GetAlerts
List the alerts that you have set up in the Power BI service.
Input properties
None.
Output properties
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
Output properties
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.
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.
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.
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.
5. Add an Image control, and set its Image property to this expression:
ImageList.Selected.'Link to item'
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.
Task Outcome No
External data No
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.
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.
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.
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.
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.
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.
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
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.
User Retrieves details about the specified user (example: user name,
description, followers count, etc.)
Tweet Tweet
UserTimeline
Get user timeline: Retrieves a collection of the most recent tweets posted by the specified user
Input properties
Output properties
TweetId string No
CreatedAt string No
MediaUrls array No
HomeTimeline
Get home timeline: Retrieves the most recent tweets and re-tweets posted me and my followers
Input properties
Output properties
TweetId string No
CreatedAt string No
MediaUrls array No
SearchTweet
Search tweet: Retrieves a collection of relevant tweets matching a specified query
Input properties
Output properties
TweetId string No
CreatedAt string No
MediaUrls array No
Followers
Get followers: Retrieves users following the specified user
Input properties
Output properties
Id integer No
FollowersCount integer No
StatusesCount integer No
FriendsCount integer No
MyFollowers
Get my followers: Retrieves users who are following me
Input properties
Output properties
Id integer No
FollowersCount integer No
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
Output properties
Id integer No
FollowersCount integer No
StatusesCount integer No
FriendsCount integer No
MyFollowing
Get my following: Retrieves users that I am following
Input properties
Output properties
Id integer No
FollowersCount integer No
StatusesCount integer No
FriendsCount integer No
User
Get user: Retrieves details about the specified user (example: user name, description, followers count, etc.)
Input properties
Output properties
Id integer No
FollowersCount integer No
StatusesCount integer No
FriendsCount integer No
Tweet
Post a new tweet: Tweet
Input properties
OnNewTweet
When a new tweet appears: Triggers a workflow when a new tweet is posted which matches your search query
Input properties
Output properties
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 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:
Ungroup(
ForAll( X,
ForAll( Y,
Y[@Value] & Text( X[@Value] ) & [@Value]
)
),
"Value"
)
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:
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 }
)
Table(
{ Name: "Chocolate",
'Quantity History': Table( { Quarter: "Q1", OnHand: 10, OnOrder: 10 },
{ Quarter: "Q2", OnHand: 18, OnOrder: 0 } )
}
)
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.
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:
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:
IfError(
"Team: " & AsType( ThisItem.Owner, [@Teams] ).'Team Name',
"User: " & AsType( ThisItem.Owner, [@Users] ).'Full Name' )
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:
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.
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:
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:
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:
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.
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:
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:
Filter radio's Items property [ "All", "Users", "Teams" ] [ "All", "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:
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.
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:
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.
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:
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:
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.
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.
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.
NOTE
As this topic describes later, you can also change this text by modifying its Text property 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.
2. In the right-hand pane, select the name of the screen (just above the Properties tab), and then type
Source.
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.
2. On the Home tab, click or tap Layouts, and then click or tap the option to add an infinite scrolling canvas:
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:
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).
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.
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.
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.
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.
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)))
ClearCollect( MyPeople,
ForAll( AttendeeEmails,
If( InOrg,
Office365Users.UserProfile( Result )
)
)
);
Collect( MyPeople,
ForAll( AttendeeEmails,
If( !InOrg,
{
DisplayName: Result,
Id: "",
JobTitle: "",
UserPrincipalName: Result
}
)
)
);
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: ""
}
)
)
)
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 ) )
);
Calendar icon
Property: OnSelect
Value: Four Set functions that reset the calendar gallery to today's date:
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:
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:
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:
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:
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:
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.
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.
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
)
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:
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.
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.
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:
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.
Property: Items
Value: The top 15 search results of the search text typed into the TextSearchBox control:
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 )
)
)
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)
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:
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.
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:
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.
Property: Items
Value:
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.
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)
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:
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.
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.
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.
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.
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"
)
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:
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.
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:
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.
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.
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:
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 )
)
)
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 )
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.
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.
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.
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.
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.
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.
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.
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.
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.
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:
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.
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.
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
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
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.
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.
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)
)
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.
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 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:
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:
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:
In summary, what are the differences when Snap to columns is on versus off?
Resize snap can be overriden No Yes, with Alt or Ctrl+Shift keys after
starting the resize
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:
InputText Input text control Displays the initial value of the field and
allows the user to change that value.
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.
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:
DataCard.DataField "ApproverEmail" The name of the field that the user can
display and edit in this card.
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.
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:
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.
3. Rename the Radio control to Choices, and set its Items property to this formula:
["red","green","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.
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
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.
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.
3. Repeat the previous two steps in the Department card to rename the Drop down control to
ddDepartment.
2. (optional) While holding down the Alt key, open ddLocation, and confirm that the list shows the three
locations.
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.
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.
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.
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.
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.
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.
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 :
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.
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:
b. Click or tap Add data source, and then click or tap OneDrive for Business.
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.
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.
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.
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 ( ✓ ).
Microsoft Edge ✓ ✓ ✓
Internet Explorer 11 ✓
Google Chrome ✓ ✓ ✓
Safari * ✓
Mozilla Firefox
* 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.
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.
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:
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.
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.
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":
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.
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
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.
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
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.
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.
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 ✔ ✔
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 “;”.
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.
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:
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
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.
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.
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.
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
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.
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.
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.
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
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
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)
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:
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.Sync The data source reported an error. Check the Error property
for more information.
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"]
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
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.
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:
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
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
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:
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
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
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 done an unusually "deep" 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.
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)
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
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.
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.
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
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.
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
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
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
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.
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.
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
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.
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>"
&$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
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)
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.
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)
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
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.
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
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.
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.
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
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.
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
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:
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 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.
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:
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.
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.
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 )
DISPLAY DESCRIPTION
The red dot represents the user's finger in the text-input box, where the user enters 77.
DISPLAY DESCRIPTION
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?
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 )
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:
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.
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].
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.
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.
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.
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.
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.
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.
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.
2. Rename the control by selecting its ellipsis in the left navigation pane, selecting Rename, and then typing
ProductName.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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
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.
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
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.
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
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.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.
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.
Location Returns the latitude and longitude of { Latitude: 47.591, Longitude: 122.333 }
the current location, as a record.
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.
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
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
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.
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.
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:
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.
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.
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.
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
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
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.
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:
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:
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:
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.
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
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
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
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:
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 )
Back()
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.
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:
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:
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(), "", 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.
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:
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:
IsBlank( Blank() ) Tests the return value from the Blank true
function, which always returns a blank
value.
IsBlank( Mid( "Hello", 17, 2 ) ) The starting character for Mid is true
beyond the end of the string. The result
is an empty string.
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:
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
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:
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".
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
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
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.
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:
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.
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.
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:
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.
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.
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
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:
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".
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.
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:
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:
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(), "", 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.
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:
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:
IsBlank( Blank() ) Tests the return value from the Blank true
function, which always returns a blank
value.
IsBlank( Mid( "Hello", 17, 2 ) ) The starting character for Mid is true
beyond the end of the string. The result
is an empty string.
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:
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:
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
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
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
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
Returns information about the app's environment, such as where the user is located in the world and which screen
is displayed.
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
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.
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
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.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.
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.
Location Returns the latitude and longitude of { Latitude: 47.591, Longitude: 122.333 }
the current location, as a record.
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.
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:
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.
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.
Concat function
For these examples, set the Text property of a label to a formula from the first column of the next table.
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.
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:
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.
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.
Concat function
For these examples, set the Text property of a label to a formula from the first column of the next table.
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.
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:
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:
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:
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.
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.
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
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.
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
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.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.
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.
Location Returns the latitude and longitude of { Latitude: 47.591, Longitude: 122.333 }
the current location, as a record.
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.
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
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
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
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.
DateTime A date with a time, in the time zone of DateTimeValue( "May 16, 2019
the app's user. 1:23:09 PM" )
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..."
Time A time without a date, in the time zone Time( 11, 23, 45 )
of the app's user.
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.
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"
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.
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:
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)
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)
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, ...
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:
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
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:
DataSourceInfo( IceCream, Returns the display name for the "Quantity on Hand"
DataSourceInfo.DisplayName, "Qua Quantity column of the IceCream
ntity" ) data source.
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(), 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(), 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
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".
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.
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.
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
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.
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.
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.
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 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
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".
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.
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.
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
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.
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.
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.
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 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
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:
Examples
For the following example, the current time is 3:59:37 PM on Thursday, April 9, 2015.
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
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
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
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 }
);
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:
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
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
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.
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.
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):
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
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
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.
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:
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
You can expand your search to include the Company column as well as the Name column:
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.
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.EditPermission An attempt was made to edit a record, and the current user
doesn't have permission to edit records.
ErrorKind.MissingRequired The value for a required column is missing from the record.
ERRORKIND DESCRIPTION
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:
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
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:
"
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:
If you set the Text property of the label to PlainText(ThisItem.description), the text appears as in this example:
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
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
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".
Examples
The following examples use the IceCream data source:
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.
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:
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.
You can expand your search to include the Company column as well as the Name column:
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.
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
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
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
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" ] )
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.
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:
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
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):
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:
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:
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
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:
Examples
For the following example, the current time is 3:59:37 PM on Thursday, April 9, 2015.
Some of these operators are dependent on the language of the author. See Global apps for more information.
* 2*3 Multiplication
& 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
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
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).
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.
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.
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
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/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).
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.
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:
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:
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(), "", 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.
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:
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:
IsBlank( Blank() ) Tests the return value from the Blank true
function, which always returns a blank
value.
IsBlank( Mid( "Hello", 17, 2 ) ) The starting character for Mid is true
beyond the end of the string. The result
is an empty string.
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:
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.
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:
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:
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
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:
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:
IsBlank( Mid( "Hello", 17, 2 ) ) The starting character for Mid is true
beyond the end of the string. The
result is an empty string.
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:
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:
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.
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.
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:
. dot or period
? question mark
* asterisk
+ plus
() parentheses
[] square brackets
{} curly braces
^ caret
$ dollar sign
\ 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:
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 (& ).
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.
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( "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( "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.
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( "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." )
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
}
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
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.
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.
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.
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:
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:
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:
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.
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:
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.
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
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" ) )
3. Insert another button, and set its OnSelect property to this formula:
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.
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"
}
]
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
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:
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
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
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
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
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
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
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
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".
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
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
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.
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:
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.
Returns information about the app's environment, such as where the user is located in the world and which
screen is displayed.
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
App
Among other properties, the App object includes a signal that indicates which screen is showing.
PROPERTY DESCRIPTION
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
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
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.
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.
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".
Examples
The following examples use the IceCream data source:
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.
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:
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.
You can expand your search to include the Company column as well as the Name column:
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.
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".
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.
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
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:
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.
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.
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:
. dot or period
? question mark
* asterisk
+ plus
() parentheses
[] square brackets
{} curly braces
^ caret
$ dollar sign
\ 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:
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 (& ).
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.
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( "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( "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.
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( "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." )
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
}
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
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:
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.
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.
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:
. dot or period
? question mark
* asterisk
+ plus
() parentheses
[] square brackets
{} curly braces
^ caret
$ dollar sign
\ 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:
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 (& ).
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.
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( "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( "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.
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( "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." )
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
}
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
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
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
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
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:
Examples
For the following example, the current time is 3:59:37 PM on Thursday, April 9, 2015.
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
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:
Examples
For the following example, the current time is 3:59:37 PM on Thursday, April 9, 2015.
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:
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:
Back()
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):
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:
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.
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.
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:
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:
4. Change the type of message to indicate an error. Add a second argument to our formula:
6. Change the type of message to indicate a warning. Change the second argument in our formula:
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.
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.
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.
* 2*3 Multiplication
^ 2^3 Exponentiation,
equivalent to the Power
function
& 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
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:
SimpleName SimpleName
NameWith123Numbers NameWith123Numbers
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).
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:
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.
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.
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:
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:
After the previous formulas have been evaluated, the data source ends with these values:
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
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
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:
"
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:
If you set the Text property of the label to PlainText(ThisItem.description), the text appears as in this example:
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
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".
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.
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
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
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:
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
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
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 ) )
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 ) )
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'.
When the user selects this icon, the current reservation changes to the product that the user selected in
ComboBox1.
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:
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.
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:
12. Insert an Add icon, and set its OnSelect property to this formula:
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.
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
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:
RemoveIf( IceCream, Quantity > 150 Removes records that have a Quantity
) that's greater than 150.
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
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:
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
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.
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.
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
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
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.
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):
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
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:
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
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
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
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.
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:
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.
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".
Examples
The following examples use the IceCream data source:
Search( IceCream, "", "Flavor" ) Because the search term is empty, all
records are returned.
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 { 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.
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:
You can expand your search to include the Company column as well as the Name column:
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:
Examples
For the following example, the current time is 3:59:37 PM on Thursday, April 9, 2015.
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)
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
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
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 )
)
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
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
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.
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
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
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
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
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".
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
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".
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
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
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
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.
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
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
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.
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.
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:
You can expand your search to include the Company column as well as the Name column:
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
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
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.
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):
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
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.
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 = 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( 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.
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
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
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
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.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.
Number placeholders
PLACEHOLDER DESCRIPTION
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
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
' Apostrophe
= Equal sign
- Minus sign
/ Slash mark
) Right parenthesis
& Ampersand
~ Tilde
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
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.
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( 0.631, "0.#" ) Pads the whole portion of the number "0.6"
with leading zeros, if needed.
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)
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(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.
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.
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
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".
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.
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.
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
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.
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.
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.
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 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(), 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.
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.
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
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 " ] )
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
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 " ] )
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
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):
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:
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
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 ) )
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 ) )
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'.
When the user selects this icon, the current reservation changes to the product that the user selected in
ComboBox1.
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:
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.
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:
12. Insert an Add icon, and set its OnSelect property to this formula:
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.
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
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:
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.
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
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
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:
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".
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.
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
Description
The User function returns a record of information about the current user:
PROPERTY DESCRIPTION
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" }
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, 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( 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
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".
Value( "$ 12.34" ) The currency symbol for the current 12.34
language is ignored.
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
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):
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
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:
Examples
For the following example, the current time is 3:59:37 PM on Thursday, April 9, 2015.
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
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
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
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:
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.
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.
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.
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.
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.
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.
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:
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.
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.
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:
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.
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:
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:
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:
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.
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:
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:
4. In the formula bar, set the new label's Text property to this formula:
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.
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:
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:
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.
Gallery1.Selected
The form shows an summary of whatever order the app user selects in the list.
3. In the data card, reduce the width of the combo box to make room for the employee picture:
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
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 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:
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:
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:
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:
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:
NewForm( Form1 )
The NewForm function shows a blank record in the form.
4. Set the Add icon's DisplayMode property to this formula:
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.
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:
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:
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.
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
This formula shows a delegation warning, but you can ignore it because no single order will contain more
than 500 products.
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:
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.
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.
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:
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:
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:
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:
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:
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:
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.
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.
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.
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.
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.
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 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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:
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.
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.
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.
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.
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
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
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.
Adobe Sign No
Asana No
AtBot Admin No
AtBot Logic No
Azure AD Yes
Azure DevOps No
Basecamp 2 No
Bitbucket No
Bitly No
bttn No
Buffer No
Business Central No
CandidateZip No
Capsule CRM No
Cognito Forms No
D&B Optimizer No
Derdack SIGNL4 No
Disqus No
Document Merge No
Dynamics 365 No
Enadoc No
Eventbrite No
Expiration Reminder No
FreshBooks No
GoToMeeting No
GoToTraining No
GoToWebinar No
Harvest No
Infusionsoft No
Inoreader No
Intercom No
JotForm No
kintone No
LinkedIn No
Medium No
Metatask No
Microsoft Forms No
Microsoft Kaizala No
Microsoft StaffHub No
Muhimbi PDF No
CONNECTOR SUPPORTS GUEST ACCESS
NetDocuments No
OneDrive No
OneNote (Business) No
Outlook.com No
Paylocity No
Planner No
Plumsail Forms No
Power BI Yes
Project Online No
Projectwise Share No
SharePoint Yes
SignNow No
Soft1 No
Stormboard No
Survey123 No
SurveyMonkey No
CONNECTOR SUPPORTS GUEST ACCESS
Toodledo No
Typeform No
Vimeo No
Webex Teams No
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.
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.
4. Specify the email addresses with which your app users sign in to OneDrive, and then select Share.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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
Prerequisites
Create an app or open one for editing, and then select App settings on the File menu.
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.
To make your app responsive, you must take additional steps, but this change is the first step toward making
responsiveness possible.
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.
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:
Upper X 0
Upper Y 0
Lower X 0
Lower Y 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:
Upper X 0
Upper Y 0
Lower X 0
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
Width Parent.Width - (N * 2)
Height Parent.Height - (N * 2)
RELATIONSHIP BETWEEN C
AND D PROPERTY FORMULA ILLUSTRATION
Width D.Width
RELATIONSHIP BETWEEN C
AND D PROPERTY FORMULA ILLUSTRATION
Height D.Height
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:
X 0 0 Parent.Width - Menu.X +
Close.Width Menu.Width
Y 0 0 0 0
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.
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.
Upper X 0
Upper Y 0
Lower X If(Parent.Orientation =
Layout.Vertical, 0, Upper.X +
Upper.Width)
Lower Y If(Parent.Orientation =
Layout.Vertical, Upper.Y +
Upper.Height, 0)
ScreenSize.Small 1 Phone
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.
NOTE
You must save an app before you can write tests for the app.
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.
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.
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.
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.
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.
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.
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)
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.
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.
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.
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.
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.
Title Single line of text Default column, used for project name
RequestDate Date
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
ApprovedDate Date
NOTE
Use Internet Explorer for this step.
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.
5. In the Data panel, click or tap the ellipsis (. . .) next to Project Details, then click or tap Remove.
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.
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.
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.
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.
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.
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.
3. In the app, click or tap for the first item in the browse gallery.
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.
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.
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.
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.
4. Under Choose an action, search for "SharePoint", then click or tap SharePoint – Update item.
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.
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.
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.
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.
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.
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.
SCREEN PURPOSE
The Data sources tab in the right pane now shows the connection that you have created.
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..."
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.
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.
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
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.
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).
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).
6. Enter "Project Management app", and paste in the address for the app.
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.
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.
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.
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.
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:
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
2. If you're not already signed in to the Power BI service, enter an account, 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.
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.
4. Click or tap the chart on the upper right, then click or tap tap .
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.
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.
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.
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.
3. Click or tap .
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.
2. Click or tap Send an e-mail to any audience when a Power BI data alert is triggered.
5. In the Alert Id drop-down list, select Alert for Max days pending approval.
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.
3. Check the inbox of the requestor's email account, and you should see an approval email.
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.
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.
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.
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.
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 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?
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.
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 )
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.
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.
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¶m1=value1¶m2=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.
https://apps.powerapps.com/play/76897698-91a8-b2de-756e-fe2774f114f2?source=iframe
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.
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 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"
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
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.
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.
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.
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
}
)
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.
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.
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.
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.
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.
This instance resembles this graphic, but you can customize the text and other properties of each instance.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Site map Specifies the navigation for your app. Site map designer
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.
Visualizations
Determines what type of data visualizations and reporting the app will have available.
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.
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
COMPONENT TOPIC
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.
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
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.
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.
Display label on the form You can choose not to display the label
at all.
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.
Business Rules Business Rules View and manage any business rules
that reference this field. More
information: Create business rules and
recommendations
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.
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.
Additional Properties Display Search Box in lookup dialog You can choose not to display the
search box in the lookup dialog.
SECTION PROPERTY DESCRIPTION
1:N N:1 No
1:N N:N No
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
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).
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?
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.
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.
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.
Define navigation for an app using the Create a site map for an app
site map 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.
Support matrix for the app designer and site map designer
The following table shows the supported operating systems and browsers.
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.
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.
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.
Clients supported
The following table explains the clients supported for different site maps.
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.
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.
TIP
Alternatively, you can also do one of the following:
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.
NOTE
Alternatively, you can also do one of the following:
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.
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.
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
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.
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.
Goal Goal Metric Import Source File Invoice Product Order Product
Price List Queue Item Quote Product Rollup Field Rollup Query
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
Max Width Set a maximum width (in pixels) to limit the width of the
form. The default value is 1900.
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 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
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.
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.
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.
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.
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.
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.
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.
NOTE
Sections can only be added on main forms and quick view forms. More information: Form types
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.
Display options Section label The localizable label for the section
visible to users.
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.
Display options Lock section Lock this section to keep it from being
removed.
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
NOTE
Tabs can only be added on main forms. More information: Form types
Display options Tab label The localizable label for the tab visible
to users.
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.
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.
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.
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.
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.
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.
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.
Display options Show related records When selected, the sub-grid displays
only records related to the current
record that is displayed on the form.
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.
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.
Display options Label The localizable label for the quick view
visible to users.
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.
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.
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.
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.
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.
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.
Main Used in model-driven apps, Dynamics Design considerations for main forms
365 for tablets, and Dynamics 365 for
Outlook.
Quick Create Used in model-driven apps, Dynamics Create and edit quick create forms
365 for tablets, and Dynamics 365 for
Outlook.
Quick View Used in model-driven apps, Dynamics Create and edit quick view forms
365 for tablets, and Dynamics 365 for
Outlook.
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.
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.
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.
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.
Email Main
Appointment Main
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.
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.
When you edit a quick view form, you must publish your changes before they will be visible in the application.
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.
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.
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:
Save and Close Save the form and close the form
editor.
- Tab Properties
- Section properties
- Common Field properties
- Special field properties
- Sub-grid properties
- Quick view control properties
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.
Insert tab
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.
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.
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.
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.
See Enable or
disable entity
options for
more
information
about entity
options.
TAB PROPERTY DESCRIPTION
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.
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 (.).
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
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.
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.
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
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.
These are the properties available to configure when using a sub-grid component on a form using the classic form
designer.
TAB PROPERTY DESCRIPTION
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.
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:
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
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.
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.
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.
Command bar Uses the data defined for ribbons to provide commands
relevant for the record.
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.
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.
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.
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
Status Bar The status bar displays the status field for the record, a
notification area, and a save button.
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
Lead 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.
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.
NOTE
You can’t include a web resource in a form header or footer.
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.
PROPERTY DESCRIPTION
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.
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.
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.
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.
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.
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.
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 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.
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.
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
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.
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.
PARAMETER DESCRIPTION
type The entity type code. This value can be different for custom
entities in different organizations. Use typename instead.
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.
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 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.
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.
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.
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.
Lock the section on the form This will prevent the section from
accidentally being removed and
prevents people from removing the
contents.
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.
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.
Select an address to use with the Choose which address should be used
Bing maps control to provide data for the map.
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.
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:
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.
PROPERTY VALUE
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.
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.
Name preventAutoSave
function preventAutoSave(econtext) {
var eventArgs = econtext.getEventArgs();
if (eventArgs.getSaveMode() == 70 || eventArgs.getSaveMode() == 2) {
eventArgs.preventDefault();
}
}
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.
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
IMPORTANT
To use this feature you must enable document management. More information: Manage your documents using SharePoint
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 {}.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
PROPERTY DESCRIPTION
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.
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
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.
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.
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
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.
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
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
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.
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.
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.
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
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
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
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
Price List
Product
Queue
Quote
Rating Model
Rating Value
Social Activity
Social Profile
Sync Error
Task
Team
User
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.
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.
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.
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:
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.
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:
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
- 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.
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
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.
Default Module for Create Experience Select the module for which you Notes
want the default create experience in
the timeline.
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
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.
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.
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
Select Card Form Select a card form from the list. Email Card form
FIELD VALUE
FIELD VALUE
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:
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:
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.
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.
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.
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
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 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.
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.
Quick View Form If the Related entity has any quick view forms you can select
them here. Otherwise, select New to create one.
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.
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_URL URL field to map for displaying the URL of each timeline item.
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
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
PROPERTY DESCRIPTION
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
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
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
Good Set a value that’s considered good for the measure (optional).
Bad Set a value that’s considered bad for the measure (optional).
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
PROPERTY DESCRIPTION
Source Set the source for the data (Grouped Options, Option Set, or
View).
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.
PROPERTY DESCRIPTION
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.
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
L – Letter
I – Letter or space
A – Alphanumeric
A – Alphanumeric or space
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
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
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.
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.
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.
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.
The field is now rendered as a slider control instead of the text field.
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.
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).
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.
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.
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
IMPORTANT
Custom help panes replace the previous learning path guided learning feature used with legacy web client apps.
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.
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.
NOTE
Currently, you can't add existing help panes to an unmanaged solution in the modern solution explorer.
<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>
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.
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>
<ol>
<li>First step</li>
<li>Second step</li>
<li>Third step</li>
</ol>
<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>
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.
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.
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
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.
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
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.
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.
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.
NOTE
By default, Power BI visualization embedding is disabled and must be enabled before users can embed them in personal
dashboards.
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.
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.
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.
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.
{"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.
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.
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.
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.
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.
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.
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.
NOTE
This step can be skipped if existing roles grant access to the data in your app.
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.
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.
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.
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
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.
PROPERTY DESCRIPTION
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.
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.
b. Select the grid flow type from Bind to static options drop down.
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
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
NOTE
You can’t include a web resource in a form header or footer.
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.
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.
FIELD DESCRIPTION
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
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.
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
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.
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 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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
This col
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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
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.
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.
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.
Europe, Middle East, Africa, and Great Britain (EMEA, GBR) West Europe
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
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
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.
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.
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.
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.
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
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.
NOTE
You might also consider replacing the Dynamics 365 for Outlook (COM Add-in) with the lightweight Dynamics 365 App for
Outlook.
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.
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)*
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"
This topic provides answers to the most common questions about Unified Interface and about transitioning from
the legacy web client to Unified Interface.
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 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
Expand and move the focus to the Alt + Shift + N Opt + Shift + N
notification area 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-
-OR-
Firefox Yes No No
Safari No No Yes
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.
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.
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.
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.
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.
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.
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:
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:
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
NOTE
It is advisable to only disable custom errors when you are in the development phase and enable custom errors once you go
live.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
NOTE
Ensure that Power BI visualization is enabled for the powerbi Liquid tag to work.
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.
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.
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:
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.
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.
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.
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.
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.
NOTE
You must sign in to your portal in the same browser session, and you must be assigned all website access permission.
NOTE
To renew the key, you must have permissions to manage your portal.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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:
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.
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:
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.
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.
CustomerSupport/DisplayAllUserActiviti FALSE
esOnTimeline
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.
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
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:
Create a username and password.
Change an existing password.
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.
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.
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.
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/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/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/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.
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
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/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- Specifies the URL within the portal to redirect to after a user
Name]/PostLogoutRedirectUri signs out.
<!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>
NAME VALUE
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).
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
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.
Substitute the [provider] tag in the site setting name with a specific identity provider name: Facebook, Google,
Yahoo,Microsoft, LinkedIn, or Twitter.
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]/Caption The text that the user can display on a sign in user interface.
microsoftaccountauthenticationoptions.caption.
Authentication/OpenAuth/[provider]/CallbackPath The request path within the application's base path where the
user-agent will be returned.
microsoftaccountauthenticationoptions.callbackpath.
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.
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
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]/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]/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]/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]/RedirectUri The reply URL location where the provider sends the
authentication response.For example:
https://portal.contoso.com/signin-oidc
SITE SETTING NAME DESCRIPTION
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.
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
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/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.
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.
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
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]/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]/UseTokenLifetime Indicates that the authentication session lifetime (for example, cookies)
should match that of the authentication token.
WsFederationAuthenticationOptions.UseTokenLifetime.
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=<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
.PARAMETER rpid
.PARAMETER adfsPath
.EXAMPLE
#>
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")
Write-Output $idpInitiatedUrl
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 |
<SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
Location=https://idp.contoso.com/idp/profile/SAML2/Redirect/SSO/>
Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Location=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=<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
.PARAMETER providerId
.PARAMETER shibbolethPath
.EXAMPLE
#>
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)
Write-Output $idpInitiatedUrl
<#
.SYNOPSIS
.PARAMETER domain
.EXAMPLE
#>
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
$issuanceTransformRules = @'
@RuleTemplate = MapClaims
c:[Type == "https://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname"]
@RuleTemplate = LdapClaims
'@ -f $identityProviderValue
$issuanceAuthorizationRules = @'
@RuleTemplate = AllowAllAuthzRule
'@
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.
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:
NOTE
The deprecated identity providers are not shown when a user registers or redeems an invitation for a portal.
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
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.
NOTE
Apart from the entities listed here, no other entity can be enabled for global search in a portal.
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.
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/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.
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
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).
IMPORTANT
When you use the searchindex tag, facets are not returned as part of results, nor can they be applied as a filter.
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.
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.
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:
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
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.
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).
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.
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.
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
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.
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.
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.
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.
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.
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.
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
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
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.)
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.)
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.
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.
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
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.
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.
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.
<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>
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 %}
Updated code
Updated code
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" %}
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 %}.
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
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.
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.
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.
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
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.
Record Not Found Message Message to be displayed when a record is not found.
On Success Settings
NAME DESCRIPTION
Hide Form on Success Requires On Success set to Display Success Message. When
selected, the form is hidden upon successful submission of
the form.
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.
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.
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 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.
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).
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.
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 Name The name of the entity from which the Saved Query view will
be loaded. This field is required.
NAME DESCRIPTION
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.
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.
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
});
});
});
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.
NAME DESCRIPTION
Basic Settings
Advanced Settings
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.
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.
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.
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.
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.
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.
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.
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.
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.
Basic Settings
none
Advanced Settings
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.
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.
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.
Filter types
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.
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.
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.
NAME DESCRIPTION
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.
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.
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.
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.
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.
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.
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.
NAME DESCRIPTION
NOTE
This option is not supported in the German Sovereign Cloud environment. The Map view section will not be visible in this
environment.
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.
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.
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.
NAME DESCRIPTION
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
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.
NAME DESCRIPTION
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!
Type One of the following: Title, Numeric (Step x of n), and Progress
Bar. Default: Title
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.
Progress Bar
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
Web Form The Web Form associated with the current step.
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
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
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 ID Query String Parameter Name A parameter name provided in the query string of the URL to
the Web Page containing this Entity Form.
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
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
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.
Next Button CSS Class CSS Class name assigned to the next button.
Submit Button CSS Class CSS Class name assigned to the submit button. Default:
button submit
Submit Button Busy Text Label on the submit button during the running process.
Default: Processing...
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.
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
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.
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
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
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.
OPERAND(S) TYPE
=, == Equals
!= Not Equals
& And
| Or
! Not
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");
});
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;
}
};
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.
NAME DESCRIPTION
Web Form Step The Web Form Step associated with the Web Form Metadata
record.
NAME DESCRIPTION
Attribute Logical Name The logical name of the attribute field to be modified.
Control style
The following options modify the style and functionality of an attribute's field.
NAME DESCRIPTION
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.
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
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.
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.
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 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.
NAME DESCRIPTION
Add Description Yes results in custom text being displayed on the form in the
position specified.
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'.
NAME DESCRIPTION
Section Name The name of the section on the entity's form to be modified.
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.
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.
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.
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.
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.
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.
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
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.
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/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.
NAME DESCRIPTION
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.
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.
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/TermsAndConditionsCo HTML
py
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/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.
OR
Attributes
The Ad Entity has the following attributes:
NAME DESCRIPTION
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.
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
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.
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.
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
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.
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.
Contact The associated Contact record of the voter if the user is signed
in.
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.
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.
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.
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.
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.
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' %}
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 Header This template renders the page title. {% include 'page_header' %}
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
or Condition A or condition B
contains
contains tests for the presence of a substring within a string.
{% 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.
{% endif %}
endswith
endswith tests whether a string ends with a given substring.
{% if page.title endswith 'Forum' %}
{% 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.
Number
Numbers can be integers or floats.
{% assign pi = 3.14 %}
{% endif %}
Boolean
A Boolean is either true or false.
{% assign x = true %}
{% assign y = false %}
{% if x %}
{% 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 %}
{% 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 %}
{% endif %}
DateTime
A DateTime object represents a specific date and time.
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] %}
{% 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.
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
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] }}
{{ 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
weblinks Allows you to load any Web Link Set by name or ID. More
information: weblinks
ads
Provides the ability to access and render an ad.
The ads object allows you to select a specific ad or ad placement:
<div>
</a>
</div>
Ads attributes
ATTRIBUTE DESCRIPTION
[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
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.
image Returns the image object (if any) for the ad.
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
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=panel-heading>
<h4>
{{ snippet.adx_value }}
</h4>
</div>
<ul class=list-group>
</a>
<h4 class=list-group-item-heading>
</h4>
<div class=content-metadata>
–
–
</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
[blog name or id] You can access any blog by its Name or Id properties.
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.
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
blogpost Object
Refers to a single blog post.
The following table explains various attributes associated with blogpost Object.
ATTRIBUTE DESCRIPTION
author Returns the authorf for the post (which is simply a contact
entity object.
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.
{% if account %}
{% endif %}
{% if contact %}
{% endif %}
Entity
An entity object provides access to the attributes of a Power Apps entity record.
ATTRIBUTE DESCRIPTION
[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
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
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
ATTRIBUTE DESCRIPTION
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_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.
Reflexive Relationship
Attempts to load reflexive (that is, self-referential) relationships on entities are returned as objects with the
following attributes.
ATTRIBUTE DESCRIPTION
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
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
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_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_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
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 }}
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
language_code Returns the Power Apps integer language code that will be
used to select all localized labels (column headers, etc.) for 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
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
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
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.
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_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_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
[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
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
note that
is also possible.
Following attributes are associated with eventoccurrences object
ATTRIBUTE DESCRIPTION
eventoccurence Object
Represents a single event occurrence. The associated attributes are given below:
ATTRIBUTE DESCRIPTION
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 %}
{% else %}
{% endif %}
{% endfor %}
Output
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.
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>
</h4>
</div>
<ul class=list-group>
<li class=list-group-item>
<div class=row>
<div class=col-sm-6>
</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.
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
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
forumthread Object
Attributes
NOTE
entities
ATTRIBUTE DESCRIPTION
author Returns the author for the thread (which is simply a contact
entity object).
post_count Returns the integer value of the count of how many posts
there are in the thread.
forumposts Object
Attributes
ATTRIBUTE DESCRIPTION
NOTE
entities
ATTRIBUTE DESCRIPTION
author Returns the author for the post (which is simply a contact
entity object).
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 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.
Attributes
ATTRIBUTE DESCRIPTION
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
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.
Attributes
ATTRIBUTE DESCRIPTION
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
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
comment_count The integer value of the count of how many comments there
are for a given 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
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>
{% endfor %}
</ul>
<div class=page-header>
</div>
<div class=page-copy>
{{ page.adx_copy }}
</div>
<div class=list-group>
{{ child.title | escape }}
</a>
{% endfor %}
</div>
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.
[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>
<div>
</div>
{% endfor %}
</div>
Polls Attributes
ATTRIBUTE DESCRIPTION
[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 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] %}
NOTE
entities
ATTRIBUTE DESCRIPTION
placement_url The URL that can be used to retrieve the poll placement fully
rendered by a template.
ATTRIBUTE DESCRIPTION
random_url The URL that can be used to retrieve a random poll from the
placement fully rendered by a template.
Poll Attributes
NOTE
entities
ATTRIBUTE DESCRIPTION
poll_url The URL that can be used to retrieve the poll fully rendered
by a template.
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.
NOTE
entities
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'] %}
NOTE
You can build URLs dynamically in Liquid by using URL Filters.
Attributes
ATTRIBUTE DESCRIPTION
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 %}
<ul>
<li>
</li>
{% endfor %}
</ul>
{% else %}
{% endif %}
{% endsearchindex %}
Attributes
ATTRIBUTE DESCRIPTION
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.
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.
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.
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] }}
{% if search_enabled %}
Search is enabled.
{% endif %}
{% if pagesize > 10 %}
{% endif %}
NOTE
Render a website header and primary navigation bar
sitemap
Allows access to the portal site map.
<ul class=breadcrumb>
{% endfor %}
</ul>
{% endfor %}
{% if node %}
{% endfor %}
{% endif %}
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.
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
Entity Returns the underlying entities of the node. If the node has
no underlying entity, this value will be null.
Parent Returns the parent site map node of the node. If the node is
the root node, parent will be null.
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 }}
{% if my_sitemarker %}
{% else %}
{% endif %}
NOTE
Render a website header and primary navigation bar
Sitemarker Attributes
ATTRIBUTE DESCRIPTION
[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] }}
{% if footer %}
{{ footer }}
{% else %}
{% 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_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
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 %}
{% else %}
{% endif %}
Attributes
In addition to having all of the attributes of an entity object, user has the following attributes.
ATTRIBUTE DESCRIPTION
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 }}
{% if nav %}
<ul>
<li>
{% if link.image %}
{% endif %}
{{ link.name | escape }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
NOTE
Render a website header and primary navigation bar |
NOTE
A web link set is an entity object, with all of the same attributes, in addition to those listed below.
ATTRIBUTE DESCRIPTION
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 }}
NOTE
A web link is an entity object, with all of the same attributes, in addition to those listed below.
ATTRIBUTE DESCRIPTION
Image The web link image object for this link. This attribute will be
null if no image is present.
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 }}
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
Output
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 {% %}.
{{ 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.
Hello, Dave.
{% endif %}
unless
Like if, except it executes a block of code if a given condition isnot met.
{% endunless %}
elsif/else
Adds more conditions to an if or unless block.
Hello, Dave.
{% 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 %}
Hello, Dave.
{% 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
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
{% endfor %}
Output
Parameters
These parameters of for can be used alone, or in combination.
limit
Exits the loop after a given number of items.
Code
{% endfor %}
Output
offset
Starts the loop at given index.
Code
{% for child_page in page.children offset:1 %}
{% endfor %}
Output
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
{% endfor %}
Output
{% end %}
Output
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>
{{ 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>
{{ child_page.title }}
{% endtablerow %}
</table>
{{ 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
<table>
{{ 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
assign
Creates a new variable. Assignments can also use filters to modify the value.
Code
{% if is_valid %}
It is valid.
{% endif %}
{{ 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
{{ hello }}
{{ hello }}
Output
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.
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.
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.
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:
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:
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.
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 %}
<!--
-->
{% if primary_nav %}
<ul>
</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.
{% endentitylist %}
By default, the entitylist object will be given the variable name entitylist. Optionally, a different variable name can
be provided.
{% 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 %}
{% 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 %}
{% endentitylist %}
name
Loads an entity list by name.
{% entitylist name:My Entity List %}
{% 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.
{% entitylist key:key_variable %}
{% 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.
{% 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.
{% endentityview %}
By default, the entityview object will be given the variable name entityview. Optionally, a different variable name
can be provided.
{% 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 %}
{% 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.
{% endentityview %}
name
The Power Apps name of the view to be loaded. Must be used in combination with logical_name.
{% 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' %}
{% endentityview %}
{% 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 %}
{% 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.
{% endentityview %}
{% 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 %}
{% endentityview %}
{% 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.
{% endentityview %}
{% 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.
{% 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 %}
{% 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.
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.
{% 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 %}
<ul>
<li>
</li>
{% endfor %}
</ul>
{% else %}
{% endif %}
{% endsearchindex %}
By default, the search index object will be given the variable name searchindex. Optionally, a different variable
name can be provided.
{% 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).
...
{% endsearchindex %}
...
{% endsearchindex %}
...
{% endsearchindex %}
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.
...
>
{% endsearchindex %}
page
The search result page to be returned. If not provided, the first page (1) will be returned.
...
{% endsearchindex %}
...
{% endsearchindex %}
page_size
The size of the result page to be returned. If not provided, a default size of 10 will be used.
...
{% 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.
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.
Array filters
Array filters are used to work with arrays.
batch
Divides an array into multiple arrays of a given size.
Code
<ul>
{% 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
Output
except
Select all the objects in an array where a given attribute does not have a given value. (This is the inverse
ofwhere.)
Code
{{ 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
{{ words | first }}
{% if words.first == This %}
{% endif %}
Output
This
group_by
Group the items in an array by a given attribute.
Code
{{ group.key }}:
{{ 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
{{ words | join: , }}
Output
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
{{ words | last }}
{% endif -%}
Output
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
Output
random
Returns a single randomly-selected item from the array.
Code
{{ group1 | random }}
Output
Pete
select
Selects the value of a given attribute for each item in an array, and returns these values as an array.
Code
Output
shuffle
Applied to an array, returns a new array with the same items, in randomized order.
Code
Output
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 -%}
{% endif -%}
Output
skip
Skips a given number of items in an array, and returns the rest.
Code
Output
take
Takes a given number of items from the array, returning the taken items.
Code
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: ', ' }}
Output
where
Select all the objects in an array where a given attribute has a given value.
Code
{{ 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
Output
5/7/2018 7:20 AM
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 }}
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 }}
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 }}
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 }}
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
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
reverse_sort
Given a sort direction, returns the opposite sort direction.
Code
{{ '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
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 | 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
Output
filename.js
capitalize
capitalizes the first word in a string.
Code
Output
Capitalize Me
downcase
Converts a string into lowercase.
Code
Output
escape
HTML -escapes a string.
Code
{{ '<p>test</p>' | escape }}
Output
<p>test</p>
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
Output
remove
Remove all occurrences of a substring from a string.
Code
Output
remove_first
Removes the first occurrence of a substring from a string.
Code
Output
Output
replace_first
Replaces the first occurrence of a string with a substring.
Code
Output
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: ' ' %}
Output
Second word: is
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
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...
truncate_words
Truncates a string down to a given number of words. An ellipsis (...) is appended to the truncated string.
Code
Output
This is a...
upcase
Converts a string into uppercase.
Code
Output
url_escape
URI-escape a string, for inclusion in a URL.
Code
Output
This+%26+that%2F%2F
xml_escape
XML -escape a string, for inclusion in XML output.
Code
{{ '<p>test</p>' | xml_escape }}
Output
<p>test</p>
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 }}
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 }}
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 }}
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
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
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
Output
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
{% 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
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.
{% 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 %}
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.
{% 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' %}
<span class=fa fa-fw fa-external-link aria-hidden=true></span>
{% elsif child.entity.logical_name == 'adx_webfile' %}
<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 %}
{% 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' %}
<span class=fa fa-fw fa-external-link aria-hidden=true></span>
{% elsif sibling.entity.logical_name == 'adx_webfile' %}
<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' %}
<span class=fa fa-fw fa-external-link aria-hidden=true></span>
{% elsif parent_sibling.entity.logical_name == 'adx_webfile' %}
<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' %}
<span class=fa fa-fw fa-external-link aria-hidden=true></span>
{% elsif sibling.entity.logical_name == 'adx_webfile' %}
<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' %}
<span class=fa fa-fw fa-external-link aria-hidden=true></span>
{% elsif parent_sibling.entity.logical_name == 'adx_webfile' %}
<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' %}
<span class=fa fa-fw fa-external-link aria-hidden=true></span>
{% elsif sibling.entity.logical_name == 'adx_webfile' %}
<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;
}
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' }}">×</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"> </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>
<tbody>
{% for e in entityview.records -%}
<tr>
<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 %}>
«
</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 }}">
…
</a>
</li>
{% endif %}
<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 %}>
»
</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
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=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.
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:
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 .
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.
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.
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.)
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
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.
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.
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.
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.
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.
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.
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
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.
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.
NAME DESCRIPTION
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.
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
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.
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.
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.
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
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.
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 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.
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.
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.
Accept MIME Types(s) Allows you to specify a list of accepted MIME types.
NAME DESCRIPTION
Maximum File Size (in KB) Allows you to specify the maximum size of a file that can be
attached.
Advanced settings
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.
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.
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.
Basic settings
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.
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.
NAME VALUE
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:
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
NOTE
You must be a global administrator to perform this action.
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.
NOTE
Document management must be enabled for the entity for which you edit the form. More information: Enable document
management for entities
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.
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.
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
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.
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).
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.
https://content.powerapps.com/resource/powerappsportal
NOTE
Power Apps portals hosted in Microsoft Government Cloud do not use CDN.
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.
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.
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.
Create an entity
1. In the navigation pane, click or tap Data to expand it, and then click or tap Entities.
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.
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.
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.
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.
4. Select Save.
5. Select Publish.
6. Select Save and close to close the form designer.
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.
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
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.
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.
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.
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.
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.
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.
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.
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
For any other changes to entity options, you must edit the entity using solution explorer.
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
OPTION DESCRIPTION
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.
OPTION DESCRIPTION
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
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.
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.
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.
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
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
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.
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 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
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
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.
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
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
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.
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.
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.
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
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.
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.
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.
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
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.
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.
OPTION DESCRIPTION
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.
OPTION DESCRIPTION
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
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.
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.
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.
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
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
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
OPTION DESCRIPTION
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.
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.
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.
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.
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.
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
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
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.
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.
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:
Active In Progress
On Hold
Waiting for Details
Researching
Canceled Canceled
Merged
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.
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;
}
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
Custom Display String Edit this text to change the display string.
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
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
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.
Requirements
Azure subscription that includes Azure Cosmos DB.
An Azure Cosmos DB SQL API collection.
The Azure Cosmos DB database type should be SQL.
id Primary Key
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
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.
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.
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
<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>
FIELD VALUE
URL https://contosowebservice.azurewebsites.net/odata
Timeout 30
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.
FIELD VALUE
Name new_ticket
Activities selected
3. Next to Areas that display this entity, select Service, and then select Save (but don’t close the entity
form).
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
Name new_severity
Minimum Value 0
Maximum Value 4
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.
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.
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.
Cascade Active Perform the action on all active related entity records.
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:
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.
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.
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.
6. Click Done to add the relationship to your entity, and then click Save entity.
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.
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 DESCRIPTION
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.
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
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:
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
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.
FIELD DESCRIPTION
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.
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.
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:
OPTION DESCRIPTION
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.
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 DESCRIPTION
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
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.
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.
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.
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.
NOTE
Developers will also be able to use these operators in code. More information Developer Documentation: Query hierarchical
data
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.
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
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.
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.
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
Connection Role Category A group describing the category of the connection. More
information: Connection Role Category values
NOTE
Although All is selected by default, make sure you consider which types are appropriate for the connection role you are
adding.
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 DESCRIPTION
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
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.
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.
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.
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.
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.
NOTE
Developers will also be able to use these operators in code. More information Developer Documentation: Query hierarchical
data
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.
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
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.
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.
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
Connection Role Category A group describing the category of the connection. More
information: Connection Role Category values
NOTE
Although All is selected by default, make sure you consider which types are appropriate for the connection role you are
adding.
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.
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
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.
Unique Identifier A system field stores a globally unique identifier (GUID) value
for each record.
Legacy form No
You can use global option sets that are defined in your organization to configure values for the multi-select option
sets.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
Managed Shows only managed and 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.
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.
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.
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.
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.
Date Time
Use these fields to store time values. You can store values as early as 1/1/1753 12:00 AM.
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
Multi Select Option Set Displays a list of options where more than one can be
selected.
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.
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
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.
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
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
View fields
With solution explorer open, under Components expand Entities and select the entity where you want to create
or edit the field.
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
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
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
You can set additional options depending on your choice of Data type. More information: Field Data types
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.
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
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
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
FORMAT DESCRIPTION
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.
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.
PROPERTY DESCRIPTION
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.
Use the other icons in the options toolbar to perform the following operations:
ICON OPERATION
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.
FORMAT DESCRIPTION
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
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
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.
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.
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.
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.
5. You can now use this option set by creating new field on an entity.
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
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
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.
Use the other icons in the options toolbar to perform the following operations:
ICON OPERATION
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.
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.
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:
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.
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 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.
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.
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.
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.
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.
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)
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.
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.
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.
Prerequisites
To follow this topic, you must switch to an environment in which you can create and edit entities.
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:
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Open the Fields tab and select the Account Number field.
In Step 2, for the Case entity, add all assets.
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.
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.
NOTE
Only one SiteMap customization can be applied between publishing. Any unpublished SiteMap customizations will be lost
when a new SiteMap definition is imported.
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.
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.
STATE DESCRIPTION
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.
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.
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.
Plug-in or workflow activity il-specify-column Avoid selecting all columns via Common
Data Service query APIs.
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-avoid-crm4-event Don't use Microsoft Dynamics CRM 4.0
plug-in registration stage.
Plug-in or workflow activity il-use-autonumber-feature Use the auto number feature instead of
a custom auto numbering solution.
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.
"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.
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.
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.
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.
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.
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.
For more information about version numbers, see Clone solution and clone patch version numbers in this article.
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.
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.
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.
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
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.
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).
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.
Outlook Synchronization Allow Address Book Synchronization Indicates whether background address
book synchronization in Microsoft
Office Outlook is allowed.
ISV Config Service Calendar Appearance You can define visual styles for service
Configuration calendars.
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.
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.
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.
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.
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.
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.
For more information about version numbers, see Clone solution and clone patch version numbers in this article.
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.
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.
NOTE
You must have a paid Power Apps plan to use dataflows, but you are not charged separately for using dataflows.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
Field Service System Job msdyn_fieldservicesystemjob Dynamics 365 for Field Service
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
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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]' ))
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.
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).
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 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
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.
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
AadError Azure Active Directory Errors Azure Active Directory Errors Azure Active Directory Errors
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.