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

Filter gallery using date range, 2 dropdowns and search box

Hi all,

 

I can't seem to figure out how to filter a gallery with multiple filters. Currently I have two date pickers (from) and (to), a 'department' dropdown and a 'status' dropdown plus a seachbox. How can i incorporate all of these so that when a user only wants to filter by date ranges or just the department  or just status. Also if they want to search for the title of the item they can as well. I've been reading a lot as well on filtering dates and trying to avoid the delegation issue. Can someone please help me out on this one? 

 

filterFields.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @_sourcecod3_ ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

View solution in original post

3 REPLIES 3
Super User III
Super User III

Hi @_sourcecod3_ ,

I will give you a concept if you have under 2,000 items in your data set I(and have your settings to this)- the below should work without Delegation errors. If you have more than this, dates are not Delegable, so some additional thought may be required.

With(
   {
      wFrom:YourFromDatePicker.SelectedDate,
      wTo:YourToDatePicker.SelectedDate,
      wDept:YourDepartmentSeach.Text,
      wStatus:YourStatusDD.Selected.Value
      wList:YourListName
   },
   Filter(
      wList,
      If(
	     Value(wFrom)=0,
         true,
         YourDateField>=wFrom
      ) &&
      If(
         Value(wTo)=0,
         true,
         YourDateField<=wTo
      ) &&
      If(
         IsBlank(wDept)=0,
         true,
         StartsWith(YourDeptField,wDept)
      ) &&
      If(
         IsBlank(wStatus)=0,
         true,
         YourStatusField=wStatus)
      )
   )
)

 

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.

Hi @_sourcecod3_ ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

View solution in original post

@WarrenBelz hi warren - i was able to figure it out, not exactly the same code are you provided but it did gear me into the right direction. 

 

Thanks for your help

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (105,287)