Current RMS - Google Sheets

Flow for interacting with Current RMS and Google Sheets. In this example we retrieve the name of a product from Current RMS and send it to a cell in a Google Sheets document.

Also included an example doing the other way round, update a the name of a product in Current RMS with a value from a cell in a Google Sheets document.

This example is very basic, if you want a more advanced custom solution please contact me

[{"id":"b14d47441f65a31c","type":"tab","label":"Current RMS - Google Sheets","disabled":false,"info":"Copyright (C) 2022 Johan Nilsson\n[https://gobo.ws]()","env":[]},{"id":"25bb596cf469878c","type":"GSheet","z":"b14d47441f65a31c","creds":"","method":"update","action":"","sheet":"","cells":"Sheet1!B1","flatten":false,"name":"Google Sheet","x":780,"y":100,"wires":[["958498171fc72168"]]},{"id":"958498171fc72168","type":"debug","z":"b14d47441f65a31c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":950,"y":100,"wires":[]},{"id":"cfcc16f831ac4d10","type":"function","z":"b14d47441f65a31c","name":"set headers","func":"msg.headers = {};\nmsg.headers['X-SUBDOMAIN'] = 'yoursubdomain';\nmsg.headers['X-AUTH-TOKEN'] = 'yourapikey';\nmsg.headers[\"content-type\"] = \"application/json\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":230,"y":100,"wires":[["6f270373ce4b9998"]]},{"id":"bef41a763694b52a","type":"inject","z":"b14d47441f65a31c","name":"Trigger","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"5","topic":"","payload":"","payloadType":"date","x":90,"y":100,"wires":[["cfcc16f831ac4d10"]]},{"id":"6f270373ce4b9998","type":"http request","z":"b14d47441f65a31c","name":"connect to API endpoint","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://api.current-rms.com/api/v1/products/28","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":430,"y":100,"wires":[["6f5584f9f5216bc5"]]},{"id":"6f5584f9f5216bc5","type":"template","z":"b14d47441f65a31c","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload.product.name}}","output":"str","x":620,"y":100,"wires":[["25bb596cf469878c"]]},{"id":"b87f6855c451997a","type":"comment","z":"b14d47441f65a31c","name":"Retrieve a product name from Current RMS and send it to a cell in a Google Sheets document","info":"","x":340,"y":40,"wires":[]},{"id":"66a31cf4234ee6b3","type":"comment","z":"b14d47441f65a31c","name":"Update a product name in Current RMS with a value from a cell in a Google Sheets document","info":"","x":340,"y":200,"wires":[]},{"id":"04ed39dff46e39df","type":"GSheet","z":"b14d47441f65a31c","creds":"","method":"get","action":"","sheet":"","cells":"Sheet1!B2","flatten":false,"name":"Google Sheet","x":240,"y":260,"wires":[["601d64a022094660"]]},{"id":"64295e76a20e5248","type":"inject","z":"b14d47441f65a31c","name":"Trigger","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":90,"y":260,"wires":[["04ed39dff46e39df"]]},{"id":"934059b9193fa957","type":"http request","z":"b14d47441f65a31c","name":"connect to API endpoint","method":"PUT","ret":"obj","paytoqs":"ignore","url":"https://api.current-rms.com/api/v1/products/28","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":750,"y":260,"wires":[["13325dc6541e6f71"]]},{"id":"9aa969388d1d3a37","type":"function","z":"b14d47441f65a31c","name":"set headers","func":"msg.headers = {};\nmsg.headers['X-SUBDOMAIN'] = 'yoursubdomain';\nmsg.headers['X-AUTH-TOKEN'] = 'yourapikey';\nmsg.headers[\"content-type\"] = \"application/json\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":260,"wires":[["934059b9193fa957"]]},{"id":"601d64a022094660","type":"template","z":"b14d47441f65a31c","name":"","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n\t\"product\": {\n\t\t\"name\": \"{{payload}}\"\n\t}\n}","output":"json","x":400,"y":260,"wires":[["9aa969388d1d3a37"]]},{"id":"13325dc6541e6f71","type":"debug","z":"b14d47441f65a31c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":950,"y":260,"wires":[]}]

Flow Info

Created 3 years, 7 months ago
Updated 3 years, 5 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • comment (x2)
  • debug (x2)
  • function (x2)
  • http request (x2)
  • inject (x2)
  • template (x2)
Other

Tags

  • Current RMS
  • google sheets
  • GSheet
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option