SharePoint Content event trigger - The SharePoint Content event trigger enable you to automate tasks based on the events that occur in a SharePoint site. The trigger listens for specific events that occur in the SharePoint site and starts the downstream actions when the events occur.

Automation 360

The SharePoint Content event trigger enable you to automate tasks based on the events that occur in a SharePoint site. The trigger listens for specific events that occur in the SharePoint site and starts the downstream actions when the events occur.

Overview

The SharePoint Content event triggers enable you to start an automation workflow based on the subscribed events. Configure the SharePoint Content event trigger to listen for the subscribed events. Once the event occurs in the SharePoint site, the trigger activates the subsequent automation workflow. The SharePoint Content event triggers allow you to create automations without any manual intervention with real-time data exchange.

The SharePoint Content event triggers use OAuth connection to authenticate the incoming data. For more information about OAuth connection for SharePoint, see Create OAuth connection. Use the Client Credentials Flow grant type to set up the OAuth connection.

Note: A significant latency occurs between the event happening in a SharePoint site and Control Room receiving the notification from SharePoint site. For more information, see the latency table in Microsoft Graph REST API Subscription latency.

Prerequisites

Ensure that the following prerequisites are met:

  • A Bot Creator or Citizen Developer license.
  • EVENT TRIGGERS and View my bots permissions.
  • Check in and Check out permission on the folders in which the automation is located.
  • An active OAuth connection for the SharePoint site.

Supported events

You can configure the SharePoint Content event triggers to listen for events in files, folders, and lists. The SharePoint Content event triggers support the following events.

Events Description
File created When a file is created in the monitored SharePoint site.
File updated When a file is updated in the monitored SharePoint site.
Folder created When a folder is created in the monitored SharePoint site.
Folder updated When a folder is updated in the monitored SharePoint site.
List item created When an item is added to a list in the monitored SharePoint site.
List item updated When an existing list item is updated in the monitored SharePoint site.

Settings

The following settings are available for SharePoint Content event trigger:

SharePoint OAuth
Specifies the OAuth connection to connect to the SharePoint site and authenticate the session. Ensure that you add Microsoft Graph permission to the OAuth connection scope. The Microsoft Graph scope allows the trigger to read the SharePoint document library for file and folder-related events, and read the SharePoint lists for list-related events.
Site
Specifies the SharePoint site that you monitor for events. You can either enter the link directly or use the Select site option to select the site from the Sites drop-down list. The Sites drop-down list connects toSharePoint site and lists all the sites within the subdomain.
Note: Use the https://{subdomain}.sharepoint.com/sites/{SiteName} format when you specify the site manually.
Event type
Specifies the type of event based on which the trigger activates the downstream automation actions. You can select File & Folder or List events.
File & Folder
Specifies the file or folder-based event type to subscribe. You can select one or more events to subscribe and the trigger activates the downstream actions when these subscribed events occur. Select the events to subscribe in Listen to event and specify the file path of the file or folder in the Folder path field to configure a File & Folder type trigger.
Listen to event
Specifies the events to subscribe. You can select one or more events from the following:
  • File created
  • File updated
  • Folder created
  • Folder updated
Folder path
Specifies the folder path of a file or a folder in which the events occur. Enter the folder path in Documents/Folder1 format. You can also use the Select folder button to navigate and select the folder from the connected SharePoint site.
List
Specifies the list-based events to subscribe. You can select one or more events to subscribe and the trigger activates the downstream actions when these subscribed events occur.
Listen to event
Specifies the list-based events to subscribe. You can select one or more events from the following:
  • List item created
  • List item updated
List
Specifies the name of the list in which the events occur. You can enter the list name manually or use the Select list button to navigate and select the appropriate list from the connected SharePoint site.
Response
Specifies the variables to store the response data. The trigger saves the response data in a key-value pair format and you can use this data in downstream actions within the session. You can use one of the following options:
  • Multiple variables: Create and specify individual variables to store specific response data.

    Use the Add variable mapping option to specify the key and corresponding variable type to store the specific response data.

  • Record: Create and specify a record variable to store the entire response data.

Reading trigger response data in Audit log

The trigger response data contains all the information about the events in which the change has occurred. The system uses the resource properties of SharePoint APIs in Microsoft Graph to generate the trigger response data. You can view the data, stored in a key-value pair, in the Bot run by trigger event on the Audit log page. For more information about the SharePoint response data, see Working with SharePoint sites in Microsoft Graph.

You can use the event payload data attributes captured in the Audit log as inputs for any subsequent actions within the session. You can also build the arguments for the attributes from the API resource type properties of SharePoint APIs in Microsoft Graph. For example, to view the folder path in which a file is created, you can use parentReference.path, where parentReference is from BaseItem resource properties and path is from the itemReference resource properties.