how to get my javascript output in json format

50 Views Asked by At

image is the javascript code for the function node

I want same output as shown just value data to be in columns rather than in rows

2

There are 2 best solutions below

2
Elnur Maharramov On

Try this, it will work I think.

JSON.parse(string)
0
hardillb On

If you just want the content of the input msg.payload.value

Then you should remove the function node and replace it with a change node that will.

move msg.payload.value to msg.payload

enter image description here