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

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,354)