How to create Conditional or Dependent dropdowns in Actions Form
The below steps need to be followed - in the Form Data collection field of the ‘Create Form Task’ activity and in the forms designer (click here for document in this section):
- Create the parent dropdown list with _dropdown. For example, we can create a country dropdown list with name country_dropdown in the form data collection and give it value new List(Of String) From { "India", "US" }
- Create the child dropdown list values which depend on the parent’s values. The key should be like _dropdown and should have a value of Dictionary<string, list>, where the key in the dictionary would be the value of the parent and the corresponding value (which is a list), should be the options shown on the form if the parent is set to the key. For example, state_dropdown can be passed in the form data collection and given value new Dictionary(Of string, List (Of String)) From { {"India", new List (Of String) from { "Karnataka", "Delhi" }}, {"US", new List (Of String) from { "California", "Washington" }} }
- Important: To make the association between a parent and a child dropdown, add a form data field - _parent and pass the field key of the parent in its value. For example, in (1) and (2) above, the key passed in the "Form Data" collection should be state_parent with value "country".
- Optional: In order to pass the values to be pre-filled (for example, with country and state fields) in the "Form Data" collection. NOTE: child values should not be passed without parent values, which can lead to unexpected behavior).
Supported versions: Persistence.activity pack V1.1.1 and above