微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用Google Sheets API创建持久值的方法有哪些?

如何解决使用Google Sheets API创建持久值的方法有哪些?

我正在编写Google表格google脚本程序。多个PropertiesService调用获取我想存储在某个地方并稍后访问的数据(无需再次调用UrlFetch)。我已经尝试了多种方法来保存信息,而不仅仅是一次运行函数。根据我的研究:

    每次调用函数时,.gs文件中的
  • 全局变量都会重新定义。不适合存储持久值
  • import React,{useEffect,useRef} from 'react'; import {AppState} from 'react-native' export default () => { const appState = useRef(AppState.currentState); var interval const _handleAppStateChange = (nextAppState) => { if ( appState.current.match(/inactive|background/) && nextAppState === "active" ) { console.log("App has come to the foreground!"); //clearInterval when your app has come back to the foreground BackgroundTimer.clearInterval(interval) }else{ //app goes to background console.log('app goes to background') //tell the server that your app is still online when your app detect that it goes to background interval = BackgroundTimer.setInterval(()=>{ console.log('connection status ',socket.connected) socket.emit('online') },5000) appState.current = nextAppState; console.log("AppState",appState.current); } useEffect (() => { AppState.addEventListener("change",_handleAppStateChange); return () => { AppState.removeEventListener("change",_handleAppStateChange); }; },[]) } 允许存储文本字符串...但是我的数据很快就超过了它。
  • 因此,我开始将数据存储在电子表格内的表格中,并且我认为我的数据也超出了电子表格文件(过去第15个标签,所以当我尝试再次运行函数时遇到异常)。 [有没有一种方法获取文件的大小? -只是我可以验证是否达到了500万个单元数限制?]
  • 我接下来要做的就是在Google云端硬盘上创建文件

这是前进的道路吗?您认为我应该将数据存储在另一个电子表格文件中还是文本文件中? JSON文件

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。