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 28 févr. 2026

Cases à cocher dynamiques

This is a step-by-step tutorial demonstrating how to configure and use dynamic checkboxes. Dynamic checkboxes allow you to view an entire list of data entries and select one or more, according to your use case. Dynamic checkboxes are created using the Select Boxes component in the Form Designer.

Remarque :

Ce didacticiel montre comment configurer les cases à cocher dynamiques pour les types de projet C# uniquement.

Tutoriel

Pour utiliser cette fonctionnalité :

  1. Add an Invoke Code activity into your workflow. This is where you create a List of strings, that holds the choices that appear dynamically in the form.
    • Cliquez sur Modifier les arguments et créez un argument nommé, pour cet exemple, choiceList. Définissez la Direction sur In/Out et le Type sur List<String>. Dans le champ Valeur , appuyez sur CTRL + k sur votre clavier et créez une variable List<String> appelée GchoiceList. Cette variable contient les choix que vous souhaitez afficher dynamiquement.

      docs image

    • Cliquez sur Modifier le code et saisissez l'extrait de code d'initialisation. Veillez à utiliser la syntaxe correcte en fonction du langage de programmation que vous avez choisi (C# ou VB.NET). Par exemple, pour définir quatre choix pour l'argument choiceList , utilisez le code suivant :

      choiceList = new List<string>();
      choiceList.Add("Choice1");
      choiceList.Add("Choice2");
      choiceList.Add("Choice3");
      choiceList.Add("Choice4");
      choiceList = new List<string>();
      choiceList.Add("Choice1");
      choiceList.Add("Choice2");
      choiceList.Add("Choice3");
      choiceList.Add("Choice4");
      
  2. Add a Create Form activity into your workflow.
    • Ouvrez la fenêtre de propriété FormFieldsCollection .

    • Créez un argument de type Dictionary<String,Boolean> . Nommez-la choices, définissez la Direction sur In/Out et la Valeur sur la variable choices . Cet argument mappe les choix sélectionnés dans le formulaire dans le workflow.

    • Créez un argument de type List<String> . Nommez-la choices_selectboxes, définissez la Direction sur In/Out et la Valeur sur la variable GchoiceList . Cet argument rend la liste qui contient les choix (Gchoicelist) pour être dynamique, en y ajoutant le suffixe _selectboxes .

    • Cochez GénérerChampsEntrée. Cela permet au formulaire de générer automatiquement un composant Cocher les cases à l'intérieur du formulaire, en fonction des arguments mappés dans la fenêtre de propriété FormFieldsCollection .

      docs image

      Remarque :

      The form determines automatically that it is dealing with a set of dynamic checkboxes and displays them accordingly.

      These checkboxes can then be later edited from the Form Designer (for example, setting the minimum or maximum choices a user can make).

  3. Add a For Each activity into your workflow. This activity iterates through every choice in the dynamic list and retrieves the name and value for each choice.
    • Dans la propriété TypeArgument , choisissez System.Collections.Generic.KeyValuePair<System.String,System.Boolean>.
    • Dans le corps de l'activité, saisissez keyVal dans le champ PourChaque .
    • Dans le corps de l'activité, transmettez la variable choices dans le champ Entrée .
  4. Add a Log Message activity into the Body of the For Each activity. This activity is used to output the choices selected by a user inside the form.
    • Définissez le Niveau du journal sur Info.

    • Dans le champ de propriété Message , transmettez l'expression suivante : keyVal.Key +":" + keyVal.Value.

      docs image

Résultat

The Select Boxes component is dynamically populated with the values held in the GchoiceList. For this example, a business user selects the first and second choice inside the form. When the form is submitted returns into the workflow, it displays the choices selected by the user as True and the ones that haven't been selected as False, in the Output panel.

docs image

Exemple de workflow

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

  • Exemple de workflow

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

Obtenez l'aide dont vous avez besoin
Formation RPA - Cours d'automatisation
Forum de la communauté UiPath
Uipath Logo
Confiance et sécurité
© 2005-2026 UiPath Tous droits réservés.