活动
最新
False
生产力活动
Last updated 2024年6月26日

连接

本节帮助您设置从使用连接的服务访问 API 所需的连接。

要设置此类连接,请首先在 Integration Service 中创建连接。 可在与您使用编码自动化相同的组织和租户中访问您在 Integration Service 中创建的连接。 您可以使用connections对象访问先前在 Integration Service 中创建的连接,然后访问相应的 API。

完成自动化并将其发布到 Orchestrator 后,您可以选择覆盖在代码中执行的初始连接配置。

先决条件

在 Integration Service 中创建连接:

  1. 转到 Integration Service 并导航至“连接”。
  2. 选择“添加连接”,然后为以下应用程序之一创建连接:
    • Google 云端硬盘
    • Gmail
    • Google 表格

步骤

  1. Open an existing coded automation from the same organization, and tenant where you initially created your connection.
  2. Execute()正文中,键入connections ,然后按Ctrl + 空格键查看可用连接。
    根据先前创建 connection 的应用程序,您可以从以下连接类型中进行选择:
    • Drive
    • Gmail
    • GoogleSheets
  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.
    建议
    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.

覆盖 Orchestrator 中的连接

  1. 将项目发布到 Orchestrator。
  2. Go to the Orchestrator feed where you've published the project.
  3. Go to the published process and select Edit.
  4. 在“流程配置”中,选择包含已配置连接的编码自动化作为入口点。
  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.
  • 先决条件
  • 步骤
  • 覆盖 Orchestrator 中的连接

此页面是否有帮助?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath 白色徽标
信任与安全
© 2005-2024 UiPath. All rights reserved.