Smartgent SharePoint Trigger icon

Smartgent SharePoint Trigger

Monitor SharePoint folders for new files and changes

Smartgent SharePoint Trigger

AI-generated

Overview

The Smartgent SharePoint Trigger node monitors specified SharePoint folders for new or modified files based on user-defined polling intervals and event types. It supports filtering by file extensions, recursive monitoring of subfolders, and optionally downloading file content as binary data. This node is useful for automating workflows that depend on changes in SharePoint document libraries, such as processing newly added files or reacting to file updates.

Use Case Examples

  1. Trigger a workflow when a new PDF file is added to a specific SharePoint folder.
  2. Monitor a SharePoint folder and its subfolders for any file modifications every 5 minutes.
  3. Download the content of newly added or modified files in a SharePoint folder for further processing.

Properties

Name Meaning
Poll Times Specifies the times at which polling should occur, supporting various modes like every minute, hour, day, week, month, custom cron expressions, or intervals of X minutes/hours.
Event The type of file event to trigger on: file added, file modified, or either.
Folder Path to Monitor The path of the SharePoint folder to monitor for changes. Use '/' for the root Documents library or specify subfolder paths relative to the root.
Poll Interval How often to check for changes in seconds, with a minimum of 10 seconds and maximum of 3600 seconds.
Additional Options Additional settings including file extension filters, whether to include subfolders recursively, and whether to download file content as binary data.

Output

Binary

If enabled, the node outputs the downloaded file content as binary data including the file's MIME type, name, and size.

JSON

  • event - The type of event that triggered the workflow (e.g., fileAdded, fileModified, fileAddedOrModified, or test for test mode).
  • trigger - Identifier of the trigger node (always 'smartgentSharePointTrigger').
  • testMode - Indicates if the execution is a test run (true/false).
  • testNote - Additional note explaining the test mode behavior.
  • file
    • id - The unique identifier of the file in SharePoint.
    • name - The name of the file.
    • lastModifiedDateTime - The last modified timestamp of the file.
    • size - The size of the file in bytes.
    • webUrl - The web URL to access the file in SharePoint.
    • downloadUrl - The direct download URL for the file content.
    • mimeType - The MIME type of the file.
  • folder
    • path - The monitored folder path in SharePoint.
    • driveId - The SharePoint drive ID containing the folder.
    • siteId - The SharePoint site ID containing the folder.
  • timestamp - The ISO timestamp when the trigger executed.
  • downloadError - Error message if downloading the file content failed.

Dependencies

  • An API key credential for Microsoft SharePoint API access

Troubleshooting

  • Ensure the folder path is correct and exists in SharePoint to avoid 'Folder not found' errors.
  • Verify that the API credentials have sufficient permissions to access the specified folder to prevent 'Access denied' errors.
  • Check client ID, client secret, and tenant ID for authentication errors.
  • If no files trigger the workflow, confirm that files exist in the folder and match any specified extension filters.
  • In test mode, existing files are returned for demonstration; no new files are detected until normal polling runs.

Links

Discussion