It would be inexplicably useful for stepped container components to have the capability of being able to map an array of steps based off however many steps would exist from data in your query.
For example, I have an app that contains a form that can have a varying number of sections depending on a template the end-user would select. The only way I've been able to map these sections is by creating a separate step component (where you can map an array of sections/steps from your data query) which defaults to the step of the stepped containers current view key. Then, having the stepped container components view depend on the options from the step component.
This obviously causes dependency issues and an unstable setup that can be confusing and overly complex to handle, leading to errors.
Can we get that capability to map an array of steps directly from the step components options? Or a more conventional way to map them in the way I attempted through a stepped container that doesn't cause dependency issues between a separate step component with mapped steps where it and the stepped container don't have to depend on each other for each view?
Interesting suggestion. So to clarify, your idea is for stepped containers to have a 'mapped' mode where a user could put in an array of objects, where each object gets converted from code to a step. Similar to how the JSON schema form component has a mapped mode for taking in a structured iterable to output the corresponding UI. Is that correct?
Yes exactly! it would be great for creating components like segmented forms or anything else that would require user interaction within a dynamic array of objects β in which each object from a query would be populated with affiliated items like a list view that can just display currently indexed object data when a next/previous button is clicked.
Woohoo thank you @Jack_T! Being able to assign an array of step objects directly from query results would make dynamic workflows so much cleaner!
If not too much trouble, it would be great to have also this option available in similar components i.e. tabbed containers, or even components like button groups β components where youβd typically have to assign each option manually. Giving us the ability to essentially place list view or select component level logic for dynamic option generation in components that are built for views would be so nice.
I can definitely add those details to the feature request ticket for you
That would be pretty useful, it always comes down to how complex is the parsing tool to map over the data to work for most cases and not bug out if there is a weirdly formatted schema being used in the component's source mapping
@Jack_T ahhh yes that actually makes alot of sense. I could imagine how unpredictable some data structures could get if users donβt standardize their object schemas.
Maybe a middle ground could be letting developers define a mapping template or schema hint for the array? Something like a lightweight config where you specify which key maps to the stepβs label, value, and content fields so Retool could validate the structure before rendering and gracefully handle malformed data instead of breaking the component entirely?