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

Display gallery items with SP/AD Groups

Hi all,

 

Can we able to display Gallery Items based on the user groups ? (For example: There are 15 items in gallery, can GroupA users see only 5 items , Group B users see other 5 items and Group C can see all the 15 items) There are posts related for hiding/showing the button for different user groups. I am trying the same scenario with the gallery items in power apps canvas

 

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @Nikhil_01 :

Could you tell me:

  • Are you talking about Office 365 Groups?

If so,you can get the groups of the current user through the following formula (a table consisting of group names with only one column)

 

Office365Groups.ListOwnedGroupsV3().value.displayName

 

Note:You need to add an Office365Groups connectior.

1.JPG

So,the Items Property of the Gallery should be:

 

If(
   "GroupC" in Office365Groups.ListOwnedGroupsV3().value.displayName,
   Filter(XXXXXXX),
   "GroupB" in Office365Groups.ListOwnedGroupsV3().value.displayName,
   Filter(XXXXXXX),   
   "GroupA" in Office365Groups.ListOwnedGroupsV3().value.displayName,
   Filter(XXXXXXX)
)

 

Best Regards,

Bof

View solution in original post

2 REPLIES 2
DTreg1
Advocate IV
Advocate IV

Hello @Nikhil_01 

 

I've achieved this by creating a "RoleDefs" table for all the users to put them into the groups. On start, collect the "RoleDefs" table, Set(currentUserRole, Filter(RoleDefs, EMAIL = User().EMAIL).GROUP) then add a filter to the gallery where that group is equal to the "currentUserRole" group.

v-bofeng-msft
Community Support
Community Support

Hi @Nikhil_01 :

Could you tell me:

  • Are you talking about Office 365 Groups?

If so,you can get the groups of the current user through the following formula (a table consisting of group names with only one column)

 

Office365Groups.ListOwnedGroupsV3().value.displayName

 

Note:You need to add an Office365Groups connectior.

1.JPG

So,the Items Property of the Gallery should be:

 

If(
   "GroupC" in Office365Groups.ListOwnedGroupsV3().value.displayName,
   Filter(XXXXXXX),
   "GroupB" in Office365Groups.ListOwnedGroupsV3().value.displayName,
   Filter(XXXXXXX),   
   "GroupA" in Office365Groups.ListOwnedGroupsV3().value.displayName,
   Filter(XXXXXXX)
)

 

Best Regards,

Bof

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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