Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
是否可以将Word online文档中的表中的XML或JSON数据作为HTML表导入Apps脚本网站?_Xml_Google Apps Script_Web Applications_Ms Word_Onedrive - Fatal编程技术网

是否可以将Word online文档中的表中的XML或JSON数据作为HTML表导入Apps脚本网站?

是否可以将Word online文档中的表中的XML或JSON数据作为HTML表导入Apps脚本网站?,xml,google-apps-script,web-applications,ms-word,onedrive,Xml,Google Apps Script,Web Applications,Ms Word,Onedrive,我正在使用应用程序脚本构建一个web应用程序。 在这个web应用程序中,我有一个需要从OneDrive中Word文档中的表填充的表。 此文档定期更新,因此我更愿意在应用程序脚本中以编程方式更新html表的内容。 这可能吗? 如果是这样的话,有谁能给我指导如何做到这一点 我已经开始研究从url导入xml,但我不确定我的思路是否正确。您需要结合以下步骤 将您的数据读入谷歌应用程序功能,例如按照Cooper的建议使用OneDriveApp 用于从html文件调用应用程序脚本函数 合并一个函数,在所需

我正在使用应用程序脚本构建一个web应用程序。 在这个web应用程序中,我有一个需要从OneDrive中Word文档中的表填充的表。 此文档定期更新,因此我更愿意在应用程序脚本中以编程方式更新html表的内容。 这可能吗? 如果是这样的话,有谁能给我指导如何做到这一点

我已经开始研究从url导入xml,但我不确定我的思路是否正确。

您需要结合以下步骤
  • 将您的数据读入谷歌应用程序功能,例如按照Cooper的建议使用
    OneDriveApp
  • 用于从
    html
    文件调用应用程序脚本函数
  • 合并一个函数,在所需的时间间隔内用新内容更新html表
样本:

代码.gs

index.html

。。。
...
函数轮询(){
setInterval(myFunction,2000);//选择表的显示频率
}
函数myFunction(){
google.script.run.withSuccessHandler(onSuccess.getFreshData();
}
函数onSuccess(myDataArray){
//使用从Word文档中新获取的myDataArray创建一个html表
...
}
...
您需要合并以下步骤
  • 将您的数据读入谷歌应用程序功能,例如按照Cooper的建议使用
    OneDriveApp
  • 用于从
    html
    文件调用应用程序脚本函数
  • 合并一个函数,在所需的时间间隔内用新内容更新html表
样本:

代码.gs

index.html

。。。
...
函数轮询(){
setInterval(myFunction,2000);//选择表的显示频率
}
函数myFunction(){
google.script.run.withSuccessHandler(onSuccess.getFreshData();
}
函数onSuccess(myDataArray){
//使用从Word文档中新获取的myDataArray创建一个html表
...
}
...

谢谢您的拼写更正。你指的是那个链接上的某篇文章吗?读一下。他有一个OneDriveApp。谢谢。他关于OneDriveApp的文章似乎很有用。这可能就是我要走的路线。谢谢你的拼写更正。你指的是那个链接上的某篇文章吗?读一下。他有一个OneDriveApp。谢谢。他关于OneDriveApp的文章似乎很有用。这可能就是我要走的路线。
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;
}
...
<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>
...