Would you like to know if Power Apps allows us to customize home screens for each user? Yes, this Power Apps tutorial will cover how to alter the home screen in the Power Apps Canvas app according to the different users.
Different Home Screen Based On Different User Power Apps
Let’s get started with step-by-step instructions for how to fulfill this desire.
Step – 1:
- First, use the verified login information to access Power Apps. Go to + Create and select the Blank app under Start from.
Step – 2:
- You can create various apps in Power Apps, including the Blank canvas app, Blank app based on Dataverse, and Power Pages website, which are all displayed on the Create page. Select the Blank canvas app and click on Create.
- Give the app a distinctive name (Different Home Screen depending on current user) and select either a Tablet or a Phone as the Format. Select Create.
Step – 3:
- The new canvas app will open with Screen1 as its default screen. Next, we must determine how many screens to make based on the number of users.
- For example, let’s say I have a total of three users from the SALES, IT, and FINANCE departments. I must make three distinct screens in Power Apps for three distinct users in order to achieve this.
- For this purpose, I have created three different screens i.e. SalesScreen, ITInfoScreen, and FinanceDetailsScreen.
- The Power Apps screen will therefore be visible to them depending on the users. For example:
- Only those employees who are available under the SALES department can see the SalesScreen.
- Only those accessible under the IT department can see the ITInfoScreen.
- Only those available under the FINANCE department can see the FinanceDetailsScreen.
The below screenshot represents all the Power Apps Home Page screens that I have created.
Step – 4:
- The app will then be connected to the Office 365 Users connectors. To add it, go to the Data tab -> + Add data -> Search Office 365 in the search bar -> Select Office 365 Users. The connector will appear below once you’ve added the connection to the app.
Step – 5:
- Next, apply the code below on App’s OnStart property:
OnStart = Set(vName, Office365Users.MyProfile().Department); If( vName = "SALES", Navigate(SalesScreen, ScreenTransition.None), vName = "IT", Navigate(ITInfoScreen, ScreenTransition.None), vName = "FINANCE", Navigate(FinanceDetailsScreen, ScreenTransition.None))
- vName = Variable name
- Office365Users.MyProfile().Department = It will retrieve the department of the current user.
- “SALES“, “IT“, “FINANCE” = Department names
- Navigate = Power Apps Navigate function helps to redirect from one screen to another screen.
- But there will be an issue after we will apply the code on App’s OnStart property. You would receive troubles in the studio if you tried to use Navigate() in OnStart:
“Navigate is not permitted in OnStart. Use the StartScreen property instead.” (Refer to the above screenshot)
- We will switch to the StartScreen property and write the exact code because the error suggests applying the above code to the App’s StartScreen property.
- However, suppose we apply the code to the StartScreen property. In that case, we will also encounter an error similar to the “Behavior function in a non-behavior property. You can’t use this property to change values elsewhere in the app.” as below.
Step – 6:
- Further research on this mistake led me to a solution that required me to enable an outdated feature under the settings menu. The navigate feature will operate on the app’s OnStart property after we enable it.
- To enable this feature, go to Settings (top of the page) -> Select Upcoming features -> Click on the Retired tab -> Enable Navigate function in App.OnStart. Then close this page.
Step – 7:
- Save the app now, then publish (publish this version). The feature will not function if you choose not to publish the app. Therefore, once the app has been activated, make sure to save and publish it.
- Apply the same code once more to the app’s OnStart property after reopening it. However, it will still display a warning message like the previous one “Navigate is not suggested in OnStart, Use the StartScreen property instead for better performance“. But, the code will now function as needed.
Step – 8:
- Save and publish the app once more. You can access Power Apps using several accounts (for testing purposes) and view the particular screen for a specific user.
- You must first share the app with users before you can proceed (those who want to show different kinds of home screens).
- I went to Power Apps to test the app, and when I logged in as an IT user, I was prompted to grant the Office 365 Users permission. When we gave it permission, the precise IT Info Screen depicted in the figure below appeared.
- Similar to this, the Sales and Finance teams’ respective home screens appeared when I logged in to Power Apps for those users.
This is how we can build Power Apps Different Home Screen Based On Different Users.
This is how we can create different home screen based On Different User in Power Apps. Also, we saw how to resolve this issue “Navigate is not permitted in OnStart. Use the StartScreen property instead.” while working with the Power Apps OnStart property.
Furthermore, have a look at some more Power Apps Tutorials:
- Power Apps Sort Function [With 19 useful examples]
- Power Apps Sort Gallery [With 15 Useful Examples]
- PowerApps Search Function + How to use with example
- Power Apps Search SharePoint List Examples
- Power Apps Dataverse Yes/No Field
- How To Get Row by ID From Dataverse Table
- How To Get Dataverse List Rows Count Using Power Automate
- Power Apps Dataverse Choices [Complete Guide]
- Scan Barcodes using Power Apps Barcode Reader
I am Bijay a Microsoft MVP (8 times – My MVP Profile) in SharePoint and have more than 15 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com