EXTRACTDATES() en IOS, Iphone Problem

I'm having problems with the extractdates() function. In Android and Windows it returns values โ€‹โ€‹correctly, but in ios or iphone, also in ipad it does not give me the expected results, in fact it does not return the date, it returns an error or a blank date.

Example: extractdate("First Monday next month"

Any suggestion?

I already tried changing languages, date formats, etc.

Thank you...

Solved Solved
0 13 279
1 ACCEPTED SOLUTION

Hi Pedro,

If you need to calculate a single date of the nth occurrence of a weekday some month before or after a certain date, for example the 3rd Friday of the month two months from today, then you don't need looping; you can calculate it with a single expression. 

If you need to calculate multiple dates, for example every 3rd Friday of every month up to the end of the year, then you might want to have a look at the sample app in this post. Its base idea can be easily applied to your requirement.

Target Workday Calculator - Google Cloud Community

View solution in original post

13 REPLIES 13

Steve
Platinum 4
Platinum 4

What error? Can you post a screenshot?

iPad_iOS.pngWindows y Androis Devices.png

This is the screenshot of the same screen on both platforms... the end date it gives on the ipad indicates that it returns blank.

Hi Steve, thanks for replying, sorry for my English, I use a translator.

It is a task management application. I initialize the Date field (date type) with a date depending on the periodicity or recurrence that the user previously indicates. For some recurrence cases I use the extractdates() function.

On Android devices (Tablets and Phones) as well as on Windows Browser I have no problems, it works fine, the extractdates() function returns what I expect... but on the devices I tested with ios, iphone and ipad, the function returns blank or null.

I copy the formula I use to initialize the Date field:

date(Any(extractdates(Concatenate([cada]," ",[diadelasemana]," next month"))))

[cada] - Has as content first, second, third, etc. and [diadelasemana] has the days of the week.

It would be something like this:


date(Any(extractdates(Concatenate("First"," ",""Monday," next month"))))

On the platform that works, it gives me the first Monday of the following month... and it works fine for the second, third, etc, of any day of the week, but I don't know or I can't find it because it doesn't work on ios, iphone and ipad. ...

Thanks for any suggestion.

I don't know if this would solve your problem, just an observation that might help.

It is shown that the regional settings on your ipad (1st screenshot) is different from your device (2nd screenshot). The first is showing a long "dd mmmm yyyy" date format, while the second is showing an "mm/dd/yyyy" date format. 

Please test changing the regional settings of your ipad to match what is configured on your other device and see the result. Thanks. 

Thanks for answering. I already tried changing region, date, languages โ€‹โ€‹etc. and the problem remains. The dates with the format that is seen in the capture in other functions have no problems. Any other suggestions?

Yes, you don't need to wrap your expression in DATE(), the result is already of type date. Just set your column type as Date and try:

ANY( EXTRACTDATES( CONCATENATE([cada]," ",[diadelasemana]," next month") ) )

Thank you Joseph, in the indicated text it does not require date(), but it follows the same behavior, that expression works on Android and Windows, but not on my iPad and iPhone. I can't find any confirmation on iOS that solves the problem.

I'm going to think of another way to solve it because Extractdates() can't make it work on that platform.

If I find anything else, I will include it here.

Thank you.

Thanks Pedro, sorry I couldn't think of anything else. FWIW, I've tested the exact expression on my iPhone, using Safari and the AppSheet app and it is giving me a correct result. 

Capture dโ€™eฬcran 2022-04-22 aฬ€ 04.31.19.png

Thanks Joseph for trying to test, obviously there is something in the configuration locale/language that allows it to work, but I can't find it. I use Safari because I haven't tried it and I have the same behavior.
Could you tell me how you have region, date and language configured on the iPhone?
I think the problem must be there... I don't know.

Hello Pedro,

I've done several additional tests and was able to reproduce the behavior. I now believe it is a bug with the implementation of this function in iOS. Also, you are right, changing phone language and regional settings do not make any difference. 

The first test I've done was with calculation in a virtual column, this is the screenshot in my previous reply, and you can see it works correctly. 

Today I've tested again but with a normal column and the date didn't get calculated correctly. 

I went back to testing with a virtual column and looked closely, I saw that once the form is saved, the field in the table view showed "invalid date" immediately after the save, but after few seconds, when the app has synced the new row with the server, this field changed to display the correct calculated date. 

So I concluded that EXTRACTDATES() was able to understand your English phrase when launched on the server, but not when launched on the local iphone device. 

To confirm my conclusion, I switched back to a normal column, and did the test below. The test was successful and you might use it as a workaround

Workaround: remove the expression from the App Formula, and instead put it in a data change action to change the value of this column, then launch this action from a Bot that monitors addition or updates of your table's rows. 

It is worth noting that when you launch this action through a button click, you get invalid dates and you get a message indicating that the action has failed. However, when launched through a bot, it performs and completes successfully. Therefore I could confirm my conclusion.

Personal note: I would never depend on a vague function that I wouldn't know how it would interpret a human language to extract information from data. Instead, you should be better off writing precise expressions to perform your date calculations. 

Joseph, great! I did the monitoring and it was as you indicated. I could make a Bot but there are seconds of waiting to see the dates.

I'm going to think of an algorithm to assemble the dates and not depend on the translation of ExtractDates(), it's a shame because it works very well on Android and Windows, but I have people who use iphone, so I'll rethink how to do the recurrence of dates. I already solved, but with a lot of code, repetitions of tasks, daily, weekly and monthly. ExtractDates() solved me a lot for tasks that are repeated every 15 days or tasks that are executed every 1st or 2nd day of a specific month... but I think I can solve it manually.

Do you know if it is possible to make a loop (Do while, for, etc...) can variables be defined? I know it's not a programming language but so far I've been able to figure out most things.

Thank you for your time and support in solving the problem.

At orders. Pedro

Hi Pedro,

If you need to calculate a single date of the nth occurrence of a weekday some month before or after a certain date, for example the 3rd Friday of the month two months from today, then you don't need looping; you can calculate it with a single expression. 

If you need to calculate multiple dates, for example every 3rd Friday of every month up to the end of the year, then you might want to have a look at the sample app in this post. Its base idea can be easily applied to your requirement.

Target Workday Calculator - Google Cloud Community

Thanks Joseph, I already have the solution designed... I'll be testing it.

Your guides were helpful. Thank you!...

 

Top Labels in this Space