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

What you show in the screen shot is patient Of. That is already included in the formula. Check my last reply

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

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 ,

 

Yes, I used your formula. Here are the mistakes it showed me.

  • TextBox1.Text : The name is invalid, this identifier is not recognized.
  • Text : The "text" function contains invalid arguments
  • && :Text is expected.We are expecting text at this stage of the formula.

Screenshot_2.png

 

Highlighted

Insert a Textbox and name it TextBox1.Text .

If you give it another name the replace TextBox1.Text  with that name

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

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

The errors come from you formula which is wrong. So the first condition is not a separate line here, but part of the rest of the formula.

Know that a comma in the formula is like an And by itself, so it is smart to use comma's to separate the individual conditions. This will make formula's easier to read and also when the first condition results in a false will stop the second condition to run.

For your case this would result in:

 

 

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

 

What the Or() does in the second condition is first to check on the data picker being blank and if this is the case results in a true always. 

 

Hope this helps.

Highlighted

hi @KroonOfficeSol @eka24  ,

 

I inserted the textbox and renamed it like you told me @eka24 

 

then I inserted the formula of @KroonOfficeSol  , I have no more errors but nothing is displayed as a result.

 

I have a question for honesty I did not understand, the textbox is supposed to return what as information ?

 

Screenshot_4.png

 

Thank you for your help,

Highlighted

That your gallery is empty is logic, this because the textbox is probably empty. So there is no match I would expect.


Also, I could imagine you would like to change the first condition to something like StartsWith(), because else there will only be a match on the full name.

 

Then you come to the next problem here, let's say you have more record on one patient and there is a typo in the name. This then won\t show up. So basically you probably want to create a patient entity with a one to many relationships to the Consultation entity.

 

Also, I see an orange triangle, what does this say?

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,730)