im trying to display all images from a src but my template just display the last one, my template:
<img width="30" height="30" src= "{{msg.payload._value}}" alt='Image not found' />
My debug show this:
Can someone help me ?
im trying to display all images from a src but my template just display the last one, my template:
<img width="30" height="30" src= "{{msg.payload._value}}" alt='Image not found' />
My debug show this:
Can someone help me ?
Possibly you have the "Reload last value on refresh" checked in ui_template node settings ?
Uncheck it and try again .. you may need to restart Node-red server to clear any cached values.
Test flow :
[{"id":"2cdd0d87130cd5c5","type":"inject","z":"54efb553244c241f","name":"image1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"_value\":\"data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==\"}","payloadType":"json","x":370,"y":1180,"wires":[["3a1854cd2e61fb33"]]},{"id":"3a1854cd2e61fb33","type":"ui_template","z":"54efb553244c241f","group":"780cfd9c93f7b572","name":"","order":0,"width":"5","height":"5","format":"<style>\n .myImage {\n height: 100px;\n width: 100px;\n }\n</style>\n\n<img class=\"myImage\" src=\"{{msg.payload._value}}\" alt='Image not found' />","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","className":"","x":560,"y":1220,"wires":[[]]},{"id":"a7015d0ff437872d","type":"inject","z":"54efb553244c241f","name":"image2","props":[{"p":"payload._value","v":"data:image/gif;base64,R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+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xdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":370,"y":1260,"wires":[["3a1854cd2e61fb33"]]},{"id":"780cfd9c93f7b572","type":"ui_group","name":"Test","tab":"0baea998ce75eabd","order":1,"disp":true,"width":"12","collapse":false,"className":""},{"id":"0baea998ce75eabd","type":"ui_tab","name":"Test Group","icon":"","disabled":false,"hidden":false}]
it did not work
well that's not very informative
can you explain to us what doesnt work and export/share a demo flow explaining in some more detail the problem ? sometimes its little difficult to understand with just screenshots
I simply i need to upload several photos to my database and then I want to go get them and show them on the dashboard
I'm an guessing this is related to your other thread: Node-red payload
If so, then I recommend you filter out the entries that are not images then send the array of data to a template node & use angularjs ngRepeat directive to build html & IMG tags with the IMG SRC set to the ._value
field.
If you had stated your intention on the original thread you would have got this answer sooner.
Ok, but my data comes from influxdb in the same _value variable how I do that?
this is the output of the function:
Here is a demo flow of how you can filter your array into data that have a _field
description and to images
[{"id":"3487880915b921a8","type":"inject","z":"54efb553244c241f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":1620,"wires":[["319f290522a46ad1"]]},{"id":"319f290522a46ad1","type":"template","z":"54efb553244c241f","name":"db data","field":"payload","fieldType":"msg","format":"json","syntax":"plain","template":"[\n {\n \"result\": \"last\",\n \"table\": 0,\n \"_start\": \"2022-06-05T13:44:43.9949941Z\",\n \"_stop\": \"2022-06-05T14:44:43.9949941Z\",\n \"_time\": \"2022-06-05T14:41:03.77Z\",\n \"_value\": \"1\",\n \"_field\": \"description\",\n \"_measurement\": \"info\"\n },\n {\n \"result\": \"last\",\n \"table\": 0,\n \"_start\": \"2022-06-05T13:44:43.9949941Z\",\n \"_stop\": \"2022-06-05T14:44:43.9949941Z\",\n \"_time\": \"2022-06-05T14:44:24.019Z\",\n \"_value\": \"hi\",\n \"_field\": \"description\",\n \"_measurement\": \"info\"\n },\n {\n \"result\": \"last\",\n \"table\": 1,\n \"_start\": \"2022-06-05T13:44:43.9949941Z\",\n \"_stop\": \"2022-06-05T14:44:43.9949941Z\",\n \"_time\": \"2022-06-05T14:41:03.77Z\",\n \"_value\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF58vYl2I0muLBgkJWVtd97M/3/f6+5bW+7aSIpzbAPgoaxWnSxlSmQwwhfAYDDADz//9P/dNn7dttvtbbsd8M/bdjhu2+GAP8ftcDhst9u2vfGVB37Hz4+323Z3O2/H29u2Hbd679vhxr/fDtt2e8M1D3wff7Adt8PtyH8f8DlvF70fn3rItQ966eG4+Vfbdrjp9fxs/NJ3fbhtbzfcOz4LN3jgvW1H3jyeit/zPHq+bbvddK3tjXfGZ8dz8wl9fVwH1z0cTtt2wzic+Od0vNNnbG/b2+1lu76dt7e3q9973I7H43Y6adzO54s/jw/Y97cdtuPhsF0vr/W5ul/88XBt23Z909icjrjecTtyPnBfeObrdrtdMCM1HppJzY/G33N10phojPSFT8J9Y478A74X184XPh/Pkc/Hd9x3xujt7cLXYw40rp6XzA/G+YBnxTNgTjzGGNfjYXu5nP2ew3Y8nrbT6cRnxOdeL2/bgWPma4770pLi7Pbv8byc79yE1i3X8A33cNzwH1Ze7vKIcfG6wmC9XTGmGg+tVvwef+n7WNYf52GMKdeFXstxydjmghrhmgGsK77+qPt42970DJxvXae+5114Jqw+XB/vwf1in92u23Z44zjjdjFPmG/dn57/hDWMFYO3bLftsl3q2Y5H/ObINcgR4ALKgvLeG/cjW4A5PXIuuX5xD7sv3AfXDF5/fas9nefSXuEHcj1e37BnYIP0eo0BxgdGRnuSfzjXV9kpLQfN2e02p0ujfTxub7g/vlDfcU3szzl/Ge/jqdc4bph2zPOc9Y/7O1/PnB/8nT8fCxKvv1y0/2v6uZQ0t/iDda49N/ewbBhHzDYjq7ZtgFbnBeNxwFxetzfYg8PbdjjettMdrrFtp5Pu63Q4bnfHE9czPv...\",\n \"_field\": \"image\",\n \"_measurement\": \"info\"\n },\n {\n \"result\": \"last\",\n \"table\": 1,\n \"_start\": \"2022-06-05T13:44:43.9949941Z\",\n \"_stop\": \"2022-06-05T14:44:43.9949941Z\",\n \"_time\": \"2022-06-05T14:44:24.019Z\",\n \"_value\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF6UvYtyG0myJZgASbXZ7O0qqa/N2v7/983s3K4qSSQBkGt+Hu4nAlDNrNqqJRJAIjPCH8ePP+L0//z+z8/P4zg+Pj+Pj+Pz+Dwdx/F0Pm719/l8fHx+HMfpdPCF9b/zx+l4+Twfp4+6wudxnD7qSvp3/Vw/8efPun697Tgdn7rO5+fHcTp9HqfT6TidzsdZ/9V34aaO0/Fxu+Gz9R++o/47n47T2beDNx51m/4Mr3fC9fD1f/Pn88Rr4q965NMZ/64n5XXzAn5+vlb3/PFxw3dxeXhfdanzmVfAax/Hcav7w6WesJbnp6d6jOM4XbVmtQcfR91PrQuv4gervz/xLKdPPxvX7IZd0/bgAc7rz/0cXM/6fP2N58QacUewz17f2jetd/3+VOtdD4b9Oem1kolP7E/9jv/hhvHe+p76XckGn/usv+cecEfnkrlPfzOeht9tkfNOeBN5/9ivU63X9fiE3GnFzhSMejY8WV2r1ozCyD3x/kKU6v1c+3qBMtlX85di+esa56PWrf57almmbJeclrRf61FbPuvZav24Lvxufmc9w+dxul2PM27xdNzq71qnusC55OQMOWlRwLPUq1zr8+nzeD7V+n8eT3juki48Ke4Te/Vxw8exfU8n6DYvL1ktmcPz96PiO5+fnvScet56gtvH8XGr/fw8np7Ox7lkTYoDnTuf8DvIivbo4+ODclDyca5rzn7Wul1vV+w314g6dNa165EgCyVD+rv2cOzBcXzoxkvfbCGwe5+lGR+9r72IkGXqJXTz9kHVqnUKG0MZLN2ttX3Gfn9+no7b7fOoZ4JMnWmfWk+hrp+xv7zXupbvH1sYi13qyP2pDTodn1hTPgvk8oP6dD4/H0/np+Pp9MS/z2f89/L8xPuR3T6eT8f55Ql7/Q...\",\n \"_field\": \"image\",\n \"_measurement\": \"info\"\n }\n]","output":"json","x":360,"y":1620,"wires":[["5104f607df7f69f1"]]},{"id":"71c8d592186e0111","type":"switch","z":"54efb553244c241f","name":"","property":"payload._field","propertyType":"msg","rules":[{"t":"eq","v":"image","vt":"str"},{"t":"eq","v":"description","vt":"str"}],"checkall":"true","repair":true,"outputs":2,"x":690,"y":1620,"wires":[["c0c7998aa6e82305"],["9b8a9ab432b8139e"]]},{"id":"7238847bd9f0e0c4","type":"debug","z":"54efb553244c241f","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1020,"y":1560,"wires":[]},{"id":"5104f607df7f69f1","type":"split","z":"54efb553244c241f","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":530,"y":1620,"wires":[["71c8d592186e0111"]]},{"id":"c0c7998aa6e82305","type":"join","z":"54efb553244c241f","name":"","mode":"auto","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":870,"y":1560,"wires":[["7238847bd9f0e0c4"]]},{"id":"eb1f63617eb61be2","type":"debug","z":"54efb553244c241f","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1020,"y":1660,"wires":[]},{"id":"9b8a9ab432b8139e","type":"join","z":"54efb553244c241f","name":"","mode":"auto","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":870,"y":1660,"wires":[["eb1f63617eb61be2"]]},{"id":"bcd4722ae550b040","type":"comment","z":"54efb553244c241f","name":"fliter data array","info":"","x":700,"y":1540,"wires":[]},{"id":"1d3eeaf7aaf5455c","type":"comment","z":"54efb553244c241f","name":"images","info":"","x":1010,"y":1500,"wires":[]},{"id":"fed09a2ded571e42","type":"comment","z":"54efb553244c241f","name":"descriptions","info":"","x":1030,"y":1720,"wires":[]}]
ps. i had to read a bit from your other Forum threads. It would be better if you continued the conversation in one place so people that already tried to help can do so.
Ok, thank you but know i have a template and when i try display all _values he just display the last one.
yes you mentioned that .. one step at a time
now that you have the data filtered you can try Steve's suggestion and use
The node-red Dashboard is based on the Angular front-end library and it has some useful directives to loop through the data.
For Example :
<div ng-repeat="x in msg.payload">
<img class="myImage" src="{{x._value}}" alt='Image not found' />
</div>
Modified Flow:
[{"id":"3487880915b921a8","type":"inject","z":"54efb553244c241f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":1620,"wires":[["319f290522a46ad1"]]},{"id":"319f290522a46ad1","type":"template","z":"54efb553244c241f","name":"db data","field":"payload","fieldType":"msg","format":"json","syntax":"plain","template":"[\n {\n \"result\": \"last\",\n \"table\": 0,\n \"_start\": \"2022-06-05T13:44:43.9949941Z\",\n \"_stop\": \"2022-06-05T14:44:43.9949941Z\",\n \"_time\": \"2022-06-05T14:41:03.77Z\",\n \"_value\": \"1\",\n \"_field\": \"description\",\n \"_measurement\": \"info\"\n },\n {\n \"result\": \"last\",\n \"table\": 0,\n \"_start\": \"2022-06-05T13:44:43.9949941Z\",\n \"_stop\": \"2022-06-05T14:44:43.9949941Z\",\n \"_time\": \"2022-06-05T14:44:24.019Z\",\n \"_value\": \"hi\",\n \"_field\": \"description\",\n \"_measurement\": \"info\"\n },\n {\n \"result\": \"last\",\n \"table\": 1,\n \"_start\": \"2022-06-05T13:44:43.9949941Z\",\n \"_stop\": \"2022-06-05T14:44:43.9949941Z\",\n \"_time\": \"2022-06-05T14:41:03.77Z\",\n \"_value\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAApgAAAKYB3X3/OAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAANCSURBVEiJtZZPbBtFFMZ/M7ubXdtdb1xSFyeilBapySVU8h8OoFaooFSqiihIVIpQBKci6KEg9Q6H9kovIHoCIVQJJCKE1ENFjnAgcaSGC6rEnxBwA04Tx43t2FnvDAfjkNibxgHxnWb2e/u992bee7tCa00YFsffekFY+nUzFtjW0LrvjRXrCDIAaPLlW0nHL0SsZtVoaF98mLrx3pdhOqLtYPHChahZcYYO7KvPFxvRl5XPp1sN3adWiD1ZAqD6XYK1b/dvE5IWryTt2udLFedwc1+9kLp+vbbpoDh+6TklxBeAi9TL0taeWpdmZzQDry0AcO+jQ12RyohqqoYoo8RDwJrU+qXkjWtfi8Xxt58BdQuwQs9qC/afLwCw8tnQbqYAPsgxE1S6F3EAIXux2oQFKm0ihMsOF71dHYx+f3NND68ghCu1YIoePPQN1pGRABkJ6Bus96CutRZMydTl+TvuiRW1m3n0eDl0vRPcEysqdXn+jsQPsrHMquGeXEaY4Yk4wxWcY5V/9scqOMOVUFthatyTy8QyqwZ+kDURKoMWxNKr2EeqVKcTNOajqKoBgOE28U4tdQl5p5bwCw7BWquaZSzAPlwjlithJtp3pTImSqQRrb2Z8PHGigD4RZuNX6JYj6wj7O4TFLbCO/Mn/m8R+h6rYSUb3ekokRY6f/YukArN979jcW+V/S8g0eT/N3VN3kTqWbQ428m9/8k0P/1aIhF36PccEl6EhOcAUCrXKZXXWS3XKd2vc/TRBG9O5ELC17MmWubD2nKhUKZa26Ba2+D3P+4/MNCFwg59oWVeYhkzgN/JDR8deKBoD7Y+ljEjGZ0sosXVTvbc6RHirr2reNy1OXd6pJsQ+gqjk8VWFYmHrwBzW/n+uMPFiRwHB2I7ih8ciHFxIkd/3Omk5tCDV1t+2nNu5sxxpDFNx+huNhVT3/zMDz8usXC3ddaHBj1GHj/As08fwTS7Kt1HBTmyN29vdwAw+/wbwLVOJ3uAD1wi/dUH7Qei66PfyuRj4Ik9is+hglfbkbfR3cnZm7chlUWLdwmprtCohX4HUtlOcQjLYCu+fzGJH2QRKvP3UNz8bWk1qMxjGTOMThZ3kvgLI5AzFfo379UAAAAASUVORK5CYII=\",\n \"_field\": \"image\",\n \"_measurement\": \"info\"\n },\n {\n \"result\": \"last\",\n \"table\": 1,\n \"_start\": \"2022-06-05T13:44:43.9949941Z\",\n \"_stop\": \"2022-06-05T14:44:43.9949941Z\",\n \"_time\": \"2022-06-05T14:44:24.019Z\",\n \"_value\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAApgAAAKYB3X3/OAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAANCSURBVEiJtZZPbBtFFMZ/M7ubXdtdb1xSFyeilBapySVU8h8OoFaooFSqiihIVIpQBKci6KEg9Q6H9kovIHoCIVQJJCKE1ENFjnAgcaSGC6rEnxBwA04Tx43t2FnvDAfjkNibxgHxnWb2e/u992bee7tCa00YFsffekFY+nUzFtjW0LrvjRXrCDIAaPLlW0nHL0SsZtVoaF98mLrx3pdhOqLtYPHChahZcYYO7KvPFxvRl5XPp1sN3adWiD1ZAqD6XYK1b/dvE5IWryTt2udLFedwc1+9kLp+vbbpoDh+6TklxBeAi9TL0taeWpdmZzQDry0AcO+jQ12RyohqqoYoo8RDwJrU+qXkjWtfi8Xxt58BdQuwQs9qC/afLwCw8tnQbqYAPsgxE1S6F3EAIXux2oQFKm0ihMsOF71dHYx+f3NND68ghCu1YIoePPQN1pGRABkJ6Bus96CutRZMydTl+TvuiRW1m3n0eDl0vRPcEysqdXn+jsQPsrHMquGeXEaY4Yk4wxWcY5V/9scqOMOVUFthatyTy8QyqwZ+kDURKoMWxNKr2EeqVKcTNOajqKoBgOE28U4tdQl5p5bwCw7BWquaZSzAPlwjlithJtp3pTImSqQRrb2Z8PHGigD4RZuNX6JYj6wj7O4TFLbCO/Mn/m8R+h6rYSUb3ekokRY6f/YukArN979jcW+V/S8g0eT/N3VN3kTqWbQ428m9/8k0P/1aIhF36PccEl6EhOcAUCrXKZXXWS3XKd2vc/TRBG9O5ELC17MmWubD2nKhUKZa26Ba2+D3P+4/MNCFwg59oWVeYhkzgN/JDR8deKBoD7Y+ljEjGZ0sosXVTvbc6RHirr2reNy1OXd6pJsQ+gqjk8VWFYmHrwBzW/n+uMPFiRwHB2I7ih8ciHFxIkd/3Omk5tCDV1t+2nNu5sxxpDFNx+huNhVT3/zMDz8usXC3ddaHBj1GHj/As08fwTS7Kt1HBTmyN29vdwAw+/wbwLVOJ3uAD1wi/dUH7Qei66PfyuRj4Ik9is+hglfbkbfR3cnZm7chlUWLdwmprtCohX4HUtlOcQjLYCu+fzGJH2QRKvP3UNz8bWk1qMxjGTOMThZ3kvgLI5AzFfo379UAAAAASUVORK5CYII=\",\n \"_field\": \"image\",\n \"_measurement\": \"info\"\n }\n]","output":"json","x":360,"y":1620,"wires":[["5104f607df7f69f1"]]},{"id":"71c8d592186e0111","type":"switch","z":"54efb553244c241f","name":"","property":"payload._field","propertyType":"msg","rules":[{"t":"eq","v":"image","vt":"str"},{"t":"eq","v":"description","vt":"str"}],"checkall":"true","repair":true,"outputs":2,"x":690,"y":1620,"wires":[["c0c7998aa6e82305"],["9b8a9ab432b8139e"]]},{"id":"7238847bd9f0e0c4","type":"debug","z":"54efb553244c241f","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":960,"y":1540,"wires":[]},{"id":"5104f607df7f69f1","type":"split","z":"54efb553244c241f","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":530,"y":1620,"wires":[["71c8d592186e0111"]]},{"id":"c0c7998aa6e82305","type":"join","z":"54efb553244c241f","name":"","mode":"auto","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":870,"y":1600,"wires":[["7238847bd9f0e0c4","5a467869265fcb5b"]]},{"id":"eb1f63617eb61be2","type":"debug","z":"54efb553244c241f","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":1720,"wires":[]},{"id":"9b8a9ab432b8139e","type":"join","z":"54efb553244c241f","name":"","mode":"auto","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":870,"y":1660,"wires":[["eb1f63617eb61be2"]]},{"id":"bcd4722ae550b040","type":"comment","z":"54efb553244c241f","name":"fliter array","info":"","x":700,"y":1560,"wires":[]},{"id":"5a467869265fcb5b","type":"ui_template","z":"54efb553244c241f","group":"780cfd9c93f7b572","name":"","order":0,"width":"5","height":"5","format":"<style>\n .myImage {\n height: 30px;\n width: 30px;\n padding: 10px;\n }\n</style>\n\n<!-- <img class=\"myImage\" ng-repeat=\"x in msg.payload\" ng-src=\"{{x._value}}\" alt='Image not found' /> -->\n\n\n<div ng-repeat=\"x in msg.payload\">\n <img class=\"myImage\" src=\"{{x._value}}\" alt='Image not found' />\n</div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","className":"","x":1060,"y":1600,"wires":[[]]},{"id":"780cfd9c93f7b572","type":"ui_group","name":"Test","tab":"0baea998ce75eabd","order":1,"disp":true,"width":"12","collapse":false,"className":""},{"id":"0baea998ce75eabd","type":"ui_tab","name":"Test Group","icon":"","disabled":false,"hidden":false}]
and if i put join node nothing work
I do it, thank you so much
It's possible i put the description in the same template with the output:
image image image
description description description
```
It's possible i put the description in the same template with the output:
I was going to ask about that .. in order to do that, each element of the array of db data returned must have the description
for each of the images in its object. So you have to review the way you return (or even save) your data from the db.
I was reading your two other Forum topics in order to understand more how your project works.
Maybe filtering and seperating the data to objects that have a _field
description
or image
is the wrong approach.
When you save the data to the db, you send a msg with the image base64 value but do you send the description
of the image along with it ? ( Im asking because from the result of your db query it seems that image and description are on seperate rows - array elements )
I havent used influxdb before but i notice that your msg.payload
is an array.
Does it need to be an array ?
I was reading the documenation of the node and i dont see an example where the payload is a single element array. There is an example of the payload being an object
msg.payload = {
intValue: '10i',
numValue: 123.0,
strValue: "message",
randomValue: Math.random()*10
}
return msg;
so in your case that would be
msg.payload = {
image: msg.payload.image,
description: msg.payload.Description
}
return msg;
can you make a backup of your db (if you have important data) re-test and see how the data is returned after the query ? we must get the image and description in the same array element
maybe someone more experienced with influx can advice you