How To Open Spreadsheet From Google App Script Deployed As Web App
I have a Google Apps script which opens and processes an existing spreadsheet and writes data to JSON. This works fine for me from the Google Script editor but I can't get it to op
Solution 1:
You can open the spreadsheet in a new window with the window.open()
method. The submit button needs to be changed, so that you don't get the blank screen in the web app after clicking the button.
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<script>
function getData() {
alert("before opening spreadsheet");
window.open("https://docs.google.com/spreadsheets/d/1feVgACmd5_g9II2ll_1u7AVt8jIVg2LbKp13k8UQw6w/edit#gid=0","_blank");
alert("after opening spreadsheet");
}
</script>
</head>
<body>
<p>Update web app from spreadsheet?</p>
<form>
<input type='button' onmouseup="getData()" value='Go'>
</form>
</body>
</html>
Post a Comment for "How To Open Spreadsheet From Google App Script Deployed As Web App"