I just put together some example flows. I think this could help as it will sync data with the cloud and offload the data enqueued on the Notecard.
There’s more to get into regarding note.template
but lets start with this.
Here’s Notecard Config:
[{"id":"24aa7f87.d1569","type":"tab","label":"Notecard Connectivity","disabled":false,"info":"# Configure Notecard for Connectivity\nTo communicate with the cloud, Notecard requires\n * A Product UID\n * A cloud synchronization policy\n\nFor more information about configuring these elements, view the links below.\n\n## Documentation Links\n\n### Setting Product UID:\nhttps://dev.blues.io/reference/notecard-walkthrough/essential-requests/#notehub-configuration\n\n### Cloud Synchronization Policy\nhttps://dev.blues.io/reference/notecard-walkthrough/essential-requests/#configuring-synchronization-modes\n "},{"id":"4454225f.a1e59c","type":"inject","z":"24aa7f87.d1569","name":"Product UID","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"req\":\"hub.set\",\"product\":\"<my-product-uid>\"}","payloadType":"json","x":170,"y":140,"wires":[["b449c4bb.506e78"]],"info":"# Product UID\nUnique identifier that is required for Notecard to connect to the cloud.\n\nUsually of the form\n\n`com.company.user.xxxxx`\n\n\nIdentifies which notehub.io project will own the data synced with this Notecard.\n\n\n## THIS IS REQUIRED FOR NOTECARD TO FUNCTION\nMany features of Notecard require the Product UID to be configured for them to function. \n\nSee Also:\n[Setting a Product UID](https://dev.blues.io/reference/notecard-walkthrough/essential-requests/#setting-a-productuid-and-serial-number)\n"},{"id":"efaab9cf.507168","type":"inject","z":"24aa7f87.d1569","name":"Periodic Mode","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"req\":\"hub.set\",\"mode\":\"periodic\",\"outbound\":1,\"inbound\":7}","payloadType":"json","x":170,"y":260,"wires":[["b449c4bb.506e78"]],"info":"# Periodic Connectivity\nConfiguration policy to set cloud connectivity on a periodic schedule.\n\n`mode`: **Periodic** -- turns on the modem and attempts to establish a cloud sync session on a periodic schedule. When sync is completed, session is closed and the modem turns off.\n\n\n`outbound`: number of minutes between cloud data syncs _if_ there is new Notes stored on Notecard since the last data sync\n\n`inbound`: number of minutes between cloud data syncs regardless of new Notes being available on Notecard since the last data sync"},{"id":"b207afeb.2440c","type":"inject","z":"24aa7f87.d1569","name":"Continuous Mode","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"req\":\"hub.set\",\"mode\":\"continuous\",\"outbound\":1,\"inbound\":7}","payloadType":"json","x":160,"y":340,"wires":[["b449c4bb.506e78"]],"info":"# Periodic Connectivity\nConfiguration policy to set cloud maintain cloud connectivity continuously.\n\n`mode`: **Continuous** -- maintain connection to the cloud continuously. Re-establish connections if it becomes disconnected.\n\n`outbound`: number of minutes between cloud data syncs _if_ there is new Notes stored on Notecard since the last data sync\n\n`inbound`: number of minutes between cloud data syncs regardless of new Notes being available on Notecard since the last data sync"},{"id":"b449c4bb.506e78","type":"notecard-request","z":"24aa7f87.d1569","notecard":"31ab40b8.fe425","name":"","payload":"payload","payloadType":"msg","outputType":"","x":440,"y":140,"wires":[["3a169bcc.1a6bc4"]]},{"id":"3a169bcc.1a6bc4","type":"debug","z":"24aa7f87.d1569","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":650,"y":140,"wires":[]},{"id":"db0bb553.b81728","type":"comment","z":"24aa7f87.d1569","name":"Configure Notecard Connectivity -- read description of each injection node in flow","info":"","x":360,"y":80,"wires":[]},{"id":"2d5bef4c.150cf","type":"comment","z":"24aa7f87.d1569","name":"must set Product UID","info":"# If you don't have a Product UID or Notehub Project\nSee this tutorial: https://dev.blues.io/build/quickstart/#create-a-notehub-project\n\n","x":140,"y":180,"wires":[]},{"id":"8ccd19aa.b99d98","type":"inject","z":"24aa7f87.d1569","name":"Force Sync Attempt","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"req\":\"hub.sync\"}","payloadType":"json","x":150,"y":400,"wires":[["b449c4bb.506e78"]],"info":"# Force Hub Sync Attempt\nRequest that forces a Notecard cloud sync attempt, as long as the `hub.set:mode` is not set to `off`\n\nSee also:\nhttps://dev.blues.io/reference/complete-api-reference/hub-requests/#hub-sync\n\n\n"},{"id":"31ab40b8.fe425","type":"notecard-config","name":"default","busno":"1","address":"0x17"}]
Adding Notes to Notecard:
[{"id":"b4be7279.4080e","type":"tab","label":"Adding Notes","disabled":false,"info":"# Add Notes to Notecard\nNotes are the primary means of storing sensor data that will be synched to the cloud.\n\nFor more information about adding Notes, see:\n\n - [Quickstart Tutorial](https://dev.blues.io/build/quickstart/#queue-notes-to-your-notecard)\n - [note.add request](https://dev.blues.io/reference/complete-api-reference/note-requests/#note-add)"},{"id":"b67112b.e0ed9f","type":"inject","z":"b4be7279.4080e","name":"Simulate New Sensor Data","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"sensor_data_1\":$now()}","payloadType":"jsonata","x":150,"y":280,"wires":[["12c10004.8cb51"]],"info":"Simulate creation of sensor data by creating a JSON object where the field values change each time it is injected."},{"id":"c440d2fd.a6a1a","type":"debug","z":"b4be7279.4080e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":750,"y":280,"wires":[]},{"id":"12c10004.8cb51","type":"function","z":"b4be7279.4080e","name":"note.add","func":"// Create note.add request for Notecard\nconst request = {\n req: \"note.add\",\n body: msg.payload\n}\n\n// Store request in message payload\nmsg.payload = request;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":360,"y":280,"wires":[["52109e38.25414"]],"info":"# Create note.add Request\nCreates a JSON object formulated to a `note.add` request for Notecard\n\n`body`: JSON object that is the user defined data of a Note that is enqueued on Notecard.\n"},{"id":"52109e38.25414","type":"notecard-request","z":"b4be7279.4080e","notecard":"31ab40b8.fe425","name":"","payload":"payload","payloadType":"msg","outputType":"","x":550,"y":280,"wires":[["c440d2fd.a6a1a"]]},{"id":"a1dee01c.1d745","type":"comment","z":"b4be7279.4080e","name":"Enqueue Data on Notecard","info":"","x":150,"y":220,"wires":[]},{"id":"31ab40b8.fe425","type":"notecard-config","name":"default","busno":"1","address":"0x17"}]
Start with this to see if this helps.