Sharepoint
Sharepoint:Download File
Controlled node
Overview
The SharePoint: Download File node connects to Microsoft SharePoint via the Microsoft Graph API to download files from your SharePoint drives and import them into the Intellectible library. This node requires an active SharePoint connection and presents a file picker interface to browse and select files directly from your SharePoint sites and drives.
When executed, the node downloads the selected file to temporary local storage, uploads it to the Intellectible library system, and returns a file object that can be consumed by other file processing nodes (such as Read PDF, Read Document, or AI Vision nodes).
This node requires a pre-configured SharePoint connection. You must set up a SharePoint connection in your project settings before using this node.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Triggers the download operation from SharePoint | - |
| Source | Data | SharePoint connection and file selection configuration. This is configured via the panel UI file picker interface which allows you to select a connection and browse SharePoint drives. | - |
Outputs
| Output | Type | Description |
|---|---|---|
| Done | Event | Fires when the file has been successfully downloaded and imported into the Intellectible library |
| Output | Data | The downloaded file object containing id, name, mimeType, size, and dir (directory) information. This object can be passed to file processing nodes like Read PDF, Read DOCX, or AI Vision Write. |
Runtime Behavior and Defaults
When the Run event is triggered, the node performs the following operations:
- Connection Validation: Retrieves the SharePoint connection key and validates permissions
- Drive Resolution: Identifies the SharePoint drive ID from the connection permissions
- File Download: Downloads the selected file from SharePoint using the Microsoft Graph API to a temporary local path
- Library Import: Uploads the downloaded file to the Intellectible library as a temporary file
- Cleanup: Removes the temporary local file after successful upload
- Output: Returns the file metadata object with the Intellectible library file ID
The node handles various file types supported by SharePoint. The downloaded file is stored in the Intellectible library's temporary storage and can be accessed by other nodes using the returned file object.
Files downloaded via this node are stored as temporary library files. If you need to persist the file permanently, use the Write To Library node to save it to a specific folder path.
Example Usage
Download and Process a PDF from SharePoint
This example demonstrates downloading a PDF file from SharePoint and extracting its text content:
- Add a Start node and connect it to the SharePoint: Download File node's Run input
- In the SharePoint: Download File panel UI:
- Select your SharePoint connection from the dropdown
- Browse and select the PDF file you want to download
- Connect the SharePoint: Download File node's Done output to a Read PDF node's Run input
- Connect the SharePoint: Download File node's Output (file object) to the Read PDF node's File input
- Connect the Read PDF node's Done output to a Show node or AI Write node to view or process the extracted text
graph LR
A[Start] -->|Run| B[SharePoint: Download File]
B -->|Done| C[Read PDF]
B -->|Output<br/>file object| C
C -->|Done| D[Show]
C -->|Text| D
Batch Processing Multiple Files
To process multiple files from SharePoint:
- Use a Batch Data node or List node to provide an array of file selections
- Connect to a For Each node to iterate through the files
- Inside the loop, use the SharePoint: Download File node to download each file
- Process each downloaded file with document parsing nodes
If the connection is invalid, the drive is inaccessible, or the file cannot be downloaded, the node will output null or an error object. Consider using an Assert node after the download to verify the file was retrieved successfully before processing.
Sharepoint:Upload File
Controlled node
Overview
Uploads files to Microsoft SharePoint. This node supports uploading text files, CSV tables, and Word documents to a specified SharePoint drive and folder. The node requires an active SharePoint connection with appropriate write permissions to the target location.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Triggers the file upload operation. | - |
| Data | Data | The content to upload. For text files, provide a string. For CSV files, provide tabular data (array of objects or arrays). For DOCX files, provide text or markdown content. | - |
| File Name | Data | The name of the file to create in SharePoint (without extension). | - |
| File Type | Enum | The file format: txt (Text File), csv (CSV Table), or docx (Word Document). | txt |
| Connection | Data | The SharePoint connection to use for uploading. Configure via the panel UI connection selector. | - |
| Connection Data | Data | Contains the target drive and folder path information. Set via the folder picker in the panel UI. | - |
Outputs
| Output | Type | Description |
|---|---|---|
| Done | Event | Fires when the upload operation completes, regardless of success or failure. |
| Output | Data | Returns true if the file was uploaded successfully, false if the upload failed. |
Runtime Behavior and Defaults
This is a controlled node that executes when triggered by the Run event. The node performs the following actions:
- Connection Validation: Verifies that a valid SharePoint connection is selected and that the connection has permitted drives configured. If no folder is specified in the connection data, the file uploads to the root of the permitted drive.
- File Preparation: Converts the input data to the appropriate format based on the selected file type:
- TXT: Converts data to plain text string using
advancedToString - CSV: Converts tabular data to CSV format using Papa Parse with headers enabled
- DOCX: Converts text/markdown to Word document format using
markdownToDocx
- TXT: Converts data to plain text string using
- Upload: Uploads the file to the specified SharePoint drive and folder using the Microsoft Graph API via
msSharepointService.uploadFile. - Completion: Triggers the Done event and sets the Output boolean to indicate success or failure.
Important Notes:
- The node requires the SharePoint connection to have write permissions to the target drive.
- File names are automatically appended with the appropriate extension based on the selected file type.
- If the upload fails due to permissions, connection issues, or invalid data, the Output will return
falseand the error will be logged.
Example Usage
Basic CSV Upload
- Connect a Start node or trigger to the Run input.
- Set the File Name to "Sales_Report_2024".
- Set the File Type to "csv".
- Connect a database query node or data transformation output to the Data input providing an array of records.
- Select a SharePoint connection and target folder in the panel UI.
- Connect the Done event to subsequent nodes to continue the workflow after upload.
- Use the Output data in an If node to check if the upload succeeded (
true) or handle failures (false).
Uploading AI-Generated Documents
Connect an AI Write node's text output to the Data input to upload AI-generated content directly to SharePoint. Set the File Type to "docx" to create a Word document from the generated text, or "txt" for a plain text file.