cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
isobelsoo
Helper II
Helper II

Can't search date in Britain format even after change the format

HI all, 

 

I would like to have my date to show in dd/mm/yyyy instead of US format :

i. I change the language property of the Date picker to "en-GB"

ii. I change the format to "dd/mm/yyyy" in the Text property of the date on Browse Screen

 

However, I realize when I search on browse screen. I still need to search in US format. I screenshotted the last picture which show when I search 6/1... (which is 1st/10/11...June in US format) , the respective date are only be filtered. 

 

Can anyone help to show how I can filter/search in the Britain format instead of US on Browse screen?

capture6.png

 

capture5.png

Screenshot 2021-06-11 104909.png

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @isobelsoo ,

That does not help me much without knowing the error - I was providing syntax guidance more than anything and relying on your code posted, so going back to your original question, you want to search in dd/mm/yyyy format (I have only added a column here)

SortByColumns(
   If(
      Searchbox.Text<>"",
      Filter(
         AddColumns(      
            'BPC Power Apps Source Report',
            "MyDate",
            Text(Date,"dd/mm/yyyy")
         ),
         Or(
            Searchbox.Text in Category.Value,
            'Mixer No.'.Value=Searchbox.Text,
            Searchbox.Text in 'Product Item',
            Searchbox.Text in 'Batch No.',
            Searchbox.Text in 'Storage Tank No.'.Value,
            Searchbox.Text in Status.Value,
            Searchbox.Text in MyDate,
            Searchbox.Text in Shift.Value
         )
      ),
      'BPC Power Apps Source Report'
   ),
   "Date",
   If(
      SortDescending1, 
      Descending, 
      Ascending
   )
)

 

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.

 

View solution in original post

isobelsoo
Helper II
Helper II

Hi all, 

 

Thank you so much for your time to help. 

 

I have somehow managed to fix it by adding the Text(Date."dd/mm"yyyy") in the Search function itself. 

Thank you! 🙂

 

isobelsoo_0-1623415836877.png

 

View solution in original post

17 REPLIES 17
CNT
Super User
Super User

@isobelsoo From the look of it u'r settings seem to be ok. Can you try with a date with day > 12 and check what happens.

WarrenBelz
Super User
Super User

Hi @isobelsoo ,

Instead of DateTimeFormat.ShortDate, put "dd/mm/yyyy"

You can see the it is able to be searched if I use US format.

If I search using Britain format,e.g. 26/6, nothing will be shown

isobelsoo_0-1623391723038.png

 

By the way, I realized a weird situation - if I search in Britain format, I can see the filtered result as I type until "dd/", but once I include the month(regardless 06 or 6)( refer 2nd picture below), the result is gone.. I also attached my search function as 3rd picture for your reference.

 

isobelsoo_1-1623392111371.png

isobelsoo_2-1623392167710.png

isobelsoo_3-1623392230416.png

 

Hi @WarrenBelz  it is still same. Sharing more details of the issue as per below for your reference:

 

I realized a weird situation - if I search in Britain format, I can see the filtered result as I type until "dd/", but once I include the month(regardless 06 or 6)( refer 2nd picture below), the result is gone.. I also attached my search function below as 3rd picture for your reference.

 

isobelsoo_5-1623392336591.png

 

isobelsoo_6-1623392336061.png

 

isobelsoo_7-1623392336062.png

 

 

Hi @isobelsoo ,
I am Australian and use date searches (in dd/mm/yyyy format) in most apps I have, so I would like to know a bit more about your issue.

What are you searching from (DatePicker etc) and what is the filter code?

Hi @WarrenBelz ,

 

The date by default in my power apps are mm/dd/yyyy. Hence, i change the formula to change it to dd/mm/yyy:

i. I change the language property of the Date picker to "en-GB" and change the format property of Date Picker to dd/mm/yyy on the Editscreen

ii. I change the format to "dd/mm/yyyy" in the Text property of the date on Browse Screen

 

My date was able to be shown in the format of dd/mm/yyyy after I did two changes stated above.

However, when I use the Search box in the browse screen, the date is not able to be filtered properly with dd/mm/yyyy format. 

E.g. if I want to search 29/06/2021:

The filtered result is still showing when I type "29/" on search box. but once I type the month - "29/06", the result is all gone which means no result is found( you can refer 2nd picture below). 

My filter codes is shown at the last section. 

 

Thank you!

 

isobelsoo_0-1623399638721.png

 

 

isobelsoo_1-1623399638429.png

SortByColumns(If(Searchbox.Text<>"",
Filter('BPC Power Apps Source Report',Or(Searchbox.Text in Category.Value,'Mixer No.'.Value=Searchbox.Text,Searchbox.Text in 'Product Item',Searchbox.Text in 'Batch No.',Searchbox.Text in 'Storage Tank No.'.Value,Searchbox.Text in Status.Value,Searchbox.Text in Date,Searchbox.Text in Shift.Value)),
'BPC Power Apps Source Report'),"Date",If(SortDescending1, Descending, Ascending))

 

 

 

 

Hi @isobelsoo ,

Your filter code is way to small to read - can you please post it in Text

Sorry about that @WarrenBelz . I have edited my reply above, kindly refer above. 

 

Thank you!

Hi @isobelsoo ,

I have not tried searching dates with a Text box before, but you are correct in that the underlying date in the data is mm/yy/dddd, so the easiest solution is to add your own column in the format you want. You could also do some of the below with the Search function, but to keep it simple.

With(
   {wSearch:Searchbox.Text},
   SortByColumns(
      Filter(
         AddColumns(
            'BPC Power Apps Source Report',
            "MyDate",
            Text(Date,"dd/mm/yyyy),
         ),
         IsBlank(wSearch) ||
         (
            'Mixer No.'.Value=wSearch ||
            wSearch in MyDate ||
            wSearch in Category.Value ||
            wSearch in 'Product Item' ||
            wSearch in 'Batch No.' ||
            wSearch in 'Storage Tank No.'.Value ||
            wSearch in Status.Value ||
            wSearch in Shift.Value
         )
      ),
      "Date",
      If(
         SortDescending1, 
         Descending, 
         Ascending
      )
   )
)

 

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.

 

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 (4,155)