My issue is, I'm using the yiono SCRIPT sql library and trying to integrate it with HTML but am having trouble with 2 pieces. Everything else is working beautifully.
For example I want to make an HTML form to update the 'Pro' value on the row that 'ID' = '1'
It works beautifully when I run the function in IDE, but I don't know the best way to put these in as variables from an HTML page. I tried some silliness with GET requests but couldn't get it to work.
function update_row(){
var SQL = new gSQL();
SQL.DB('*redacted*').TABLE('DAILY-DATA').UPDATE('Pro').WHERE('ID', '=', '1').VALUES('KAOS').setVal();
}
Problem 1: Get form input into .WHERE('ID', '=','from_html_form') and I'd like to do it within the Google environment by way of web app.
Minimal Reproducible Example
Here is the function

Here is the result

Replace
function update_row(){
var SQL = new gSQL();
SQL.DB('*redacted*').TABLE('DAILY-DATA').UPDATE('Pro').WHERE('ID', '=', '1').VALUES('KAOS').setVal();
}
by
function update_row(input = '1'){
var SQL = new gSQL();
SQL.DB('*redacted*')
.TABLE('DAILY-DATA')
.UPDATE('Pro')
.WHERE('ID', '=', input)
.VALUES('KAOS')
.setVal();
}
Main changes
Add the below simple trigger to a .gs file in your Google Apps Script project.
function doGet(e){
const html = `
<input type="number" />
<button onClick="myFunction();">Submit</button>
<script>
function myFunction(){
google.script.run
.withSuccessHandler(()=> {
const div = document.createElement('div');
div.innerText = 'Done!'
document
.body
.appendChild(div)
})
.update_row(document.querySelector('input').value);
}
</script>`
return HtmlService.createHtmlOutput(html);
}
To test this you will have to deploy as web app. Please follow the instructions for this on https://developers.google.com/apps-script/guides/web.
Resources