Sharepoint icon

Sharepoint

Interact with Sharepoint

Overview

This node interacts with SharePoint to perform file-related operations within specified SharePoint sites and document libraries. The "Get File" operation allows users to retrieve a file from a chosen SharePoint site and document library by specifying the file either by its path or ID.

Common scenarios where this node is beneficial include:

  • Automating retrieval of documents stored in SharePoint for further processing or integration.
  • Accessing files dynamically based on workflow inputs, such as fetching reports or templates.
  • Integrating SharePoint file storage with other systems without manual downloads.

For example, a user can configure the node to get a specific file by providing the site name, document library, and the file path, then use the output file content in subsequent workflow steps like sending it via email or saving it to another system.

Properties

Name Meaning
Site Name or ID Select or specify the SharePoint site from which to retrieve the file.
Document Library Name or ID Select or specify the document library (drive) within the chosen site that contains the file.
File Locator for the file to retrieve; can be specified either by its full path (e.g., /sites/test/Documents/file.txt) or by its unique ID.

Output

The node outputs JSON data representing the retrieved file's metadata and content. The exact structure depends on the SharePoint API response but typically includes fields such as file name, size, MIME type, and possibly the file content encoded appropriately.

If the file content is binary, it will be available in the binary data property of the output item, allowing downstream nodes to process or save the file directly.

Dependencies

  • Requires an authenticated connection to SharePoint via OAuth2 credentials configured in n8n.
  • Depends on SharePoint REST API access to the specified site and document library.
  • The node uses internal helper methods to load options dynamically for sites and document libraries.

Troubleshooting

  • Common issues:
    • Incorrect site or document library selection may result in "file not found" errors.
    • Specifying an invalid file path or ID will cause the operation to fail.
    • Insufficient permissions on the SharePoint site or library can lead to authorization errors.
  • Error messages:
    • "Unsupported operation called": This indicates an invalid operation parameter; ensure "Get File" is selected.
    • API errors related to authentication or permissions should be resolved by verifying the OAuth2 credential setup and user access rights.

Links and References

Discussion