copier icon indicating copy to clipboard operation
copier copied to clipboard

Support dynamic choices

Open jaecktec opened this issue 6 months ago • 3 comments

Actual Situation

I'd like to ask for some choices (my case aws-regions) and in the second step I want that the user selects the primary region from the previously specified region.

Sadly the choices field is not evaluated as expression

Desired Situation

What happens right now: the String is destructed as an array and I can chose a letter from my expression

What should happen: The user should have a way how to dynamicly specify the choices

Proposed solution

I'd like that this works:

list_input:
  type: str
  help: "Enter a comma-separated list of items."
  default: "item1,item2,item3"

selected_choice:
  type: str
  help: "Select one of the items from your list."
  choices: "{{ list_input.split(',') | map('trim') | list }}"

jaecktec avatar Aug 23 '24 08:08 jaecktec