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 Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,862)