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

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
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
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
Super User
Super User

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

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (3,679)