简体   繁体   English

Google Apps脚本:如何使用电子表格中的数据查询外部数据库?

[英]Google Apps Script: how to use data in a spreadsheet to query a external database?

I want to build an app that use data in a selected row in my google spreadsheet to make a query in an external site whose source code is something like this: 我想构建一个使用Google电子表格中选定行中的数据的应用程序,以在源代码如下所示的外部站点中进行查询:

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd"><html dir="ltr">
    <head><title>NAME_SITE</title><meta name="name" content="Oracle ADF Faces"><link rel="stylesheet" charset="UTF-8" type="text/css" href="/name_query/adf/styles/cache/mycompany-desktop-10_1_3_4_0-webkit.css"><script>var _AdfWindowOpenError='Pop error message.';</script><script src="/name_query/adf/jsLibs/Common10_1_3_4_0.js"></script><script>_defaultTZ()</script>
      <meta http-equiv="Content-Type"
            content="text/html; charset=windows-1252"/>
          <script language="JavaScript" src="../js/functions.js"></script>
    </head>

My goal is to automate the task of having to visit an external site and put the search term in it. 我的目标是使必须访问外部站点并将搜索词放入其中的任务实现自动化。 I would simply use a function to do the query and show to user the page with the result of the query. 我只是使用一个函数进行查询,并向用户显示查询结果页面。 Can I do this with GAS? 我可以使用GAS做到这一点吗? What are the first steps? 第一步是什么?

You question is too vague to answer properly. 您的问题太含糊,无法正确回答。 Your HTML fragment is not even a full page and contains no query code. 您的HTML片段甚至不是整页,也不包含查询代码。

I suggest you find out if your external database has a RESTful API available. 我建议您找出您的外部数据库是否具有可用的RESTful API。 You can then use App script to march through your spreadsheet and make queries on after another using that API. 然后,您可以使用App脚本浏览电子表格,然后使用该API进行查询。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 Google Apps 脚本访问外部电子表格中的数据 - How to access data from an external spreadsheet with Google Apps Script 如何使用 JavaScript 将 Google 电子表格数据拉入 Google Apps 脚本中的 HTML - How to use JavaScript to pull Google Spreadsheet data into HTML within Google Apps Script 如何使用Google Apps脚本自动下载Google电子表格数据 - how to automatically download Google spreadsheet data using Google Apps script 如何在给定时间使用Apps脚本在Google Spreadsheet中“复制-粘贴值”动态数据? - How To Use an Apps Script To “Copy-PasteValue” Dynamic Data In a Google Spreadsheet at a given time? 如何实现查询功能以将Google电子表格用作数据库? - How to implement query function to use Google spreadsheet as a database? 谷歌应用程序脚本 html 到电子表格 - Google apps script html to spreadsheet 如何判断Google Spreadsheet的Google Apps脚本中两个单元格是否相等 - How to tell if two cells are equal in Google Apps Script for Google Spreadsheet 如何在 Google 电子表格的 Google Apps 脚本中解析 JSON - How to parse JSON in Google Apps Script for Google Spreadsheet Google Spreadsheet:如何使用Google Apps脚本命名范围 - Google Spreadsheet: How to name a range using Google Apps Script 使用Google Apps脚本搜索电子表格不会返回任何数据 - Searching a spreadsheet using Google Apps Script returns no data
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM