Hi all,
I have a data change bot that is triggered when a new customer record is added to a sheet, which is done via the REST API. There is an order_date field that is not provided by the external system making the call to the AppSheet REST API, so I've added an initial value to the field of NOW().
When calling the REST API to add a new customer record, the Locale is set to "en-GB" as part of Properties, e.g.
The google sheet for the app has a locale of "London" and Timezone of "GMT(+00:00) London", and the table customer_details that the bot is writing to has a localisation setting of "English (London).
But when the order_date field is initialised, it does so with UTC time and doesn't adjust for daylight saving currently in force.
Reading through other questions on similar topics I found this thread:
https://www.googlecloudcommunity.com/gc/AppSheet-Q-A/How-do-I-get-a-bot-to-set-a-timestamp-in-a-spec...
Where @dbaum says:
"An automation triggered by a data change receives the time from the triggering user's device and applies that in expressions like NOW(). A scheduled automation indeed always uses UTC."
So I'm assuming that a data change that is actually triggered via the REST API behaves like a scheduled automation and always users UTC.
If that's correct, what is the simplest way to fix this? It seems like there is no automatic way to set up the Google Sheet or Appsheet to adjust for when Daylight Saving applies to the locale and timezone on the server side? So should I just simply manually change the timezone in google sheets, and then change it back manually after Daylight savings is over? Or is there a better way?
PS All customers (and app users) are in same UK timezone, so there is no requirement to deal with different timezones based on the location of the customer.
Thanks!
Joe
Solved! Go to Solution.
Sorry, should have spotted this before posting but I was missing the 'Timezone' property on the JSON used for the API call. When this is set to "GMT Standard Time" this is correctly passed to the bot, and the NOW() function adjusts correctly for daylight saving.
"
User | Count |
---|---|
17 | |
12 | |
5 | |
5 | |
5 |