cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sbgoh
Post Patron
Post Patron

Filter gallery by default value in combo box

Hi,

I have a combo box "Stage" that acts as a filter for the gallery. I am using Sharepoint list and "Stage" is a choice field with data "New, Closed, Cancelled". When the page is loaded, I hope to display all the items with "Stage = New". I tried to change the defaultselecteditem = ["New"] but it don't seems working to filter the gallery list. 

Does anyone has any advise on this? THanks in advance. 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Anonymous
Not applicable

@sbgoh 

Ive seen my supplied code work before but I'm not surprised that it didn't work.

 

@Krishna92 code should've worked for you, can you please supply the exact code you used with that method?

View solution in original post

v-siky-msft
Community Support
Community Support

Hi @sbgoh ,

 

Please refer to the following steps:ac

Set the Items property of Gallery:

Filter(Listname,Stage.Value=ComboBox1.Selected.Value)

 Set the Items property of Combobox:

Choices(ListName.Stage)

Set the DefaultSelectedItems property:

LookUp(Choices(ListName.Stage), Value="New")

 Then it should work as you expected.

Sik

View solution in original post

6 REPLIES 6
Krishna92
Microsoft
Microsoft

@sbgoh 

 

Try setting up the filter formula on the items property of the Gallery.

 

the formula has to be Filter(Listname,Columnname = Combobox.selected.value)

 

Please refer to the document  for more information related to filter function.

 

If the information helps you, please consider giving a thumbs up and mark solution as resolved

Anonymous
Not applicable

@sbgoh 

Try this in the DefaultSelectedItems

{Stage: "New"}

I used this method "Filter(Listname,ColumnName = Combobox.selected.value)" but the gallery don't see to read the DefaultSelectedItems value that I set in the combo box. 

I also tried to set the DefaultSelectedItems={Stage: "New"} to the following but nothing is filtered.

 
 
 

sbgoh_0-1594379606787.png

 

 

 

 

Anonymous
Not applicable

@sbgoh 

Ive seen my supplied code work before but I'm not surprised that it didn't work.

 

@Krishna92 code should've worked for you, can you please supply the exact code you used with that method?

v-siky-msft
Community Support
Community Support

Hi @sbgoh ,

 

Please refer to the following steps:ac

Set the Items property of Gallery:

Filter(Listname,Stage.Value=ComboBox1.Selected.Value)

 Set the Items property of Combobox:

Choices(ListName.Stage)

Set the DefaultSelectedItems property:

LookUp(Choices(ListName.Stage), Value="New")

 Then it should work as you expected.

Sik

It is working now. Thanks!

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 (5,586)