activities
latest
false
Importante :
Este contenido se ha localizado parcialmente a partir de un sistema de traducción automática. La localización de contenidos recién publicados puede tardar entre una y dos semanas en estar disponible.
UiPath logo, featuring letters U and I in white

Actividades del flujo de trabajo

Última actualización 9 de mar. de 2026

Desplegables condicionales

Los menús desplegables condicionales te permiten seleccionar una opción del menú desplegable, basada en una selección anterior realizada en otro componente del formulario.

Por ejemplo, si seleccionas un estado específico de una lista desplegable, el menú desplegable condicionado muestra las ciudades de ese estado.

Tutorial

Para usar esta función:

  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. Arrastra y suelta la actividad Invocar código en la secuencia del flujo de trabajo.

  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. Almacene la selección del menú desplegable de usuario en variables de flujo de trabajo. Por ejemplo:

    • cityListSelected, de tipo List<String>: almacena la lista correspondiente al estado seleccionado.
    • selectedState, de tipo String: almacena el estado seleccionado.
    • selectedCity, de tipo String: almacena la ciudad seleccionada.
  8. Open the FormFieldsCollection window from the activity Properties panel.

  9. Para definir los campos desplegables en el formulario:

    • Define the dropdown fields. The Name you set is used for data binding (see Dropdown Component > Field Key tab > Property name).
    • Además, define las listas desplegables agregando _dropdown al nombre del campo desplegable.
  10. In the Value column, set the user selection as follows:

    • Para la lista desplegable principal, usa la lista definida en el Paso 1.
    • Para la lista desplegable secundaria, usa la variable almacenada en el Paso 7.
    • Para el campo desplegable principal, usa la variable almacenada en el Paso 7.
    • Para el campo desplegable secundario, usa la variable almacenada en el Paso 7.

    docs image

  11. Haz clic en Aceptar.

Flujo de trabajo de muestra

Para comprobar el flujo de trabajo completo o para tener una referencia futura, descarga el ejemplo XAML

    ¿Te ha resultado útil esta página?

    Conectar

    ¿Necesita ayuda? Soporte

    ¿Quiere aprender? UiPath Academy

    ¿Tiene alguna pregunta? Foro de UiPath

    Manténgase actualizado