Working With JSON Data in Node Red

preview_player
Показать описание
JSON is popular format for encoding data sent over the Internet, and also for data stored in files.
In this video tutorial we take a more detailed look at node-red and JSON data.
We look at the JSON.parse() and JSON.stringify() functions which you can use in the function node and also the JSON node which does the encoding and decoding for you.

We look at decoding JSON data using the JSON expression editor in the change node.

You will learn how to extract data from JSON strings,payload and message objects using the function node and the change node and the expression editor and jsonata.
We also look at working through JSON data using the node command line.

This is very useful when troubleshooting JSON data problems.

You will also encounter errors when decoding JSON data we look at creating JSON data using the inject node and what the message Unexpected token in JSON at position 0 means

Tutorial on website

Flow used in video

Related videos

Publish JSON Data over MQTT with Node-Red
Receive JSON Data Over MQTT with Node-Red
Node-Red -Guide to Using The CSV Node
How to Log MQTT Sensor Data in Node-Red
Have a question Use the comments or if you want help then use
If you find these videos useful then you might want to consider buying me a coffee
Рекомендации по теме
Комментарии
Автор

Finally I'm beginning to understand this. This was by far the clearest and most practical explanation of the object I have seen. Many thanks for making this.

jarchdm
Автор

Thank, thank you, thank you Steve. After 30+ years of fog of non tech work, I am trying to get back into making stuff. I have set my goal as a small monitoring system, weather, water butt levels, nothing too complicated. I have been going spare searching, and watch video, and not understanding. You have opened my eyes in this video. Thank you. I was contemplating scrapping the idea, and going old school with 8085 and machine code.

wingman
Автор

Great video Steve, this has helped answer a lot of my questions I was having. Thanks!!

daveacorn
Автор

thank you man! I just fall into NodeRED and your tutorials are amazing. I watched them all in last few days with man flu :)
BTW your voice sounds very similar to my UK colleague. Stratford Upon Avon, Redditch area. Thanks for your work and I am looking forward for next video.

mikrom
Автор

Thanks for providing a very helpful examination of JSON uses and techniques.

asiw
Автор

You're doing great job, Steve! Thank you

The_Unobtainium
Автор

Excellent video and very clear. There are so many useful topics here, some are worth their own video, especially that last one.

mickc
Автор

Thank you! very helpful after being stuck for nearly two hours :)

qusaiamer
Автор

I have learned a lot. Thank you very much

Venkel
Автор

Very nice video, helped me grately to understand JSON

CreatureArtworks
Автор

Another fantastic tutorial. Can you point me where to learn about using node red with an external database like MongoDB or uploading my data in JSON format to my Google drive or Google docs spreadsheet (or dropbox)?
Another confusing topic is how to send files from node red to other computers on my home network running windows or ubuntu. SSH via node-red??
Thanks!

quaternion-pi
Автор

Great Video Steve! I am just starting to work with Node Red. I try to follow the steps but i was wondering what would come out if you would have put “s.payload.Time” with T instead of t at 19:37?

biogasbrasil
Автор

Great tutorial Steve, thanks! Just check the download link on your site, it's giving a "permission denied" error

horrorcoder
Автор

I had a question why would we multiply the average with the count and then add it to the payload ?? trying to wrap my head around this

jehan
Автор

Is there any easier and faster way to inject dynamic data into JSON object or is it always necessary to use a function and dynamically create an object?

mateuszmalik
Автор

What is the node.log(type of p) statement you seem to always skip explaining it when going through the JSON in the function node. Why is it? Btw thanks for the good work

guicmbh
Автор

Hi, I am currently trying to design a NodeRed app that will respond to a http request with an http response containing a json string. My request arrives, I am able to build the json I want to return but formatting the response to feed on the html response node has been a challenge. Any suggestion on adapting your above design in an http response node? Thanks

fingerprint
Автор

Why doesn't node red read the Arduino JSON ? I think it s a JSONformat that is specif to Arduino. Instead if in Arduino I write a JSON string (that can be parsed to make it become prettified) with sprintf(so In this case I think it makes a string more specific to the language C), node red can read it correctly.

abcd-ygrx
Автор

I get the error 'Invalid conversion from system.string to json.linq.object'. How do i resolve this? i can't pass a variable back to my robot now..

dion
Автор

So how do I get the JSON from an API ? If I am going to make up the data I can just set variables.

andreac