Excel Online
Use the Excel Online connector to perform operations on Excel Online.
Before you begin
Configure your Google Cloud project, create your OAuth application and grant the required permissions.Configure your Google Cloud project
Before using the Excel Online connector, do the following tasks in your Google Cloud project:
- Ensure that network connectivity is set up. For information about network patterns, see Network connectivity.
- Enable the following services:
secretmanager.googleapis.com
(Secret Manager API)connectors.googleapis.com
(Connectors API)
To understand how to enable services, see Enabling services.
If these services or permissions have not been enabled for your project previously, you are prompted to enable them when configuring the connector.
Create Custom OAuth Application - Azure AD
- Log in to Azure Portal.
- In the left-hand navigation pane, select Azure Active Directory, then applicationRegistrations.
- Click New registration.
- Enter a name for the application.
- Select the desired tenant setup: single or multi-tenant, and public or private use.
- If you select the default option, "Accounts in this organizational directory only", you must set the AzureTenant connection property to the Id of the Azure AD Tenant when establishing a connection with the CData JDBC Driver for Microsoft Excel Online. Otherwise, the authentication attempt fails with an error.
- If your application is for private use only, specify Accounts in this organization directory only.
- If you want to distribute your application, choose one of the multi-tenant options.
- Set the redirect url to http://localhost:33333 (the driver's default) OR specify a different port and set CallbackURL to the exact reply URL you defined.
- Click Register to register the new application. An application management screen displays. Note the value in Application (client) ID as the OAuthClientId and the Directory (tenant) ID as the AzureTenant.
- Navigate to Certificates & Secrets and define the application authentication type. There are two types of authentication available: certificate (recommended) or client secret.
- For certificate authentication: In Certificates & Secrets, select Upload certificate, then upload the certificate from your local machine.
- For creating a new client secret: In Certificates & Secrets, select New Client Secret for the application and specify its duration. After the client secret is saved, Microsoft Excel Online displays the key value. Copy this value, as it is displayed only once. This value becomes the OAuthClientSecret.
- Select API Permissions > Add > Delegated permissions.
- Add the following application permissions: Sites.Read.All, Files.Read, Files.Read.All, Files.Read.Selected, Files.ReadWrite, Files.ReadWrite.All, Files.ReadWrite.AppFolder, Files.ReadWrite.Selected, and offline_access.
- Save your changes.
- If you have specified the use of permissions that require admin consent (such as the Application Permissions), you can grant them from the current tenant on the API Permissions page.
Create Custom OAuth Application - Azure Service Principal
- Use the search bar to search for the Subscriptions service.
- Open the Subscriptions page.
- Select the subscription to which to assign the application.
- Open the Access control (IAM).
- Select Add > Add role assignment. Microsoft Excel Online opens the Add role assignment page.
- Assign your custom Azure AD application the role of Owner.
Assign a role to the application
- To access resources in your subscription, you must assign a role to the application.
- Open the Subscriptions page by searching and selecting the Subscriptions service from the search bar.
- Select the subscription to assign the application to.
- Open the Access control (IAM) and select Add > Add role assignment to open the Add role assignment page.
- Select Owner as the role to assign to your created Azure AD app.
Grant admin consent
- Log in to Azure Portal
- Navigate to App Registrations and find the custom OAuth application you created.
- Under API Permissions, click Grant Consent.
Grant permissions for client credentials
- Log in to Azure Portal
- Navigate to App Registrations.
- Find the application you just created, and open API Permissions.
- Select the Microsoft Graph permissions. There are two distinct sets of permissions: Delegated and Application.
- Under Application Permissions, select the permissions you require for your integration.
Configure the connector
Configuring the connector requires you to create a connection to your data source (backend system). A connection is specific to a data source. It means that if you have many data sources, you must create a separate connection for each data source. To create a connection, do the following steps:
- In the Cloud console, go to the Integration Connectors > Connections page and then select or create a Google Cloud project.
- Click + Create new to open the Create Connection page.
- In the Location section, choose the location for the connection.
- Region: Select a location from the drop-down list.
Supported regions for connectors include:
For the list of all the supported regions, see Locations.
- Click Next.
- Region: Select a location from the drop-down list.
- In the Connection Details section, complete the following:
- Connector: Select Excel Online from the drop down list of available Connectors.
- Connector version: Select the Connector version from the drop down list of available versions.
- In the Connection Name field, enter a name for the Connection instance.
Connection names must meet the following criteria:
- Connection names can use letters, numbers, or hyphens.
- Letters must be lower-case.
- Connection names must begin with a letter and end with a letter or number.
- Connection names cannot exceed 49 characters.
- Optionally, enter a Description for the connection instance.
- Optionally, enable Cloud logging,
and then select a log level. By default, the log level is set to
Error
. - Service Account: Select a service account that has the required roles.
- Optionally, configure the Connection node settings:
- Minimum number of nodes: Enter the minimum number of connection nodes.
- Maximum number of nodes: Enter the maximum number of connection nodes.
A node is a unit (or replica) of a connection that processes transactions. More nodes are required to process more transactions for a connection and conversely, fewer nodes are required to process fewer transactions. To understand how the nodes affect your connector pricing, see Pricing for connection nodes. If you don't enter any values, by default the minimum nodes are set to 2 (for better availability) and the maximum nodes are set to 50.
- Azure Tenant: The Microsoft Online tenant being used to access data. If not specified, your default tenant is used.
- Drive: The ID of the drive. You can use the Drives and SharePointSites views to view all the sites and drives you have access to.
- Sharepoint URL: The base URL of your Sharepoint Server.
- Show Shared Documents: Whether or not to show shared documents.
- Workbook: The name or Id of the workbook.
- Header: Indicates whether or not the column names should be detected from the first row.
- Table: Restricts the connection to a table containing a range of cells of a worksheet. Format: [{Workbook Name}_{Worksheet Name}!{Range}]
- Optionally, click + Add label to add a label to the Connection in the form of a key/value pair.
- Click Next.
- In the Authentication section, enter the authentication details. To understand how to configure these authentication details, see Configure authentication.
- Click Next.
- Review: Review your connection and authentication details.
- Click Create.
Configure authentication
Enter the details based on the authentication you want to use.
- Client ID: The client ID used for requesting access tokens.
- Scope: A comma-separated list of desired scopes.
- Client secret: The client secret used for requesting access tokens.
- Authorization URL: The authorization URL generated when creating client.
Excel Online - Web connection type
This section lists the sample values for the various fields that you configure when creating the Excel Online connection.
Fieldname | Details |
---|---|
Location | us-central1 |
Connector | Excelonline |
Connector version | 1 |
Connection Name | excelonline-gcp |
Service Account | SERVICE_ACCOUNT_NAME@serviceaccount |
Azure Tenant | 9b******-****-****-****-*********12 |
Drive | b!p_648NCXwk6hJ1pfyn0SeFaithFnRM1JmYNur9asmHAs2k8qe5UsR5a1cX6luuD0 |
Sharepoint URL | https://*****.sharepoint.com/ |
Show Shared Documents | True |
Minimum number of nodes | 2 |
Maximum number of nodes | 50 |
Client ID | e89*****-****-****-****-*********b6 |
Scopes | https://graph.microsoft.com/.default |
Client secret | CLIENT_SECRET |
Secret version | 1 |
Authorization URL | https://login.microsoftonline.com/{Azure-Tenant}/oauth2/v2.0/authorize |
Additional steps after connection creation
If you selected OAuth 2.0 - Authorization code
for
authentication, you must do the following additional steps after creating the connection:
- In the Connections page,
locate the newly created connection.
Notice that the Status for the new connector will be Authorization required.
- Click Authorization required.
This shows the Edit authorization pane.
- Copy the Redirect URI value to your external application.
- Verify the authorization details.
- Click Authorize.
If the authorization is successful, the connection status will be set to Active in the Connections page.
Re-authorization for authorization code
If you are using Authorization code
authentication type and have made any cofiguration changes in your Azure Synapse application,
you must re-authorize your Azure Synapse connection. To re-authorize a connection, perform the following steps:
- Click on the required connection in the Connections page.
This opens the connection details page.
- Click Edit to edit the connection details.
- Verify the OAuth 2.0 - Authorization code details in the Authentication section.
If required, make the necessary changes.
- Click Save. This takes you to the connection details page.
- Click Edit authorization in the Authentication section. This shows the Authorize pane.
- Click Authorize.
If the authorization is successful, the connection status will be set to Active in the Connections page.
System limitations
The maximum Excel file size that the Excel Online connector can process is 25 MB.
The Excel Online connector can process 3 transactions per second, per node, and throttles any transactions beyond this limit. By default, Integration Connectors allocates 2 nodes (for better availability) for a connection.
For information on the limits applicable to Integration Connectors, see Limits.
Use the Excel Online connection in an integration
After you create the connection, it becomes available in both Apigee Integration and Application Integration. You can use the connection in an integration through the Connectors task.
- To understand how to create and use the Connectors task in Apigee Integration, see Connectors task.
- To understand how to create and use the Connectors task in Application Integration, see Connectors task.
Entities, operations, and actions
All the Integration Connectors provide a layer of abstraction for the objects of the connected application. You can access an application's objects only through this abstraction. The abstraction is exposed to you as entities, operations, and actions.
- Entity: An entity can be thought of as an object, or a collection of properties, in the
connected application or service. The definition of an entity differs from a connector to a
connector. For example, in a database connector, tables are the entities, in a
file server connector, folders are the entities, and in a messaging system connector,
queues are the entities.
However, it is possible that a connector doesn't support or have any entities, in which case the
Entities
list will be empty. - Operation: An operation is the activity that you can perform on an entity. You can perform
any of the following operations on an entity:
Selecting an entity from the available list, generates a list of operations available for the entity. For a detailed description of the operations, see the Connectors task's entity operations. However, if a connector doesn't support any of the entity operations, such unsupported operations aren't listed in the
Operations
list. - Action: An action is a first class function that is made available to the integration
through the connector interface. An action lets you make changes to an entity or entities, and
vary from connector to connector. Normally, an action will have some input parameters, and an output
parameter. However, it is possible
that a connector doesn't support any action, in which case the
Actions
list will be empty.
Actions
This section lists the actions supported by the connector. To understand how to configure the actions, see Action examples.
Add Worksheet action
Adds a worksheet to an existing Excel Online workbook.
Input parameters of the AddWorksheet Action
Parameter Name | Data Type | Required | Description |
---|---|---|---|
Title | String | True | Name of the worksheet. |
WorkbookId | String | True | The Id of the workbook. This ID must belong to the drive accessible with current connection properties. |
Output parameters of the AddWorksheet action
For example on how to configure the AddWorksheet
action,
see Examples.
Examples
This section describes how to perform some of the actions in this connector.
Action examples
This section describes how to perform some of the actions in this connector.
Example - Perform AddWorksheet action
This example adds a worksheet to an existing Excel Online workbook.
- In the
Configure connector task
dialog, clickActions
. - Select the
AddWorksheet
action, and then click Done. - In the Data Mapping section
Open Data Mapping Editor
and then enter a value similar to the following in theInput
field:{ "WorkbookId": "01M7ENMYA2QJVY77NPOFD3WQIJ6PNNX5VL", "Title": "Worksheet_SP1" }
If the action is successful, the
AddWorksheet
task's connectorOutputPayload
response
parameter will have a value similar to the following:
[{ "Success": "true", "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#workbookWorksheet", "@odata.type": "#microsoft.graph.workbookWorksheet", "@odata.id": "/drives('b%21p_648NCXwk6hJ1pfyn0SeFaithFnRM1JmYNur9asmHAs2k8qe5UsR5a1cX6luuD0')/items('01M7ENMYA2QJVY77NPOFD3WQIJ6PNNX5VL')/workbook/worksheets(%27%7BD9372F53-CB1B-4082-9E13-02E65C2FC233%7D%27)", "id": "{D9372F53-CB1B-4082-9E13-02E65C2FC233}", "name": "Worksheet_SP1", "position": "1", "visibility": "Visible" }]
Entity operation examples
This section shows how to perform some of the entity operations in this connector.
Example - List all Drives
- In the
Configure connector task
dialog, clickEntities
. - Select Drives from the
Entity
list. - Select the
List
operation, and then click Done.
Example - List all SharedDocuments
- In the
Configure connector task
dialog, clickEntities
. - Select SharedDocuments from the
Entity
list. - Select the
List
operation, and then click Done.
Example - List all Workbooks
- In the
Configure connector task
dialog, clickEntities
. - Select Workbooks from the
Entity
list. - Select the
List
operation, and then click Done.
Example - Get Drives
- In the
Configure connector task
dialog, clickEntities
.
ect Drives from the - Select the
Get
operation, and then click Done. - Set the entity ID to Get single Drives. To set the entity ID, in
the Data Mapper section of the Data Mapping, click Open Data Mapping Editor and
then enter
b!ZETdEU1T_UOBEzbgDmsvcubxvUaXbcJNrrNPM4LqokkwLC3zCRPiQLi2PBfCs9-v
in the Input Value field and choose the EntityId as Local variable.
Entity
list.
Example - Get SharedDocument
- In the
Configure connector task
dialog, clickEntities
. - Select SharedDocuments from the
Entity
list. - Select the
Get
operation, and then click Done. - Set the entity ID to Get single SharedDocument. To set the entity ID, in
the Data Mapper section of the Data Mapping, click Open Data Mapping Editor and
then enter
01BDTL6TS3OQ3HDXCKGREILDYKY47S7LEI
in the Input Value field and choose the EntityId as Local variable.
Example - Get Workbooks
- In the
Configure connector task
dialog, clickEntities
. - Select Workbooks from the
Entity
list. - Select the
Get
operation, and then click Done. - Set the entity ID to Get single Workbooks. To set the entity ID, in
the Data Mapper section of the Data Mapping, click Open Data Mapping Editor and
then enter
01M7ENMYA2QJVY77NPOFD3WQIJ6PNNX5VL
in the Input Value field and choose the EntityId as Local variable.
Example - Delete data from Book
- In the
Configure connector task
dialog, clickEntities
. - Select Book 4567_Sheet1 from the
Entity
list. - Select the
Delete
operation, and then click Done. - Set the entity ID to Delete Book 4567_Sheet1. To set the entity ID, in
the Data Mapper section of the Data Mapping, click Open Data Mapping Editor and
then enter
5.0
in the Input Value field and choose the EntityId as Local variable.
Example - Create a Formula for Formulae_Sheet_List
- In the
Configure connector task
dialog, clickEntities
. - Select Formulae_Sheet_List from the
Entity
list. - Select the
Create
operation, and then click Done. - In the Data mapper section of the Task click
OpenDataMapping
editor and then enter a value similar to the following in thefield:
{ "Excel_Sheet": "Old_Excel", "B": "=SUM(C8:D8)", "C": "6", "D": "6" }
Running this example, returns a response similar to the following in the Connector task's
connectorOutputPayload
output variable:{ "Id": 8.0 }
Example - Create With_Headers
- In the
Configure connector task
dialog, clickEntities
. - Select Book 4567_Book4567_Sheet1 from the
Entity
list. - Select the
Create
operation, and then click Done. - In the Data mapper section of the Task click
OpenDataMapping
editor and then enter a value similar to the following in thefield:
{ "Name": "workbooknew", "Type": "newly created", "Sl no": 5.0 }
Running this example, returns a response similar to the following in the Connector task's
connectorOutputPayload
output variable:{ "Id": 6.0 }
Example - Create Without_Headers
- In the
Configure connector task
dialog, clickEntities
. - Select Book 4567_Book4567_Sheet1 from the
Entity
list. - Select the
Create
operation, and then click Done. - In the Data mapper section of the Task click
OpenDataMapping
editor and then enter a value similar to the following in thefield:
{ "A": "6", "B": "Halo", "C": "Stardust" }
Running this example, returns a response similar to the following in the Connector task's
connectorOutputPayload
output variable:{ "Id": 7.0 }
Example - Update an Formula for Formulae_Sheet_List
- In the
Configure connector task
dialog, clickEntities
. - Select Formulae_Sheet_List from the
Entity
list. - Select the
Update
operation, and then click Done. - Set the entity ID to Update a Formulae_Sheet_List. To set the entity ID, in
the Data mapper section of the Tasks, click entityId and
then enter
8.0
in the given field. - In the Data mapper section of the Task click
OpenDataMapping
editor and then enter a value similar to the following in thefield:
{ "B": "=MAX(C8:D8)", "C": "7", "D": "10" }
Running this example, returns a response similar to the following in the Connector
task's connectorOutputPayload
output variable:
{ "Id": 8.0 }
Example - Update Without_Header
- In the
Configure connector task
dialog, clickEntities
. - Select Book 4567_Book4567_Sheet1 from the
Entity
list. - Select the
Update
operation, and then click Done. - Set the entity ID to Update a Book 4567_Book4567_Sheet1. To set the entity ID, in
the Data mapper section of the Tasks, click entityId and
then enter
7.0
in the given field. - In the Data mapper section of the Task click
OpenDataMapping
editor and then enter a value similar to the following in thefield:
{ "B": "cosmically", "C": "interlinked" }
Running this example, returns a response similar to the following in the Connector
task's connectorOutputPayload
output variable:
{ "Id": 7.0 }
Example - Update_With_Header
- In the
Configure connector task
dialog, clickEntities
.
li>Select Book 4567_Book4567_Sheet1 from the - Select the
Update
operation, and then click Done. - Set the entity ID to Update a Book 4567_Book4567_Sheet1 To set the entity ID, in
the Data mapper section of the Tasks, click entityId and
then enter
6.0
in the given field. - In the Data mapper section of the Task click
OpenDataMapping
editor and then enter a value similar to the following in thefield:
{ "Name": "updated", "Type": "newupdate" }
Entity
list.
Running this example, returns a response similar to the following in the Connector
task's connectorOutputPayload
output variable:
{ "Id": 6.0 }
Get help from the Google Cloud community
You can post your questions and discuss this connector in the Google Cloud community at Cloud Forums.What's next
- Understand how to suspend and resume a connection.
- Understand how to monitor connector usage.
- Understand how to view connector logs.