activities
latest
false
Importante :
A tradução automática foi aplicada parcialmente neste conteúdo. A localização de um conteúdo recém-publicado pode levar de 1 a 2 semanas para ficar disponível.
UiPath logo, featuring letters U and I in white

Atividades do fluxo de trabalho

Última atualização 9 de mar de 2026

Controles avançados para menus suspensos

The tutorials on this page demonstrate using drop-down lists with the UiPath Form Designer, inside the Create Form Task activity. The most used property for achieving the results in the tutorials is the FormData(Collection).

Criando menus suspensos dinâmicos

Use-os em fluxos de trabalho em que deseja enviar dados dinâmicos para preencher um controle suspenso dentro de uma ação de formulário.

With this method, a variable of the type List of Strings holds the values of the drop-down list instead of adding static values on the Data tab in the UiPath Form Designer.

No exemplo a seguir, criamos uma lista suspensa dinâmica de países, inicializamos uma variável com a lista de países e criamos uma variável adicional para capturar o país selecionado pelos usuários.

docs image

To create a dynamic drop-down:

  1. In the Create Form Task activity, click the ellipsis (...) to the right of FormData.
  2. Adicione um argumento para o menu suspenso dinâmico da seguinte maneira:
    • Nome: countryList_dropdown

    • Direction: In

    • Type: List of Strings (List<String>)

    • Value: Press Ctrl + K and enter listOfCountries as the variable name.

      A variável listOfCountries contém os itens na lista suspensa.

      Observação:

      Array of Strings is also supported, but you must manually add the drop-down component in Form Designer and add the Field Key value.

  3. Se você deseja obter a seleção do usuário de volta ao fluxo de trabalho, adicione outro argumento para capturar o valor selecionado:
    • Nome: country (a chave de campo do componente suspenso)
    • Direction: In/Out or Out
    • Type: String
    • Value: Press Ctrl + K and enter selectedCountry as the variable name.
  4. Click OK to close Form Data.
  5. Open the Variables panel and initialize listOfCountries with the default value new List(of string) from { "India", "Romania", "US" }.
    Dica:

    You can also choose to populate listOfCountries through other activities instead of initializing it.

Criando menus suspensos em cascata

Use-os em formulários baseados em tarefas quando desejar que a seleção em um menu suspenso (pai) preencha os valores no segundo menu suspenso (filho).

docs image

Para criar um menu suspenso em cascata:

  1. In the Create Form Task activity, click the ellipsis (...) to the right of FormData.

  2. Vincule o menu suspenso pai ao fluxo de trabalho.

    Para este exemplo, crie um argumento que passe a variável listOfCountries List<String> para o fluxo de trabalho como uma lista suspensa.

    Observação:

    A variável listOfCountries contém os itens na lista suspensa pai, ou seja, a lista de países.

    1. Nomeie o argumento CountryList_dropdown. O nome da propriedade Chave de Campo para este argumento é CountryList.
    2. Defina a Direção como Em
    3. Defina o Tipo como System.Collections.Generic.List<System.String>
    4. Defina o Valor como a variável List<String> listOfCountries .
  3. Vincule o menu suspenso filho ao fluxo de trabalho.

    Para este exemplo, crie um argumento que passe a stateDictionaryList Dictionary<String, List<String>> para o fluxo de trabalho como uma lista suspensa.

    Observação:

    A variável stateDictionaryList contém os itens na lista suspensa filha, ou seja, os estados para cada país.

    1. Nomeie o argumento stateDictList_dropdown. O nome da propriedade Chave de Campo para este argumento é stateDictList.
    2. Defina a Direção como Em
    3. Defina o Tipo como System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.List<System.String>
    4. Defina o Valor como a variável stateDictionaryList Dicionário<String, Lista<String>
  4. Vincule o menu suspenso filho ao menu suspenso pai.

    Create an argument with the name of the child dropdown and add the _parent suffix. Then set the Value of the argument to the name of the parent dropdown, like this: ”ParentDropdownVariableName”.

    Para este exemplo, crie um argumento denominado stateDictList_parent. O menu suspenso filho é stateDictList e você adiciona o sufixo _parent a ele.

    1. Defina a Direção como In.
    2. Defina o Tipo como String.
    3. Defina o Valor como o ”CountryList”.

    When populating the stateDictList Dictionary variable, take note that the dictionary Key is a value from the parent drop-down list and its corresponding Value is a list of options to be shown on the form if the parent is set to the key.

    Dica:

    Você pode passar os valores para serem pré-preenchidos (por exemplo, com campos de país e estado) na coleção DadosDoFormulário . Se você estiver passando valores filho, certifique-se de incluir também o valor pai para evitar um comportamento inesperado.

  5. Map each value from the parent drop-down to a List of Strings variable. You can populate the list (dictionary) for the parent drop-down in any way, but for this example, we use an Add to Dictionary activity for each value.

    • Dictionary: the dictionary of the child drop-down, stateDictList.
    • Key: a value from the list of strings for the parent drop-down, CountryList - in this example, "US", "India", and "Romania".
    • Value: Press Ctrl + K and enter a name for the the List of Strings variable which holds the values to show in the child drop-down when the Key value is selected in the parent - usaStatesList, indianStatesList, and romanianCountyList, respectively.
  6. Make sure you place the activity or activities for the above step before the Create Form Task activity.

  7. Click OK to close Form Data.

  8. Open the Variables panel and initialize the new List of String variables you created with the following default values:

    • Por indianStatesList: new List(of string) from { "Odisha", "Rajasthan", "Karnataka" }
    • Por usaStatesList: new List(of string) from {"Florida", "Georgia", "Washington"}
    • para romanianCountyList: new List(of string) from {"Cluj", "Prahova", "Constanta"}.

Baixe estes exemplos aqui

Criando menus suspensos em cascata nos componentes Edit Grid e Data Grid

To use cascaded drop-downs inside a Edit Grid or Data Grid component:

  1. Create the drop-down fields following the steps above (using the FormData wizard).

  2. Abra o Designer de formulário.

  3. Se os campos suspensos não forem criados dentro do seu formulário, verifique se:

    • The <dropdownKey> , <dropdownKey>_dropdown, and <dropdownKey>_parent arguments are correctly added in the FormData collection.
    • The GenerateInputFields box is checked.
  4. Drag and drop the Edit Grid or Data Grid component.

  5. Drag and drop the drop-downs created at Step 1 into the Edit Grid or Data Grid component.

  6. Abra o menu de configuração do menu suspenso filho (clique em ).

  7. In the Logic tab, notice the preconfigured advanced logic.

    docs image

  8. Navigate to the Actions > Schema Definition field.

  9. Substitua [data.<parent_dropdown_key>] por [row.<parent_dropdown_key>] na expressão do esquema.

    docs image

    Observação:

    A palavra-chave de linha instrui o formulário a usar o valor pai da linha de grade.

  10. Salve o formulário.

Definindo o número de resultados de pesquisa para menus suspensos

Os menus suspensos mostram no máximo quatro resultados de pesquisa por padrão. Você pode alterar esse limite definindo uma propriedade no design do formulário.

To set the number of search results for a drop-down:

  1. In the UiPath Form Designer, click Edit to open settings for the drop-down list and then select the Data tab.
  2. Under Choices.js options, add { "searchResultLimit" : x }, where x is the maximum number of results you want to show.

Exibindo todas as opções dentro de menus suspensos

Se as strings no menu suspenso tiverem mais de 50 caracteres, elas podem ser omitidas da exibição.

Para exibir todas as opções que correspondem ao seu termo de pesquisa:

  1. Clique em Editar JSON docs image para o componente Lista Suspensa que você deseja editar.
  2. In the Component JSON field, add the following properties:
    ...
      "fuseOptions": {
        "distance": 800,
        },
      "threshold": 1,
      "useExactSearch": false,
    ...
    ...
      "fuseOptions": {
        "distance": 800,
        },
      "threshold": 1,
      "useExactSearch": false,
    ...
    
Observação:

A propriedade threshold determina em que ponto o algoritmo interrompe a operação de pesquisa para o termo de pesquisa fornecido. Por exemplo, um threshold de 0 requer uma correspondência exata de letras e local. Um threshold de 1 pode corresponder a qualquer coisa, até mesmo erros de ortografia. Ajuste o valor threshold com base no seu caso de uso.

Esta página foi útil?

Conectar

Precisa de ajuda? Suporte

Quer aprender? Academia UiPath

Tem perguntas? Fórum do UiPath

Fique por dentro das novidades