This service creates an OData V4 endpoint from Excel files stored in SharePoint, specifically designed to be compatible with Templafy's data connector requirements.
- Exposes Excel table data as OData V4 endpoints
- Implements Bearer token authentication required by Templafy
- Connects to SharePoint (on-premises or online) to access Excel files
- Supports Microsoft Graph API for Office 365 environments
- Provides comprehensive logging and error handling
- Node.js 16+ and npm
- SharePoint environment (on-premises or Office 365)
- Excel files with tables in SharePoint
- Templafy account with Data Connectors module enabled
- Clone the repository
- Install dependencies:
npm install - Create a
.envfile based on.env.example:cp .env.example .env - Update the
.envfile with your SharePoint and Templafy configuration - Build the application:
npm run build - Start the server:
npm start
The following environment variables need to be configured:
PORT: Port number for the server (default: 3000)NODE_ENV: Environment (development, production)LOG_LEVEL: Logging level (info, warn, error, debug)
SHAREPOINT_TENANT_ID: Azure AD tenant IDSHAREPOINT_CLIENT_ID: Azure AD application IDSHAREPOINT_CLIENT_SECRET: Azure AD application secretSHAREPOINT_SITE_URL: SharePoint site URL
API_BEARER_TOKEN: Static Bearer token for Templafy authenticationTOKEN_EXPIRES_IN: Token expiration time (not used for static tokens)
EXCEL_FILE_PATH: Path to Excel file in SharePointEXCEL_TABLE_NAME: Name of the table in Excel file
The OData endpoint is available at:
http://localhost:3000/odata
All requests to the OData endpoint must include the Bearer token in the Authorization header:
Authorization: Bearer your-secure-bearer-token
-
Get metadata:
GET http://localhost:3000/odata/$metadata -
Get all rows:
GET http://localhost:3000/odata/ExcelRow -
Get a specific row:
GET http://localhost:3000/odata/ExcelRow('1') -
Filter rows:
GET http://localhost:3000/odata/ExcelRow?$filter=ColumnName eq 'Value'
To integrate with Templafy:
- Ensure your OData service is publicly accessible via HTTPS
- Configure Templafy to use your OData endpoint URL
- Use the same Bearer token in both your service and Templafy configuration
- Test the connection from Templafy
-
Run in development mode:
npm run dev -
Build the application:
npm run build
This project is licensed under the MIT License - see the LICENSE file for details.