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

Reset filter by date

Ok, easy one, but it has me stumped as a novice. I have a gallery that is filtered by a datepicker.  On first entry it displays all dates. When I click on date it works fine and filters selected date, But how do I get it to display all the dates again?

Thx for your consideration.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Reset filter by date

HI @slhangen ,

Are you wanting all the information back when the date picker is cleared?

Try this (replace with your names)

If(
   Value(YourDatePickerName.SelecedDate)=0,
   YourListName,
   Filter(
      YourListName,
      DateDiff(
         YourDateField,
         YourDatePickerName.SelectedDate,
         Days
      )=0
   )
)

 

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

Highlighted
Super User III
Super User III

Re: Reset filter by date

Hi @slhangen ,

I actually spotted that afterwards and wondered if you needed that - try

Sort(
   Sort(
      If(
         Value(dpSelContactDate_4.SelectedDate)=0,
         Filter(
            'AT HOME LEARNING STUDENT CONTACT LOG',
            LogContactPerson=varUserName
         ),
         Filter(
            'AT HOME LEARNING STUDENT CONTACT LOG',
            LogContactPerson=varUserName &&
            DateDiff(
               LogContactDate,
               dpSelContactDate_4.SelectedDate,
               Days
            )=0
         )
      ),
      LogStudentName,
      Ascending
   ),
   LogContactDate,
   Descending, 
)

View solution in original post

16 REPLIES 16
Highlighted
Super User III
Super User III

Re: Reset filter by date

HI @slhangen ,

Are you wanting all the information back when the date picker is cleared?

Try this (replace with your names)

If(
   Value(YourDatePickerName.SelecedDate)=0,
   YourListName,
   Filter(
      YourListName,
      DateDiff(
         YourDateField,
         YourDatePickerName.SelectedDate,
         Days
      )=0
   )
)

 

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

Highlighted
Helper V
Helper V

Re: Reset filter by date

Still getting errors in DateDiff argument: Invalid argument type (Table), expecting DATE.TIME value instead

If(
Value(dpSelContactDate_4.SelectedDate)=0,
'AT HOME LEARNING STUDENT CONTACT LOG',
Filter(
'AT HOME LEARNING STUDENT CONTACT LOG',
DateDiff(
LogContactDate,
'AT HOME LEARNING STUDENT CONTACT LOG',
Days
)=0
)
)

 

Sharepoint List is          'AT HOME LEARNING STUDENT CONTACT LOG'

Sharepoint column is    Sharepoint is LogContactDate

Datepicker control is     dpSelContactDate_4

 

Thx for your assistance

Highlighted
Super User III
Super User III

Re: Reset filter by date

Thanks @slhangen ,

You have to compare the date field with the date picker selected date - you are comparing it with the list.

 

If(
   Value(dpSelContactDate_4.SelectedDate)=0,
   'AT HOME LEARNING STUDENT CONTACT LOG',
   Filter(
      'AT HOME LEARNING STUDENT CONTACT LOG',
      DateDiff(
         LogContactDate,
         dpSelContactDate_4.SelectedDate,
         Days
      )=0
   )
)

 

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
Helper V
Helper V

Re: Reset filter by date

Thx WarrenBelz,

 

That worked great.  When I click the refresh button I get all the dates back. 

 

A couple final things though, with this sophisticated IF statement, I am perplexed on how to write the sortbycolumns and a filter user statement. Just not can't figure out where they go.

 

The gallery needs to be filtered by current user:

Filter('AT HOME LEARNING STUDENT CONTACT LOG',LogContactPerson=varUserName) and

sorted with ThisItem.LogContactDate descending, then ThisItem.LogStudentName in ascending order.

 

Sorry for this but I thought once I got the date picker to work I could write in the other arguments but I am getting all kinds of errors with my syntax around your IF statement. 

 

Thx again for your prompt and easy to follow support!  I have been working on this gallery for weeks:{  Much appreciated.

 
Highlighted
Super User III
Super User III

Re: Reset filter by date

Thanks @slhangen ,

I will give you a Sort statement

Sort(
   Sort(
      Filter(
      'AT HOME LEARNING STUDENT CONTACT LOG',
       LogContactPerson=varUserName
      ),
      LogStudentName,
      Ascending
   ),
   LogContactDate,
   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.

Highlighted
Helper V
Helper V

Re: Reset filter by date

Thank you, I was able to get that but I don't know how to wrap it around the other IF statement:

 

If(
   Value(dpSelContactDate_4.SelectedDate)=0,
   'AT HOME LEARNING STUDENT CONTACT LOG',
   Filter(
      'AT HOME LEARNING STUDENT CONTACT LOG',
      DateDiff(
         LogContactDate,
         dpSelContactDate_4.SelectedDate,
         Days
      )=0
   )
)

 Very complicated

Highlighted
Super User III
Super User III

Re: Reset filter by date

@slhangen ,

Yes challenging - if the below does not work (free-typed so watch commas and brackets), it is going to get very complex

Sort(
   Sort(
      If(
         Value(dpSelContactDate_4.SelectedDate)=0,
         'AT HOME LEARNING STUDENT CONTACT LOG',
         Filter(
            'AT HOME LEARNING STUDENT CONTACT LOG',
            LogContactPerson=varUserName &&
            DateDiff(
               LogContactDate,
               dpSelContactDate_4.SelectedDate,
               Days
            )=0
         )
      ),
      LogStudentName,
      Ascending
   ),
   LogContactDate,
   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.

Highlighted
Helper V
Helper V

Re: Reset filter by date

You are amazing! Small thing (but I can live with it, if necessary):

The gallery works perfect when date is selected. 

 

However, on this screen I only want to show the user's contacts.  With your syntax, this is working but it shows all contact people when screen opens or when calendar value is cleared. I think its because the user filter is nested within the IF statement.

 

Tried to run Filter('AT HOME LEARNING STUDENT CONTACT LOG', LogContactPerson=varUserName) on screen's On Visible property but I still get all users.

 

FACESLAP!

 

Thx so much for your patience!

Highlighted
Super User III
Super User III

Re: Reset filter by date

Hi @slhangen ,

I actually spotted that afterwards and wondered if you needed that - try

Sort(
   Sort(
      If(
         Value(dpSelContactDate_4.SelectedDate)=0,
         Filter(
            'AT HOME LEARNING STUDENT CONTACT LOG',
            LogContactPerson=varUserName
         ),
         Filter(
            'AT HOME LEARNING STUDENT CONTACT LOG',
            LogContactPerson=varUserName &&
            DateDiff(
               LogContactDate,
               dpSelContactDate_4.SelectedDate,
               Days
            )=0
         )
      ),
      LogStudentName,
      Ascending
   ),
   LogContactDate,
   Descending, 
)

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,190)