Gecko Board

Written By Brian Sathinathan (Super Administrator)

Updated at January 5th, 2021

Description

The current version of this component only allows the creation of Datasets by specifying the table schema in the msg.fields property.

Code For Above Flow

[{"id":"49b904c.6d9cdfc","type":"geckoboard","z":"eb81f250.bb565","name":"","tokens":"","x":430,"y":640,"wires":[["74020171.2bd4f"]]},{"id":"778934d8.61062c","type":"inject","z":"eb81f250.bb565","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":640,"wires":[["a92a2c91.06564"]]},{"id":"74020171.2bd4f","type":"console","z":"eb81f250.bb565","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":590,"y":640,"wires":[]},{"id":"a92a2c91.06564","type":"function","z":"eb81f250.bb565","name":"setting up fields","func":"var require = context.global.get('require'); \nmsg.fields = {\n  \"id\": \"sales.by_day\",\n  \"fields\": {\n    \"amount\": { \"type\": \"number\", \"name\": \"Amount\", \"optional\": false },\n    \"timestamp\": { \"type\": \"datetime\", \"name\": \"Time\" }\n  },\n  \"unique_by\": [\"timestamp\"]\n};\nreturn msg;","outputs":1,"noerr":0,"x":260,"y":640,"wires":[["49b904c.6d9cdfc"]]}]

Input

fields (JSON)A string formated as a JSON object to specify the schema for the dataset to be created (Example: msg.fields = {
  “id”: “sales.by_day”,
  “fields”: {
    “amount”: { “type”: “number”, “name”: “Amount”, “optional”: false },
    “timestamp”: { “type”: “datetime”, “name”: “Time” }
  },
  “unique_by”: [“timestamp”]
})

Parameters

API_KEY(string)The users API_KEY (Obtained from having an account with geckoboard)

Output

payload (object)Confirmation message that the dataset was created.


Was this article helpful?