Reputation: 1589
I'm working on a GAS deployed as a Web App. I can share the script and let others edit it, but I can't find a way to let them test the web app.
The link from "Test web app for your latest code." is available only to the owner of the script.
Am I missing something ?
Upvotes: 0
Views: 152
Reputation: 45720
You can use the supported way to deploy Google app script as a web service: create new versions and publish them, then all editors can access the app by its deployment URL(s). This allows all editors to test the latest published version, but not the latest edited version.
The cons of this approach:
Manage Versions / Create
, then Deploy
.)The pros:
Upvotes: 3
Reputation: 5051
UPDATE: Looks like this is available now - via Release Notes "If a script is shared with editors other than its owner and published as a web app, those other editors can now update the app's version and access its development URL (which ends in /dev)."
... OLD WORKAROUND: You could connect another script file into your main one as a workaround. In the second script, import the main one as a library in Dev mode. When you save, publish and share the exec link of the second it'll be like sharing the dev link.
Master script
function doGet() {
var app = UiApp.createApplication();
var btn = app.createButton('Click').setId('btn');
var box = app.createTextBox().setId('box').setName('box').setText('hello');
var handler1 = app.createClientHandler().forEventSource().setEnabled(false);
var handler2 = app.createServerHandler('change').addCallbackElement(box);
btn.addClickHandler(handler1).addClickHandler(handler2);
app.add(btn).add(box);
return app;
}
function change(e) {
var app = UiApp.getActiveApplication();
var box = e.parameter.box;
app.getElementById('btn').setText(box).setEnabled(true);
return app;
}
Second script (after importing Master script as a library and naming the identifier as 'master')
function doGet() {
var app = master.doGet();
return app;
}
Upvotes: 3