UiPath Documentation
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.

Atividades de integrações clássicas

Última atualização 20 de mai de 2026

Início rápido — registros

Visão geral

O objetivo deste guia é ajudá-lo a criar um exemplo de trabalho que usa as seguintes atividades do Microsoft Dynamics 365:

Este exemplo de trabalho permite que você verifique rapidamente a conexão com seu aplicativo do Microsoft Dynamics 365 e se familiarize com os tipos de dados de entrada/saída da atividade.

Depois de concluir as etapas deste guia, você terá uma sequência de automação que faz o seguinte:

  1. Estabelece uma conexão com seu aplicativo Microsoft Dynamics 365 (Get Credential e Microsoft Dynamics Application Scope).
  2. Insere um novo registro de conta (Inserir Registro).
  3. Pesquisa o registro da conta inserida (Search Records).
  4. Atualiza o campo site do registro da conta (Atualizar registro).
  5. Verifica se o registro da conta foi atualizado com sucesso (Get Record).
  6. Exclui o registro da conta inserida (Excluir registro).
    Observação:

    While there may be more efficient ways of achieving the same result, the goal of this sequence is to demonstrate all of the record activities.

Pré-requisitos

Antes de você começar:

  1. Conclua as etapas de Configuração do Microsoft Dynamics 365.
  2. Use o Gerenciador de Pacotes para instalar o pacote Microsoft.Activities.Extensions (isso é para a atividade Search Records ).
    Observação:

    Este guia usa CredenciaisDoCliente como a atividade TipoDeAutenticação na atividade Microsoft Dynamics Application Scope . Se você preferir usar PasswordCredentials, você pode pular a etapa 1 (adicionar uma atividade Get Credential ) e seguir as subetapas com marcadores na etapa 2 (adicionar a atividade Microsoft Dynamics Application Scope ).

Etapas

Crie seu projeto

  1. Adicione uma atividade Obter credencial .
  2. Enter the AssetName for the credential asset you created (during the Setup) for the application Client Secret (e.g., "MicrosoftDynamics365ClientCredentials").
  3. Create and enter a SecureString variable for the Password property (e.g., clientSecret).
  4. Create and enter a String variable for the Username property (e.g, clientId).
  5. Adicione a atividade Microsoft Dynamics 365 Application Scope após a atividade Get Credential .
  6. Clique no botão Configurar (isso abre o Assistente de conexão), selecione seu TipoDeAutenticação, insira suas credenciais e clique no botão Conexão de teste . Para obter mais informações sobre a finalidade e o comportamento desse assistente, consulte a seção.
    • This step is for design time purposes only. To populate the Microsoft Dynamics Application Scope properties, continue to complete the steps below.
  7. In the AuthenticationType property, select your preferred authentication type.
    • If you select PasswordCredentials, create a String variable for the ClientId (e.g., Name: clientId Default: "56X9aXXX-b5d9-4a90-XXXX-13XX9643XXXX")
  8. In the ClientId property, enter the String variable you created for the Get Credential activity or substep above (e.g., clientId).
  9. In the ClientSecret property, enter the SecureString variable you created for the Get Credential activity (e.g., clientSecret).
    • If you selected PasswordCredentials leave the ClientSecret property empty.
  10. Na propriedade UrlDoEndpoint , crie e insira uma variável String com a URL da instância do CRM à qual você deseja se conectar (por exemplo, Nome: endpointURL Padrão: "https://uipath.crm4.dynamics.com/" )
  11. In the TenantId property, create and enter a String variable for the directory (tenant) ID assigned to your Azure Active Directory (ADD) tenant (e.g., Name: tenantId Default: "d8353d2a-b153-4d17-8827-902cXXXXXXX").
    • Se você selecionou CredenciaisDeSenha, selecione sua preferência de Solicitação de senha (opções).

  12. Adicione a atividade Insert Record dentro da atividade Microsoft Dynamics Application Scope .
    1. Click the Configure button inside the Insert Record activity (this opens the Object Wizard).

      1. In the Select Entity drop-down list, select Account.

      2. In the accountId field, create and enter a String variable (e.g., accountId).

      3. In the Add Single Field textbox, enter name and click enter.

      4. In the name field, enter an account name (e.g., "Quickstart_Account").

      5. Click the Done button.

    2. Add an Add to dictionary activity after the Insert Record activity.

    3. In the Dictionary property, create and enter a Dictionary<String,String> variable accordingly: Name: queryOption, Default: new Dictionary(Of String, String) (you may use a different Name value, but the Default value is required).

    4. In the Key property, enter "$filter".

    5. In the Value property, enter "name eq 'Quickstart_Account'" (Quickstart_Account is the name of the account you inserted in the steps above. If you entered a different name, use that value instead).

    6. Adicione a atividade Pesquisar Registros após a atividade Adicionar ao dicionário .

    7. In the Object property, select Account.

    8. In the Query Options property, enter the Dictionary<String,String> variable you created above (e.g., queryOption).

    9. In the Result property, create and enter a DataTable variable (e.g., searchResults).

  13. Add an Assign activity after the Search Records activity.
    1. In the To property, create and enter a String variable (e.g., webURL).
    2. In the Value property, enter the following: searchResults.Rows(0).Item("websiteurl").ToString.
    3. Add an If activty after the Assign activity.
    4. Crie uma variável String com um valor padrão de uma URL (por exemplo, Nome: website, Padrão: "www.uipath.com").
    5. In the Condition property, enter the following: webURL = website.
    6. In the Then statement box, add a Write Line activity with the following Text: "Website present".
    7. Na caixa de Declaração Else , adicione a atividade Update Record .
      1. Click the Configure button inside the Update Record activity (this opens the Object Wizard).
        1. In the Select Entity drop-down list, select Account.

        2. In the accountId field, enter the String variable you created for the Insert Record activity (e.g., accountId).

        3. In the Add Single Field textbox, enter websiteurl and click enter.

        4. In the name field, enter the String variable you created in the step above (e.g., website).

        5. Click the Done button.

Teste seu projeto

  1. Adicione a atividade Get Record após a atividade Update Record (dentro da caixa da instrução Else ).

    1. Click the Configure button inside the Get Record activity (this opens the Object Wizard).
      1. In the Select Entity drop-down list, select Account.
      2. In the accountId field, enter the String variable you created for the Insert Record activity (e.g., accountId).
      3. In the Add Single Field textbox, enter websiteurl and click enter.
      4. In the websiteurl field, create and enter a String variable (e.g., websiteVerification).
      5. Click the Done button.
    2. Add an If activity after the Get Record activity (inside the Else statement box).
    3. In the Condition property, enter the following: website = websiteVerification.
    4. In the Then statement box, add a Write Line activity with the following Text: "Website update succeeded!".
    5. In the Then statement box, add a Write Line activity with the following Text: "Website update failed".
  2. Adicione a atividade Delete Record fora da primeira atividade If .

    1. In the Object property, select Account.
    2. In the Id field, enter the String variable you created for the Insert Record activity (e.g., accountId).
    3. In the MicrosoftDynamicsStatus property, create and enter a ResponseStatus variable (e.g., responseStatus).
  3. Add a Write Line activity after the Delete Record activity.

    1. In the Text property, enter the following: "Record deleted: "+responseStatus.Success.ToString.
  4. Click Run and verify the Output window includes the expected write line values.

Está feito!

Para saber mais sobre as atividades Microsoft Dynamics 365 (incluindo entradas/saídas de propriedades de exemplo), consulte a página Atividades para uma lista completa de atividades e links para as páginas de detalhes das atividades.

  • Visão geral
  • Pré-requisitos
  • Etapas
  • Crie seu projeto
  • Teste seu projeto

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