Wrong Time Recorded - Possible Bug?

So far this behavior has only been observed on one device. The device is an iOS phone.

When the user creates a new row, one field records the current dateTime through the use of the NOW() expression. The problem seems to be that the recorded time is behind the actual current time. Depending on how long it has been since the user last created a new row, the recorded time may be off by several minutes, hours, or days.

So far, this behavior has only been observed by one user, on the one device and one app.

Initially, manually syncing seemed to be the solution but that doesnโ€™t actually seem to work. Any ideas as to why this is happening would be appreciated.

0 17 764
17 REPLIES 17

Steve
Platinum 4
Platinum 4

If the new row is added from a form, and the current time is captured in a column of that row using the expression, NOW(), as either an Initial value or an App formula, the time will reflect when the form was opened, not when it was saved.

The behavior described is not the result of the form having been left open for a time before being saved. I observed the behavior myself this morning. I opened the form and created a new row and the time was off by 4 days. Prior to my creating this row, the last row was saved/created 4 days ago.

After I created this new row, the behavior has persisted. The next rows were off by an hour or so.

If you create multiple rows back to back are they off by the same time after the first new row is added?
What Iโ€™m wondering is do they stay consistently off by X time when adding lots of rows, not just like 2 rows.

Iโ€™ll get with the user and try that tomorrowโ€ฆ Thanks for your interest.

I would have to guess the problem is the userโ€™s device; Iโ€™ve never heard of this behavior otherwise.

Is the deviceโ€™s time correct? Does the time recorded by AppSheet reflect the deviceโ€™s time?

How is the deviceโ€™s time set: manually, or from the network?

Is the device fully up-to-date? Not just AppSheet, but the operating system and other installed apps, too?

Is the device still supported by the manufacturer?

Does the device have any questionable, possibly malicious apps installed?

Does the user play games on the app, and adjust the device time for the games?

Hello,

@Steve, I am working on an App in which users track their sick notes.

Recently, we found some rows in the database, where the timestamp (second column in the screenshots) had a two month gap to the sick leave date (fifth column).


While I find the chances quite low of leaving the Form View open in the device for two months before completing it, I would take that as an answer. But then again, it is suspicious that this happened to at least three users in the same period of time. By looking up the affected users in the database, I found that they had previously submitted forms with a timestamp dated after the one in their latest entry:

Any idea how that can happen or is that a case for AppSheet support?

How are each of those columns given their values? Are any actions, workflows, reports, or bots involved? Can the forms be reopened after their initial save?

User: initial value = USEREMAIL(), show set off,
Timestamp: type DateTime, initial value = NOW(), show set off,
from date: type date, initial value = NOW(),
to date: type date, valid if [_THIS]>=[from_date]
(I hope that answers the first question)

Heaps of workflows to send out emails to corresponding addresees and an action to show a โ€œpopupโ€ after submitting the form are involved.

There is a view sliced by the condition email_address = USEREMAIL() so that users can see their submitted forms. But the forms cannot be edited after saving.

Iโ€™m confused: youโ€™ve referred to columns as โ€œtimestampโ€, โ€œsick leave dateโ€, โ€œfrom dateโ€, and โ€œto dateโ€. Which are which? Are โ€œfrom dateโ€ and โ€œsick leave dateโ€ the same thing?

Based on the information youโ€™ve given me, it would seem the user has the freedom to set the โ€œfrom dateโ€ to any date they want, so Iโ€™m confused why you question the difference between the timestamp and the โ€œfrom dateโ€. Can you clarify?

Sorry for confusing you

Timestamp is the second column in my screenshots and has the function to capture the datetime when the user has added this row. (Yes, set at the time when the user opens the form not when he saves it).

With โ€œsick leave dateโ€ I mean the โ€œfrom dateโ€ (fifth column in screenshots).

The user has the freedom to set both โ€œfromโ€ and โ€œtoโ€ dates. But he cannot set the timestamp column. The user submitted his sick leave for April 23 with a timestamp in February, which was confusing to me. Also, same user had already entries in the sheet dating March 15 and April 13, which makes me question the timestamp in his latest add.

I hope that is somehow understandable?

Given that the user can set the โ€œfrom dateโ€ and โ€œto dateโ€, I see no reason to suspect a technical problem as the cause of the unexpected dates. Iโ€™d instead suspect user error. Have you asked the app user about the entry?

Thanks for your estimation. Though, I am not entirely convinced No, I have not reached out to any of the affected users yet.

I have similar issue related to this, why does timenow() reset to 12.00am after saving the form despite the device time being correct??

why does timenow( ) reset to 12.00am after the form is saved??

I have had records that come in with weeks ago on their load dates because Appsheet creates the time stamp when you open the form not when the row was added. Also depending on if you have delayed sync enabled, users maybe be sending their changes much later. I have also had instances where users will quickly send 4-5 changes and then close their phone and the last change or 2 are still waiting to be synced over but since the app is closed it doesnโ€™t sync. This is a very annoying thing for sure that syncs donโ€™t continue in the background of a phone but are saved on the phone. As a data admin it makes it hard to show that their change wasnโ€™t sent through because it immediately updates when they open their phones and โ€œLook itโ€™s right thereโ€.

Bahbus
New Member

And if this particular user either denies/refuses changing system time and messing things up, an alternative method would be to use a workflow for after the form is saved to add the datetime. I think NOW() in a workflow uses the servers time, but if the user is offline when submitting new information, then the workflow will be delayed. You could try using some kind of combination of both and comparing, but that is getting potentially excessive.

It turns out that the user was opening the form an leaving it open for a time before saving it. I have instructed the user not to do that. Hopefully this resolves the issue.

Thanks for everyoneโ€™s input.

Top Labels in this Space