Studio
2024.10
False
Guía de usuario de Studio
Last updated 28 de jun. de 2024

Crear conexiones para servicios en automatizaciones codificadas

This section helps you create connections needed to access APIs from services that use connections, such as GSuite.Activities and Excel.Activities within coded automations.

Start by creating a connection in Integration Service. The connections can be accessed within the same organization, and tenant of your coded automation project. Inside the coded automation, use the connections object to access the earlier created connections in Integration Service, and then access the corresponding APIs.

After you complete the automation and publish it to Orchestrator, you can override the original connection configurations set up in code, if needed.

Requisitos previos

Crea una conexión en Integration Service:

  1. Go to Integration Service, and select the tenant that your Studio is connected to.
  2. Navega a Conexiones.
  3. Selecciona Añadir conexión y crea una conexión para una de las siguientes aplicaciones:
    • Google Drive
    • Gmail
    • Google Sheets
    • Microsoft Office 365

Pasos

  1. Open an existing coded automation from the same organization, and tenant where you initially created your connection.
  2. Dentro del cuerpo Execute(), escribe connections, y luego pulsa Ctrl + Space para ver las conexiones disponibles.
    Dependiendo de la aplicación para la que creaste anteriormente connection, puedes elegir entre los siguientes tipos de conexión:
    • GDrive
    • Gmail
    • GoogleSheets
    • Excel
    • OneDrive
    • O365Mail
  3. Further configure your connection by adding the Orchestrator folder name and the desired connection address, separated by underlines.
    For example, a Gmail connection for the My Workspace folder in Orchestrator, and for the john.doe@gmail.com address would be written in code as: connections.Gmail.My_Workspace_john_doe_gmail_com.
    Recomendable
    We recommend you to create your connections in one step to avoid potential errors. We also recommend you to create a variable for the connection. This way, if changes occur in Integration Service, you'll avoid updating every instance of the connection throughout your automation. Use the following approach:
    var myGmailConnection = connections.Gmail.My_Workspace_john_doe_gmail_com;var myGmailConnection = connections.Gmail.My_Workspace_john_doe_gmail_com;
    Avoid creating your connections in two separate steps like:
    var myGmailConnection = connections.Gmail;
    conn.My_Workspace_john_doe_gmail_com;var myGmailConnection = connections.Gmail;
    conn.My_Workspace_john_doe_gmail_com;
  4. Once you've established the connection, you can access the relevant APIs specific to a service through that connection.
    For example, if you have set up a Gmail connection as follows: var myGmailConnection = connections.Gmail.My_Workspace_john_doe_gmail.com, you can use the service's API using myGmailConnection.

Anular la conexión en Orchestrator

  1. Publica tu proyecto en Orchestrator.
  2. Go to the Orchestrator feed where you've published the project.
  3. Go to the published process and select Edit.
  4. En Configuración del proceso, elige la automatización codificada que contiene tu conexión configurada como punto de entrada.
  5. In Package Requirements, find and select the corresponding connection type for your coded automation.

    Be careful to select the connection type for your coded automation, as connections for XAML files within your project also appear in the list.

  6. Identify and select the account address you plan to associate with the connection when it runs.

Limitación conocida

The default connection of an exported library will work in other projects, only if the imported project is in the same tenant as the originating library project.

Was this page helpful?

Obtén la ayuda que necesitas
RPA para el aprendizaje - Cursos de automatización
Foro de la comunidad UiPath
Logotipo blanco de UiPath
Confianza y seguridad
© 2005-2024 UiPath. All rights reserved.