Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to store values across google app script executions?

How can I store a key value on first executions of a google app scripts and retrieve it at a later execution?

I thought about using the cache, but I'm unclear how long it will survive and there is quite some time between my last and my previous execution.

Thx, I really appreciate your help and expertise a lot!

like image 306
Manuel Avatar asked Oct 23 '25 05:10

Manuel


1 Answers

Thx to @Tanaike for providing solution as a comment.

Google App Scripts PropertiesService provides the possibility to store variables in the context of the script, user or document which accesses it:

var userProperties = PropertiesService.getUserProperties();
userProperties.setProperties({
  "key1": "value1",
  "key2": "value2"
});
like image 64
Manuel Avatar answered Oct 26 '25 01:10

Manuel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!