I'm trying to create a custom form in order to send one value (ID) and below of the form see the search result based on the input field.
For example: Complete the form and below see the search result in a DataBase (Google Sheets)
I saw some examples but I don't know how to get the value of the input field and use it with the Google Apps Script code (in order to search the ID in the rows).
Here some code I was trying: code.gs
function doGet() {
return HtmlService.createHtmlOutputFromFile('index')
.setSandboxMode(HtmlService.SandboxMode.IFRAME);
}
function obtenerId() {
var email = Session.getActiveUser().getEmail();
var idtest='Juan';
return messageSecret_(idtest);
}
function messageSecret_(urldoc) {
return 'test'+urldoc;
}
index.html
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<script>
function onSuccess(balance) {
var div = document.getElementById('output');
var idtest = document.getElementById('ingresoid').value;
div.innerHTML = balance+' '+idtest;
}
</script>
</head>
<body>
<!--Modificar texto de la aplicación -->
<p style="margin-bottom: 16px; font-family: 'Verdana regular'; font-size: 16px;color: #727277;line-height: 16px;text-align: justify;">Ingrese ID:
<br><br></p>
<input type="textbox" id="ingresoid" size="20">
<br><br>
<input type="button" value="Enviar respuesta" onclick="google.script.run.withSuccessHandler(onSuccess)
.obtenerId();" style="background-color:#C1D72E;border-radius:10px;padding:5px;color: #fff; border-color: #C1D72E;"
/><br>
<br>
<div id="output"></div>
</body>
</html>


SpreadsheetAppclass, get the spreadsheet by ID, and then get the sheet tab, then get a range, then set the value in the range. Link to Get Sheet by Name And: Link to Get Range And also: Set Value