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

  • Travis Jefferds's avatar
    Travis Jefferds
    Copper Contributor

    Brent Ellis 

    probably obsolete answer now, but Reza addresses this in linked vid. I wish it was simpler but this workaround isn't horrible. https://www.youtube.com/watch?v=dIzOAbMjN7g

  • 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

  • Ben McMann's avatar
    Ben McMann
    Copper Contributor

    My colleague, Geetha, wrote a blog post outlining how to do this using Flow and SharePoint Groups.  https://svaghub.wordpress.com/2018/11/03/role-based-security-in-powerapps-using-spgroups/

     

     

  • 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.
      • Sohail Merchant's avatar
        Sohail Merchant
        Brass Contributor
        This might be little late but hopefully others will find it useful. Showing exactly how to do achieve this:
        https://www.youtube.com/watch?v=LRGfH7bOhNA
    • 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