Column Header to JSON list

Hi Knime team.

I’m extracting column names from a table. I want to create a JSON list as seen in the example below:
“extraColumnNames”: [
“extraColumn1”,
“extraColumn2”
]
Using columns or table to JSON I cant seem to get it working. Any ideas?

Hi @tiaandp
Maybe try creating a collection column before using table to JSON:
JSON_column_names.knwf (15.2 KB)

1 Like

Hi @tiaandp , I put something quickly together for you.

The workflow looks like this:
image

Input table looks like this:
image

Results look like this:
image

Here’s the workflow:
Column Header to JSON list.knwf (9.9 KB)

2 Likes

@bruno29a Thanks so much. I did not know about the collection column. I really appreciate it.

1 Like

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