studio
latest
false
- Introdução
- Configuração e Instalação
- Projetos de automação
- Dependências
- Tipos de fluxos de trabalho
- Fluxo de controle
- Comparação de arquivos
- Melhores Práticas de Automação
- Integração de controle de origem
- Sobre o controle de versões
- Como gerenciar projetos com o TÁS
- Como gerenciar projetos com o SN
- Dif. do fluxo de trabalho
- Depuração
- Geração de logs
- A ferramenta de diagnóstico
- Analisador de Fluxo de Trabalho
- Sobre o Analisador de Fluxo de Trabalho
- STN MG-001 - Convenção de nomenclatura de variáveis
- STN MG-002 - Convenção de nomenclatura de argumentos
- STN MG-004 - Duplicação de Nome de Exibição
- STN MG-005 - Variável substitui variável
- STN MG-006 - Variável substitui argumento
- STN MG-008 - Comprimento de variável excedido
- STN MG-009 - Variáveis Catablema de prefixo
- STN MG-011 - Argumentos Catablema de prefixo
- STN MG-012 - Valores padrão de argumentos
- STN MG-016 - Comprimento do argumento excedido
- ST-NMG-017 - O nome da classe corresponde ao namespace padrão
- SR-DB-002 - Contagem alta de argumentos
- SR-DB-003 - Esvaziar bloco catechu
- SR-DB-007 - Múltiplas camadas Com fluxograma
- ST-DPB-010 - Várias instâncias de [Fluxo de trabalho] ou [Caso de teste]
- SR-DB-020 - Propriedades de saída indefinidas
- SR-DB-021 - Tempo limite embutido em código
- SR-DB-023 - Fluxo de trabalho vazio
- SR-DB-024 - Verificação da atividade Persistente
- SR-DB-025 - Pré-requisito de serialidade de variáveis
- SR-DB-027 - Melhores práticas de persistência
- SR-DB-028 - Pré-requisito de serialidade de argumentos
- ST-USG-005 - Hardcoded Activity Properties
- SR-US-009 - Variáveis não utilizadas
- SR-US-010 - Dependências não utilizadas
- SR-US-014 - Restrições de pacotes
- ST-USG-017 – Modificador de parâmetro inválido
- SR-US-020 - Mensagens de logue mínimas
- SR-US-024 - Não utilizado e postergado
- SR-US-025 - Uso incorreto do valor salvo
- SR-US-026 - Restrições da atividade
- SR-US-027 - Pacotes necessários
- ST-USG-28 — restringir modelos de invocação de arquivos
- ST-USG-032 — rótulos obrigatórios
- ST-USG-034 — URL do Automation Hub
- Variáveis
- Argumentos
- Namespaces Importados
- Automações codificadas
- Introdução
- Registro de serviços personalizados
- Contextos Antes e Depois
- Gerando código
- Geração de caso de teste codificado a partir de casos de teste manuais
- Integração do OpenAI com fluxos de trabalho codificados
- Solicite um empréstimo com o UiBank
- Geração de filas com fluxos de trabalho codificados e APIs do Orchestrator
- Usando projetos de biblioteca importados em automações codificadas
- Usando autenticação de dois fatores em automações codificadas
- Connecting to MongoDB Atlas with coded automations
- Solução de problemas
- Automação assistida baseada em gatilho
- Repo. de Objetos
- A ferramenta ScreenScrapeJavaSupport
- Extensões
- Sobre extensões
- Ferramenta SetupExtensions
- UiPathRemoteRuntime.exe não está sendo executado na sessão remota
- O UiPath Remote Runtime bloqueia a sessão do Citrix de ser fechado
- O UiPath Remote Runtime causa vazamento de memória
- O pacote UiPath.UIAutomation.Activities e as versões do UiPath Remote Runtime não correspondem
- A extensão do UiPath necessária não está instalada na máquina remota
- Configurações de resolução de tela
- Políticas de grupo
- Não é possível se comunicar com o navegador
- A extensão do Chrome é removida automaticamente
- A extensão pode ter sido corrompida
- Verifique se a extensão para o Chrome está instalada e habilitada
- Check if ChromeNativeMessaging.exe is running
- Check if ComSpec variable is defined correctly
- Habilite o Acesso às URLs do arquivo e o Modo Anônimo
- Multiple browser profiles
- Group Policy conflict
- Known issues specific to MV3 extensions
- Lista de extensões para Chrome
- Extensão do Chrome no Mac
- Políticas de grupo
- Não é possível se comunicar com o navegador
- A extensão Edge é removida automaticamente
- A extensão pode ter sido corrompida
- Check if the Extension for Microsoft Edge is installed and enabled
- Check if ChromeNativeMessaging.exe is running
- Check if ComSpec variable is defined correctly
- Enable access to file URLs and InPrivate mode
- Multiple browser profiles
- Group Policy conflict
- Known issues specific to MV3 extensions
- Lista de extensões para Edge
- Extensão para Safari
- Extensão para o Varear Horizonte
- Extensão para Amazon WorkSpaces
- Plug-in do SAP Solution Manager
- Suplemento do Excel
- Teste do Studio
- Solução de problemas
- Sobre a solução de problemas
- Erros de compilação de montagem
- Suporte e limitações do Microsoft Apo-V
- Solução de problemas do Internet Explorer x64
- Problemas do Microsoft Office
- Como identificar elementos de EU em PDF com opções de acessibilidade
- Reparando o suporte da Active Accessibility
- Validation of large Windows-legacy projects takes longer than expected
Importante :
A localização de um conteúdo recém-publicado pode levar de 1 a 2 semanas para ficar disponível.

Guia do usuário do Studio
Última atualização 26 de nov de 2025
This tutorial shows how to connect to a MongoDB Atlas database from your UiPath coded automations. MongoDB Atlas is a fully-managed cloud database service that provides a reliable and scalable database solution without the need for local installations.
Here are the ways to implement the MongoDB connection code:
-
Copy and paste the code into a
CSfile of your target project. -
Use a custom activity package and the sample
NUPKGfile
When opting to use the sample
NUPKG file, you have the capability to add the two-factor authentication as an activity within your XAML files.
Tip: Regardless of whether you choose to integrate the MongoDB connection code in your CS files (for coded automations) or XAML files (for low-code automations), remember that you can invoke a coded automation into a low-code one and vice versa. For more information about hybrid automations, visit Creating hybrid automations - Combining Coded and Low-code Workflows.
- Ensure you have UiPath Studio (version 2024.10 or later - recommended).
- Ensure you have a MongoDB Atlas account.
- Install the
MongoDB.DriverNuGet package in your project.- Open your UiPath project in Studio.
- In the Design ribbon, go to Manage Packages.
- Select All Packages or the .NET tab.
- Procure por
MongoDB.Driver. - Select
MongoDB.Driver, and then select Install. - Accept the license agreement and dependencies.
To use the MongoDB Atlas connection in your coded automation, you can copy and paste the following sample code in a
CS file from your target project. Make sure the namespace of the file matches with the one of your project name.
Note: The sample code connects to MongoDB Atlas using the connection string format specific to cloud deployments. Make sure to replace the placeholder credentials with your actual MongoDB Atlas credentials.
using System;
using System.Collections.Generic;
using System.Data;
using UiPath.CodedWorkflows;
using UiPath.Core;
using UiPath.Core.Activities.Storage;
using MongoDB.Driver;
namespace MongoDBCodedWorkflowsSample
{
public class TestConnection : CodedWorkflow
{
[Workflow]
public string Execute(string username, string password, string cluster)
{
List<string> databaseNames = new List<string>();
try
{
// Create MongoDB Atlas connection string
string connectionString = $"mongodb+srv://{username}:{password}@{cluster}/?retryWrites=true&w=majority";
Console.WriteLine("Connecting to MongoDB Atlas...");
// Initialize MongoDB client
var client = new MongoClient(connectionString);
// List all databases to verify connection
Console.WriteLine("\nAvailable databases:");
databaseNames = client.ListDatabaseNames().ToList();
foreach (var dbName in databaseNames)
{
Console.WriteLine($"- {dbName}");
}
Console.WriteLine("\nConnection successful!");
}
catch (MongoAuthenticationException authEx)
{
Console.WriteLine($"Authentication error: {authEx.Message}");
Console.WriteLine("Please verify your username and password.");
throw;
}
catch (MongoConnectionException connEx)
{
Console.WriteLine($"Connection error: {connEx.Message}");
Console.WriteLine("Please check your network access settings in MongoDB Atlas.");
throw;
}
catch (Exception ex)
{
Console.WriteLine($"MongoDB connection error: {ex.Message}");
throw;
}
return databaseNames;
}
}
}using System;
using System.Collections.Generic;
using System.Data;
using UiPath.CodedWorkflows;
using UiPath.Core;
using UiPath.Core.Activities.Storage;
using MongoDB.Driver;
namespace MongoDBCodedWorkflowsSample
{
public class TestConnection : CodedWorkflow
{
[Workflow]
public string Execute(string username, string password, string cluster)
{
List<string> databaseNames = new List<string>();
try
{
// Create MongoDB Atlas connection string
string connectionString = $"mongodb+srv://{username}:{password}@{cluster}/?retryWrites=true&w=majority";
Console.WriteLine("Connecting to MongoDB Atlas...");
// Initialize MongoDB client
var client = new MongoClient(connectionString);
// List all databases to verify connection
Console.WriteLine("\nAvailable databases:");
databaseNames = client.ListDatabaseNames().ToList();
foreach (var dbName in databaseNames)
{
Console.WriteLine($"- {dbName}");
}
Console.WriteLine("\nConnection successful!");
}
catch (MongoAuthenticationException authEx)
{
Console.WriteLine($"Authentication error: {authEx.Message}");
Console.WriteLine("Please verify your username and password.");
throw;
}
catch (MongoConnectionException connEx)
{
Console.WriteLine($"Connection error: {connEx.Message}");
Console.WriteLine("Please check your network access settings in MongoDB Atlas.");
throw;
}
catch (Exception ex)
{
Console.WriteLine($"MongoDB connection error: {ex.Message}");
throw;
}
return databaseNames;
}
}
}Connection Parameters
- username: The database user you created in MongoDB Atlas
- password: The password for your database user
- cluster: Your cluster hostname from the connection string (e.g.,
cluster0.abc123.mongodb.net)
The sample returns a list of all databases for that specific set of credentials.
Connection String Format - MongoDB Atlas uses the
mongodb+srv:// protocol, which:
- Automatically discovers all nodes in your cluster
- Provides automatic failover support
- Includes retry logic for write operations (
retryWrites=true) - Sets the write concern to majority (
w=majority)
Tratamento de Erro
- MongoAuthenticationException: Occurs when credentials are incorrect
- MongoConnectionException: Occurs when network access is blocked or cluster is unavailable
- General exceptions: Catches any other MongoDB-related errors
Using a sample
NUPKG file enables you to include the two-factor code in your automations.
- Download the
NUPKGfile. - Upload the downloaded
NUPKGfile to your Orchestrator Host or Tenant feed, which are accessible through your Studio instance. For more information on uploading theNUPKGfile as a custom library to Orchestrator, refer to Manually uploading a library to Orchestrator. - Abra seu projeto do Studio e acesse o menu Gerenciar Pacotes.
- Search for the
MongoDB.Coded.Workflows.SampleNUPKGfile you previously saved to your Orchestrator Host or Orchestrator Tenant feed, and install it.Figure 1. Custom library in the Manage Packages menu
- After you install the file, navigate to the Activities panel and locate
MongoDB.Coded.Workflows.Sample. Drag and drop the GetDatabases activity into yourXAMLfiles to test your MongoDB connection and fetch a list of the available databases.Figure 2. GetDatabases activity in the Activities panel