I’m trying to create a recursive JSON tree from a bunch of repeating rows as an input and can’t figure out how to do it. I would really appreciate some hints.
It’s basically just a table with defined paths:
Similiar to what the JSON Row combiner is doing, but each new row has to be nested in the row before it:
did you try the “Collect into object with key” option of the JSON Row Combiner? From the description this looks similar to what you describe.
If you can share your table with us, this would also help to find a solution.
it didn’t work with the JSON Row Combiner, but the JSON Transformer worked. It is not yet an optimal solution (e.g. it would need either an automated creation of the path or an automatically created JSON Transformer statement), but as you already have a Python solution I didn’t want to spent too much time on this.
So here are two examples on how you can use the JSON Transformer (either a combination with the JSON Row Combiner and a move operator, or an add operator in a recursive loop). I’ve added some comments where additional work would be necessary to make this automatically. Json_nested.knwf (72.1 KB)