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

Multiple combo filters on gallery

Hi,

I have a gallery with multiple filters on it and contains the following code for items property:

SortByColumns(Search(Filter('SEA MarketPlace New Item','Created By'.Email =varUser.mail),
TextSearchBox1_3.Text,"Title","Description"),"Created",Descending)

 

This allows me to see all records created by the current user sorted by most recent.

I have three other combo fields that I would like to create filters for on this same gallery but not sure how to add them to this formula:

1.  AvailabilityCombo

2.  CategoryCombo

3.  ConditionCombo

Would appreciate some help with this.  Thanks.

2 ACCEPTED SOLUTIONS

Accepted Solutions
joshieboy
Helper V
Helper V

Hi @Sunil-Narnaware 

They are all fields in the SEA Marketplace New Item list.  So Availability is a dropdown in the list, so too are Category and Condition. 

 

In a previous screen, I have this code which filters where availability = available and only shows items with that status but also has filters on the gallery in case users want to filter by Condition or Category.  See below.

 

With(
{
AvailableItems: Filter(
'SEA MarketPlace New Item',
Availability.Value = "Available"
)
},
SortByColumns(Search(Filter(AvailableItems,IsBlank(CategoryCombo_3.Selected) ||
CategoryCombo_3.Selected.Value ="All" || Category.Value=CategoryCombo_3.Selected.Value, IsBlank(ConditionCombo_3.Selected)
|| Condition.Value = ConditionCombo_3.Selected.Value),TextSearchBox1.Text,"Title","Description"),"Created",Descending)
)

 

 

Im trying to use the same SortByColumns piece in the other gallery which is filtered by the current user to only show "your submissions" but I also want the same filters for those users so from their submissions they can also filter by Availability, Category or Condition.  Hope this helps.

 

SortByColumns(Search(Filter('SEA MarketPlace New Item','Created By'.Email =varUser.mail),
TextSearchBox1_3.Text,"Title","Description"),"Created",Descending)

View solution in original post

HI @joshieboy ,

Try this way - all the top filter is Delegable, so you only need Search at the bottom

With(
   {
      AvailableItems: 
      Filter(
         'SEA MarketPlace New Item',
         Availability.Value = "Available" &&
         'Created By'.Email = varUser.mail &&
         (
            IsBlank(CategoryCombo_3.Selected) || 
            CategoryCombo_3.Selected.Value ="All" || 
            Category.Value=CategoryCombo_3.Selected.Value
         ) &&
         (
            IsBlank(ConditionCombo_3.Selected) || 
            Condition.Value = ConditionCombo_3.Selected.Value
         )
      )
   },
   SortByColumns(
      Search(
         AvailableItems,
         TextSearchBox1.Text,
         "Title",
         "Description"
      ),
      "Created",
      Descending
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

4 REPLIES 4
Sunil-Narnaware
Super User
Super User

@joshieboy  how your comboboxes are related to 'SEA MarketPlace New Item'?

joshieboy
Helper V
Helper V

Hi @Sunil-Narnaware 

They are all fields in the SEA Marketplace New Item list.  So Availability is a dropdown in the list, so too are Category and Condition. 

 

In a previous screen, I have this code which filters where availability = available and only shows items with that status but also has filters on the gallery in case users want to filter by Condition or Category.  See below.

 

With(
{
AvailableItems: Filter(
'SEA MarketPlace New Item',
Availability.Value = "Available"
)
},
SortByColumns(Search(Filter(AvailableItems,IsBlank(CategoryCombo_3.Selected) ||
CategoryCombo_3.Selected.Value ="All" || Category.Value=CategoryCombo_3.Selected.Value, IsBlank(ConditionCombo_3.Selected)
|| Condition.Value = ConditionCombo_3.Selected.Value),TextSearchBox1.Text,"Title","Description"),"Created",Descending)
)

 

 

Im trying to use the same SortByColumns piece in the other gallery which is filtered by the current user to only show "your submissions" but I also want the same filters for those users so from their submissions they can also filter by Availability, Category or Condition.  Hope this helps.

 

SortByColumns(Search(Filter('SEA MarketPlace New Item','Created By'.Email =varUser.mail),
TextSearchBox1_3.Text,"Title","Description"),"Created",Descending)

HI @joshieboy ,

Try this way - all the top filter is Delegable, so you only need Search at the bottom

With(
   {
      AvailableItems: 
      Filter(
         'SEA MarketPlace New Item',
         Availability.Value = "Available" &&
         'Created By'.Email = varUser.mail &&
         (
            IsBlank(CategoryCombo_3.Selected) || 
            CategoryCombo_3.Selected.Value ="All" || 
            Category.Value=CategoryCombo_3.Selected.Value
         ) &&
         (
            IsBlank(ConditionCombo_3.Selected) || 
            Condition.Value = ConditionCombo_3.Selected.Value
         )
      )
   },
   SortByColumns(
      Search(
         AvailableItems,
         TextSearchBox1.Text,
         "Title",
         "Description"
      ),
      "Created",
      Descending
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

joshieboy
Helper V
Helper V

Thank you @WarrenBelz 

This works like a charm.  Greatly appreciated.

 

Regards,

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.

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 (4,264)