1. 먼저 구글 스프레드시트에 목록을 입력합니다.

    테스트명단

    https://s3-us-west-2.amazonaws.com/secure.notion-static.com/cc08bf30-f7c8-45db-96cd-ff6c56f3b8dc/_2021-01-15__12.09.36.png

  2. 시트 키를 이용하여 html 형식으로 출력되도록 합니다.

    https://s3-us-west-2.amazonaws.com/secure.notion-static.com/30f66c7c-8db5-4d76-b8d7-e0bbdde86379/_2021-01-15__12.18.17.png

    기본 구글스프레드시트 주소에서 키를 가져옵니다.

    https://docs.google.com/spreadsheets/d/**1z4p9YlkQxsroWcYKEcjnm1NSZPegfBvXUA5cFxrsg6Y**/edit#gid=0

    다음 주소에 키를 입력하여 실행합니다.

    https://docs.google.com/spreadsheets/u/0/d/**1z4p9YlkQxsroWcYKEcjnm1NSZPegfBvXUA5cFxrsg6Y**/gviz/tq?tqx=out:html

    시트1

  3. 쿼리언어를 이용해서 주소를 수정해주고 원하는 내용만 출력되도록 합니다.

    Select *

    Where A = 허명성 and B = 080201

    https://docs.google.com/spreadsheets/u/0/d/1z4p9YlkQxsroWcYKEcjnm1NSZPegfBvXUA5cFxrsg6Y/gviz/tq?tqx=out:html&tq=SELECT+*+WHERE+A+=+"허명성"+and+B+=+"080201"

    https://docs.google.com/spreadsheets/u/0/d/1z4p9YlkQxsroWcYKEcjnm1NSZPegfBvXUA5cFxrsg6Y/gviz/tq?tqx=out:html&tq=SELECT+*+WHERE+A+LIKE+"허명성"+and+B+=+"080201"

  4. 구글 스프레드 시트의 공동작업 이슈를 없애기 위해 웹페이지에서 자바스크립트를 이용하고자 합니다.

    4.1. 구글 사이트도구를 이용해서 페이지를 만듭니다.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b7bdef8b-bc4c-4bfa-92a9-cb9a84672a58/_2021-01-15__12.33.42.png

4.2. 페이지에 삽입을 누르고 소스코드를 입력합니다.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/45919f69-adec-4f3c-baff-4cd49f5ffb05/_2021-01-15__12.10.08.png

4.3. 소스코드는 다음과 같습니다.

<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>Document</title>

    <script language=javascript>
        function getPost() {

            var search = document.frmSubmit.txt1.value;
            var search2 = document.frmSubmit.txt2.value;

            if (search == '' || search == null || search2 == '' || search2 == null) {
                alert(" 값을 입력해주세요 ");
            } else {
                var url;
                url = "<https://docs.google.com/spreadsheets/u/0/d/1z4p9YlkQxsroWcYKEcjnm1NSZPegfBvXUA5cFxrsg6Y/gviz/tq?tqx=out:html&tq=SELECT+*+WHERE+A+=+>'" + search + "'+AND+B+=+'" + search2 + "'";
                window.open(url, "", "width=400,height=400,left=600");//1
//               location.href = url; //2
            }

        }
        
    </script>

</head>

<body>
    <form name=frmSubmit method="POST">
        이름<br>
        <input type=text name=txt1>
        <p>
        생년월일<br>
        <input type=text name=txt2>
        <p>
        <input type=button name=btn1 value="검색" target="_blank" onClick="getPost()">

    </form>
</body>

</html>

테스트 알리미

  1. 결과확인