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

Filter a gallery from ClearCollect and Dropdown selection

I am creating a custom event calendar.  I use a connected SP list that contains the event start/end dates and a selectable column for who is to perform the event.  I utilize ClearCollect (colEvents) to gather all the events and place them in a child gallery but need to add a filter feature that allows me to only show a specific person's event.  My gallery displays the events using the following Filter:

 

Filter(colEvents, StartDate <= DateValue(lblCurrentDate.Text) And EndDate >= DateValue(lblCurrentDate.Text))

 

The dropdown items are as follows:

 

Choices('ConsultantActivity'.'Consultant')

 

How do I also incorporate the dropdown selection to the filter to display the events related to the individual selected?

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@scottypotty4x4 

If your Consultant column is a Person column, then your formula would be this:

Filter(colEvents, 
    StartDate <= DateValue(lblCurrentDate.Text) &&
    EndDate >= DateValue(lblCurrentDate.Text) &&
    Consultant.Email = yourDropdown.Selected.Email
)

If it is something other than a person column, then please adjust as necessary or post back with more details on it.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@scottypotty4x4 

If your Consultant column is a Person column, then your formula would be this:

Filter(colEvents, 
    StartDate <= DateValue(lblCurrentDate.Text) &&
    EndDate >= DateValue(lblCurrentDate.Text) &&
    Consultant.Email = yourDropdown.Selected.Email
)

If it is something other than a person column, then please adjust as necessary or post back with more details on it.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Anonymous_Hippo
Resolver I
Resolver I

Hi @scottypotty4x4 ,

 

In the below code replace "yourDropdown" with the control name of your dropdown...

Can you try the following code inside the items property of your gallery

Filter(colEvents, (StartDate <= DateValue(lblCurrentDate.Text) And EndDate >= DateValue(lblCurrentDate.Text)),(Len(yourDropdown.Selected.Value)=0 || 'Consultant'.Value in yourDropdown.Selected.Value))

 

 

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 (1,193)