By default, the connector delivers a Salesforce notification for each enabled SharePoint event. You can extend this behavior by creating Salesforce Flows that respond to notification events.
Using Flows, you can:
- Send email alerts
- Post Chatter messages
- Update Salesforce records
- Create tasks
- Trigger custom business processes
SharePoint notifications are published as platform events, allowing any supported Salesforce automation to consume them.
The connector includes a Flow template that receives SharePoint notifications and exposes the notification data as Flow variables that you can use in your automation.
Prerequisites
- SharePoint Notifications must be configured and enabled.
- Users must have permission to create and activate Salesforce Flows.
Create a flow from the notification template
Follow these instructions to create a flow from the notification template:
- In Salesforce Setup, enter Flows in the Quick Find box, and then select Flows.
- Click New Flow.
- Under the Triggered Automations category, select View All Automations and locate the SharePoint: Notifications template.
- Select the SharePoint: Notifications template and create a copy. The copy opens in Flow Builder, leaving the packaged template unchanged.
- The cloned flow starts in Draft status. Add your custom actions on the appropriate path, then activate the flow.
How the notification template works
The template provides a starting point for processing SharePoint notifications.
| Flow | What happens at each step? |
|---|---|
| 1. Receive the notification | The Flow starts when the connector publishes a SharePoint notification for an enabled event in a subscribed document library. |
| 2. Process the notification | The Flow uses the SharePoint Notifications Deserializer action to convert the platform event into Flow variables, including:
|
| 3. Verify that the event type is enabled | The Flow evaluates the isEnabled value. If the specific SharePoint event is disabled in SharePoint Setup, the Flow ends. |
| 4. Determine the item type | The Flow checks whether the notification represents a file or folder by using:
Based on the result, the Flow can retrieve additional information by using either:
|
| 5. Run custom automation | Add your own Flow actions after the enabled-event path. Examples include:
|
Notification fields
After the SharePoint Notifications Deserializer action runs, the notification variable contains the following fields.
| Field | Description |
|---|---|
| changeType | The SharePoint change type, such as FILE_ADDED. |
| changedAt | The date and time when the change occurred. |
| siteUrl | The SharePoint site URL of the changed item. |
| libraryId | The SharePoint document library ID. |
| itemId | The item identifier within the library. |
| itemUniqueId | The SharePoint unique ID of the item. |
| itemName | The file or folder name. |
| modifiedBy | The user who made the change. |
| sourceLibraryId | For move operations, the source document library ID. |
| destinationLibraryId | For move operations, the destination document library ID. |
| isFile | true if the notification is for a file. |
| isFolder | true if the notification is for a folder. |
Change type reference
Use the changeType field to determine what occurred and route the Flow to the appropriate actions.
To branch by item type, use the isFile and isFolder fields. To branch by the specific event, compare changeType to one of the values in the following tables.
| ChangeType | changeType value | Description |
|---|---|---|
| Document change types | FILE_ADDED | A document was uploaded. A version value of 1.0 indicates the initial upload. |
| FILE_UPDATED | A document was modified. This includes content changes, metadata updates, and new versions. | |
| FILE_DELETED | A document was deleted or moved to the recycle bin. | |
| FILE_RENAMED | A document was renamed. | |
| FILE_MOVED | A document was moved from one document library to another. Use sourceLibraryId and destinationLibraryId to identify the libraries involved. | |
| FILE_RESTORED | A document was restored from the recycle bin. | |
| Folder change types | FOLDER_CREATED | A folder was created. |
| FOLDER_UPDATED | A folder's metadata or properties were updated. | |
| FOLDER_DELETED | A folder was deleted. | |
| FOLDER_RENAMED | A folder was renamed. | |
| FOLDER_MOVED | A folder was moved from one document library to another. Use sourceLibraryId and destinationLibraryId to identify the libraries involved. | |
| FOLDER_RESTORED | A folder was restored from the recycle bin. |
For delete events, fields such as itemName and modifiedBy might be empty because the item no longer exists when the notification is processed. Use itemId, itemUniqueId, and libraryId to correlate the event with Salesforce records.
Retrieve additional SharePoint metadata
The notification contains enough information to identify the SharePoint item and understand the event. If your automation requires additional information, use one of the following actions:
- Get File Details
- Get Folder Details
These actions can return additional metadata, such as:
- Item path
- Version information
- File size
- Folder item counts
- Additional SharePoint columns
For more information, see Apex Invocable Methods Available Within the Connector.
