cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
farhandsome
Level: Powered On

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 Team
Community Support Team

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 Team
Community Support Team

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

eka24
Level 10

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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,250)