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

DateValue for gallery not working for iOS

Hi All

 

I have an issue with a reporting feature I've made. It uses a filter function that sorts if a Sales Order is within the selected date range. I have a drop down that contains a StartDate and EndDate. The function works great on a browser, however, when I'm using an iOS device, I'm not getting the same results as I do when using a browser. So I'm not quite sure if its there is code I need to add, or if its the device that has the issue.

 

Here is the code for the function

Date Range Selection

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

Set(StartDate,DateValue(Text(DateDropdown.Selected.StartDate,"[$-en-GB]DD/MM/YYYY")));
Set(EndDate,DateValue(Text(DateDropdown.Selected.EndDate,"[$-en-GB]DD/MM/YYYY")));

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

 

Gallery Filter Formula

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

Filter(Sales, DateValue(Text(OrderDate,"[$-en-GB]DD/MM/YYYY")) >= StartDate && DateValue(Text(OrderDate,"[$-en-GB]DD/MM/YYYY")) <= EndDate)

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

 

 

 

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: DateValue for gallery not working for iOS

Hi @AdrianAtEckoo ,

Could you please share a bit more about the issue within your Mobile device? Does the Filter function not work?

Is there something error message with your Filter formula in your Mobile device?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. Please consider take a try to modify your formula as below:

Date Ranage Selections:

Set(StartDate, DateValue(Text(DateDropdown.Selected.StartDate,"[$-en-GB]dd/mm/yyyy")));  // Please Type "dd/mm/yyyy" rather than "DD/MM/YYYY"
Set(EndDate, DateValue(Text(DateDropdown.Selected.EndDate,"[$-en-GB]dd/mm/yyyy")));

Filter function:

Filter(
       Sales, 
       Value(Text(OrderDate,"[$-en-GB]yyyymmdd")) >= Value(Text(StartDate, "[$-en-GB]yyyymmdd")) && Value(Text(OrderDate,"[$-en-GB]yyyymmdd")) <= Value(Text(EndDate, "[$-en-GB]yyyymmdd"))
)

or

Filter(
       Sales, 
       DateValue(Text(OrderDate,"[$-en-GB]dd/mm/yyyy")) >= StartDate && DateValue(Text(OrderDate,"[$-en-GB]dd/mm/yyyy")) <= EndDate
)

Please consider take a try with above solution, then check if the issue is solved.

 

More details about Text function to convert date value format, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-text#date-and-time-p...

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Helper I
Helper I

Re: DateValue for gallery not working for iOS

Hi @v-xida-msft 

 

Thanks for the reply, but after wrapping my head around the issue for quite some time, I took a step back and re read the DateValue documentation and found that it was because I didn't specify which way PowerApps was reading the date. Initially I didn't place anything to specify it, then I tried, DateValue(OrderDate, "en") and that didn't work. But DateValue(OrderDate, "fr") worked perfectly. So in this case it was just programmer error. 

 

Thanks for the reply and help!

Highlighted
Community Support
Community Support

Re: DateValue for gallery not working for iOS

Hi @AdrianAtEckoo ,

Have you solved your problem?

Have you taken a try with the solution I provided above? Is it helpful in your senario?

 

If you have solved your problem, please consider go ahead to click "Accept as Solution" identify this thread has been solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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