Skip to content
BlokloDocumentation

Microsoft Excel

Reading and writing Excel workbooks in OneDrive for Business and SharePoint, for example appending form submissions to an Excel table.

Connection type: For the app and the agent. Sign-in: Sign in with a Microsoft account in the provider's window and approve the permissions listed below. No passwords or keys are entered in Bloklo.

How it works

The app and the agent never see the credentials. They call the Microsoft Excel API through the Bloklo gateway, for example fetch("/gw/<connection id>/me/drive/root/search(q='.xlsx')"). The gateway appends the path to the address https://graph.microsoft.com/v1.0, adds an access token from the Microsoft sign-in, renewed automatically, and passes the service's response back to the app.

  • Reads (GET) go through at once. Writes (POST, PUT, PATCH, DELETE) go through at once only when the connection is set to Always allow; otherwise the gateway returns status 202 with an approval_id and the write waits for approval in the panel (see Agent permissions).
  • The Test button sends GET /me/drive and checks that the service accepted the credentials.

JSON over Microsoft Graph v1.0; results are paged, and the next page is at the @odata.nextLink URL (use it unchanged). Workbooks (.xlsx) are drive files (/me/drive/items/{id}/workbook/…); ranges are read and written in A1 notation with values as a two-dimensional array. A series of changes can use a session (createSession) and the workbook-session-id header.

Before you start

  • A Microsoft account with access to the data the app should use.

Connecting in Bloklo

  1. Open Connectors in the sidebar and find Microsoft Excel.
  2. Click Connect and enter a connection name in Details.
  3. Click Connect. The Microsoft sign-in window opens.
  4. Choose the Microsoft account and approve the permissions. After approval you return to Bloklo and the connection is active.
  5. Attach the connection to a project: Attach to a project… on the connection page, or describe the task in the project chat.
Note

In organisations where the administrator has turned off user consent to apps, Microsoft shows a request for admin approval. The company's Microsoft 365 administrator then approves the Bloklo app in the Entra admin center.

Provider permissions

Bloklo asks Microsoft for exactly these scopes: Files.ReadWrite, User.Read, offline_access. Access can be revoked at any time by removing the connection in Bloklo or in the Microsoft account settings.

Note

Microsoft 365 work accounts only: the workbook API does not support files in personal OneDrive. Give the agent the name or link of the .xlsx file.

Microsoft Excel documentation

Example prompts

Prompts to type in the chat of a project with the connection attached:

  • “Show the data from Sales.xlsx in a table with a chart.”
  • “Append each new order as a row in the Orders table in Excel.”
  • “Build a monthly report from range A1:F200 of the chosen workbook.”

API methods

The most commonly used Microsoft Excel API methods. The path goes after /gw/<connection id>; parts in braces, such as {id}, are replaced with values. The gateway treats every request other than GET as a write, including queries sent with POST (such as search or GraphQL), so they need approval unless the connection is set to Always allow. The full list of methods is in the provider's documentation.

MethodPathWhat it doesIn the gateway
GET/me/drive/root/search(q='.xlsx')Find workbooks on the driveread
GET/me/drive/items/{id}/workbook/worksheetsList workbook worksheetsread
GET/me/drive/items/{id}/workbook/worksheets/{nazwa}/range(address='A1:C10')Read a cell rangeread
GET/me/drive/items/{id}/workbook/worksheets/{nazwa}/usedRangeRead all used cells of a sheetread
PATCH/me/drive/items/{id}/workbook/worksheets/{nazwa}/range(address='A1:B2')Write values or formulas to a rangewrite (approval)
GET/me/drive/items/{id}/workbook/tablesList workbook tablesread
POST/me/drive/items/{id}/workbook/tables/{nazwa}/rowsAdd rows to a tablewrite (approval)
POST/me/drive/items/{id}/workbook/createSessionCreate a workbook sessionwrite (approval)
PUT/me/drive/root:/{ścieżka}.xlsx:/contentUpload a workbook filewrite (approval)

Service limits

All Excel requests: 5,000 per 10 seconds per app across tenants and 1,500 per 10 seconds per app and tenant; the documentation recommends sessions and batching changes rather than fixed numbers. Upload through PUT up to 250 MB. Sessions (createSession) and table rows work only with work or school accounts.

Microsoft Excel API reference

Agent actions and permissions

ActionTypeWhat the agent uses it for
Read datareadFetches data from the service, such as a list of records, to build and check the app. Examples: find workbooks on the drive; list workbook worksheets; read a cell range.
Write datawriteRequests other than GET: creating, changing or deleting data in the service, and also queries sent with POST (such as search). Examples: write values or formulas to a range; add rows to a table; create a workbook session.
Tip

By default, reads run without asking and writes need approval in the chat. Change this on the connector page or in Settings → Agent permissions (see Agent permissions).

Troubleshooting

The connection says it needs reconnecting

Access was revoked in the Microsoft account, expired, or the password changed. Open the connection and click Authorize.

The test returns HTTP 403

The account has no access to this data, or some permissions were unticked during sign-in. Reconnect and approve all permissions.

Limits and security

  • One connection can make up to 1,000 requests per minute; the service's own limits also apply.
  • Credentials are encrypted and not shown in the browser after saving; only the names of stored fields are visible.
  • A published app works for every visitor: protect the data the connection gives access to with sign-in in the app.

Something unclear or out of date? Contact us