I'm trying to hide some tab from a form, like a Field Security Profiles.
Is it possible?
You can use the visible property to hide almost any control on a PowerApps screen. I have an app where I check to see if the logged in user is listed in the admin list and if so, sets a global variable gvIsAdmin to true. Then I am hiding the last two rows of fields on the form if the user isn't an admin by setting the visible property of the datacards to gvIsAdmin.
So how you define and maintain the roles and users?
My app is leveraging a SP List to maintain an admin user table, and then I use:
If(CountIf(Role, User.Email = User().Email)>0, something true, something false) to control the behaviour of my app.
In my case I have a list called "PowerApps Roles" and each item in the list is a role (Title field) and each role item has a person field (Users) with a list of users in that role. Then on the start of my app I run this code to identifiy if the logged in user is in the admin role.
ClearCollect(colAdmins, LookUp('PowerApps Roles', Title = "Admins", Users));
Set(gvIsAdmin, !IsBlank(LookUp(colAdmins,Concatenate("i:0#.f|membership|", gvCurrentUser.Email) in Claims, DisplayName)))
*The reason I am using "Claims" instead of "Email" is because our tenant doesn't use the email address as the UPN and User().Email actually returns the UPN and not the Email address. For most tenants this doesn't matter because their Email and UPN are the same.
I'm trying to do what you told me, but I'm tryng to see where should I go to be able to apply some code to Hide/unhide tabs...
I don't recognize the screenshot. What type of PowerApp is this (Canvas, Model or Portal)?
Check out the on demand sessions that are available now!
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Features releasing from October 2020 through March 2021
Check out the Power Platform Community Highlights