Plz Help with Parsing String

Hi everyone! I am trying to parse data from a HTTP request into objects so I can create entities in Home Assistant. Unfortunately, I can't seem to get it parsed / split the right way. Can you help?

This is the msg.payload how it comes out of the JSON node:
Thanks in advance!


Welcome to the forum @plimplamm

What happens if you use a Change node to Move msg.payload.data To msg.payload and then feed it through another JSON node?

1 Like

Haha! You are the best, Colin. Thanks heaps.

Thanks also for the warm welcome.

Are there any good tutorials / documentation you reckon I should have a look at? I would love to learn the basics.

I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

My Tips...

  • Dont post screenshots when you can paste text/code
    • This then provides the helper with the ability to use the pasted code to re-write it or try it out.
    • ALWAYS use the "copy value" button when copying from debug side bar (see other tips below)
  • When exporting a flow for users to try out / fix up, only select the nodes of interest - better still, make a minimal demo flow that demonstrates the issue
    • Include the name of any custom/contrib nodes (many users wont know or may even advise alternative methods)
    • even better - dont include any custom/contrib nodes the the export - instead, sustitute them with an inject containing actual demo data

Other (canned) tips...

Use the tools provided ...

There’s a great page in the docs (Working with messages : Node-RED) that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

BX00Cy7yHi

Posting...

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote ```)

``` 
   code goes here 
```

You can edit and correct your post by clicking the pencil :pencil2: icon.

See this post for more details - How to share code or flow json

JSON? Object?

This post should help to clarify the difference between Javascript objects and JSON.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.