Nested "format as text" to create JSON

Hello All!
I am trying to create a csv download based on a complex data structure. In normal JS, this would be trivial. In this case, in bubble I am not sure how to do it. My current approach is to use Create CSV from JSON from the CSV Creator plugin.

The Data structure is in the ERD.

We start with a list of registrations. The CSV/JSON should have one line for each registration. Each Custom question for the event should be one column in the CSV (one field in the JSON).

I start with the list of registrations and use format as text. I can create the json structure for each registration. When it comes time for the custom questions, I use an inner ‘format as text’ nested inside the outer ‘format as text’ that I used for registration. The inner format as text works on the Event’s list of questions so that I can create a field/attribute/column for each one.

The problem is that when I try to access the current registration from the inner ‘format as text’, it’s not available so I can’t add the answers to that field/cell.

Is there a way to do this in Bubble?

It’s a little annoying cause the “This Things” goes away, but I think one time I just got a uuid from Online UUID Generator Tool

Stuck that uuid in the inner :format as text, then on the outside did :find&replace after and replaced that uuid with the text you want :man_facepalming:

Hey @dave21 :wave:

I know what you mean, it’s always frustrating to not be able to access what you need. I think what I have done in the past was to do a backend workflow (or front end using the looper plugin) that loops and allows you to access the data you need one at a time. This should allow you to pass along the data you need for the next loop for you to access it.

If you know how to do it in JavaScript, there is also the toolbox plugin to run JavaScript if you want.

Does that help at all? :man_shrugging: