Add dependsOn
to the ENUM-type inputs to allow one input to depend on the chosen value from another input
#3610
Labels
enhancement
New feature or request
Milestone
Feature description
Dynamic inputs help manage complex use cases where one input may depend on the chosen value from another input.
Example
Imagine that you want your end user to select the cloud provider first. Then, based on the chosen cloud provider, you want to show the services available for that cloud provider. The new
dependsOn
attribute in all ENUM-type inputs helps accomplish that:The
services
input will be dynamically rendered based on the chosen cloud provider.UI behavior
When you execute this flow, the
services
input will be disabled until you select a value for thecloud
input.Once you select a value for the
cloud
input, theservices
input will show only the services available for the selected cloud provider. This dynamic rendering of dependent inputs allows you to select the correct service matching the previously chosen cloud provider.Backend behavior
Under the hood, Kestra will use a JSON schema with
oneOf
in the backend:Fetching ENUM values from KV Store
Once we add the KV Store, you can also fetch these values dynamically (related issue #283).
Imagine that the ENUM
values
are dynamic and need to be fetched from some external source like a database or file. You can create a flow that will regularly update the value for a given key. Then, you can reference that value by key in your dynamic input:The text was updated successfully, but these errors were encountered: