This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.

⚠️ We've moved!

Hi there!

To reduce project dependency on 3rd party paid services the StackStorm TSC has decided to move the Q/A from this forum to Github Discussions. This will make user experience better integrated with the native Github flow, as well as the questions closer to the community where they can provide answers.

Use 🔗 Github Discussions to ask your questions.

How can I provide a list of options as a dropdown in core.ask

Hello,
In my workflow, I’m trying to provide a list of options to the user to choose from in “core.ask” action. This list is a published variable from the previous task. How do I achieve this?

choose_target_state:
    action: core.ask
    input:
      schema:
        type: object
        properties:
          allowed_states:
           type: string
            description: "Target state"
            required: true
            enum:
              - with: 
                  items: <% ctx(target_states) %>

This does not seem to work. It causes the UI to crash/reload when the option is provided like this.

in the st2debug, this is what I see -

{“allowed_nss_states”: {“required”: true, “type”: “string”, “description”: “Target state”, “enum”: [{“with”: {“items”: [“InM”, “InP”, “InR”, “DR”, “D”, “InM”]}}]}}}}

Turns out it was quite simple, I just had to do it the following way -

enum: <% ctx(target_states) %>