Repository navigation
How can we bind dynamic options in a dropdown field in Elsa 3.5.2? #7144
|
Does anyone know how to bind dynamic options to a dropdown field in Elsa 3.5.2? I’m trying to populate the field values from the database, but I’m not sure which approach is supported in this version. Any guidance or examples would be appreciated. |
Replies: 3 comments 2 replies
|
You can create a class, inherit from DropDownOptionsProviderBase and override GetItemsAsync. I noticed, that this gets evaluated once for the client, so if your data changes during use, you may need to Ctrl+F5 to get the new list. |
|
What is supported in the current codebase is a custom dropdown options provider. The relevant pieces are:
So the first reply in this thread is directionally correct: for a dynamic list loaded from your own source, you can implement a custom However, for the follow-up scenario where dropdown B depends on the value selected in dropdown A at design time, I do not see a built-in cascading-dropdown experience in the current Studio component. Why I say that:
So for Elsa 3.5.x, my reading is:
If you need B to react to A in the designer, that likely needs a custom editor/UI extension rather than only a dropdown options provider. |
|
Closing this as answered. Current support is a custom |
What is supported in the current codebase is a custom dropdown options provider.
The relevant pieces are:
DropDownOptionsProviderBaseinelsa-core/src/modules/Elsa.Workflows.Core/UIHints/Dropdown/DropDownOptionsProviderBase.csUIHandler = typeof(...)with a dropdown provider, e.g.HttpContentTypeOptionsProviderSo the first reply in this thread is directionally correct: for a dynamic list loaded from your own source, you can implement a custom
DropDownOptionsProviderBaseand point the input'sUIHandlerat it.However, for the follow-up scenario where dropdown B depends on the value selected in dropdown A at design time, I do not see a built-in cascading-dropdown experie…