Node-REDのHowTo(その9)

Node-REDのメモ 応用編 Google spreadsheet Read

Node-REDでGoogle spreadsheet からデータを取得したときの設定手順のメモ。
鶏頭で忘れっぽいのでメモ。

準備

その8 に従って準備済みであるものとする。

フローの作成

Google Sheetsノード

設定内容と取得内容の関係はよくワカランので、色々試してみてください。
現実的には、細かくデータを取得してどうこうするより、シート全体を取得して処理するような使い方になるのかな??

実行

トリガとなるノードからトリガが入力されれば、スプレッドシートの内容が取得されるハズ。

このとき、Google Sheetsノードが"Missing VISEO Bot Maker key - Read the documentation."というメッセージを出力するが、これは単なるワーニングなので、気にしなくて良い(らしい)。

フローの例

秘密鍵の内容は入っていないので、別途入力すること
スプレッドシートのIDも削除してあるので、作成したスプレッドシートのIDを入力すること


[
    {
        "id": "5eb2475f.ea747",
        "type": "tab",
        "label": "spreadsheet_read",
        "disabled": false,
        "info": ""
    },
    {
        "id": "60d62f37.80a8a",
        "type": "inject",
        "z": "5eb2475f.ea747",
        "name": "",
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 110,
        "y": 140,
        "wires": [
            [
                "bba510f2.5bb2d8"
            ]
        ]
    },
    {
        "id": "e183b4f0.c372f",
        "type": "debug",
        "z": "5eb2475f.ea747",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "x": 490,
        "y": 140,
        "wires": []
    },
    {
        "id": "37bd743e.1ca96c",
        "type": "debug",
        "z": "5eb2475f.ea747",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "x": 490,
        "y": 180,
        "wires": []
    },
    {
        "id": "bba510f2.5bb2d8",
        "type": "google-spreadsheet",
        "z": "5eb2475f.ea747",
        "name": "spreadsheet read",
        "auth": "9550e71e.d49b88",
        "sheet": "ナイショ 自分のシートのIDを書いてね",
        "range": "BME280!a:zzz",
        "method": "append",
        "direction": "line",
        "action": "get",
        "clear": false,
        "line": false,
        "column": true,
        "fields": "all",
        "save": "_sheet",
        "selfields": [
            ""
        ],
        "cell_l": "",
        "cell_c": "",
        "input": "",
        "output": "_output",
        "saveType": "msg",
        "inputType": "msg",
        "outputType": "msg",
        "sheetType": "str",
        "rangeType": "str",
        "cell_lType": "str",
        "cell_cType": "str",
        "x": 290,
        "y": 140,
        "wires": [
            [
                "e183b4f0.c372f"
            ],
            [
                "37bd743e.1ca96c"
            ]
        ]
    },
    {
        "id": "9550e71e.d49b88",
        "type": "google-service-account",
        "z": "",
        "name": "edior1@myproject3",
        "scope": [
            "https://www.googleapis.com/auth/spreadsheets"
        ],
        "way": "json",
        "check_dialogflow": "",
        "check_speech": ""
    }
]