Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

fix(microsoft-excel-365): resolve Invalid URL in New Row and Updated … (#16206)

sanket-a11y6c01ab70b60e
diff --git a/bun.lock b/bun.lock
index 60ae67471b8..03b68786134 100644
--- a/bun.lock
+++ b/bun.lock
@@ -5840,7 +5840,7 @@
},
"packages/pieces/community/microsoft-excel-365": {
"name": "@activepieces/piece-microsoft-excel-365",
- "version": "0.8.0",
+ "version": "0.8.1",
"dependencies": {
"@activepieces/core-piece-types": "workspace:*",
"@activepieces/core-utils": "workspace:*",
diff --git a/packages/pieces/community/microsoft-excel-365/package.json b/packages/pieces/community/microsoft-excel-365/package.json
index 097fec1c5f0..be78ba2d526 100644
--- a/packages/pieces/community/microsoft-excel-365/package.json
+++ b/packages/pieces/community/microsoft-excel-365/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-microsoft-excel-365",
- "version": "0.8.0",
+ "version": "0.8.1",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"dependencies": {
diff --git a/packages/pieces/community/microsoft-excel-365/src/lib/common/common.ts b/packages/pieces/community/microsoft-excel-365/src/lib/common/common.ts
index c046a7b0006..04315069be2 100644
--- a/packages/pieces/community/microsoft-excel-365/src/lib/common/common.ts
+++ b/packages/pieces/community/microsoft-excel-365/src/lib/common/common.ts
@@ -337,9 +337,12 @@ export const excelCommon = {
worksheetId: string,
accessToken: string,
drivePath?: string,
- cloud?: string | null
+ cloudProp?: unknown
): Promise<(string | number | boolean)[][]> {
- const basePath = drivePath || excelCommon.getBaseUrl(cloud);
+ const cloud = typeof cloudProp === 'string' ? cloudProp : undefined;
+ const basePath = drivePath
+ ? `${getGraphBaseUrl(cloud)}/v1.0${drivePath}`
+ : excelCommon.getBaseUrl(cloud);
const response = await httpClient.sendRequest<{
values: (string | number | boolean)[][];
}>({
diff --git a/packages/pieces/community/microsoft-excel-365/src/lib/trigger/new-row-added.ts b/packages/pieces/community/microsoft-excel-365/src/lib/trigger/new-row-added.ts
index 38edb37ec93..c3888c616e7 100644
--- a/packages/pieces/community/microsoft-excel-365/src/lib/trigger/new-row-added.ts
+++ b/packages/pieces/community/microsoft-excel-365/src/lib/trigger/new-row-added.ts
@@ -35,7 +35,8 @@ const polling: Polling<
workbookId,
worksheetId,
auth.access_token,
- drivePath
+ drivePath,
+ auth.props?.['cloud']
)) ?? [];
const currentValues = fetchedValues.map((row: any[], rowIndex: number) => {
diff --git a/packages/pieces/community/microsoft-excel-365/src/lib/trigger/updated-row.ts b/packages/pieces/community/microsoft-excel-365/src/lib/trigger/updated-row.ts
index 71394dc80b1..20dc9215a60 100644
--- a/packages/pieces/community/microsoft-excel-365/src/lib/trigger/updated-row.ts
+++ b/packages/pieces/community/microsoft-excel-365/src/lib/trigger/updated-row.ts
@@ -25,7 +25,7 @@ function createRowHash(rowData: unknown[]): string {
// Helper function to get all worksheet rows with error handling
async function getWorksheetRows(auth: AppConnectionValueForAuthProperty<typeof excelAuth>, workbookId: string, worksheetId: string, drivePath: string): Promise<(string | number | boolean)[][]> {
try {
- return await excelCommon.getAllRows(workbookId, worksheetId, auth.access_token, drivePath);
+ return await excelCommon.getAllRows(workbookId, worksheetId, auth.access_token, drivePath, auth.props?.['cloud']);
} catch (error) {
throw new Error(`Failed to fetch worksheet rows: ${error}`);
}