Forum Discussion

Brent Ellis's avatar
Brent Ellis
Silver Contributor
Jan 19, 2018

PowerApps Rule (hide or disable if you are not in a particular Group)?

I am messing with PowerApps, and trying to see if it is possible to hide of disable certain elements based on Group membership.

 

e.g. have a SharePoint Group (or maybe a Security Group) called "Test App Administrators"

If the user is in that group, they can edit certain fields

If the user is NOT in that group, then those fields are locked

9 Replies

  • BrettR's avatar
    BrettR
    Copper Contributor

    Brent Ellis Here's a blog I wrote on how to do this with Office 365 Groups.  All within PowerApps (No Flow or SharePoint required): https://thebaretta.blogspot.com/2019/07/powerapps-hide-buttons-objects-based-on.html

  • The only way to do something like this at this time is to create a list with the admin users. Then in the OnStart you would pull that list into a collection (e.g. colAdminUsers) and create a variable (e.g. gvIsAdmin) and set the value (true/false) by checking if the current user is listed in colAdminUsers. Now that gvIsAdmin is set you can use the variable with different fields to change the visibility, display mode or other properties.
    • Brent Ellis's avatar
      Brent Ellis
      Silver Contributor
      Interesting approach. I suppose its no different then managing the users as an actual SharePoint Group, just doing it in a different place.

      A single list called permissions, with the Title, and maybe another field (multi-user) should work. I'll have to start exploring this.
    • Mahendra Gohel's avatar
      Mahendra Gohel
      Copper Contributor

      Can you please give an example ? as i am new to PowerApps i don't know how to save this to collection and use it for show/hide.

Resources