object array to file

Hello! I have multiple objects in an array.

I would like to save this in the txt file.

Unfortunately we haven't found a solution yet. Maybe someone can help me there.

This is what the array looks like

[0… 9]
0: object
col1: "ASC91880"
1: object
col1: "ASC91881"
2: object
col1: "ASC91882"
3: object
col1: "ASC91883"
4: object
col1: "ASC91884"
5: object
col1: "ASC91885"

I want to export it like this

ASC91880
ASC91881
ASC91882
ASC91883
ASC91884
ASC91885

I am pretty sure if you pass this array through a CSV node then to the file node, that's exactly what you'll get.

Ps, when copying from the debug, use the copy button that appears under your mouse pointer when you hover over the msg payload. (and use the forums code toolbar button to preserve formatting - makes things much easier to read)

Hello!

Many thanks for the answer.

I want to steal the values in one another.

just like here

ASC91880
ASC91881
ASC91882
ASC91883
ASC91884
ASC91885

Not certain what you mean.

Did you try the CSV node?

I believe he wants it sorted in order
e.g.

[{"id":"144d3c45.d26de4","type":"inject","z":"5a245aa1.510164","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"col1\":\"ASC91880\"},{\"col1\":\"ASC91882\"},{\"col1\":\"ASC91883\"},{\"col1\":\"ASC91881\"}]","payloadType":"json","x":100,"y":960,"wires":[["f371ac23.cad37"]]},{"id":"f371ac23.cad37","type":"change","z":"5a245aa1.510164","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload^(col1)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":960,"wires":[["f8ca8b1e.bbec98"]]},{"id":"f8ca8b1e.bbec98","type":"csv","z":"5a245aa1.510164","name":"","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":490,"y":960,"wires":[["62541fd9.d58bc8"]]},{"id":"62541fd9.d58bc8","type":"debug","z":"5a245aa1.510164","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":680,"y":960,"wires":[]}]
1 Like

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