Excel Agent
This page provides detailed configuration instructions for the Excel AI Agent, which enables integration with Microsoft 365 for accessing, analyzing, and managing Excel workbooks

Overview
Search and retrieve Excel workbooks stored in OneDrive or SharePoint through Blockbrain
Read, update, and analyze data within Excel worksheets and tables
Extract and summarize spreadsheet content for reporting or AI analysis
Access workbook properties and file metadata
Automate data processing and reporting workflows using Excel files

Prerequisites
Complete the general setup steps from the main AI Agents page
Ensure users have active Microsoft 365 accounts with access to OneDrive or SharePoint
Verify appropriate Microsoft 365 or Office licensing for Excel Online and file access
Azure App Registration Configuration
Required API Permissions
Add the following Microsoft Graph permissions to your app registration:
offline_access
Delegated
Maintain access to data you have given it access to
Files.Read
Delegated
Read all files the signed-in user can access, including Excel workbooks in OneDrive or SharePoint
Files.ReadWrite
Delegated
Read and write all files the signed-in user can access, including editing Excel workbooks
openid
Delegated
Sign in the user and allow the app to read the user's basic profile information
User.Read
Delegated
Read the signed-in user's profile, including basic information such as name and email
Sites.Selected
Delegated
Access content in specific SharePoint sites selected by the admin, including Excel files
For Excel-specific operations, the most relevant permissions are
Files.Read,Files.ReadWrite, andSites.Selected, as these control access to Excel workbooks stored in OneDrive or SharePoint.
Redirect URL
Add https://nango.theblockbrain.ai/oauth/callback as allowed redirect URL to your app registration
Permission Configuration Steps
In your Azure app registration, go to API permissions
Click "Add a permission" > Microsoft Graph > Delegated permissions
Search for and select each required permission
Click "Add permissions"
Click "Grant admin consent" (recommended for organization-wide deployment)
Agent Configuration in Blockbrain


Access Agent Settings:
Navigate to your Blockbrain admin panel
Go to Agents > Excel Agent
Click "Configure"
Enter Azure Credentials:
Client ID: Enter the Application ID from your Azure app registration
Client Secret: Paste the client secret you generated
Tenant: Enter your Azure tenant ID
Configure OAuth Scopes:
Add each required scope individually using the "Add" button as mentioned here
Each scope will appear as a removable tag
Use the "X" button to remove incorrect scopes
Additional Configuration (Optional):
Add custom key-value pairs if needed for specific requirements
Configure any organization-specific settings
Save Configuration:
Click "Save" to apply the settings
Wait for the confirmation message
Alternative: Admin Consent Configuration
For simplified scope management with admin pre-approval:
In Azure, grant admin consent for all required permissions
In Blockbrain configuration, use
.defaultscope instead of individual scopesThis eliminates the need for users to consent to individual permissions
Testing the SharePoint Agent
Verification Steps
Connection Test:
Use the built-in connection test in Blockbrain
Verify successful authentication with Microsoft Graph
User Testing:
Have a test user connect their Microsoft account
Attempt to access a known Excel file in OneDrive or SharePoint
Verify file retrieval, worksheet access, and data read/write functionality
Permission Validation:
Check that the agent can access the appropriate Excel files and locations
Confirm read and write permissions are working correctly
Common Excel Integration Use Cases
Workbook Search: Find Excel files across OneDrive and SharePoint
Data Extraction: Access and analyze data from specific worksheets or tables
File Editing: Update or write data to Excel workbooks
Metadata Retrieval: Extract workbook properties and file metadata
Troubleshooting
Authentication Issues
Problem: "Access denied" or authentication failures
Solution: Verify admin consent is granted for all required permissions
Check: Ensure the redirect URL is exactly
https://nango.theblockbrain.ai/oauth/callback
Permission Errors
Problem: "Insufficient privileges" when accessing Excel files
Solution: Confirm the app registration has
Files.Read,Files.ReadWrite, andSites.SelectedpermissionsCheck: Verify the user has access to the relevant OneDrive or SharePoint locations
Scope Configuration Issues
Problem: Scopes not saving correctly
Solution: Add each scope individually using the "Add" button
Check: Remove any duplicate or incorrect scopes using the "X" button
Security Considerations
File Access: The agent inherits the user's Microsoft 365 file permissions
Location Scope: Access is limited to files and sites the authenticated user can access
Data Privacy: Files are processed according to Blockbrain's data handling policies
Audit Trail: Excel file access is logged in both Azure AD and Microsoft 365 audit logs
Next Steps
After successful Excel Agent configuration:
Train users on Excel integration features
Configure additional agents (e.g., SharePoint, Outlook) if needed
Monitor usage and performance through Azure AD reports
Last updated

