Automating Email-To-Case Uploads
This article shows you how to automatically upload Email-to-Case Files to SharePoint. There are some special conditions with how Email-To-Case works, so we’ve outlined the best practices for moving your files in Salesforce to Sharepoint using automation. This can be done two ways:
Record-Triggered Flow – Use this Flow to automatically upload files from new Email-to-Case records to SharePoint as they’re created. This automation ensures your SharePoint workspace stays organized without any manual steps.
Scheduled Flow – Use this Flow to migrate existing Email-to-Case files to SharePoint. This is typically a one-time process to catch any records created before the Record-Triggered Flow was in place.
Please Note: Uploading files using Scheduled Flows requires the Mass Actions add-on. Please contact sales for more information.
Creating the Record-Triggered Flow
- Go to Salesforce Setup.

- Search for Email-To-Case.

- Enable Save Email-to-Case attachments as Salesforce files by checking the box.

- In Salesforce Setup, search for Flows.

- Click on New Flow.

- Select Record-Triggered Flow, then click Create.

- In Configure Start, set the Object to Case, and set the Trigger as A Record is Created.

- Below the starting node select the Add Element node, then select Action. This will auto-display the Action section to the right.

- In the Search Actions panel on the right, search for and select the Automate SharePoint action (apex-shareconnect__AutomateSharePoint).

- Click the Operation picklist and select New SharePoint Folder.

- Complete setting up the operation by providing the desired Folder Name and Destination. You will also need to enable both Link folder to record and Set as Default Record Folder.

- Once completed, click Save, then Activate.

- Back in Salesforce Setup, search Flows, and click on New Flow.

- Select Record-Trigger Flow, then click Create.

- In Configure Start, set the Object to File, and set the Trigger as A Record is Created.

- Below the Start node, select the Add Element node, then select Action. This will auto-display the Action section to the right.

- In the Search Actions panel that appears at right, search for and select the Automate SharePoint action (apex-shareconnect__AutomateSharePoint).

- Click the Operation picklist and select Upload to SharePoint.

- Complete setting up the operation by providing the desired File Name, Link to File Record and Delete Salesforce File status. Since we want these files to upload to the Default Record Folder on the Case Record, set your Destination to Default Record Folder.

- Once completed, click Save, then Activate.

- Now, when an email with attachments is sent through Salesforce, a default record folder will be created for the new Case, and the attached files will be uploaded to that folder automatically.

Creating the Schedule-Triggered Flow
- Go to Salesforce Setup.

- Search for Email-To-Case.

- Enable Save Email-to-Case attachments as Salesforce files by checking the box.

- In Salesforce Setup, search for Flows.

- Click on New Flow.

- Select Schedule-Triggered Flow, then click Create.

- On Start select your desired date, time and frequency of automation. We recommend you set the frequency as Once. Then select Choose Object (Optional), and set the Object to Email Message.

- Below the Start node, select the Add Element node, and select Action. This will auto-display the Action section to the right.

- In the Search Actions panel on the right, search for and select the Automate SharePoint action (apex-shareconnect__AutomateSharePoint).

- Click the Operation picklist and select Upload to SharePoint.

- Complete setting up the operation by providing the desired File Name, Link to File Record, and Delete Salesforce File status. Since we want these files to upload to the Default Record Folder on the Case Record, set your Destination to Parent Record’s Default Record Folder, and set the Lookup Field to Parent Record to Case ID.

- Once completed, click Save, then Activate.

- Now you can automatically upload files from Email Messages that were generated via Email-to-Case. When your Schedule-Triggered Flow runs, if the Case Record has a Default Record Folder, the files in the email message will be uploaded to that folder.
