cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gkrish23
Frequent Visitor

Filter gallery using Date Picker & Text box in Power-Apps

Hi,

     I have been working on an app that I need to filter the gallery by using text box (search) and date picker (Start-date & End-date). 

 

Date-Picker:

Gkrish23_0-1612353114244.png

text-box:

Gkrish23_1-1612353171957.png

   Gallery Name: Feedback Info  - where it contains info such as Area,Created by, Floor Name, Location, Created (date) etc stored in share-point.

  

  Based on the text box values I want to filter the gallery at first, if in-case I want to narrow down further then need to use date range functionality. 

 

For ex:  Suppose If I type my name in text box then I will get all the info related to my name in gallery. If I want to check the specific time-period/date between November 2020 to December 2020 using date picker function, this is where I am not getting the exact result.

 

Code details are as follows for search text-box : (attached) and Date picker: (attached)

 

Please help assist on this query.

 

Thanks.

 

1 ACCEPTED SOLUTION

Accepted Solutions
nate_halliwell
Advocate I
Advocate I

try this:

 

If(IsBlank(DatePicker_Start.SelectedDate),If(IsBlank(DatePicker_Start.SelectedDate),If(IsBlank(Searchbox.Text),FeedbackInfo,Filter(FeedbackInfo,Or(Searchbox.Text in Area, Searchbox.Text in Floor, Searchbox.Text in 'Created By'.DisplayName))),Filter(If(IsBlank(Searchbox.Text),FeedbackInfo,Filter(FeedbackInfo,Or(Searchbox.Text in Area, Searchbox.Text in Floor, Searchbox.Text in 'Created By'.DisplayName))),DaveValue(CreatedDate) >= DatePicker_Start.SelectedDate)),Filter(If(IsBlank(DatePicker_Start.SelectedDate),If(IsBlank(Searchbox.Text),FeedbackInfo,Filter(FeedbackInfo,Or(Searchbox.Text in Area, Searchbox.Text in Floor, Searchbox.Text in 'Created By'.DisplayName))),Filter(If(IsBlank(Searchbox.Text),FeedbackInfo,Filter(FeedbackInfo,Or(Searchbox.Text in Area, Searchbox.Text in Floor, Searchbox.Text in 'Created By'.DisplayName))),DaveValue(CreatedDate) >= DatePicker_Start.SelectedDate)),DaveValue(CreatedDate) <= DatePicker_End.SelectedDate))

View solution in original post

4 REPLIES 4
nate_halliwell
Advocate I
Advocate I

try this:

 

If(IsBlank(DatePicker_Start.SelectedDate),If(IsBlank(DatePicker_Start.SelectedDate),If(IsBlank(Searchbox.Text),FeedbackInfo,Filter(FeedbackInfo,Or(Searchbox.Text in Area, Searchbox.Text in Floor, Searchbox.Text in 'Created By'.DisplayName))),Filter(If(IsBlank(Searchbox.Text),FeedbackInfo,Filter(FeedbackInfo,Or(Searchbox.Text in Area, Searchbox.Text in Floor, Searchbox.Text in 'Created By'.DisplayName))),DaveValue(CreatedDate) >= DatePicker_Start.SelectedDate)),Filter(If(IsBlank(DatePicker_Start.SelectedDate),If(IsBlank(Searchbox.Text),FeedbackInfo,Filter(FeedbackInfo,Or(Searchbox.Text in Area, Searchbox.Text in Floor, Searchbox.Text in 'Created By'.DisplayName))),Filter(If(IsBlank(Searchbox.Text),FeedbackInfo,Filter(FeedbackInfo,Or(Searchbox.Text in Area, Searchbox.Text in Floor, Searchbox.Text in 'Created By'.DisplayName))),DaveValue(CreatedDate) >= DatePicker_Start.SelectedDate)),DaveValue(CreatedDate) <= DatePicker_End.SelectedDate))

View solution in original post

Gkrish23
Frequent Visitor

@nate_halliwell Thanks for the quick response. I am getting the expected results. 

What if I want to add a drop-down box along with both Date-picker and search box?

 

Drop-down box (Items) contain country locations such as India,Thailand etc. Based on the country wise I want to filter the same gallery along with both functions. In that case , what adjustments do we need to make in the code?

 

Please assist on this..!!

@Gkrish23 i recently made a video about this exact scenario, actually....  https://www.youtube.com/watch?v=0bRR-Zq407c

 

essentially you'll need to nest the entire formula from my original post inside of an If(isBlank(CountryDropDown.Selected.Value), ......) formula.

Gkrish23
Frequent Visitor

@nate_halliwell Thanks for the update. Now I have understood the logic behind the filter function.!!

 

Kudos to the video as well..!!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,510)