Hello,
In my last topic (https://powerusers.microsoft.com/t5/Building-Power-Apps/Data-table-filter-modification/m-p/694197#M2...) I received a help in making my DatePicker works in my gallery.
This is the function:
Sort(Filter(Search(IdeaBox_1;SearchBox.Text;"Nazwa";"Opis");
Text(Utworzony;ShortDate) = Text(DatePicker1.SelectedDate;ShortDate));
Utworzony; If(SortDescending2;Descending;Ascending))
I use in my gallery SearchBox that i searching true filds Name/Description (Nazwa/Opis), and a button that lists all gallery records desc/asc of date.
I also added DatePicker1 that I wanted to use an additional source of possible filters.
This filter is however very problematic, because it is not optional - it filter the data in default mode.
So for example my gallery has 30 records - after implementing in Items of gallery updated function with listed DataPicker it only shows today records. When I delete value Today() it shows no records at all.
At this moment I have no means to show all RECORDS.
What I intented was to create a new filter that would help my users filter some data, but that would be optional not obligatory.
Is it possible to change this filter?
I thought that maybe I could use two DataPickers one would be start date of filter which would be set on 01.01.1900 and another would be Today() on default.
So it will list all records, but also allow users to search when they need.
Or maybe is there other way to achieve it?
I found this function but I have troubles in implementing it in my formula:
I created DatePicker2
Filter(DataSourceName, EventDate > DatePicker1.SelectedDate && EventDate < DatePicker2.SelectedDate)
Thank you for your help.
Solved! Go to Solution.
Use this:
Sort(Filter(Search(IdeaBox_1;SearchBox.Text;"Nazwa";"Opis"); Utworzony >= DatePicker1.SelectedDate &&
Utworzony <= DatePicker2.SelectedDate); 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.
Using Datapicker1 and 2, Use the formula;
Sort(Filter(Search(IdeaBox_1;SearchBox.Text;"Nazwa";"Opis"); Text(Utworzony;ShortDate) >= Text(DatePicker1.SelectedDate;ShortDate)&&Text(Utworzony;ShortDate) <= Text(DatePicker2.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.
Ok. it showed 25 errors, but when I added ) at the end it showed only 4 errors:
All Invalid type of argument expected number and received text.
Yes because of the comparison, there should a value:
Sort(Filter(Search(IdeaBox_1;SearchBox.Text;"Nazwa";"Opis"); Value(Text(Utworzony;ShortDate)) >= Value(Text(DatePicker1.SelectedDate;ShortDate))&&Value(Text(Utworzony;ShortDate)) <= Value(Text(DatePicker2.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.
This is weird. I used this function:
Sort(Filter(Search(IdeaBox_1;SearchBox.Text;"Nazwa";"Opis"); Value(Text(Utworzony;ShortDate)) >= Value(Text(DatePicker1.SelectedDate;ShortDate))&&Value(Text(Utworzony;ShortDate)) <= Value(Text(DatePicker2.SelectedDate;ShortDate))
); Utworzony; If(SortDescending2;Descending;Ascending))
It now shows all results, all filters but date works well.
No matter what value I provide in DataPickers the filter does not change.
It always shows all records (f.e if I make both data pickers on 20.09.2020 it should show one proposition) but it shows all):
Show a screenshot of your Column from your Datasource. Do you get errors in the formula?
------------
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.
There are no errors at all.
Just 3 warning (delegation) from a different source.
I use date of creation in gallery:
This is from Sharepoint list:
Data type: Date and hours
Date format: Standard/Friendly (are the last settings).
This is a standard field (same as modified by).
Do you perhaps have any idea what to do 😞
I would be very grateful as those filters are very important and I cannot fix them myself.
Let me send you a private message
Use this:
Sort(Filter(Search(IdeaBox_1;SearchBox.Text;"Nazwa";"Opis"); Utworzony >= DatePicker1.SelectedDate &&
Utworzony <= DatePicker2.SelectedDate); 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.
User | Count |
---|---|
251 | |
251 | |
82 | |
45 | |
29 |
User | Count |
---|---|
343 | |
262 | |
129 | |
69 | |
57 |