cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JamtMaster
New Member

Filter within a date range

Hello, I need the gallery to only show me the information within a range of dates that the user will select and then filter what he wants within that date range, if I use both codes separately it filters me by date or by the box of text but if I try to make it filter what the user writes inside the text box in the range that is selected then it does not work, what would be the correct way? I leave the code that I am trying to use:

 

Filter(CarReport;Date>=DTPStart.SelectedDate;Date<=DTPFin.SelectedDate)
&&
SortByColumns(Filter([@CarReport];StartsWith(Lote;txtsearch.Text));"Date";Ascending)

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
timl
Super User
Super User

Hi @JamtMaster 

You can combine the the date and text input in your search like so:

SortByColumns(Filter([@CarReport];
                     StartsWith(Lote;txtsearch.Text) && 
                     Date>=DTPStart.SelectedDate &&
                     Date<=DTPFin.SelectedDate)
               );
              "Date";
               Ascending
)

 

 

View solution in original post

JamtMaster
New Member

That code gave me an error (it says that an argument was placed and I expected more than 1) but looking at the way you organized it I put it in the following way and it worked for me so I mark it as valid, thank you very much.

 

SortByColumns (Filter ([@ CarReport];
StartsWith (Batch; txtsearch.Text);
Date> = DTPStart.SelectedDate;
Date <= DTPFin.SelectedDate); "Date"; Ascending)

View solution in original post

2 REPLIES 2
timl
Super User
Super User

Hi @JamtMaster 

You can combine the the date and text input in your search like so:

SortByColumns(Filter([@CarReport];
                     StartsWith(Lote;txtsearch.Text) && 
                     Date>=DTPStart.SelectedDate &&
                     Date<=DTPFin.SelectedDate)
               );
              "Date";
               Ascending
)

 

 

View solution in original post

JamtMaster
New Member

That code gave me an error (it says that an argument was placed and I expected more than 1) but looking at the way you organized it I put it in the following way and it worked for me so I mark it as valid, thank you very much.

 

SortByColumns (Filter ([@ CarReport];
StartsWith (Batch; txtsearch.Text);
Date> = DTPStart.SelectedDate;
Date <= DTPFin.SelectedDate); "Date"; Ascending)

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,882)