

#Microsoft office showhide code
Write this code in the OnStart property of the app. Include a red Settings button that will show/hide based on the current user. Open Power Apps Studio and create a new app that looks like the one shown below. If the hardcoded email ever needs to be changed we must edit and republish the app because the email address is hardcoded instead of being retrieved from a datasource.Ĭheck The Current App User’s Email Address This is the easiest option to show/hide a button but it has a disadvantages over the other options. When both emails addresses match the button will show and when they do not match the button will be hidden. The simplest way to show or hide a button based on the current user is to compare their email address to an email address hard-coded into the app and see if it matches. Option #1: Show/Hide Button If Current User Matches Hardcoded Email Employees should not have access to the Settings Screen. When an Employee who is not a Project Manager logs into the app the Settings button becomes hidden. Pressing this button will navigate the app to a screen that only the Project Manager should see. When a Project Manager is logged the app’s menu shows a settings button. The Project Tracker app is used by Project Managers and other employees at a construction company to manage locations, review works orders and create invoices. Check The SharePoint List For Current App User.Check The Azure AD Group For Current App User Option #3: Show/Hide Button If Current User Is In SharePoint List.Check The Current Apps User's Email Address Option #2: Show/Hide Button If Current User Is In Azure AD Group.Introduction: The Project Tracker App Option #1: Show/Hide Button If Current User Matches Hardcoded Email In this article I will show 3 ways to show/hide a button in Power Apps so you can decide which one is best for you. But the better way is is to check if the current user belongs to a specific Azure AD group or is found in a SharePoint list. The quickest way is to comparing the current user’s email to a hardcoded value to see if it matches. Need to show or hide a button in Power Apps based on the current user? There are several ways to do it.
