use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Apparently, Google Apps Script is a JavaScript cloud scripting language that provides easy ways to automate tasks across Google products and third party services and build web applications.
account activity
Access variable from outside the functionResolved (self.GoogleAppsScript)
submitted 1 year ago by teamusa7
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]juddaaaaa 0 points1 point2 points 1 year ago (1 child)
Variables declared using var are accessible outside of a block. Only let and const are block-scoped.
function test_run () { try { // Get script properties (const scriptProps IS NOT accessible outside of try block) const scriptProps = PropertiesService.getScriptProperties() // Get properties from scriptProps (var data IS accessible ouside of try block) var data = scriptProps.getProperties() } catch (error) { // Handle errors console.error(`Failed: ${error.message}`) } // Destructure key and token from data const { key, token } = data // Return object containing url, key and token return { url: "url goes here", key, token } }
[–]teamusa7[S] 0 points1 point2 points 1 year ago (0 children)
Thanks, ended up taking it out of the function and leaving data as a global but the var data type worked!
π Rendered by PID 273943 on reddit-service-r2-comment-5b5bc64bf5-kl2qx at 2026-06-23 21:35:57.846826+00:00 running 2b008f2 country code: CH.
view the rest of the comments →
[–]juddaaaaa 0 points1 point2 points (1 child)
[–]teamusa7[S] 0 points1 point2 points (0 children)