cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TimmyBoy
Post Patron
Post Patron

Gallery Textinput with SortByColumns Filter with date

 

Hello,

Seems i can't get my code to work

It doesn't show any dates

In my sharepoint we have column with datetime and saved as yyyy-m-d

And i transfer the data to a collect (CollAllData)

 

 

SortByColumns(Filter([@CollAllData],
         
         (
            TextSearchBox_2.Text in DateValue(Text("field_4", "[$-nl-NL]d-m-yyyy"))
         )

), "Title", Descending)

 

 I add in TextSearchBox2.Text = "22-9" or "22-09" but nothing happens

Any solution?

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @TimmyBoy ,

You do not need quotes around "field_4", but also try this

SortByColumns(
   Filter(
      AddColumns(
         CollAllData,
         "DateText",
         Text(field_4,"d-m-yyyy")
      ),
       TextSearchBox_2.Text in DateText
   ), 
   "Title", 
   Descending
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @TimmyBoy ,

You do not need DateValue around it - you have converted it to Text which is what you need.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

@WarrenBelz 

I also did that

But same result.

 

SortByColumns(Filter([@CollAllData],
         
         (
            TextSearchBox_2.Text in Text("field_4", "[$-nl-NL]d-m-yyyy")
         )

), "Title", Descending)

 

And even tried

 

SortByColumns(Filter([@CollAllData],
         
         (
            TextSearchBox_2.Text in Text("field_4", ShortDate)
         )

), "Title", Descending)

Not sure why its not working

 

Hi @TimmyBoy ,

You do not need quotes around "field_4", but also try this

SortByColumns(
   Filter(
      AddColumns(
         CollAllData,
         "DateText",
         Text(field_4,"d-m-yyyy")
      ),
       TextSearchBox_2.Text in DateText
   ), 
   "Title", 
   Descending
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

@WarrenBelz 

Thanks, works like a charm 😄

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,665)