CaseCloud Help

Extending SharePoint Notifications with Salesforce Flows

Updated on

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.

  • 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:

  1. In Salesforce Setup, enter Flows in the Quick Find box, and then select Flows.
  2. Click New Flow.
  3. Under the Triggered Automations category, select View All Automations and locate the SharePoint: Notifications template.
  4. Select the SharePoint: Notifications template and create a copy. The copy opens in Flow Builder, leaving the packaged template unchanged.
  5. The cloned flow starts in Draft status. Add your custom actions on the appropriate path, then activate the flow.
New Automation dialog showing the SharePoint: Notifications Flow template

How the notification template works

The template provides a starting point for processing SharePoint notifications.

FlowWhat happens at each step?
1. Receive the notificationThe 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:

  • notification
  • notificationTitle
  • notificationBody
  • isEnabled
3. Verify that the event type is enabledThe 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:

  • notification.isFile
  • notification.isFolder

Based on the result, the Flow can retrieve additional information by using either:

  • Get File Details
  • Get Folder Details
5. Run custom automation

Add your own Flow actions after the enabled-event path. Examples include:

  • Send Custom Notification
  • Create Records
  • Post to Chatter
  • Email alerts
  • Custom business automation

Notification fields

After the SharePoint Notifications Deserializer action runs, the notification variable contains the following fields.

FieldDescription
changeTypeThe SharePoint change type, such as FILE_ADDED.
changedAtThe date and time when the change occurred.
siteUrlThe SharePoint site URL of the changed item.
libraryIdThe SharePoint document library ID.
itemIdThe item identifier within the library.
itemUniqueIdThe SharePoint unique ID of the item.
itemNameThe file or folder name.
modifiedByThe user who made the change.
sourceLibraryIdFor move operations, the source document library ID.
destinationLibraryIdFor move operations, the destination document library ID.
isFiletrue if the notification is for a file.
isFoldertrue 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.

ChangeTypechangeType valueDescription
Document change typesFILE_ADDEDA document was uploaded. A version value of 1.0 indicates the initial upload.
FILE_UPDATEDA document was modified. This includes content changes, metadata updates, and new versions.
FILE_DELETEDA document was deleted or moved to the recycle bin.
FILE_RENAMEDA document was renamed.
FILE_MOVEDA document was moved from one document library to another. Use sourceLibraryId and destinationLibraryId to identify the libraries involved.
FILE_RESTOREDA document was restored from the recycle bin.
Folder change typesFOLDER_CREATEDA folder was created.
FOLDER_UPDATEDA folder's metadata or properties were updated.
FOLDER_DELETEDA folder was deleted.
FOLDER_RENAMEDA folder was renamed.
FOLDER_MOVEDA folder was moved from one document library to another. Use sourceLibraryId and destinationLibraryId to identify the libraries involved.
FOLDER_RESTOREDA 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.

Previous Article Using the Folder Templates Tab (deprecated)
Next Article [START HERE]☞Integration Guide
Still need help? Click here!
AdvoLogix® is a registered trademark of AdvoLogix.com LLC a Texas Limited Liability Company. All references to other trademarks belonging to third parties that appear on this website, documentation, or other materials shall be understood to refer to those registered trademarks owned by others, and not to any trademark belonging to AdvoLogix. Otherwise, all material herein is the copyright of AdvoLogix.com LLC. All Rights Reserved.