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 18 de mai de 2026

Início rápido

Visão geral

O objetivo deste guia é ajudá-lo a criar uma amostra funcional para verificar rapidamente a conexão com sua organização Salesforce e se familiarizar com os tipos de dados de entrada/saída de atividades incluídas.

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

  1. Cria variáveis SecureString para suas credenciais do Salesforce e Invoke Method.
  2. Estabelece uma conexão com seu Salesforce Org usando suas SecureString credenciais (Escopo do aplicativo do Salesforce)
  3. Cria um novo registro de conta do Salesforce (Inserir registro).
  4. Carrega um arquivo para sua organização do Salesforce (Carregar arquivo).
  5. Atribui o arquivo carregado ao novo registro da conta do Salesforce (Atribuir arquivo).
  6. Verifica os resultados das atividades Insert Record, Upload File e Assign File gerando cada um de seus objetos SalesforceStatus ().

Pré-requisitos

Antes de você começar:

  1. Conclua as etapas de Configuração do Salesforce.
  2. Crie um novo projeto de automação.
    1. Abra o UiPath Studio.

    2. Under New Project, click Process (this opens a New Blank Process window).

    3. Enter a project Name, Location, and Description.

    4. Clique em Criar.

  3. Install the UiPath.Salesforce.Activities package.
    1. In the Design ribbon, click Manage Packages (this opens the Manage Packages window).
    2. Under All Packages, click Official.
    3. In the Search bar, enter Salesforce.
    4. Click, install and accept the license for the UiPath.Salesforce.Activities.

Etapas

Crie seu projeto

A atividade Salesforce Application Scope requer tipos de dados SecureString para as propriedades de entrada Segredo do consumidor, Senha e TokenDeSegurança . Para obter esses tipos de dados SecureString , você converte os valores String que você armazenou para essas propriedades ao concluir as etapas Obter suas credenciais no guia de Configuração .

Observação:

As etapas abaixo destinam-se a demonstrar como você pode converter um String em um SecureString. Para simplificar e para ajudar você a criar rapidamente a amostra de trabalho, a conversão é feita dentro da sua sequência do projeto e requer que você insira seus valores de credenciais como variáveis. Isso não é recomendado ao criar projetos compartilháveis ou que não sejam de exemplo. Ao criar projetos compartilháveis ou que não sejam de exemplo, você pode criar e fazer referência a fluxos de trabalho externos que obtém seu Segredo do consumidor, Senha e TokenDeSegurança de uma origem local (por exemplo, .txt, *.xlsx .dll) e realize a conversão usando e argumentos.

Converter Strings em SecureStrings

  1. Crie as três variáveis a seguir:
    1. String with your Salesforce login password as the Default value (e.g., Name: textPassword, Default: "UiPath123")
    2. SecureString with New SecureString() as the Default value (e.g., Name: securePassword, Default:New SecureString())
    3. SecureString (e.g., Name: password)
      • For all SecureString variables, select the System.Security.SecurityString type.
    4. Adicionar uma nova instrução ao processo.
    • Recommendation: change the Display Name to "Create SecureString - Password" or something to make it easy to identify its purpose.
  2. Adicione uma atividade dentro de Sequence.
    1. In the TypeArgument property, select System.Char.
    2. In the Values property, enter the String variable (e.g., textPassword).
  3. Na atividade For Each , adicione a atividade InvokeMethod (Programação > Executar > InvokeMethod).
    1. In the TargetObject property, enter your first SecureString variable (e.g., securePassword)
      • Make sure the the TargetType property is (null) (either the TargetObject or TargetType is allowed, not both).
    2. In the MethodName property, enter AppendChar.
      • O método AppendChar é usado para adicionar uma unidade de código UTF-16 após a string.
    3. In the Parameters property, add a new parameter using the following values: Direction: In, Type: System.Char, Value: item.
  4. Adicione a atividade após a atividade InvokeMethod .
    1. In the To property, enter your second SecureString variable (e.g., password).

    2. In the Value property, enter your first SecureString variable (e.g., _securePassword).

  5. Crie as três variáveis a seguir:
    1. String with your Consumer Secret as the Default value (e.g., Name: textPassword, Default: "4FA94...")
    2. SecureString with New SecureString() as the Default value (e.g., Name: secureConsumerSeret, Default:New SecureString())
    3. SecureString (e.g., Name: consumerSecret)
      • For all SecureString variables, select the System.Security.SecurityString type.
    4. Repeat steps 2-5 to convert your Consumer Secret String to a SecureString.
  6. Crie as seguintes 3 variáveis:
    1. String with your Security Token as the Default value (e.g., Name: textPassword, Default: ""MUc2B...")
    2. SecureString with New SecureString() as the Default value (e.g., Name: secureSecurityToken, Default:New SecureString())
    3. SecureString (e.g., Name: securityToken)
      • For all SecureString variables, select the System.Security.SecurityString type.
    4. Repeat steps 2-5 to convert your Security Token String to a SecureString.

You should now have three Create Secure String sequences in your process, similar to the image below.

Now that you have your SecureString variables, you can add the Salesforce Application Scope activity along with the other Salesforce activities.

Adicione as atividades do Salesforce

  1. Adicione a atividade Salesforce Application Scope ao seu projeto.
    1. Antes de inserir os valores de sua propriedade, vamos testar sua conexão.

      1. Click the Configure button (this opens the connection wizard).
      2. Select your Server (if connecting to, a developer org or non-developer production org- select "Live", a sandbox/test org - select "Test").
      3. Enter your Consumer Key, Consumer Secret, Username, Password, and Security Token (required for developer logins).
      4. Click the Test Connection button and wait for the Connection Successful window.
        • Se você receber um erro, certifique-se de que selecionou o Servidor correto. Em seguida, tente redefinir seu token de segurança seguindo a última etapa no guia Obter suas credenciais no guia Configuração e insira o novo valor que é enviado para você.

      5. Após uma conexão bem-sucedida, agora você pode adicionar seus valores de propriedade, incluindo as variáveis SecureString que você criou nas etapas acima (os valores inseridos no assistente de conexão são independentes dos valores de propriedade e não são compartilhados).
    2. Insira seu valor da ChaveDoConsumidor (String) que você copiou ao concluir as etapas Obter suas credenciais .

    3. In the ConsumerSecret property, enter the second SecureString variable you created in step 6 above (e.g., consumerSecret).

    4. In the Password property, enter the second SecureString variable you created in step 1 above (e.g., password).

    5. Enter your Server value ("Live" or "Test").

    6. Insira seu Nome de usuário de login do Salesforce (por exemplo, "name@company.com")

    7. For the SalesforceConnection property, create and enter a IConnectionService variable (e.g., salesforceConnection).

      • Você não usará essa variável ao concluir as etapas deste guia, mas é uma boa prática criar suas variáveis de saída para uso em atividades subsequentes.

    8. Adicione a atividade Insert Record na atividade Salesforce Application Scope .

    9. Create a new String variable for this activity's output property (e.g., newAccountID).

    10. Click the Configure button (this opens the Salesforce Object Wizard).

    11. In the Salesforce Object drop-down list, select Account (the Account ID and Name fields should appear).

    12. In the Add Single Field text box, enter Type and click Enter (you should now have 3 fields).

    13. In the Account ID field, enter the String variable you created in step 1 (e.g., newAcountID).

    14. Enter a Name for the Account (e.g., "Salesforce Quickstart").

    15. Enter a valid Type String (e.g., "Prospect").

      • All fields with a picklist Data Type require a String value that matches an item in the list as shown in the Salesforce user interface.

        • Usando o campo Tipo como exemplo, por padrão, a lista de seleção inclui os valores exibidos na imagem abaixo (da tela Conta do Salesforce). Você pode usar a atividade Format Labels And Values para visualizar os valores String válidos (consulte o exemplo abaixo).

      • Click Done.

    16. In the SalesforceOutput property, create and enter a SalesforceStatus variable (e.g., insertRecordStatus).

  2. Adicione a atividade Carregar arquivo após a atividade Inserir registro .
    1. Enter your file Description, FilePath, and Title.

    2. In the OutputID property, create and enter a new String variable (e.g., newFileID).

    3. In the SalesforceStatus property, create and enter a new SalesforceStatus variable (e.g., uploadFileStatus).

  3. Adicione a atividade Assign File após a atividade Get Record .
    1. In the Id property, enter the String variable you created for the Upload File activity (e.g., newFileID).

    2. In the RecordId property, enter the String variable you created for the Insert Activity activity (e.g., newAccountID).

    3. Enter a ShareType value (e.g., "I" for Inferred).

    4. Enter a Visibility value (e.g., "AllUsers").

    5. In the SalesforceStatus property, create and enter a new SalesforceStatus variable (e.g., assignFileStatus).

Teste seu projeto

  1. Para verificar se seu registro foi inserido, carregado e atribuído ao registro inserido, adicione três atividades após a atividade Assign File .

    1. In the first Write Line activity, enter the following Text: "Insert Record Success: "+insertRecordStatus.Success.ToString.

      • insertRecordStatus is the SalesforceStatus variable you created for the Insert Record activity.
    2. In the second Write Line activity, enter the following Text: "Upload File Success: "+uploadFileSuccess.Success.ToString.

      • uploadFileStatus is the SalesforceStatus variable you created for the Upload File activity.
    3. In the third Write Line activity, enter the following Text: "Upload File Success: "+assignFileSuccess.Success.ToString.

      • assignFileStatus is the SalesforceStatus variable you created for the Assign File activity.
    4. Click Start and verify the results in the output window.

  2. To further verify your results, login to your Salesforce Org and go to your Accounts and Files to see your new additions.

Está feito! Agora você tem um projeto de automação que inclui atividades do Salesforce. Para saber mais sobre as atividades do Salesforce, consulte Atividades para links para as páginas de detalhes da atividade.

Para aprimorar sua automação do Salesforce, consulte a documentação do UiPath Connector para Salesforce . O UiPath Connector para Salesforce cria uma conexão "servidor - servidor" entre o Salesforce e o UiPath Orchestrator (instâncias no local ou na nuvem). Ele oferece a capacidade de enviar trabalhos UiPath ou adicionar itens de fila do Salesforce por meio do Flow Builder, do Process Builder ou do Workflow.

  • 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