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

PowerApps Search / Filter advanced control

Hi all,

 

I had a quick question about some more user-friendly controls for an app I am developing. See the below control:

 

Power BI Search_Filter Supercede.PNG

 

These are sample production orders for the day. As you can see, I have a date filter as well as a search command bar attached to this filter. 

 

What I would like to do is have the search function supercede the date filter (e.g. if a user types in an order that is not on the current date filter, the date filter will change to the date that the order can be found)

 

I can think of some complicated ways to do this, but I was hoping someone would be able to guide me to the cleanest way of execution here.

 

Thanks in advance,

Farhan

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: PowerApps Search / Filter advanced control

Hi @farhandsome ,

Do you want to : if there's no filtered order in the selected date, the datepicker will change its selected date to the date that the filtered order is?

If so, I've made a similar test for your reference:

1)use a textinput and a datepicker to filter a gallery

Title is a text field, Created is datetime field

2)set the gallery's Items:

 

If(IsEmpty(Filter(fruit11111,TextInput1.Text in Title,Created=DatePicker1.SelectedDate)),
Filter(fruit11111,TextInput1.Text in Title),
Filter(fruit11111,TextInput1.Text in Title,Created=DatePicker1.SelectedDate))

 

// there's no filtered order in the selected date, then only filter based on the textinput

3)set the datepicker's DefaultDate:

 

var

 

4)set the textinput's OnChange:

 

If(IsEmpty(Filter(fruit11111,TextInput1.Text in Title,Created=DatePicker1.SelectedDate)),
   Set(var,LookUp(fruit11111,TextInput1.Text in Title,Created));Reset(DatePicker1)
   )

 

//If there's no filtered order in the selected date, the datepicker's selected date will change to the first filtered item's date.

1284.PNG

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: PowerApps Search / Filter advanced control

Hi @farhandsome ,

Do you want to : if there's no filtered order in the selected date, the datepicker will change its selected date to the date that the filtered order is?

If so, I've made a similar test for your reference:

1)use a textinput and a datepicker to filter a gallery

Title is a text field, Created is datetime field

2)set the gallery's Items:

 

If(IsEmpty(Filter(fruit11111,TextInput1.Text in Title,Created=DatePicker1.SelectedDate)),
Filter(fruit11111,TextInput1.Text in Title),
Filter(fruit11111,TextInput1.Text in Title,Created=DatePicker1.SelectedDate))

 

// there's no filtered order in the selected date, then only filter based on the textinput

3)set the datepicker's DefaultDate:

 

var

 

4)set the textinput's OnChange:

 

If(IsEmpty(Filter(fruit11111,TextInput1.Text in Title,Created=DatePicker1.SelectedDate)),
   Set(var,LookUp(fruit11111,TextInput1.Text in Title,Created));Reset(DatePicker1)
   )

 

//If there's no filtered order in the selected date, the datepicker's selected date will change to the first filtered item's date.

1284.PNG

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Community Champion
Community Champion

Re: PowerApps Search / Filter advanced control


If(IsBlank(SearchInput.Text),

Filter(DataSource, Datefield=Datepicker.SelectedDate),

Search(DataSource, SearchInput.Text, "FieldName" ))

After this, set a variable  at the defaultdate of the datefield to pick the variable if the PO Search field is blank.

Example Set(varDate,DafieldinGallery)

 

Please not that based on your request, one PO number can be for same date only.

 

 

 

If this helped, give thumps up

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,315)