How do I convert an Object into Comma list?

Describe the problem/error/question

I am trying to convert the data from a previous node into a comma separated string. In the screenshots below, you’ll see that my JSON data has some arrays and strings, and in particular an Object with a list of strings within. I need to get the words “automation” and “helpers” into a comma separated list, like in the second/third screenshots. I do not need the long string of numbers.

How can I do this? I tried so many combinations of nodes, but I feel like I’m at my wits end. I understand Code enough to try it if given suggestions, but not enough to come up with my own solution to this.

The previous node data:

image

I want to convert that into something like this:

Where instead of “sensor,ecobee” it would be “automation,helpers” from above screenshot.
image

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @protechtedd ,

I’ve created a workflow based on your use case. Please have a look at it, and I hope it helps resolve the issue you’re facing!

2 Likes

Brilliant, that worked! This also taught me something about n8n, being able to type a period after a $json.node to get more options, such as “keys” etc. Thank you!

1 Like

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