Studio
2024.10
False
Studio-Benutzerhandbuch
Last updated 28. Juni 2024

Erstellen von Verbindungen für Dienste in codierten Automatisierungen

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.

Voraussetzungen

Erstellen Sie eine Verbindung im Integration Service:

  1. Go to Integration Service, and select the tenant that your Studio is connected to.
  2. Wechseln Sie zu Verbindungen.
  3. Wählen Sie Verbindung hinzufügen aus und erstellen Sie eine Verbindung für eine der folgenden Anwendungen:
    • Google Drive
    • Gmail
    • Google Tabellen
    • Microsoft Office 365

Schritte

  1. Open an existing coded automation from the same organization, and tenant where you initially created your connection.
  2. Im Textkörper von Execute() geben Sie connections ein und drücken Sie dann Ctrl + Space, um die verfügbaren Verbindungen anzuzeigen.
    Je nach der Anwendung, für die Sie zuvor die connection erstellt haben, können Sie aus den folgenden Verbindungstypen wählen:
    • 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.
    Empfehlung
    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.

Überschreiben der Verbindung im Orchestrator

  1. Veröffentlichen Sie Ihr Projekt im Orchestrator.
  2. Go to the Orchestrator feed where you've published the project.
  3. Go to the published process and select Edit.
  4. Wählen Sie in der Prozesskonfiguration die codierte Automatisierung aus, die Ihre konfigurierte Verbindung als Einstiegspunkt enthält.
  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.

Bekannte Einschränkung

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.

War diese Seite hilfreich?

Hilfe erhalten
RPA lernen – Automatisierungskurse
UiPath Community-Forum
UiPath Logo weiß
Vertrauen und Sicherheit
© 2005-2024 UiPath. All rights reserved.