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

Filtering with Date Picker, Text Search, and IsBlank

Hello Everyone,

My organization has asked me to create a basic app that will allow employees to volunteer to help with activities throughout the company during the COVID situation. I have a list of all available assignments and I would like the browse gallery to only show items with no support resource assigned.

 

COVID Support AppCOVID Support App

 

With help from the power apps community yesterday I was able to make real progress. Now I’m being asked to add a date picker as well. I'm able to get each of these to function separately; however, I haven't been able to successfully join the two statements into one. 

 

Date Filter

Filter(Support_Needs_List,DateValue(Text(StartDateOnly),"en")=DateValue(Text(DatePicker1.SelectedDate),"en"))

 

Text Filter

SortByColumns(Filter(Support_Needs_List,IsBlank(Support_Resource),IsBlank(FilterTextBox.Text) || FilterTextBox.Text in FacilityText),"StartDate", Ascending)

 

Any thoughts you could share would be much appreciated. The SortByColumns feature is a requirement as I only want the app to show opportunities that haven't been filled.

 

Sincerely, 

Justin

21 REPLIES 21
Highlighted
Super User III
Super User III

Hi @voglejm ,

If they both work now, try this

SortByColumns(
   Filter(
      Support_Needs_List,
      IsBlank(Support_Resource)  &&
      (
         IsBlank(FilterTextBox.Text) || 
         FilterTextBox.Text in FacilityText
      ) &&
      DateValue(Text(StartDateOnly),"en")=
      DateValue(Text(DatePicker1.SelectedDate),"en")
   ),
   "StartDate", 
   Ascending
)

 

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.

Highlighted

@WarrenBelz  - This is really great and exactly what I asked for. How would I go about showing everything to the user until they made a selection in the date picker? 

Highlighted

Thanks @voglejm ,

I will try the short version here (sorry cannot test it presently) but this should work. I will also give you a shorter way of comparing the dates.

SortByColumns(
   Filter(
      Support_Needs_List,
      IsBlank(Support_Resource)  &&
      (
         IsBlank(FilterTextBox.Text) || 
         FilterTextBox.Text in FacilityText
      ) &&
      If(
         !IsBlank(DatePicker1),
         DateDiff(
            StartDateOnly,
            DatePicker1.SelectedDate,
            Days
         )=0
      )
   ),
   "StartDate", 
   Ascending
)

 

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.

Highlighted

Thanks for another quick reply @WarrenBelz . I must be doing something wrong because when I attempt to utilize this my gallery becomes blank. 

 

4-15-2020 8-45-21 PM.png

I change the default date from Today() to blank but the results were the same. Additionally, I removed the ! before IsBlank and received the same results. I appreciate any other insight as I'm pretty new to using the date picker. 

 

Sincerely, 

Justin

 

Highlighted

Thanks @voglejm ,

Was not at my PC so free -typed it - longer version should work.

SortByColumns(
   Filter(
      Support_Needs_List,
       If(
         IsBlank(DatePicker1),
	     IsBlank(Support_Resource)  &&
         (
            IsBlank(FilterTextBox.Text) || 
            FilterTextBox.Text in FacilityText
         ),
		 IsBlank(Support_Resource)  &&
         (
            IsBlank(FilterTextBox.Text) || 
            FilterTextBox.Text in FacilityText
         ) &&
         DateDiff(
            StartDateOnly,
            DatePicker1.SelectedDate,
            Days
         )=0
      )
   ),
   "StartDate", 
   Ascending
)

 

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.

Highlighted

@WarrenBelz - I'm getting the same result as I was before. The gallery is completely blank. I again removed the Default date to see if that had any impact and it didn't. Any other thoughts?

 

Justin

Highlighted

Ok @voglejm ,

Here is the really long version

If(
   IsBlank(DatePicker1),
   SortByColumns(
      Filter(
         Support_Needs_List,      
         IsBlank(Support_Resource)  &&
         (
            IsBlank(FilterTextBox.Text) || 
            FilterTextBox.Text in FacilityText
         )
      ),
      "StartDate", 
      Ascending
   ),
   SortByColumns(
      Filter(
         Support_Needs_List,      
         IsBlank(Support_Resource)  &&
         (
            IsBlank(FilterTextBox.Text) || 
            FilterTextBox.Text in FacilityText
         ) &&
         DateDiff(
            StartDateOnly,
            DatePicker1.SelectedDate,
            Days
         )=0
      ),
      "StartDate", 
      Ascending
   )
)

 

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.

Highlighted

@WarrenBelz - Thanks for trying. Unfortunately, I continue to get the same results, the gallery is blank and when I choose a date or type a location I'm not returned anything. It just might not be in the cards to have both functions. I appreciate all the effort though. 

 

Justin

Highlighted

Hi @voglejm ,

This cannot be that hard (I thought) - I have actually tested the first syntax here and got the result.
Can you please put a label on the screen with this text

IsBlank(DatePicker1)

 

and see if it is true when there is no date in the control

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (16,262)