Studio
2024.10
False
Guide de l’utilisateur de Studio
Last updated 28 juin 2024

Créer des connexions pour les services dans les automatisations codées

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.

Prérequis

Créez une connexion dans Integration Service :

  1. Go to Integration Service, and select the tenant that your Studio is connected to.
  2. Accédez à Connexions.
  3. Sélectionnez Ajouter une connexion et créez une connexion pour l’une des applications suivantes :
    • Google Drive
    • Gmail
    • Google Sheets
    • Microsoft Office 365

Étapes

  1. Open an existing coded automation from the same organization, and tenant where you initially created your connection.
  2. Dans le corps Execute(), tapez connections, puis appuyez sur Ctrl + Space pour afficher les connexions disponibles.
    En fonction de l’application pour laquelle vous avez précédemment créé connection, vous pouvez choisir l’un des types de connexion suivants :
    • 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.
    Recommandation
    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.

Remplacer la connexion dans Orchestrator

  1. Publiez à nouveau le projet dans Orchestrator.
  2. Go to the Orchestrator feed where you've published the project.
  3. Go to the published process and select Edit.
  4. Dans Configuration du processus, choisissez l’automatisation codée contenant votre connexion configurée en tant que point d’entrée.
  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.

Limites connues

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.

  • Prérequis
  • Étapes
  • Remplacer la connexion dans Orchestrator
  • Limites connues

Cette page vous a-t-elle été utile ?

Obtenez l'aide dont vous avez besoin
Formation RPA - Cours d'automatisation
Forum de la communauté UiPath
Logo Uipath blanc
Confiance et sécurité
© 2005-2024 UiPath. All rights reserved.