Skip to content

Get Sharepoint File

Summary

The Get Sharepoint File node retrieves a file from a SharePoint document library using Microsoft Graph API. This node connects to a SharePoint site via a configured Autodesk service account, accesses a specified file by its path, and stores the retrieved file metadata in the workflow context.

This node is commonly used to fetch files for processing, sharing, or logging in subsequent workflow steps.


Node Type

  • task

Task Type

  • Get Sharepoint File

Icon

  • mdi mdi-file-download

Required Inputs

LabelTypeDescription
Sharepoint FiletextThe SharePoint file path, including the site and library, used to locate the file. This should follow the internal path format (e.g. Sites/ProjectX/Shared Documents/myfile.pdf).

Output

Upon successful execution, the node stores the downloaded file metadata as an object in the workflow variable SharepointFile. This object contains properties returned by Microsoft Graph DriveItem, such as the file name, size, and last modified date.


Backend Behavior

  1. Validation The node checks for the presence of the Sharepoint File input. If missing, execution halts with an error.

  2. Authentication Retrieves Autodesk-linked service account credentials using the ThirdParty-Autodesk key and obtains a valid Microsoft Graph access token.

  3. Path Parsing Parses the file path into site, document library, and folder path using the helper function GetSharePointLocations.

  4. File Retrieval Calls the SPGraphService.GetFileByPathAsync() method to retrieve the file metadata from SharePoint.

  5. Output Assignment Replaces the Sharepoint File input with a SharepointFile output in the taskParameters.data dictionary.

  6. Error Handling Returns detailed failure messages for token errors, path issues, or file retrieval failures.


Example Usage

This node is useful in workflows where a SharePoint-hosted document must be processed, validated, or attached to an external communication (e.g., sending via email or uploading to another system).

Example sequence:

  1. GetSharepointFile
  2. ConvertToPDF (uses file from SharepointFile)
  3. SendEmailWithAttachment

Notes

  • The file is not physically downloaded; instead, its metadata is retrieved and stored.
  • You may need a separate node to download the binary content if needed for processing.
  • Make sure the Autodesk service account has permission to access the specified SharePoint location.

Tentech 2024