I am building a web app using Apps Script. In this web app I have a table that needs to be populated from a table in a Word doc in OneDrive. This document is updated regular
OneDriveApp
as recommended by Cooperhtml
fileSample:
code.gs
function doGet(){
return HtmlService.createHtmlOutputFromFile('index');
}
function getFreshData(){
//read here your Word Doc data, e.g. with One DriveApp and store it e.g. in an array
...
return myDataArray;
}
index.html
...
<body onload="polling()">
...
<script>
function polling(){
setInterval(myFunction,2000); //chose how often you want your table
}
function myFunction(){
google.script.run.withSuccessHandler(onSuccess).getFreshData();
}
function onSuccess(myDataArray){
// Create a html table with the freshly obtained myDataArray from the Word Doc
...
}
</script>
...