Skip to main content

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).

Connection Required

This node requires a pre-configured SharePoint connection. You must set up a SharePoint connection in your project settings before using this node.

Inputs

InputTypeDescriptionDefault
RunEventTriggers the download operation from SharePoint-
SourceDataSharePoint 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

OutputTypeDescription
DoneEventFires when the file has been successfully downloaded and imported into the Intellectible library
OutputDataThe 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:

  1. Connection Validation: Retrieves the SharePoint connection key and validates permissions
  2. Drive Resolution: Identifies the SharePoint drive ID from the connection permissions
  3. File Download: Downloads the selected file from SharePoint using the Microsoft Graph API to a temporary local path
  4. Library Import: Uploads the downloaded file to the Intellectible library as a temporary file
  5. Cleanup: Removes the temporary local file after successful upload
  6. 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.

File Lifecycle

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:

  1. Add a Start node and connect it to the SharePoint: Download File node's Run input
  2. In the SharePoint: Download File panel UI:
    • Select your SharePoint connection from the dropdown
    • Browse and select the PDF file you want to download
  3. Connect the SharePoint: Download File node's Done output to a Read PDF node's Run input
  4. Connect the SharePoint: Download File node's Output (file object) to the Read PDF node's File input
  5. 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:

  1. Use a Batch Data node or List node to provide an array of file selections
  2. Connect to a For Each node to iterate through the files
  3. Inside the loop, use the SharePoint: Download File node to download each file
  4. Process each downloaded file with document parsing nodes
Error Handling

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

InputTypeDescriptionDefault
RunEventTriggers the file upload operation.-
DataDataThe 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 NameDataThe name of the file to create in SharePoint (without extension).-
File TypeEnumThe file format: txt (Text File), csv (CSV Table), or docx (Word Document).txt
ConnectionDataThe SharePoint connection to use for uploading. Configure via the panel UI connection selector.-
Connection DataDataContains the target drive and folder path information. Set via the folder picker in the panel UI.-

Outputs

OutputTypeDescription
DoneEventFires when the upload operation completes, regardless of success or failure.
OutputDataReturns 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:

  1. 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.
  2. 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
  3. Upload: Uploads the file to the specified SharePoint drive and folder using the Microsoft Graph API via msSharepointService.uploadFile.
  4. 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 false and the error will be logged.

Example Usage

Basic CSV Upload

  1. Connect a Start node or trigger to the Run input.
  2. Set the File Name to "Sales_Report_2024".
  3. Set the File Type to "csv".
  4. Connect a database query node or data transformation output to the Data input providing an array of records.
  5. Select a SharePoint connection and target folder in the panel UI.
  6. Connect the Done event to subsequent nodes to continue the workflow after upload.
  7. 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.