I'm currently working on a project that is bound to a Google Sheet container. The purpose of this project is to search for a specific value in one column, and based on the result, either mark the record as complete, allow for missing values to be filled in, or add a new row if the value doesn't exist.
The HTML implementation is not posing any challenges, and with the help of Stackdriver Logger, I've confirmed that the initial form values are being passed correctly. These values include setting a cache which determines the content of the second HTML form for the sidebar. However, upon submitting either of the second forms, the function intended to add values to the table is not initializing, despite using the same script.
Here's a snippet from the <script>
tags within the initial HTML file:
document.querySelector("#cunyID").addEventListener("submit",
function(e) {
e.preventDefault();
google.script.run.cunyIDQuery(this);
google.script.run.newSidebar();
}
);
This excerpt shows the script included in one of the second forms:
gpa.onchange = function setTwoNumberDecimal(event) {
this.value = parseFloat(this.value).toFixed(2);
};
q1.onchange = function setWholeNumber(event) {
this.value = parseFloat(this.value).toFixed(0);
};
// More onchange events...
document.querySelector("#noCUNYID").addEventListener("submit",
function(e) {
e.preventDefault();
google.script.run.noCUNYIDSubmit(this);
google.script.host.close();
}
);
And here's an example from the sub-level forms:
q1.onchange = function setWholeNumber(event) {
this.value = parseFloat(this.value).toFixed(0);
};
// More onchange events...
document.querySelector("#yesCUNYID").addEventListener("submit",
function(e) {
e.preventDefault();
google.script.run.yesCUNYIDSubmit(this);
google.script.host.close();
}
);
Despite the expected behavior of google.script.run calling the functions, there seems to be an issue where Stackdriver does not show the function opening, although google.script.host.close() executes properly. Any insights into what might be causing this problem would be greatly appreciated.