0

I have a series of google sheets reports that access my MSSQL Server database through jdbc. All of those reports each have a google app script (GAS) file with the credentials for my database. They all start somewhat like this:

var connectionName = 'server address';
var user = 'username';
var userPwd = 'password';

I recently started thinking about changing the password for that database, but that would imply in going through all the files and changing them manually. So I asked myself (and haven't found an answer yet): "could I store a 'universal' variable somewhere in the GAS suite and just reference it in my code?"

Something along the lines of:

var connectionName = getVariable(serverAddress);
var user = getVariable(user);
var userPwd = getVariable(password);

Thank you.

1 Answers1

2

One possible solution is to use a library to hold all the common variables.

Reference

Related

Rubén
  • 34,714
  • 9
  • 70
  • 166