cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Elitezone
Post Prodigy
Post Prodigy

Data table filter modification

Hello,

 

I have such a formula in data table:

Sort(Search(IdeaBox_1;SearchBox.Text;"Nazwa";"Opis");Utworzony;If(SortDescending2;Descending;Ascending))

It allows me to search through an input box, and label descending;ascending.

 

In my table I have also a column "Date of creation":

Text(ThisItem.Utworzony;DateTimeFormat.ShortDate)

 Is it possible to modify my formula to be able not only to sort date (utworzony) descending/ascending, but also to be able to use date picker or something to filter date in this column?

Date picker would be great cause it is very intuitive.

This way I could not only sort desc/asc, but also pick a date that I am interested in.

 

Once again thank you in advance guys.

Thanks to you each day I am becoming better and better, but... Filter functions are still the worst thing for me. I still do not understand why I need to add it all in one table, and why couldn't it be made on button/labels. Or why in the world data table does not have any standard filter like sharepoint list or anything (at least headings filters asc/desc) ;(

14 REPLIES 14
eka24
Super User III
Super User III

Modify the code to:

Sort(Filter(Search(IdeaBox_1,SearchBox.Text,"Nazwa";"Opis"), 
Text(datea,ShortDate) = Text(DatePicker1.SelectedDate,ShortDate)), 
Utworzony, If(SortDescending2,Descending,Ascending))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

It 'worked' in some sort of way:

 

Sort(Filter(Search(IdeaBox_1;SearchBox.Text;"Nazwa";"Opis"); 
Text(Utworzony;ShortDate) = Text(DatePicker1.SelectedDate;ShortDate)); 
Utworzony; If(SortDescending2;Descending;Ascending))

Maybe I designed it bad - I do not know, but now this DatePicker1 only shows records from Today(). When I delete DefaultDate it shows no records - so it never shows all records... I wanted it to be optional and with empty DatePicket1 to show all records.

Is it possible, or maybe there should be used another solution>

@eka24 

Thank you for your help!

I don't understand your explanation of the Datepicker in the formula. 

Are you referring to the formula or different issue?

I tested it so if you say it worked some how, do you have errors

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Ok. I will try to explain better:

 

Before using your formula my page showed a list of propositions that I could filter by entering values in fields or by using button (desc/asc date). But when you opened this page it showed all propositions by default.

 

After using your solution when you enter a page with propositions it shows by default only a propositions that fit within a DatePicker1 value. It is set by default on Today().

So when you go into the page you see only Today propositions. Filters should be optionals and that's not how they are supposed to work I believe.

 

When I delete date value from DatePicker no data is shown, so there is no way to shows all data anymore. I lost ability to view all propositions.

 

I thought that I could use 2 date pickers and set them on default with some weird values that would show all records? So this way it would sort data from X (for example 01.01.1900 to Today())

Or is there other workaround?

I only worked on your own formula you posted so it works for you. It wasn't my formula in the first place as you stated. Check your first post.

If you want Add additional issues, you can put in a new post and explain further. 

 

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

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

Top Solution Authors
Top Kudoed Authors
Users online (27,741)