cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gowtham1907
Frequent Visitor

PowerApps Restrict users to view the Screens using data-verse

I am developing powerapps application to capture the requests from customer in my organization and ai am using data-verse is my backend.I have multiple screen tabs and i would like to show the screen tabs based on the logged in users.

1. New requests screen - To all users cane create new request from

2. My Pending Requests - Managers group people can see the screen

3.Admin screen- Only admin users can see the  screen

 

For thi s scenario how we can achieve it using data-verse and canvas apps . I knew if we used Sharepoint lists/library this is simple scenario. But using data-verse how we can meet this condition.

 

Please suggest any ideas or if you have sample applications share the link.Much appreciated for your help. 

1 ACCEPTED SOLUTION

Accepted Solutions
v-albai-msft
Community Support
Community Support

Hi @gowtham1907 ,

I want to add more information based on @zaphod88 ‘s answer about how to use Office 365 Groups connector.

Before doing this, you should have different O365 groups to keep different users. Like User-Group for normal users, Admin-Group for admin users. Then you can check in your app, if the login user is a member of the specified O365 group, navigate him/them to the specified screen.

For example, I have a group called “testpowerapp”, members in this group are all admin users. When selecting this group in admin center to see its detailed information, you can get its group ID from URL: 

v-albai-msft_0-1620632651930.png

 

In your app, you can set OnStart property of App to this formula(when admin user open this app, he will directly to to the Admin Screen 😞

If(User().Email in Office365Groups.ListGroupMembers("cdd2bc5c-a5ac-4516-8ab9-740a2b8974a2").value.mail,Navigate(AdminScreen))

 

Or, since all users can see the new request screen, you can add a button called "AdminScreen" in this request screen, and set its Visible property to:

If(User().Email in Office365Groups.ListGroupMembers("cdd2bc5c-a5ac-4516-8ab9-740a2b8974a2").value.mail,true)

Set its OnSelect property to:

Navigate(AdminScreen)

v-albai-msft_1-1620633040524.png

This time, anyone open this app will see the new request screen, if an admin do not want to add new request, he can click the "AdminScree" button to go to the Admin Screen(only admin can see this button). Same steps to configure a "ManagerScreen" button for "Managers group people".

Best regards,

Allen

View solution in original post

2 REPLIES 2
zaphod88
Responsive Resident
Responsive Resident

I have done this by using the Office 365 Groups connector or the Azure AD connector to save group members to a collection. Listing own groups with the O365 connector is unfortunately not working with security groups, but listing group members is.

Then you filter/lookup if User().Email is in the corresponding column and set a variable to true which is set as "Visible" of your navigaton controls. Of course, you have to create or have O365 groups or security groups beforehand. But this way, you don't need people picker columns at all.

v-albai-msft
Community Support
Community Support

Hi @gowtham1907 ,

I want to add more information based on @zaphod88 ‘s answer about how to use Office 365 Groups connector.

Before doing this, you should have different O365 groups to keep different users. Like User-Group for normal users, Admin-Group for admin users. Then you can check in your app, if the login user is a member of the specified O365 group, navigate him/them to the specified screen.

For example, I have a group called “testpowerapp”, members in this group are all admin users. When selecting this group in admin center to see its detailed information, you can get its group ID from URL: 

v-albai-msft_0-1620632651930.png

 

In your app, you can set OnStart property of App to this formula(when admin user open this app, he will directly to to the Admin Screen 😞

If(User().Email in Office365Groups.ListGroupMembers("cdd2bc5c-a5ac-4516-8ab9-740a2b8974a2").value.mail,Navigate(AdminScreen))

 

Or, since all users can see the new request screen, you can add a button called "AdminScreen" in this request screen, and set its Visible property to:

If(User().Email in Office365Groups.ListGroupMembers("cdd2bc5c-a5ac-4516-8ab9-740a2b8974a2").value.mail,true)

Set its OnSelect property to:

Navigate(AdminScreen)

v-albai-msft_1-1620633040524.png

This time, anyone open this app will see the new request screen, if an admin do not want to add new request, he can click the "AdminScree" button to go to the Admin Screen(only admin can see this button). Same steps to configure a "ManagerScreen" button for "Managers group people".

Best regards,

Allen

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,055)