Smartgent SharePoint icon

Smartgent SharePoint

Get documents from SharePoint document libraries using Microsoft Graph API

Move File

AI-generated

Overview

This node operation moves a file from one location to another within a SharePoint document library using the Microsoft Graph API. It is useful for automating file organization tasks, such as relocating documents to different folders based on workflow conditions or user actions. For example, moving a document from a general folder to a project-specific folder after review.

Use Case Examples

  1. Automatically move approved documents to an 'Approved' folder.
  2. Organize files by moving them to client-specific folders based on metadata.

Properties

Name Meaning
Source Document ID The ID of the document to move, identifying the file to be relocated.
Destination Folder Path The path of the destination folder where the file will be moved, e.g., '/NewFolder' or 'ParentFolder/SubFolder' to specify the target location.
Additional Options Optional parameters to filter, select fields, or limit the number of items when listing documents (not directly used in move operation but available in the node).

Output

JSON

  • operation - The operation performed, here 'moveFile'.
  • siteId - The SharePoint site ID where the operation took place.
  • driveId - The drive ID representing the document library.
  • sourceDocumentId - The ID of the document that was moved.
  • destinationFolderPath - The path of the folder to which the file was moved.
  • destinationFolderId - The internal ID of the destination folder.
  • movedFile - Details of the moved file, including metadata like name, size, and timestamps.
  • success - Boolean indicating if the move operation was successful.
  • timestamp - The timestamp when the operation was performed.

Dependencies

  • Microsoft Graph API access via OAuth2 credentials

Troubleshooting

  • Ensure the source document ID is correct and the document exists.
  • Verify the destination folder path is valid and accessible with the provided credentials.
  • Check permissions to move files within the SharePoint site; access denied errors indicate insufficient permissions.
  • Authentication errors may occur if the OAuth2 credentials are invalid or expired; re-authenticate if needed.
  • If the destination folder does not exist, the node will throw an error; verify the folder path before running the operation.

Links

Discussion