activities
latest
false
Important :
Veuillez noter que ce contenu a été localisé en partie à l’aide de la traduction automatique. La localisation du contenu nouvellement publié peut prendre 1 à 2 semaines avant d’être disponible.
UiPath logo, featuring letters U and I in white

Activités de workflow

Dernière mise à jour 9 mars 2026

Listes déroulantes conditionnelles

Les listes déroulantes conditionnelles vous permettent de sélectionner une option dans la liste déroulante, en fonction d'une sélection précédente effectuée dans un autre composant de formulaire.

Par exemple, si vous sélectionnez un état spécifique dans une liste déroulante, la liste déroulante conditionnée affiche les villes de cet état.

Tutoriel

Pour utiliser cette fonctionnalité :

  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. Glissez et déposez l’activité Appeler le code dans la séquence de workflow.

  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. Stockez la sélection déroulante de l'utilisateur dans des variables de workflow. Par exemple :

    • cityListSelected, de type List<String>: stocke la liste correspondant à l'état sélectionné.
    • selectedState, de type String: stocke l'état sélectionné.
    • selectedCity, de type String: stocke la ville sélectionnée.
  8. Open the FormFieldsCollection window from the activity Properties panel.

  9. Pour définir les champs déroulants du formulaire :

    • Define the dropdown fields. The Name you set is used for data binding (see Dropdown Component > Field Key tab > Property name).
    • De plus, définissez les listes déroulantes en ajoutant _dropdown au nom du champ déroulant.
  10. In the Value column, set the user selection as follows:

    • Pour la liste déroulante parent, utilisez la liste définie à l'étape 1.
    • Pour la liste déroulante enfant, utilisez la variable stockée à l'étape 7.
    • Pour le champ déroulant parent, utilisez la variable stockée à l'étape 7.
    • Pour le champ déroulant enfant, utilisez la variable stockée à l'étape 7.

    docs image

  11. Cliquez sur OK .

Exemple de workflow

Pour vérifier le workflow complet ou pour avoir une référence future, téléchargez l’ exemple XAML

    Cette page vous a-t-elle été utile ?

    Connecter

    Besoin d'aide ? Assistance

    Vous souhaitez apprendre ? UiPath Academy

    Vous avez des questions ? UiPath Forum

    Rester à jour