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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Can I make each person...
Power Apps
Answered

Can I make each person look at a different screen?

(0) ShareShare
ReportReport
Posted on by 25

Hello
I want to make an electronic authorization system in the company.

The function I want is, for example, that I want the management support department and the marketing department to see a different screen.
If you click on the Enter Form screen for the Management Support department, you can see the form assigned to the Management Support department.

I hope it will be implemented similarly in other ways.
What I want is not to see other departments' documents, forms, and screens.

Categories:
I have the same question (0)
  • BCLS776 Profile Picture
    8,994 Moderator on at

    Yes, you can use features such as 365 Groups or column values to classify users, and then have them navigate to specific screens based on that info.

     

    Keep in mind, this is not a security feature; some data sources (such as SharePoint lists) must be shared in their entirety with all users in order for the app to work.

     

    Hope that helps,

    Bryan

  • hyunjin904 Profile Picture
    25 on at

    Is there a document that I can explain the function in more detail or see the relevant practice? I'd appreciate it if you could explain it in more detail. Thank you very much.

  • BCLS776 Profile Picture
    8,994 Moderator on at

    Yes, here is the documentation for using the Office365Groups connector, which is one of my favorite ways to do this. Make sure your users belong to 365 Groups that allow you to distinguish them.

     

    Then, in your app use Office365Groups.ListOwnedGroupsV3().value as a table to Lookup or Filter for the specific group name. The displayName column contains the name of the group, and this connector runs under the context of the currently logged-in user.

     

    From there you could set a global variable marking this user as a particular role and then use that variable in an If() statement combined with Navigate() to take your user to the designated screen.

    Those are high-level descriptions, but let us know if you need more info.

    Bryan

  • hyunjin904 Profile Picture
    25 on at

    I don't quite understand. Can you give me a more detailed explanation or example? I'd really appreciate it if you could explain it. thank you.

  • Verified answer
    Irfan Profile Picture
    164 on at

    The way of how I have achieved it is by defining roles in the application and than adding users to those specific role.
    Eg: I have defined a role "Super User" in my application. Through Office365 connector, I can add different users to that role. On my home screen, when a user clicks on the navigate button, I do a check whether if the logged in user is a part of the role "Super User", if so, he is then navigated to a different screen. If not, he is navigated to a regular screen.
    In this way, I dont need to rely on the accuracy of Office365Groups as that might change in future and I wont have a direct control over that change. But also, in my case, the role "Super Users" have only have a limited no of users. Also, I need to than manually manage the super users in case if more users are required to be added in the application. This is similar to any enterprise grade application where you have to manage your application users manually within the app.

     

    Let me know if you need more info. I can post some screenshots with the way of how I have achieved it.

  • hyunjin904 Profile Picture
    25 on at

    Could you post a screenshot and a brief description? Thank you.  ã…  ã…  

  • Irfan Profile Picture
    164 on at

    Cool. Will start my sharepoint list. It only has 3 columns - UserType, UserName, UserEmail.

    In this way, you can define various roles.

    Irfan_1-1628666505692.png

     

     

    In my app, where I manage Super Users

    Irfan_2-1628666617653.png

     

    Items for my dropdown (control name is cb_SUSearch). Basically, I am only filtering those records to appear in my dropdown where city is not blank. This removes any accounts such as service accounts etc. Based on your setup, you might need a different filter or you might not need a filter at all.


    If(IsBlank(cb_SUSearch.SearchText),
    Filter(Office365Users.SearchUser(), IsBlank(City)=false),
    Filter(Office365Users.SearchUser({searchTerm: cb_SUSearch.SearchText, top: 20}), IsBlank(City)=false)
    )


    Next is on change property of the ComboBox. 

    Set(AdmName,cb_SUSearch.Selected.GivenName & " " & cb_SUSearch.Selected.Surname);
    Set(AdmEmail,cb_SUSearch.Selected.UserPrincipalName);

    This basically updates my variables which I'll use when patching.

    Irfan_3-1628666939221.png

    You can skip this if you wish to refer to the Combobox directly while patching.

     

    Finally your patch command on the "Add" icon:

     

    Patch(LOTO_Users,Defaults(LOTO_Users),{UserType:"Super User",UserName:AdmName,UserEmail:AdmEmail});
    Reset(cb_SUSearch);
    Set(AdmName,"");
    Set(AdmEmail,"");
    ClearCollect(collection_SuperUsers, Filter(LOTO_Users,UserType = "Super User"));

     

    As you can see, I have collected my Super Users in a collection. I have used the same command on my OnStart of the app. This allows the app to recognize the logged in user when the app loads.

    Irfan_4-1628667166027.png

     

    Also,   when the app loads, I have initialized a couple of variables which holds the logged in user name and logged in user email. 

     

    Irfan_5-1628667299488.png

     


    //Custom Variables for Email and UserName
    Set(LoggedinUserEmail,User().Email);
    //Set(userName,First(Office365Users.SearchUser({searchTerm:userEmail}).DisplayName).DisplayName);
    Set(LoggedinUserName,First(Office365Users.SearchUser({searchTerm:LoggedinUserEmail}).GivenName).GivenName & " " & First(Office365Users.SearchUser({searchTerm:LoggedinUserEmail}).Surname).Surname);

     

    So now, you have the required setup to drive your screens in your application. In my application, I have used it to hide or display a settings icon based on the user who has logged in. The cog wheel on the right side of the screen basically has access to "Setup" items of my app including the ability to add more super users. 

     

    Irfan_6-1628667391703.png

     

    Visible property of that icon:

    If(LoggedinUserEmail in collection_SuperUsers.UserEmail,true,false)

     

    LoggedinUserEmail variable is initalized when user first logs in.

    The above command checks if the logged in user email exists in our collection of super users. If the email exists, the icon is visible. If not, the icon is not visible.

    You can use this in your app to drive the users to different screens as per your setup.

     

    In the above example, I have only used one role "Super User". In my other app, I have used 5 different roles. But as an app maker, you do not want to sit and keep on adding/removing users. Thus, I requested business to nominate their super usrers. Those super users are now managing which users have what level of control in the app.

     

    Hope that helps.

     

    -Irfan

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard