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

How to filter a gallery based of the count of another list

SPList1 = Event List

SPList2 = Signup form for event list

 

Here is the process. SPList1 has all the events available for sign up and it has a column called Volunteers Needed which is the number of people needed for each event

 

SPList 2 is the signup sheet. 

 

I need to be able to filter out an event in a gallery when the count of signees for an event on SPList2 equals the number of volunteers needed on SPList1

 

The filter code below doesn't work. Do I need to create a second collection instead?

Any help would be awesome

 

Filter(SPList1,
         EventType="Project",
        EventSupportSearchDate<=Today(),
       SupportStaffNeeded= true,
       EventSupportSearchDate<=Today(),
      LastDaytoRegister>=Today(),
     Not(EventName in UserSignUpList.EventName),
    EventLeader.DisplayName<>Var_OfficeName,
   EventName && VolunteersNeeded=(CountRows(Filter(SPList2, EventName))))

1 ACCEPTED SOLUTION

Accepted Solutions
EricLott
Level 10

Re: How to filter a gallery based of the count of another list

You can use this to build on to your event list. This would replace the general SPList1 reference in your filter.

 

AddColumns(SPList1,"EventFull",CountRows(Filter(SPLst2,EventID=[@EventID]))>=NumberOfSupportStaffNeeded)

 

 Here is the docs for AddColumns()

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-table-shaping

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

View solution in original post

2 REPLIES 2
EricLott
Level 10

Re: How to filter a gallery based of the count of another list

You can use this to build on to your event list. This would replace the general SPList1 reference in your filter.

 

AddColumns(SPList1,"EventFull",CountRows(Filter(SPLst2,EventID=[@EventID]))>=NumberOfSupportStaffNeeded)

 

 Here is the docs for AddColumns()

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-table-shaping

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

View solution in original post

Becca51178
Level: Powered On

Re: How to filter a gallery based of the count of another list

Thank you! This worked great!

Helpful resources

Announcements
thirdimage

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (6,188)