JSON string to CSV - string

#1

Hello All ,

I am new to Node-red - i am having a issue to get json to csv , tried the node json2csv but don't get it to work.

Main goal is to get via insert Node a json string and then translate it into a csv string,

Can anybody give help ?

Roland

0 Likes

#2

Did you try the built in csv node. It converts csv to a json object and from an object to csv. So if you start with a json string use a json node to convert from string to an object then the csv node to go from an object to csv.

0 Likes

#3

Hi dceejay , i tried your suggestion and got this working , thanks !

0 Likes

#4

I am trying to get a timestamp in the injection node with de following example json payload : {"abc":12345678,"defc":453478} - any suggestion ?

0 Likes

#5

Can you explain your issue differently? I don’t understand what mean. Where is that data coming from?

Maybe showing your flow

0 Likes

#6

If you are trying to INJECT a message with that then you can do it with a change node.

BUT check what the CSV node will convert. My guess is that it will convert the msg.payload to CSV so you would need to make msg.payload = {"abc":12345678,"defc":453478};

0 Likes