cancel
Showing results for 
Search instead for 
Did you mean: 
LRVinNC

Tip: Include a Demo Function in your App

Do you frequently need to demonstrate the functionality of an application that operates differently based on on the specific user logged on? Or perhaps you are providing support and need to be able to quickly diagnose user issues?  Consider building in a demo function.

I frequently found myself doing demos and training on a multi-persona application that included unique user experiences for five different groups of users:
1.  Individual users

2.  Managers

3.  Resource Managers

4.  Regional Resource Manager Administrators

5.  Global Support Staff

 

When I first wrote my application, I found myself adding lines of code to the App.OnStart to tell the system I was a different user than I really was.  This got old fast and was an accident waiting to happen if I published the app with this additional code still activated. 

Sp, in order to readily demonstrate application performance for each of these types of users, I created a demo function accessed by a demo button on the home page which was displayed ONLY for me by setting the visible property of the button with a condition that evaluates to true like User().Email = "myemail@domain.com".

Demo1.jpg
Selecting Demo will navigate to a simple screen full of additional buttons.

Demo2.jpg

 

Under normal operations (without using the demo button), the application detects my identity during the App.OnStart and then displays the appropriate content.  Using the demo buttons allows me to override the normal operations and masquerade as a different user.

 

For example,  clicking on "Demo based on Email Address", opens a text input field to enter an email address.  If I enter the email address of a consultant, I see the simplest interface which simply allows the individual to submit and display their own documents.  If instead, I enter the email address of a manager, I will display the manager screen which will list all of the manager's direct reports.
Additionally, I can enter the email address of a resource manager or region admin to see the what that individual resource manager is would be seeing on their screen.  This is a tremendous time saver when providing support or diagnosing problems in the field.  

Be sure to provide a button to allow you to return to normal operations.  This may include additional buttons to reset variables used when working as an alternate persona.  For example, the "Set as Global" button shown above, will reset a variable to indicate I am working as the global support person.

Exactly how you set up your demo controls will vary, but adding this simple feature to your application can save you time and effort in the future.

Comments

@LRVinNC great idea, I might start using this concept myself!!

Meet Our Blog Authors
  • PowerApps Community Mentor 2018, Practicing surgeon and former Professor of Surgery, University of Illinois, Chicago.
  • Jill of All Trades (Power Apps, SharePoint, PowerShell, Exchange, Power Automate and odds & ends of assorted other things)
  • I am the Owner/Principal Architect at Don't Pa..Panic Consulting. I've been working in the information technology industry for over 30 years, and have played key roles in several enterprise SharePoint architectural design review, Intranet deployment, application development, and migration projects. I've been a Microsoft Most Valuable Professional (MVP) 12 consecutive years and am also a Microsoft Certified SharePoint Masters (MCSM) since 2013.
  • I'm Tim Leung - a PowerApps builder. In addition to PowerApps, my main interests include building software with SQL Server and Microsoft .NET. I'm the author of 'Beginning PowerApps' - the first published book on PowerApps. You can buy this from Amazon and other leading bookstores.
  • Systems developer
  • My name is Timothy Shaw and I create digital solutions using the Power Platform, Office 365, and Azure SQL and handle the IT for a small company in the energy sector. When not building the future :), I enjoy playing guitar, good (or really bad!) sci-fi, Xbox therapy, and hanging with my wife and son. Twitter: @ShortForTim