Actions14
Overview
The Microsoft SharePoint node for n8n allows you to interact with files stored in Microsoft SharePoint sites. Specifically, the File → Copy operation creates a duplicate of a specified file within a SharePoint site, optionally renaming it and/or placing it in a different folder or drive. This is useful for automating document management tasks such as creating templates, archiving files, or organizing content across different folders or drives.
Practical examples:
- Automatically duplicating a contract template into a project folder when a new project is created.
- Backing up important files by copying them to a designated archive location.
- Creating a copy of a report with a new name for monthly distribution.
Properties
Name | Meaning |
---|---|
Site ID | The identifier or name of the SharePoint site where the file resides. Options may include pre-configured site IDs (e.g., "Financial"). |
File ID | The unique identifier of the file to be copied. |
Additional Fields | Collection of optional fields: • Name: The new name for the copied file. If not provided, the original file's name will be used. |
Parent Reference | Collection specifying the destination for the copied file: • Drive ID: Identifier of the target drive. • Drive Type: Type of the drive. • ID: Identifier of the parent item. • List ID: Identifier of the list. • Name: Name of the referenced item. • Path: Path to the parent item. • Share ID: Identifier for a shared resource. |
Output
The output is a JSON object containing:
{
"location": "<URL>"
}
- location: A URL indicating where the newly created copy can be accessed or tracked. This is typically a link to the new file or an endpoint to check the status of the copy operation.
Dependencies
- External Service: Requires access to Microsoft SharePoint via its API.
- Authentication: Needs valid OAuth2 credentials configured in n8n (
microsoftSharepointOAuth2Api
). - n8n Configuration: Ensure that the Microsoft SharePoint OAuth2 credential is set up and authorized for the relevant SharePoint site(s).
Troubleshooting
Common issues:
- Invalid Site ID or File ID: If the provided Site ID or File ID is incorrect, the operation will fail. Double-check these values.
- Insufficient Permissions: The connected account must have permission to read the source file and write to the destination location.
- Missing Required Fields: Omitting required properties like Site ID or File ID will result in errors.
- API Rate Limits: Excessive requests may trigger throttling from Microsoft SharePoint.
Error messages:
- "The ID you provided does not belong to a file.": This occurs if the File ID does not reference a valid file. Verify the File ID.
- "File name must be set!": If attempting to upload without specifying a file name (not directly related to copy, but possible in similar operations).