I'm working with a JSON file that is a form configuration. Users complete the form through a company website and there are lots of conditional questions and picklists embedded within questions. It's a real nesting doll of data.
Our form system has gotten bloated so I am taking redundant forms and creating one normalized form, but first I need to break down the configuration of each form and represent it in a CSV format so I can easily see the flow of questions and their sub questions. So far I have been able to download the JSON file, add a reader and perform a couple transformations (reader > list_populator > attribute_keeper > list_exploder > list_builder) to isolate the overarching questions and organize each by an index number (the order which they appear in the form). In total there are 8 main branches of questions, but each of those has dozens of nested sub-layers that go deeper and deeper; many of which are long picklists.
From here, I want to be able to isolate each main-branch question and then basically flatten all the layers within that question branch to be able to write to CSV, but everything I try to do feels like a dead end.

Here is a rough csv schema for what I was wanting the csv output to look like:
It would be great if I could sort everything in descending layers starting with the central field (which in this case is the key value for the question branch and all it's paths) and then moving to the main question and then moving through every conditional field after that.