Productivity Activities
Last updated Jun 11, 2024


This section helps you set up connections required for accessing APIs from services that use connections.

To set up such a connection, you begin by creating a connection in Integration Service. The connections that you create in Integration Service are accessible within the same organization and tenant as your coded automation where you're working. You can use the connections object to access the connections you previously created in Integration Service, and then access the corresponding APIs.

After you complete the automation and publish it to Orchestrator, you have the option to override the initial connection configurations you performed in code.


Create a connection in Integration Service:

  1. Go to Integration Service and navigate to Connections.
  2. Select Add connection, and create a connection for one of the following applications:
    • Microsoft OneDrive & SharePoint
    • Microsoft Outlook 365


  1. Open an existing coded automation from the same organization, and tenant where you initially created your connection.
  2. Inside the Execute() body, type connections, and then press Ctrl + Space to see the available connections.
    Depending on the application for which you previously created the connection, you can choose from the following connection types:
    • Office365
  3. Further configure your connection by adding the Orchestrator folder name and the desired connection address, separated by underlines.
    For example, a OneDrive connection for the My Workspace folder in Orchestrator, and for the address would be written in code as: connections.OneDrive.My_Workspace_john_doe_company_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 myOneDriveConnection = connections.OneDrive.My_Workspace_john_doe_company_com;var myOneDriveConnection = connections.OneDrive.My_Workspace_john_doe_company_com;
    Avoid creating your connections in two separate steps like:
    var myOneDriveConnection = connections.OneDrive;
    conn.My_Workspace_john_doe_company_com;var myOneDriveConnection = connections.OneDrive;
  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 OneDrive connection as follows: var myOneDriveConnection =, you can use the service's API using myOneDriveConnection.

Overriding the connection in Orchestrator

  1. Publish your project to Orchestrator.
  2. Go to the Orchestrator feed where you've published the project.
  3. Go to the published process and select Edit.
  4. In Process Configuration, choose the coded automation containing your configured connection as the entry point.
  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.
  • Prerequisites
  • Steps
  • Overriding the connection in Orchestrator

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.