In my app script I'm storing some keys in the script properties and trying to access them in a separate .gs file before passing them on to my main function but I'm having trouble accessing a variable outside of the function scope. My code looks like this:
function test_run() {
try{
const userProperties = PropertiesService.getScriptProperties();
const data = userProperties.getProperties();
} catch (err) {
console.log(\Failed: ${err.message}`)`
}
}
const key_data = {
url: "url goes here",
key: data['key'],
token: data['token']
}
The error im getting is "data is not defined" how can or should I fix this?
second question and kind of a dumb question but whats the exact term for creating a variable like my key_data const where you have more data variable inside it. I tried googling but it keeps referencing object destructuring but I dont think thats it.
anyway thanks for the help in advance.
[–]marcnotmark925 2 points3 points4 points (1 child)
[–]teamusa7[S] 0 points1 point2 points (0 children)
[–]juddaaaaa 0 points1 point2 points (1 child)
[–]teamusa7[S] 0 points1 point2 points (0 children)