Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
9669ca4
feat(microsoft-excel): add SharePoint drive support for Excel integra…
waleedlatif1 Apr 14, 2026
6162253
fix(microsoft-excel): address PR review comments
waleedlatif1 Apr 14, 2026
a3c93ee
fix(microsoft-excel): validate driveId in files route
waleedlatif1 Apr 14, 2026
780fa90
fix(microsoft-excel): unblock OneDrive users and validate driveId in …
waleedlatif1 Apr 14, 2026
f18af3c
fix(microsoft-excel): validate driveId in getItemBasePath utility
waleedlatif1 Apr 14, 2026
65308e4
fix(microsoft-excel): use centralized input validation
waleedlatif1 Apr 14, 2026
2884587
lint
waleedlatif1 Apr 14, 2026
649c3e6
improvement(microsoft-excel): add File Source dropdown to control Sha…
waleedlatif1 Apr 14, 2026
8b1c88c
fix(microsoft-excel): fix canonical param test failures
waleedlatif1 Apr 15, 2026
326114d
fix(microsoft-excel): address PR review feedback for SharePoint drive…
waleedlatif1 Apr 15, 2026
3be18ca
fix(microsoft-excel): use validateMicrosoftGraphId for driveId valida…
waleedlatif1 Apr 15, 2026
12231db
fix(microsoft-excel): use validatePathSegment with strict pattern for…
waleedlatif1 Apr 15, 2026
8148260
lint
waleedlatif1 Apr 15, 2026
16ad6ce
fix(microsoft-excel): reorder driveId before spreadsheetId in v1 block
waleedlatif1 Apr 15, 2026
d1b8778
fix(microsoft-excel): clear manualDriveId when fileSource changes
waleedlatif1 Apr 15, 2026
def6e90
refactor(microsoft-excel): use getItemBasePath in sheets route to rem…
waleedlatif1 Apr 15, 2026
5334c2b
lint
waleedlatif1 Apr 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(microsoft-excel): unblock OneDrive users and validate driveId in …
…sheets route

- Add credential to any[] arrays so OneDrive users (no drive selected)
  still pass the dependsOn gate while driveSelector remains in the
  dependency list for context flow to SharePoint users
- Add /^[\w-]+$/ validation for driveId in sheets API route
  • Loading branch information
waleedlatif1 committed Apr 14, 2026
commit 780fa9073508870c8e2108c25b4f59ec70d4657e
4 changes: 4 additions & 0 deletions apps/sim/app/api/tools/microsoft_excel/sheets/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ export async function GET(request: NextRequest) {
`[${requestId}] Fetching worksheets from Microsoft Graph API for workbook ${spreadsheetId}`
)

if (driveId && !/^[\w-]+$/.test(driveId)) {
return NextResponse.json({ error: 'Invalid drive ID format' }, { status: 400 })
}

const basePath = driveId
? `https://graph.microsoft.com/v1.0/drives/${driveId}/items/${spreadsheetId}`
: `https://graph.microsoft.com/v1.0/me/drive/items/${spreadsheetId}`
Comment thread
waleedlatif1 marked this conversation as resolved.
Outdated
Expand Down
6 changes: 3 additions & 3 deletions apps/sim/blocks/blocks/microsoft_excel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ export const MicrosoftExcelV2Block: BlockConfig<MicrosoftExcelV2Response> = {
requiredScopes: [],
mimeType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
placeholder: 'Select a spreadsheet',
dependsOn: { all: ['credential'], any: ['driveSelector'] },
dependsOn: { all: ['credential'], any: ['credential', 'driveSelector'] },
Comment thread
waleedlatif1 marked this conversation as resolved.
Outdated
mode: 'basic',
},
// Manual Spreadsheet ID (advanced mode)
Expand All @@ -441,7 +441,7 @@ export const MicrosoftExcelV2Block: BlockConfig<MicrosoftExcelV2Response> = {
type: 'short-input',
canonicalParamId: 'spreadsheetId',
placeholder: 'Enter spreadsheet ID',
dependsOn: { all: ['credential'], any: ['manualDriveId'] },
dependsOn: { all: ['credential'], any: ['credential', 'manualDriveId'] },
Comment thread
waleedlatif1 marked this conversation as resolved.
mode: 'advanced',
},
// Drive ID for SharePoint (advanced mode)
Expand Down Expand Up @@ -480,7 +480,7 @@ export const MicrosoftExcelV2Block: BlockConfig<MicrosoftExcelV2Response> = {
required: true,
dependsOn: {
all: ['credential'],
any: ['manualDriveId'],
any: ['credential', 'manualDriveId'],
},
mode: 'advanced',
},
Expand Down
Loading