J. G.
J. G.

Reputation: 1832

Integrate url parameters

Is there a way to construct a local link with parameters that will work in both test and prod? I was planning to hard code it but realized the first part of the link being different would cause problems. (yes, I can create a script variable but that isn't ideal).

By this I mean links that end with #Files?id=100

Upvotes: 0

Views: 43

Answers (1)

Morfinismo
Morfinismo

Reputation: 5253

Yes there is! You need to use this on the server script:

var appUrl = ScriptApp.getService().getUrl();
appUrl += "#Files?id=100;

Reference: https://developers.google.com/apps-script/reference/script/service#getUrl()

Upvotes: 1

Related Questions