cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PeterDonohue
Level: Powered On

Filter Gallery to Managers

I have a SP list with people picker column (Responsible_Officer) and I'm trying tto create a gallery that displays only the managers from the list.

I'd like to customise the gallery by adding extra labels to show volumes of statuses for each manager.

 

So far I can determine if someone is a manager using:

On Visible

ClearCollect(
    myReports,
    Office365Users.DirectReports(
        Office365Users.MyProfile().Id))

Items

CountRows(myReports) > 0

I'm just having trouble with my syntax

 

I'm thinking I need to 

  1. AddColumns  and determine if the Responsible_Officer is a manager
  2. Filter by just the managers
  3. GroupBy Managers

I'm just stuck on how to write it Smiley Happy

 

Thanks

1 REPLY 1
Community Support Team
Community Support Team

Re: Filter Gallery to Managers

Hi @PeterDonohue,

Do you want to only display managers from your SP list within the Gallery?

If you want to display managers from your SP list within the Gallery, I have made a test on my side, please take a try with the following workaround:5.JPG

Set the Items property of the Gallery to following:

Filter(
AddColumns('20190211_case5', "IsManager", If(CountRows(Office365Users.DirectReports(Responsible_Officer.Email))>0, true, false)),
IsManager = true
)

On your side, you should type following:

Filter(
AddColumns('YourSPList', "IsManager", If(CountRows(Office365Users.DirectReports(Responsible_Officer.Email))>0, true, false)),
IsManager = true
)

 

In addition, if you want to group by Managers records, I have made a test on my side, please take a try with the following workaround:6.JPG

 

7.JPG

Set the Items property of the Gallery (Outer Gallery) to following:

GroupBy(
Filter(
AddColumns(
'YourSPList',
"IsManager", If(CountRows(Office365Users.DirectReports(Responsible_Officer.Email))>0, true, false),
"ManagerName", Responsible_Officer.DisplayName
),
IsManager = true
),
"ManagerName",
"GroupData"
)

Within the Gallery (Outer Gallery), add a Label control, set the Text property to following:

CountRows(ThisItem.GroupData)

Note: We could not group Filtered Managers reocrds by Person column directly using GroupBy function.

More details about GroupBy function, please check the following article:

GroupBy function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.