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

How to filter a gallery via a search bar by mentioning the date

Hello,

which formula will allow me to filter the recordings by indicating a date?

 

Screenshot_20.png

 

the entity containing the records and the "date" field:

Screenshot_21.png

 

the gallery that I'm going to filter:

Screenshot_22.png

Thanks for your help,

15 REPLIES 15
Highlighted
Super User III
Super User III

If you want to search bu date, then rather insert a Datepicker Example Datepicter1.

Then filter as follows:

Filter(Consultation,Date=DatePicker1.SelectedDate)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Highlighted

Hi @eka24 ,

 

it's a silly question but the formula I'm supposed to put it or exactly in the picker's date? 😅

 

Update :

On second thought, I'm supposed to do it in the items section of the gallery, right ?

Screenshot_23.png
But since I already have a filter, how am I supposed to do it since I can't make two filters ?

Highlighted

Insert a DatePicker and put the formula on the Items of the Gallery as you showed on your screen shot:

Filter(Consultation,Text(Date,ShortDate)=Text(DatePicker1.SelectedDate,ShortDate)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

Highlighted

@eka24 ,

 

I don't know if you saw the modification that I made just above, knowing that I already have a filter function that allows me to display only the recordings of the connected user, I had understood that I could not make 2 functions which follow one another no? Maybe I'm wrong.

 

How could I do to have both filter functions in my gallery?

Highlighted

Does it mean you want to filter by the Two conditions. If so then:

1. Insert a DatePicker on your screen

2. Put this formula on the Items of the Gallery (Please select the Gallery itself not a portion of the Gallery)

   Filter(Consultation,Patient_ID=TextBox1.Text &&Text(Date,ShortDate)=Text(DatePicker1.SelectedDate,ShortDate)

 

Or

 

   Filter(Consultation,Patient_ID=TextBox1.Text || Text(Date,ShortDate)=Text(DatePicker1.SelectedDate,ShortDate)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Highlighted

Hi @Ryder 

Just a FYI, PowerApps executes functions from the inside out.  That is why @eka24 's functions will work.  For example if you wanted to sort the results of one of his filters, you would wrap that function in a Sort() function. 

 

Sort(Filter(Consultation,Patient_ID=TextBox1.Text || Text(Date,ShortDate)=Text(DatePicker1.SelectedDate,ShortDate),Date, Ascending)

So first the Text functions create the short date, then the Or(||) is applied, then the Filter is applied and finally the result is sorted.  There is no need to chain the formulas. 

 

Highlighted

@Drrickryp @eka24  ,

 

Great. It's working,

 

I probably expressed myself badly but here the concern is that it displays only the recordings of a date as soon as I enter the history, I would have wanted it to display all the consultations of the user and once I apply a date it filters and displays me the recordings of this day,

while having the possibility of re-displaying all the consultations (to cancel the filtering).

 

filter.gif

 

I hope that my message remains a minimum comprehensible to you...

Highlighted

If you want to display for a particular user, add another filter.

But before that, do you have the User in your table consultation

Filter(Consultation,Patient_ID=TextBox1.Text || Text(Date,ShortDate)=Text(DatePicker1.SelectedDate,ShortDate&&
UserColumn=User().FullName)

 

I cant see any user column in the Table Screen shot.

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

 

Highlighted

Hi,

 

Yes, I have a column containing users in my entity.

 

 

I apologize for my late response.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (11,701)