Automating File Upload
Share Connect can automatically upload Salesforce Files to SharePoint. Once uploaded, files can be automatically linked to the record they were originally attached to and show up in the SharePoint Links component. Salesforce Files can also be automatically deleted from Salesforce once they are uploaded to SharePoint, saving you on pricey Salesforce storage.
There are two ways to upload files using Flow:
- Record-Trigger Flow - Use this when you want a file immediately uploaded to SharePoint upon upload to Salesforce.
- Scheduled Flow - Use this when you have existing files in Salesforce you want to upload to SharePoint or you want to periodically move files for archival purposes.
Uploading Files to SharePoint with Record-Triggered Flows via Custom File Object
With Share Connect installed, a custom file object for use with the Automatic File Upload feature will be added. When using the File Object, you will be able to trigger the flow from any object record, and the act of uploading files into Salesforce will be the trigger.
-
- Go to Salesforce Setup.
- Search for Flows.

- Click on New Flow.
- Select Record Trigger Flow and then click Create.
- On Configure Start, select the custom packaged object shareconnect__File__c object. You will only be able to trigger the flow when A record is created.
- Below the starting node select the Add Element node and then select Action. This will auto-display the Action section to the right.

- In the Search Actions panel, search for and select the Automate SharePoint action (apex-shareconnect__AutomateSharePoint).
- Complete the configuration of the operation. Below is a list of some of the available options:
- Publish Results Event— If this is toggled on and the Link file to record is enabled, then when a file is uploaded to SharePoint, the SharePoint Links component will automatically refresh to show all of the uploaded files.
- File Name — By default, is is set to Existing File Name which is the name of the file in Salesforce once the upload process begins. However this can be changed to any of the following options:
- Existing File Name - Created Date
- Custom Name - This is an input field where you can provide static text or merge fields to hard set the name of the Salesforce file once the upload process begins. File names containing any of the following special characters are not supported, per SharePoint limitations: [“, *, :, <, >, ?, /, , |] as such they will automatically be removed from the file name
- Destination – By default, it is set to Default Record Folder, however, this can be changed to any of the following destinations:
- Default Object Folder
- Folder in Default Record Folder
- Linked Folder
- One Drive
- Folder from SharePoint…
- Fallback Destination — By default, it is set to None. However, if you select Upload to Folder from SharePoint the Microsoft picker will pop up and you can select a folder location. This selected folder location is where files will upload should the previously selected Destination not exist for a record when the scheduled job runs instead of being skipped.
- Link file to record— If enabled, the uploaded Salesforce files will appear on the SharePoint Links component once the flow has been completed. Complete the configuration of the action and click on Done. Below is a list of some of the available options:
- Delete Salesforce File— If enabled, the uploaded Salesforce files will be deleted from the Salesforce File component once the flow has been completed.
- Click on Save.
- Click on Activate.
- Now that your flow is set up, you can go to an object record and upload a file to Salesforce. Your files will appear in the designated SharePoint location.

- Go to Salesforce Setup.
Please Note: Due to Salesforce heap size limitations, only files up to ~11MB can be uploaded.
Uploading Files to SharePoint with Record-Triggered Flows via an Object
When using the automatic file upload feature for a desired object you will be able to trigger the flow from only a record on that object, however all existing files for that object record will be uploaded on flow trigger.
- Go to Salesforce Setup.
- Search for Flows.

- Click on New Flow.
- Select Record Trigger Flow and then click Create.
- On Configure Start, select the custom packaged object shareconnect__File__c object. You will only be able to trigger the flow when either A record is created or A record is updated.
- Below the starting node select the Add Element node and then select Action. This will auto-display the Action section to the right.

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

- Select the Operation Upload to SharePoint.
Please Note: The user must have the ability to delete files in Salesforce in order for all the files to get deleted. Giving users the Delete Files permission is recommended.
- If the packaged custom object shareconnect__File__c is set, you will only see the operation Upload to SharePoint. Complete the configuration of the operation. Below is a list of some of the available options:
- Publish Results Event— If this is toggled on and the Link file to record is enabled, then when a file is uploaded to SharePoint, the SharePoint Links component will automatically refresh to show all of the uploaded files.
- File Name — By default, is is set to Existing File Name which is the name of the file in Salesforce once the upload process begins. However this can be changed to any of the following options:
- Existing File Name - Created Date
- Custom Name - This is an input field where you can provide static text or merge fields to hard set the name of the Salesforce file once the upload process begins. File names containing any of the following special characters are not supported, per SharePoint limitations: [“, *, :, <, >, ?, /, , |] as such they will automatically be removed from the file name
- Destination – By default, it is set to Default Record Folder, however, this can be changed to any of the following destinations:
- Default Object Folder
- Folder in Default Record Folder
- Linked Folder
- One Drive
- Folder from SharePoint…
- Fallback Destination — By default, it is set to None. However, if you select Upload to Folder from SharePoint the Microsoft picker will pop up and you can select a folder location. This selected folder location is where files will upload should the previously selected Destination not exist for a record when the scheduled job runs instead of being skipped.
- Link file to record— If enabled, the uploaded Salesforce files will appear on the SharePoint Links component once the flow has been completed. Complete the configuration of the action and click on Done. Below is a list of some of the available options:
- Delete Salesforce File— If enabled, the uploaded Salesforce files will be deleted from the Salesforce File component once the flow has been completed.

- Click on Save.

- Click on Activate.

- Now navigate to your desired object record.

- Verify the files that will upload to SharePoint.

- Trigger your automation to get your Salesforce files to upload to SharePoint.

Please Note: Due to heap size limitations only files that are at most ~11MBs in size will upload.
Upload Files to SharePoint with Schedule-Triggered Flows
Leverage Scheduled Flows when you have existing files in Salesforce you want to upload to SharePoint or you want to periodically move files for archival purposes. When using the scheduled flow action, all files under the same record will go to the same destination.
Please Note: Uploading files using Scheduled Flows requires the Mass Actions add-on. Please contact sales for more information.
- Go to Salesforce Setup.

- Search for Flows.

- Click on New Flow.

- Select Scheduled Automations.

- Select Schedule-Triggered Flow.

- Under Start Schedule-Triggered Flow, set the schedule and select the Choose Object (Optional) and set the object to the object the files are associated with.
Please Note: There is no pointer to the original object for each attachment, so all files would need to be routed to a single folder as opposed to being directed to individual record folders.

- When the Add Element panel appears, select Action.

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

- Select the Operation Upload to SharePoint.
Please Note: Uploading files using Scheduled Flows requires the Mass Actions add-on. Please contact sales for more information.

- Complete the configuration of the action and click Done. Below is a list of some of the available options:
-
Publish Results Event — If this is toggled on and the Link file to record is enabled, then when a file is uploaded to SharePoint, the SharePoint Links component will automatically refresh to show all of the uploaded files.
-
File Name — By default, it is set to Existing File Name which is the name of the file in Salesforce once the upload process begins. However, this can be changed to Created Date as well.
-
Destination — By default, it is set to Default Object Folder. However, this can be changed to any of the following destinations:
-
Default Record Folder
-
Folder in Default Record Folder
-
Linked Folder
-
Parent Record’s Default Record Folder
-
Folder in Parent Record’s Default Record Folder
-
Parent Record’s Linked Folder
-
OneDrive
-
Folder from SharePoint…
-
-
Fallback Destination — By default, it is set to None. However, if you select Upload to Folder from SharePoint the picker will pop up and you can select a folder location. This selected folder location is where files will upload should the previously selected Destination not exist for a record when the scheduled job runs instead of being skipped.
-
Link file to record — If this is enabled, the uploaded Salesforce files will appear on the SharePoint Links component once the flow has been completed.
-
Delete Salesforce File — If this is enabled, the uploaded Salesforce files will be deleted from the Salesforce File component once the flow has been completed.
-
Child Operation: New SharePoint Shortcut — If this is added, the uploaded Salesforce files will have a shortcut created in SharePoint to any of the above Destination options you select.
-
- Click Save.

- Enter the required fields for Flow Label and Flow API Name, and click Save.

- Click Activate.

- Now that your flow is set up, you can go to Scheduled Jobs and see that the job has been scheduled to run.

Please Note: Due to Salesforce heap size limitations, only files up to ~11MB can be uploaded.