---
title: "Automating Email-To-Case Uploads - Appiphony"
url: "https://appiphony.com/docs/share-connect/features/automation/automating-email-to-case-uploads"
---

# 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](https://appiphony.com/contact-sales/) for more information.

### Creating the Record-Triggered Flow

1. Go to **Salesforce Setup**.
2. Search for **Email-To-Case**.
3. Enable **Save Email-to-Case attachments as Salesforce files** by checking the box.
4. In **Salesforce Setup**, search for **Flows**.
5. Click on **New Flow**.
6. Select **Record-Triggered Flow**, then click **Create**.
7. In **Configure Start**, set the **Object** to **Case**, and set the **Trigger** as **A Record is Created**.
8. Below the starting node select the **Add Element** node, then select **Action**. This will auto-display the **Action** section to the right.
9. In the **Search Actions** panel on the right, search for and select the **Automate SharePoint** action **(apex-shareconnect__AutomateSharePoint).**
10. Click the **Operation** picklist and select **New SharePoint Folder**.
11. 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**.
12. Once completed, click **Save**, then **Activate**.
13. Back in **Salesforce Setup**, search **Flows**, and click on **New Flow**.
14. Select **Record-Trigger Flow**, then click **Create**.
15. In **Configure Start**, set the **Object** to **File**, and set the **Trigger** as **A Record is Created**.
16. Below the **Start** node, select the **Add Element** node, then select **Action**. This will auto-display the **Action** section to the right.
17. In the Search Actions panel that appears at right, search for and select the **Automate SharePoint** action **(apex-shareconnect__AutomateSharePoint)**.
18. Click the **Operation** picklist and select **Upload to SharePoint**.
19. 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**.
20. Once completed, click **Save**, then **Activate**.
21. 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

1. Go to **Salesforce Setup**.
2. Search for **Email-To-Case**.
3. Enable **Save Email-to-Case attachments as Salesforce files** by checking the box.
4. In **Salesforce Setup**, search for **Flows**.
5. Click on **New Flow**.
6. Select **Schedule-Triggered Flow**, then click **Create**.
7. 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**.
8. Below the **Start** node, select the **Add Element** node, and select **Action**. This will auto-display the **Action** section to the right.
9. In the **Search Actions panel** on the right, search for and select the **Automate SharePoint** action **(apex-shareconnect__AutomateSharePoint)**.
10. Click the **Operation** picklist and select **Upload to SharePoint**.
11. 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**.
12. Once completed, click **Save**, then **Activate**.
13. 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.
