activities
latest
false
Wichtig :
Bitte beachten Sie, dass dieser Inhalt teilweise mithilfe von maschineller Übersetzung lokalisiert wurde. Es kann 1–2 Wochen dauern, bis die Lokalisierung neu veröffentlichter Inhalte verfügbar ist.
UiPath logo, featuring letters U and I in white

Workflow-Aktivitäten

Letzte Aktualisierung 9. März 2026

Bedingte Dropdownmenüs

Bedingte Dropdownmenüs ermöglichen es Ihnen, eine Option aus der Dropdownliste auszuwählen, die auf einer vorherigen Auswahl basiert, die in einer anderen Formularkomponente getroffen wurde.

Wenn Sie beispielsweise einen bestimmten Bundesstaat aus einer Dropdownliste auswählen, zeigt die bedingte Dropdownliste die Städte in diesem Bundesstaat an.

Tutorial

So verwenden Sie diese Funktion:

  1. Create a parent dropdown, by defining a workflow variable of type List<String> or Dictionary<String, String>. For example, stateList.

  2. Create a child dropdown, by defining a workflow variable of type Dictionary<String, List<String>> or Dictionary<String, Dictionary<String, String>>. For example, cityStateMap.

    docs image

  3. Ziehen Sie die Aktivität Invoke Code in die Workflow-Sequence.

  4. Click Edit Arguments and add the previously created variables as In/Out arguments. Click OK.

    docs image

  5. Click Edit Code. Enter the code to initialize the data and populate the dropdowns with data. For example, the following code snippet initializes the dropdowns (stateList and cityStateMap) and adds items to them.

    // initialize the parent dropdown
    stateList = new List<string>();
    // add items to the parent dropdown
    stateList.Add("HP");
    stateList.Add("Punjab");
    // initialize the child dropdown
    cityStateMap = new Dictionary<string,List<string>>();
    // add items to the HP-child dropdown
    cityStateMap.Add("HP",new List<string>());
    cityStateMap["HP"].Add("Shimla");
    cityStateMap["HP"].Add("Solan");
    cityStateMap["HP"].Add("Hamirpur");
    // add items to the Punjab-child dropdown
    cityStateMap.Add("Punjab", new List<string>());
    cityStateMap["Punjab"].Add("Chandigarh");
    cityStateMap["Punjab"].Add("Patiala");
    cityStateMap["Punjab"].Add("Jalandhar");
    // initialize the parent dropdown
    stateList = new List<string>();
    // add items to the parent dropdown
    stateList.Add("HP");
    stateList.Add("Punjab");
    // initialize the child dropdown
    cityStateMap = new Dictionary<string,List<string>>();
    // add items to the HP-child dropdown
    cityStateMap.Add("HP",new List<string>());
    cityStateMap["HP"].Add("Shimla");
    cityStateMap["HP"].Add("Solan");
    cityStateMap["HP"].Add("Hamirpur");
    // add items to the Punjab-child dropdown
    cityStateMap.Add("Punjab", new List<string>());
    cityStateMap["Punjab"].Add("Chandigarh");
    cityStateMap["Punjab"].Add("Patiala");
    cityStateMap["Punjab"].Add("Jalandhar");
    
  6. Drag and drop the Create Form activity.

  7. Speichern Sie die Dropdown-Auswahl des Benutzers in Workflowvariablen. Zum Beispiel:

    • cityListSelectedvom Typ List<String>– speichert die Liste, die dem ausgewählten Status entspricht.
    • selectedStatevom Typ String– speichert den ausgewählten Status.
    • selectedCityvom Typ String– speichert die ausgewählte Stadt.
  8. Open the FormFieldsCollection window from the activity Properties panel.

  9. So definieren Sie die Dropdownfelder im Formular:

    • Define the dropdown fields. The Name you set is used for data binding (see Dropdown Component > Field Key tab > Property name).
    • Definieren Sie außerdem die Dropdownlisten, indem Sie _dropdown an den Namen des Dropdownfelds anhängen.
  10. In the Value column, set the user selection as follows:

    • Verwenden Sie für die übergeordnete Dropdownliste die in Schritt 1 definierte Liste.
    • Verwenden Sie für die untergeordnete Dropdownliste die in Schritt 7 gespeicherte Variable.
    • Verwenden Sie für das übergeordnete Dropdown-Feld die in Schritt 7 gespeicherte Variable.
    • Verwenden Sie für das untergeordnete Dropdownfeld die in Schritt 7 gespeicherte Variable.

    docs image

  11. Klicken Sie auf OK.

Beispielworkflow

Laden Sie das XAML-Beispielherunter, um den vollständigen Workflow zu überprüfen oder später darauf zurückgreifen zu können

    War diese Seite hilfreich?

    Verbinden

    Benötigen Sie Hilfe? Support

    Möchten Sie lernen? UiPath Academy

    Haben Sie Fragen? UiPath-Forum

    Auf dem neuesten Stand bleiben