web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Restricting Functions ...
Power Apps
Answered

Restricting Functions and Access

(0) ShareShare
ReportReport
Posted on by 278

Is there a way to restrict access to screens or functions (i.e. create or remove records from a data source) within an app?

I believe this can be easily done with an if statement within the visible property, but where can the groups or users be defined to ensure the restriction is enabled?

Categories:
  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @duncant ,

    Do you want to limit the function of creating or removing data source?

    There are two ways, let me explain them.

    1)give different users different permission of your data source.

    You should setting this in your data source.

     

    2)use if statement when creating or removing data source to justify users.

    You should set this in your app.

    For example, set the navigate button's OnSelect:

    If(User().Email="emailaddress1",Navigate(Screenupdate),
     Navigate(Screenread)
     )

    You could only set the submit button's OnSelect:

    If(User().Email="emailaddress1",Patch(...)) //please replace emailaddress1 with the emaill address that you want

    //only current user's email="emailaddress1", then he could submit the data

     

     

    Best regards,

  • duncant Profile Picture
    278 on at

    What if you want to limit access by group versus having to key in each email, how would you go about doing that?

  • Verified answer
    CU11011415-0 Profile Picture
    472 on at

    You can restrict access by determining if the user belongs to an Active Directory Security Group, SharePoint Group, or Office 365 Group.

     

    This is from a post I wrote on implementing security using the Office 365 Groups connector. 

    https://docs.microsoft.com/en-us/connectors/office365groups/

     

    My Post: https://powerusers.microsoft.com/t5/News-Announcements-Formerly/Components-Part-2-Theme-Component-Add-Security/ba-p/243604

    In the Parent, App - OnStart property add the following after where we detect if we are connected or not:

    // Detect if we are Online or Offline
    ...
    
    ClearCollect(
     BrandingSecurityGroup,
     Office365Groups.ListGroupMembers("[GROUP OBJECT ID]").value
    );
    If(
     Office365Users.MyProfile().DisplayName in BrandingSecurityGroup.displayName,
     Set(
     SharePointAccess,
     true
     ),
     Set(
     SharePointAccess,
     false
     )
    )

    Hope this helps.

  • duncant Profile Picture
    278 on at

    Lets say you are not using Common Data Services to restrict your data, but an excel spreadsheet instead.  What would you do then?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard