Skip to content

Add File To SharePoint ​

The Add File To SharePoint node uploads a local file to a specified SharePoint folder using the SharePoint Graph API. This task is commonly used to store generated or processed files from workflows into a SharePoint document library.

🧠 Summary ​

This task uploads a file from the local automation working directory to a designated SharePoint document library and folder. It requires the appropriate SharePoint access token to be associated with a service account.

βš™οΈ Inputs ​

LabelTypeRequiredDescription
Local File Full Pathtextβœ… YesThe full absolute path of the local file to be uploaded.
Sharepoint Foldertextβœ… YesThe SharePoint folder reference used to derive site, document library, and path. Must be pre-configured in the system.
ServiceAccount-AutodeskserviceAccountβœ… YesThe linked service account that provides the SharePoint access token.

ℹ️ The "Sharepoint Folder" must match a configured entry that maps to a SharePoint site, document library, and folder path using the system's helper configuration logic.

πŸ“€ Output ​

KeyDescription
NewSharepointFileThe resulting SharePoint DriveItem object returned after successful upload.

πŸ“ Behavior ​

  1. Validates required inputs.
  2. Retrieves a SharePoint access token using the configured Autodesk (Graph API) service account.
  3. Parses the SharePoint folder configuration to get site, library, and folder path.
  4. Uploads the local file to SharePoint using the Microsoft Graph API.
  5. Stores the uploaded file’s metadata (DriveItem) in the NewSharepointFile variable.
  6. Cleans up input fields from the task data to prevent downstream data leakage.

βœ… Success Criteria ​

  • The task completes with status Completed.
  • The uploaded file is successfully added to the configured SharePoint location.
  • The NewSharepointFile variable is available for use in downstream nodes.

❌ Failure Scenarios ​

  • Service account is missing or the token cannot be retrieved.
  • SharePoint folder mapping fails due to invalid or missing configuration.
  • Local file does not exist at the specified path.
  • Upload fails due to API error or invalid permissions.

πŸ“Ž Example Use Case ​

This node could be used at the end of a workflow that generates a PDF or CSV report locally, with the goal of storing the file in a shared team folder on SharePoint.


Tentech 2024