You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be awesome if we could use answers from previous questions in our question messages and default values.
Current Limitations:
Right now, all our prompts and defaults are static and can't adapt based on previous answers.
Proposed Changes:
Dynamic Messages:
Let us use answers from earlier questions in new question prompts.
questions:
- name: player_namerequired: trueprompt:
message: What's your name?
- name: player_agerequired: trueprompt:
message: And how old are you, {{ .Scaffold.player_name }}?
Dynamic Default Values:
Use previous answers to set default values with interpolations.
I like it! Fully support adding this, few things I can offer on the implementation:
I don't know if this would be possible. I'm doing some pretty nargly things to get templating to work for the when field and I don't see a clear way to add support for this. It may require upstream changes in the huh library. - Which is to say, this will probably be more difficult that it initially seems.
Important that we support all types of default values, list of strings is the only other one I can think of.
For the templates for the when field, properties from preview inputs are available at top level ({{ .player_name}} vs {{ .Scaffold.player_name }}) I think this makes sense because none of the other top level properties are available.
Happy to work together to get this done, but my summer is pretty packed so may be gaps between when I can reply!
Hello! It looks like dynamic forms are on the roadmap for huh, but are not available yet. In the meantime they recommend using separate forms, but that kind of breaks the workflow I guess? I think we should wait until this is released :)
Description:
It'd be awesome if we could use answers from previous questions in our question messages and default values.
Current Limitations:
Right now, all our prompts and defaults are static and can't adapt based on previous answers.
Proposed Changes:
Dynamic Messages:
Let us use answers from earlier questions in new question prompts.
Dynamic Default Values:
Use previous answers to set default values with interpolations.
Benefits:
What do you think?
The text was updated successfully, but these errors were encountered: