You should never have two functions with the same name. It's the same ambiguity as when there are two people called David nearby, and you say "David, come here". JavaScript resolves this ambiguity by always calling the function that appears later in your program; in effect it overwrites the former.
Note that the name of function parameters (Viz, UTH, etc) is internal business of a function; the outside world doesn't care how the function names its parameters or any other local variable. This does not distinguish one function from another. That is,
function addone(x) {
return 2*x;
}
is identical to
function addone(y) {
return 2*y;
}
In either case, you get back twice the number you put it; that's all that matters.
Back to your script: you have a bunch of functions with identical names. You have to given them different names, like this
function showColumnsViz() {
...
}
function showColumnsUTH() {
...
}
and so on.
Also, you have two functions with the name onOpen
. There should be one:
function onOpen(Viz) {
var menu = [{name: "Show Viz", functionName: "showColumnsViz"}, {name: "Hide Viz", functionName: "hideColumnsViz"}, {name: "Show UTH", functionName: "showColumnsUTH"}, {name: "Hide UTH", functionName: "hideColumnsUTH"}];
SpreadsheetApp.getActiveSpreadsheet().addMenu("Show/Hide Columns", menu);
}
I just did a test and found that the on form submit event it's not being triggered when a response is edited.
I'm not sure if the on form submit trigger is working as intended, if the above is due to a bug or to a glitch. To be sure, post an issue to the Google Apps Script Issue Tracker.
As a workaround, instead of using the on form submit event, use another way to run your script, like a time-drive trigger.
References
Best Answer
Yes, you can trigger an Apps Script function with an HTTPS POST request. You'll need to add a
doPost()
function to a script file. ThedoPost()
function can also receive data from the POST request. If you want to receive data into thedoPost()
function, add a variable name inside of the parenthesis:The documentation typically shows a variable named
e
inside of the parenthesis, but you can use any name that you want.If you need to send a POST request from an Apps Script function, you can use:
The default type of request is a GET request, so you will need to use advanced options, and explicitly designate a POST request.
Google Apps Script Documentation - UrlFetchApp.fetch()
In order for the Apps Script project to be available, it must be published. In the script editor, click the "Publish" menu, and choose "Deploy as Web App". There are two versions of a Web App, the development version, and the "production" version. The development version has "dev" on the end of the URL. The production version has "exec" on the end of the URL.
The "exec" version of the Apps Script URL is what you must use for the URL in your POST request to your Apps Script project.
If you want to return something from the Apps Script web app, then you must use Content Service.
You can get more information from the following Stack Overflow post:
Call a custom GAS function from an external URL