A presentation I gave at ESPC 2018 (the European SharePoint, Office 365 and Azure Conference) about enterprise PowerApps. Focus areas include how to implement offline support, how to connect to on-premises data, and various tips for performance and management. I also talk about what I find to be the most important PowerApps functions from the list of 150+ that can be used in PowerApps formulas.
Enterprise PowerApps - Build Rich Apps with Offline Support and On-Prem Data
1. Enterprise PowerApps – Rich Apps
with Offline Support and On-
Premises Data
Chris O’Brien (MVP)
Independent/Content and Code
2.
3. Use Excel-like formulas – not code
To do Formula
“Next” button to change screen Navigate(MyScreen, ScreenTransition.Fade)
Add item to SharePoint list Patch(MySharePointList, Defaults(MySharePointList),
{
FirstName:TextInput1.Text,
LastName:TextInput2.Text
}
)
Add record to local collection
(cache)
ClearCollect(
SelectedProducts,
{
ID: ProductID,
Name: ”XT1000”
}
)
13. Functions for SharePoint data
Patch
• Add list item
Collect
• Fetch list item
Update
• Update list item
Delete
• Remove
Multi-page forms
Person/Group fields
Taxonomy fields
18. Working with data
Connection is hit when:
Data-related functions:
Connection (e.g.
a database)
Data source
(e.g. a table)
19. Using a Gallery control for navigation
The pattern
On start - define
collection of screens
(with ClearCollect)
Gallery OnSelect -
lookup screen from
selected item, then
navigate
22. Tips – key PowerApps functions
To do Use
Set a global variable available across all screens Set()
Set a context variable in a single screen UpdateContext() – and also Navigate()
Change screen Navigate(), Back()
Save a local record (e.g. for offline) Collect(), ClearCollect(), Update – use SaveData() to store
Open a web address/app Launch()
Get data on current user User()
Display a message banner Notify()
150+ functions in total. See:
https://docs.microsoft.com/en-
us/powerapps/formula-reference
23. Tips
Get used to:
Lots of fiddly work to generate PATCH command
Adding a “debug screen” with labels showing variables etc
“Declarative” variables
Variables and If statements
NOT:OnLoad-If(X){Label1.Visible=true}else{Label1.Visible=false}
INSTEAD:Label1.Visible=if(X,false,true)
Conditional display
Adda“rule”tocontrol,usepaneltoconfigurewhatpropertieswhichshouldbeset(e.g.Visible=false)
24. Be careful loading data sources
Tips - performance
https://powerapps.microsoft.com/en-
us/blog/tips-for-a-maintainable-extensible-app
https://powerapps.microsoft.com/en-
us/blog/performance-considerations-with-
powerapps/
Consider not loading OnStart (slow app load)
Load into local collections and consume those
Use Concurrent() if appropriate (e.g. multiple data sources)
Using a Connector? Avoid multiple trips to the server
25. Tips - using PATCH with SharePoint fields
To do Use
Update a choice/lookup from a dropdown Paternity_LengthOfPaternityLeave: {
'@odata.type':"#Microsoft.Azure.Connectors.
SharePoint.SPListExpandedReference",
Value: ddlPaternityLeaveDuration.Selected.Value,
Id: 1
}
Update a person field currentUser: {
'@odata.type':"#Microsoft.Azure.Connectors.
SharePoint.SPListExpandedUser",
Claims:"i:0#.f|membership|" & Lower(User().Email),
Email:User().Email,
JobTitle:".",
Picture:"."
}
30. My favourite recent/upcoming features
Available or in preview
• PowerApps web part in SharePoint!
• New size/layout options - choose size OR
use responsive (with formulas)
• Improved performance – parallel data load,
faster SharePoint forms
• App checker
• ALM – solution export/import
• Up to 20MB offline storage
• Message panel (Notify function)
Jan 2019
• Better debugging – e.g. in middle of formula
(Jan 2019)
• Easier cascading dropdowns (Jan 2019)
• Friendly SharePoint names in formulas
31. Takeaways
PowerApps can be VERY transformative for an org with lots of forms/processes
Very easy to get apps onto mobile devices
“Simple” requirements can sometimes be
difficult to implement
1
2
3
4 PowerApps are going to continue to evolve!