Making complex data from option sets

So I have created an app to help people generate better prompts for Midjourney. It’s all working mostly pretty well except for the last step where I create the actual prompt as a piece of fully coherent data.

I have a multitude of selectable options from Aspect ratio to photography style. These are all option sets. A prompt is created as soon as the page loads, then they select various options, which generate “prompt blocks”. Finally, these prompt blocks are converted into a single prompt once the “Generate” button is pressed.

My issue is, that whilst the Current page’s prompt’s prompttxt seems to be creating the right string, it’s not saving each option’s selection to the corresponding category, E.g. Current Page’s Prompt’s Aspect Ratio remains empty despite the prompttxt value containing --ar 1:1.

UPDATE: I managed to get some categories to fill by speaking directly to the repeating group that the prompt block creates. Unfortunately, the prompt blocks can be edited to have prompt weight and so this is not coming through in the database. it seems like a workaround from what I actually want, which is for the prompt block data to feed into and crate the prompt.