# Google sheets sync

**URL:** https://discourse.nodered.org/t/google-sheets-sync/49258
**Category:** General
**Created:** [3 August 2021 10:03 UTC](https://discourse.nodered.org/t/google-sheets-sync/49258 "2021-08-03T10:03:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![John\_Barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/john_barry/32/28987_2.png) [@John\_Barry](https://discourse.nodered.org/u/John_Barry)
#### Post date: [3 August 2021 10:03 UTC](https://discourse.nodered.org/t/google-sheets-sync/49258/1 "2021-08-03T10:03:01Z")

</div>

Hi All,

I am building a mobile scale that logs weight with a RFID tag. I have this setup sending the data to google sheets but the issue is the device will most likely loose connectivity intermittently so I need to buffer the data until its online again to sync (the setup is using a battery so the buffered data must be retained) . This could probably be done by writing to file and fetching when a ping to google is successful but is it not possible to save to sheets in offline mode and its syncs by itself?

If I turn off the wifi I get these errors:  
"Auth Error: FetchError: request to [https://www.googleapis.com/oauth2/v4/token](https://www.googleapis.com/oauth2/v4/token) failed, reason: getaddrinfo EAI\_AGAIN [www.googleapis.com](http://www.googleapis.com)"  
connect: Network is unreachable  
Please check that your service provider or network device has IPv6 enabled

Can I change the API to point at the offline file?

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [3 August 2021 12:36 UTC](https://discourse.nodered.org/t/google-sheets-sync/49258/2 "2021-08-03T12:36:42Z")

</div>

Basically, GS isn't really a very good choice of technology for what you are trying to achieve I'm afraid.

You really want a database that manages sync itself. Something like CouchDB or one of its variants. Since that follows an "eventually" sync model. But anything that supports local writes with delayed sync.

Otherwise, you certainly need to keep a local cache of the data and a track of what has been written. You might also need to keep track of the last used row in the SS so that you can tally up attempted writes and know if something went wrong (e.g. loss of network part-way through a write which could corrupt the data).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [17 August 2021 12:37 UTC](https://discourse.nodered.org/t/google-sheets-sync/49258/3 "2021-08-17T12:37:10Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
