在Google站点中引用Google表格的搜索框

问题描述 投票:0回答:1

早安

我正在尝试创建一个搜索按钮,该按钮将从Google网站上的Google表格中检索数据。我现在不需要太多编程,但是正在阅读很多东西。这是我的距离:

<!DOCTYPE html>
<html>
<body>

<h1>Attorney History Lookup</h1>

<script>
(function() {
var id = '7b3319b0-8755-11ea-9b6c-0242ac130002';
var ci_search = document.createElement('script');
ci_search.type = 'text/javascript';
ci_search.async = true;
ci_search.src = 'https://cse.expertrec.com/api/js/ci_common.js?id=' + id;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ci_search, s);
})();
</script>

<ci-search></ci-search>
<iframe width= '100%' height='1500'src="https://docs.google.com/spreadsheets/d/e/2PACX-1vRt1A6_tc7gV4EnJtGwUlu2zFtoRCYWq2Ba0PV4SfFzJSiGp7hWIPw-KLykq76zzJAKmOL-y58ug3Pu/pubhtml?widget=true&amp;headers=false"></iframe>

</body>
</html>

有人可以帮我将搜索结果与我的Google表格相关联吗?

亲切的问候

Alwina

google-sheets google-sites
1个回答
0
投票

由于您没有提到,因此以下内容可能有用。

  1. 如果要从电子表格中搜索内容,则需要先使用Sheets API对其进行检索。

This page here讨论了如何做。

  1. 您将需要从Google开发者控制台获取的凭据。您将需要该库以轻松使用它。有一个可以使用的JavaScript库。

  2. 此外,结果以JSON格式返回。您将需要解析它们。

  3. 之后,使用“条件语句”即可获得所需的结果。

  4. 最后,您可以显示结果。

© www.soinside.com 2019 - 2024. All rights reserved.