How to create Conditional or Dependent dropdowns in Actions Form

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):

 

  1. Create the parent dropdown list with <parent field>_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" }
  2. Create the child dropdown list values which depend on the parent’s values. The key should be like <child field>_dropdown and should have a value of Dictionary<string, list<string>>, 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" }} }
  3. Important: To make the association between a parent and a child dropdown, add a form data field - <child 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".
  4. 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