cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JimboSey
Helper V
Helper V

Filter gallery by dropdown

Hi, 

 

I currently have a full functioning App, which basically uses a form to log maintenance items, and then shows them in a Gallery, I have applied several filters on the Gallery, but now I need to update the functionality slightly. 

This is the code I have now on the Gallery 

 

 

Filter(

Filter(MaintRequests,

(Status.Value = Status_Radio_1.Selected.Value

||

Status_Radio_1.Selected.Value = Blank())

&&

((Checkbox_Me_1.Value && Owner.Email = User().Email)

||

Checkbox_Me_1.Value = false && Checkbox_Other_1.Value = false)

||

(Checkbox_Other_1.Value && Owner.Email = Resource_ComboBox_1.Selected.Email))

,

TextBox_1.Text in Title & Code)

 

 

This all works fine, but what I want to add now, is a combobox on the main screen of my App (from a choice column in SP) which filters the gallery based on that dropdown selected. 

Lets say the new combobox will be called projectnamedropdown.

End result I'd like is the gallery to filter accordingly from the projectnamedropdown selected.

Thanks 
J

1 ACCEPTED SOLUTION

Accepted Solutions

@JimboSey You will add it to your inner Filter like this,

Filter(
	Filter(MaintRequests,
		(Status.Value = Status_Radio_1.Selected.Value
		||
		Status_Radio_1.Selected.Value = Blank())
		&&
		((Checkbox_Me_1.Value && Owner.Email = User().Email)
		||
		Checkbox_Me_1.Value = false && Checkbox_Other_1.Value = false)
		||
		(Checkbox_Other_1.Value && Owner.Email = Resource_ComboBox_1.Selected.Email)
		&&
		projectname.Value = projectnamedropdown.Selected.Value
	)
	,
TextBox_1.Text in Title & Code)

Please remember to give a 👍 and accept my solution as it will help others in the future.

View solution in original post

5 REPLIES 5
CNT
Super User
Super User

@JimboSey You have to add one more condition to your Filter which will look like (change column, control name as needed),

projectname.Value = projectnamedropdown.Selected.Value

 

Please remember to give a 👍 and accept my solution as it will help others in the future.

Thanks for your speedy reply, 

I am quite a novice, so the code I quote above was a from a video I followed. So not entirely sure how/where to add the additional filter condition to my code. 

Thanks

@JimboSey You will add it to your inner Filter like this,

Filter(
	Filter(MaintRequests,
		(Status.Value = Status_Radio_1.Selected.Value
		||
		Status_Radio_1.Selected.Value = Blank())
		&&
		((Checkbox_Me_1.Value && Owner.Email = User().Email)
		||
		Checkbox_Me_1.Value = false && Checkbox_Other_1.Value = false)
		||
		(Checkbox_Other_1.Value && Owner.Email = Resource_ComboBox_1.Selected.Email)
		&&
		projectname.Value = projectnamedropdown.Selected.Value
	)
	,
TextBox_1.Text in Title & Code)

Please remember to give a 👍 and accept my solution as it will help others in the future.

Brilliant, I had to tweak the code slightly (see below) but it now works a treat, thanks so much

Filter(
	Filter(MaintRequests,
    LearningFormat.Value = projectnamedropdown.Selected.Value,
		(Status.Value = Status_Radio_1.Selected.Value
		||
		Status_Radio_1.Selected.Value = Blank())
		&&
		((Checkbox_Me_1.Value && Owner.Email = User().Email)
		||
		Checkbox_Me_1.Value = false && Checkbox_Other_1.Value = false)
		||
		(Checkbox_Other_1.Value && Owner.Email = Resource_ComboBox_1.Selected.Email)
		
		
	)
	,
TextBox_1.Text in Title & Code)

@JimboSey 

Glad to help!

 

Please remember to give a 👍 and accept my solution as it will help others in the future.

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 (3,877)