[{"element_type":"text","content":"\n  \n  \n  \n  \n        \u003cp\u003eSo it turns out there's a very simple way to use Actions in Adafruit IO to forward data to a google sheets spreadsheet. It's indirect, going from a webhook pointed at a third party, via google forms, with the responses recorded in the sheet. The third party is running the API for free, but \u003ca href=\"https://github.com/iketiunn/restful-google-form\" target=\"_blank\"\u003eit's also on GitHub\u003c/a\u003e, so you don't have to trust them (I've forked it for possible future deployment/recreation).\u003c/p\u003e\n      \n\n\n\n","metadata":{}},{"element_type":"alert","content":"\u003cp\u003eThis uses a third party service, not recommended for any data that you consider confidential, private, not safe to make public, etc.\u003c/p\u003e\n\n\u003cp\u003eLong term there is a plan to possibly add easy integrations to external platforms via extra Blocks, but no ETA yet.\u003c/p\u003e","metadata":{"class":"element alert-element build-alert alert-warning","markdown":"This uses a third party service, not recommended for any data that you consider confidential, private, not safe to make public, etc.\n\nLong term there is a plan to possibly add easy integrations to external platforms via extra Blocks, but no ETA yet.","alert_type":"warning"}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n        \u003ch1\u003eInstructions:\u003c/h1\u003e\n      \n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n        \u003cp\u003e1. Create a new form at \u003ca href=\"https://docs.google.com/forms/\" target=\"_blank\"\u003ehttps://docs.google.com/forms/\u003c/a\u003e\u003cbr\u003e\u003cbr\u003e\u003c/p\u003e\n\u003cp\u003e2. Add some questions on the Questions tab, which use the Short Answer (simple values) or paragraph type (multi-line support).\u003c/p\u003e\n      \n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/533/original/image.png?1737242061","metadata":{"caption":""}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003e3. On the Responses tab click the Link to Sheet button/link to set the responses to goto a sheet, create a new one or choose existing\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/535/original/image.png?1737242187","metadata":{"caption":""}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003e4. Publish the form, and click the Chain Link icon (two away from publish) to copy the link to the respondents form (where the data is entered)\u003cbr\u003e\u003cbr\u003e\u003c/p\u003e\n\u003cp\u003e5. Goto the third party API,\u0026nbsp;\u003ca href=\"https://restful-google-form.vercel.app/\"\u003ehttps://restful-google-form.vercel.app/\u003c/a\u003e and enter your form url and submit. \u003cbr\u003eYou'll see the form fields (the questions) displayed in JSON, and beneath is a curl command that you can run in your terminal / shell / command-line interface to test sending data to the form.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/532/original/Screenshot_2025-01-18_225010.png?1737242000","metadata":{"caption":""}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003e6. We'll use the URL from that curl command first for our webhook in Adafruit IO automated Actions, so copy it.\u003cbr\u003e\u003cbr\u003e\u003c/p\u003e\n\u003cp\u003e7. Goto Actions page of Adafruit IO and create a new Action (Blockly Action if asked):\u0026nbsp;\u003ca href=\"https://io.adafruit.com/\" target=\"_blank\"\u003ehttps://io.adafruit.com/\u003c/a\u003e\u003cbr\u003e\u003cbr\u003e\u003c/p\u003e\n\u003cp\u003e8. Add a trigger block, that fires when any data is received. Point it to a feed that will be receiving regular data.\u003cbr\u003e\u003cbr\u003e\u003c/p\u003e\n\u003cp\u003e9. Then add the output block, a publish Webhook block.\u0026nbsp;\u003cbr\u003eSet the URL to the one just copied from the third party site (begins https://restful-google-).\u003cbr\u003eSet the webhook blocks message to match the JSON data portion of the curl command (the section between single quotes after\u0026nbsp;\u003cstrong\u003e-d\u003c/strong\u003e). You'll notice the image below shows the message as it stands after step 11.\u003cbr\u003eSet the Feed of the webhook (last drop-down selector) to the feed with the data to publish.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/536/original/image.png?1737242302","metadata":{"caption":""}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003e10. Test the Action works. Add some data manually to the Feed that should trigger the Action.\u003cbr\u003eIf it didn't then please have a little play with the interface in case it tells you there is a validation issue with your action, but if you still are stuck please get in touch with IO support, via the forums, or feedback button.\u003cbr\u003eWe want the Actions to be fool-proof, so your struggle should be noted, and we'd appreciate the heads up!\u003cbr\u003e\u003cbr\u003e\u003c/p\u003e\n\u003cp\u003e11. Assuming it works, and some example data was added to your spreadsheet, then you now update the webhook message to use the feed value in the template.\u003cbr\u003eMy form has 3 short answer questions, so I've filled out my webhook templated message with this:\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003e{\u003cbr\u003e\"entry.1351769664\": \"{{feed_key}}\",\u003cbr\u003e\"entry.1707566972\": \"{{value}}\",\u003cbr\u003e\"entry.2029449718\": \"{{feed_name}}\"\u003cbr\u003e}\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e12. Test it, either with patience by waiting for fresh data, or manually add some to the feed to trigger the Action\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/537/original/image.png?1737242408","metadata":{"caption":""}},{"element_type":"text","content":"\n        \u003ch1\u003eRejoice! 🥳\u0026nbsp;Now be free...Go play with your lovely data!\u0026nbsp;\u003c/h1\u003e\n\u003cp\u003e\u003cbr\u003eWorth mentioning, there is a 5million cell limit in Google Sheets, but the 200,000 row limit is no longer an issue.\u003c/p\u003e\n\u003cp\u003eYou'll start losing data eventually, but when is anyone's guess...\u003c/p\u003e\n      ","metadata":{}}]