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

Filter gallery with dropdown

Hello friends,

I have a question, I have a gallery in my power app and the gallery shows me the information when all the statements
are true, but now I need a way to keed this function and also be able to filter with just one dropdown,
Like in excel when you select "Date" and then "name", it will give you the information under that date and just that
specific name, this is my button configuration, any suggestion or idea (Can be in Spanish or English).
My button:
image.png

 

Now its showes like this: 

image.png

 

I need a way to filter using all the options or just two or just one 

thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User
Super User

Re: Filter gallery with dropdown

I have a page with 10 different filters.  The user can apply none, all or something in between.  I use a series of If's in my filter to determine which criteria to use.  The very first criteria (RMRegion = ConsultantRegion) is always used, the rest are variable.  I use the 1=1 in my IFs for clarity to say I'm not using this test -- so don't throw anything out (1=1 will always be true).  You should be able to write something similar for your set of filters.

Filter(colResources, 
     RMRegion = ConsultantRegion,
     If(ContainsSpecial, 1=1, Left(ConsultantCountry,13) = "United States", ConsultantArea in colGeoFilter.RMGeo, ConsultantCountry in colGeoFilter.RMGeo),
     If(IsBlank(txtName.Text), 1=1, txtName.Text in Title || Upper(txtName.Text) in Upper(QuicklookID)),                           
     If(txtArea.Selected.Result = " None selected", 1=1, 
          ConsultantLocation in Filter(Filter(colGeo,txtArea.Selected.Result = Area).d0rf,!IsBlank(d0rf)) || 
          ConsultantCountry in Filter(colGeo,txtArea.Selected.Result = Area).Geo),     
      If(txtCountry.Selected.CountryName = " None selected", 1=1, ConsultantCountry = txtCountry.Selected.CountryName) || 
          (!IsBlank(ConsultantLocation) && ConsultantLocation in Filter(colGeo,txtCountry.Selected.CountryName = Geo).d0rf), 
     If(txtLocation.Selected.Result = " None selected", 1=1, ConsultantLocation = txtLocation.Selected.Result), 
     If(txtPractice.Selected.Result = " None selected", 1=1, ConsultantPractice = txtPractice.Selected.Result),
     If(txtSubpractice.Selected.Subpractice = " None selected" || IsBlank(txtSubpractice.Selected.Subpractice), 1=1, 
         ConsultantSubpractice = txtSubpractice.Selected.Subpractice),
     If(txtRole.Selected.Role = " None selected", 1=1, ConsultantRole = txtRole.Selected.Role),
     If(IsBlank(txtKeyword.Text),1=1, txtKeyword.Text in Keywords),
     If(ddCitizenship.Selected.CountryName = " None selected",1=1, ddCitizenship.Selected.CountryName in Citizenship),
     If(IsBlank(txtClearance.Text),1=1, txtClearance.Text in Clearance))

 

View solution in original post

Community Support Team
Community Support Team

Re: Filter gallery with dropdown

Hi @felipewltc ,

Could you please share a bit more about your scenario?

Do you want to filter your Gallery Items based on any combination of your DatePicker, Dropdown box and Text Input box?

 

Based on the issue that you mentioned, I think If function could achieve your needs. In addition, you could consider use ComboBox control to list all available options rather than Dropdown control, because, in default, there is no option selected within the ComboBox, and you could clear the selection within the ComboBox.

I have made a test on my side, please consider modify your formula as below (set the Items property of the Gallery to following😞

Filter(
       'Work Flow Tool 4.0 - WFT',
        Text(Created, DateTimeFormat.ShortDate) = Text(Fechas, DateTimeFormat.ShortDate),
        If(
           IsBlank(PriorityMenuComboBox.Selected.Value),
           true,
           Priority.Value = PriorityMenuComboBox.Selected.Value
        ),
        If(
           IsBlank(TeamMenuComboBox.Selected.Value),
           true,
           Team.Value = TeamMenuComboBox.Selected.Value
        ),
        ...,
        If(
           IsBlank(TextInputBox.Text),
           true,
           FilterTextColumn = TextInputBox.Text
        )
)

 

Please consider take a try with above solution, then check if the issue is solved.

 

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.

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

Re: Filter gallery with dropdown

I have a page with 10 different filters.  The user can apply none, all or something in between.  I use a series of If's in my filter to determine which criteria to use.  The very first criteria (RMRegion = ConsultantRegion) is always used, the rest are variable.  I use the 1=1 in my IFs for clarity to say I'm not using this test -- so don't throw anything out (1=1 will always be true).  You should be able to write something similar for your set of filters.

Filter(colResources, 
     RMRegion = ConsultantRegion,
     If(ContainsSpecial, 1=1, Left(ConsultantCountry,13) = "United States", ConsultantArea in colGeoFilter.RMGeo, ConsultantCountry in colGeoFilter.RMGeo),
     If(IsBlank(txtName.Text), 1=1, txtName.Text in Title || Upper(txtName.Text) in Upper(QuicklookID)),                           
     If(txtArea.Selected.Result = " None selected", 1=1, 
          ConsultantLocation in Filter(Filter(colGeo,txtArea.Selected.Result = Area).d0rf,!IsBlank(d0rf)) || 
          ConsultantCountry in Filter(colGeo,txtArea.Selected.Result = Area).Geo),     
      If(txtCountry.Selected.CountryName = " None selected", 1=1, ConsultantCountry = txtCountry.Selected.CountryName) || 
          (!IsBlank(ConsultantLocation) && ConsultantLocation in Filter(colGeo,txtCountry.Selected.CountryName = Geo).d0rf), 
     If(txtLocation.Selected.Result = " None selected", 1=1, ConsultantLocation = txtLocation.Selected.Result), 
     If(txtPractice.Selected.Result = " None selected", 1=1, ConsultantPractice = txtPractice.Selected.Result),
     If(txtSubpractice.Selected.Subpractice = " None selected" || IsBlank(txtSubpractice.Selected.Subpractice), 1=1, 
         ConsultantSubpractice = txtSubpractice.Selected.Subpractice),
     If(txtRole.Selected.Role = " None selected", 1=1, ConsultantRole = txtRole.Selected.Role),
     If(IsBlank(txtKeyword.Text),1=1, txtKeyword.Text in Keywords),
     If(ddCitizenship.Selected.CountryName = " None selected",1=1, ddCitizenship.Selected.CountryName in Citizenship),
     If(IsBlank(txtClearance.Text),1=1, txtClearance.Text in Clearance))

 

View solution in original post

Community Support Team
Community Support Team

Re: Filter gallery with dropdown

Hi @felipewltc ,

Could you please share a bit more about your scenario?

Do you want to filter your Gallery Items based on any combination of your DatePicker, Dropdown box and Text Input box?

 

Based on the issue that you mentioned, I think If function could achieve your needs. In addition, you could consider use ComboBox control to list all available options rather than Dropdown control, because, in default, there is no option selected within the ComboBox, and you could clear the selection within the ComboBox.

I have made a test on my side, please consider modify your formula as below (set the Items property of the Gallery to following😞

Filter(
       'Work Flow Tool 4.0 - WFT',
        Text(Created, DateTimeFormat.ShortDate) = Text(Fechas, DateTimeFormat.ShortDate),
        If(
           IsBlank(PriorityMenuComboBox.Selected.Value),
           true,
           Priority.Value = PriorityMenuComboBox.Selected.Value
        ),
        If(
           IsBlank(TeamMenuComboBox.Selected.Value),
           true,
           Team.Value = TeamMenuComboBox.Selected.Value
        ),
        ...,
        If(
           IsBlank(TextInputBox.Text),
           true,
           FilterTextColumn = TextInputBox.Text
        )
)

 

Please consider take a try with above solution, then check if the issue is solved.

 

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.

View solution in original post

felipewltc
Level: Powered On

Re: Filter gallery with dropdown

Thank you, you are a lifesaver! 

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,771)