# Unable to store information in cloudant

**URL:** <https://discourse.nodered.org/t/unable-to-store-information-in-cloudant/12349>\
**Category:** General\
**Created:** [18 June 2019 00:18 UTC](https://discourse.nodered.org/t/unable-to-store-information-in-cloudant/12349 "2019-06-18T00:18:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![leftShark2019](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@leftShark2019](https://discourse.nodered.org/u/leftShark2019)\
**Post date:** [18 June 2019 00:18 UTC](https://discourse.nodered.org/t/unable-to-store-information-in-cloudant/12349/1 "2019-06-18T00:18:08Z")

</div>

I've read through several pages of background docs, I have a cloudant database provisioned, I've successfully made a function that takes a photo with camerapi and a flow that converts that photo data to cloudant readable format, but when it turns into the cloudant database update object I get a perfect string but the database does update.

I've looked here:

> **[How to use Cloudant node in Node-Red? Need some guidance!!](https://developer.ibm.com/answers/questions/29740/how-to-use-cloudant-node-in-node-red-need-some-guidance.html)**
>
> Greetings folks.   
> Can someone provide me with a quick example of how to read data from a cloudant database using the Cloudant node? I have been struggling with this for a few days and can't seem to get this working. I am sure it's just a Newbie...

> <https://stackoverflow.com/questions/43170270/ibm-bluemix-iot-dashboard-line-graph-not-using-database-only-works-in-realtime>

> **[node-red-node-cf-cloudant](https://flows.nodered.org/node/node-red-node-cf-cloudant)**
>
> A Node-RED node to access Cloudant and couchdb databases

I've pulled several flows from IBM to figure out how to get this to work.

The database just isn't updating.

```auto
[{"id":"25a28659.b87cba","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"115baa25.2ebd96","type":"debug","z":"25a28659.b87cba","name":"","active":false,"console":"false","complete":"false","x":395.75,"y":184.5,"wires":[]},{"id":"5f5a52db.1d7a4c","type":"cloudant out","z":"25a28659.b87cba","name":"","cloudant":"b965da8a.f2f218","database":"demo_photos","service":"_ext_","payonly":true,"operation":"insert","x":900,"y":260,"wires":[]},{"id":"cfe60903.ffc7c8","type":"function","z":"25a28659.b87cba","name":"json","func":"var picId = msg.filename;\nvar picDate = msg.filedate;\nvar encoded = msg.payload;\nvar len = encoded.length;\n\n data = {\n \"fileName\":picId,\n \"len\":len,\n \"value\": \"data:image/png;base64,\" + msg.payload, \n \"pic_date\" : picDate\n }\n \nreturn [{payload:JSON.stringify(data)}, {payload: picId}];\n","outputs":1,"noerr":0,"x":728,"y":268,"wires":[["5f5a52db.1d7a4c","f176a38e.3a37c"]]},{"id":"d4a2f843.8d6ad8","type":"exec","z":"25a28659.b87cba","command":"base64 -w0","addpay":true,"append":"","useSpawn":"","timer":"","name":"","x":559,"y":280.5,"wires":[["cfe60903.ffc7c8","e2c197f7.f256f8"],[],[]]},{"id":"e2c197f7.f256f8","type":"debug","z":"25a28659.b87cba","name":"","active":true,"console":"false","complete":"false","x":630,"y":185,"wires":[]},{"id":"f176a38e.3a37c","type":"debug","z":"25a28659.b87cba","name":"","active":true,"console":"false","complete":"false","x":835,"y":184,"wires":[]},{"id":"2c30a4cd.198a8c","type":"wiotp out","z":"25a28659.b87cba","authType":"d","qs":"true","qsDeviceId":"picturetaken20161118","deviceKey":"","deviceType":"","deviceId":"","event":"pic taken","format":"json","qos":"","name":"pic taken","x":737.5833129882812,"y":383,"wires":[]},{"id":"1e7f2fca.aaff3","type":"comment","z":"25a28659.b87cba","name":"sending name of the file to bluemix","info":"","x":640,"y":334,"wires":[]},{"id":"c53991bf.2dab7","type":"inject","z":"25a28659.b87cba","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":180,"wires":[["e8186328.7c12b"]]},{"id":"5fbb8b22.636be4","type":"function","z":"25a28659.b87cba","name":"Prep photo object to send to telegram","func":"msg.payload={};\nmsg.payload.chatId=862276680;\nmsg.payload.type=\"photo\";\nmsg.payload.caption=\"Here's the caption\";\nmsg.payload.content= \"/home/pi/Pictures/photo0.JPEG\";\n//msg.payload.type=\"message\";\n//msg.payload.content=\"hello from node-red!\";\nreturn msg;","outputs":1,"noerr":0,"x":790,"y":460,"wires":[[]]},{"id":"80833ece.09266","type":"function","z":"25a28659.b87cba","name":"","func":"msg.payload=msg.payload;\n//msg.payload.chatId=862276680;\nmsg.payload.type=\"photo\";\nmsg.payload.caption=\"Photo to analyze\";\nmsg.payload.content= \"/home/pi/Pictures/photo0.JPEG\";\n//msg.payload.type=\"message\";\n//msg.payload.content=\"hello from node-red!\";\nreturn msg;","outputs":1,"noerr":0,"x":350,"y":280,"wires":[["115baa25.2ebd96","d4a2f843.8d6ad8"]]},{"id":"e8186328.7c12b","type":"camerapi-takephoto","z":"25a28659.b87cba","filemode":"1","filename":"photo0.JPEG","filedefpath":"0","filepath":"/home/pi/Pictures/","fileformat":"jpeg","resolution":"2","rotation":"0","fliph":"0","flipv":"0","brightness":"50","contrast":"0","sharpness":"0","quality":"80","imageeffect":"none","exposuremode":"auto","iso":"0","agcwait":"1.0","led":"0","awb":"auto","name":"","x":180,"y":300,"wires":[["80833ece.09266"]]},{"id":"b965da8a.f2f218","type":"cloudant","z":"25a28659.b87cba","host":"c1fe38c9-4d91-464d-ac51-89d4f24e9dcc-bluemix.cloudantnosqldb.appdomain.cloud","name":"node red db"}]

```
