Automatically Uploading Salesforce Files to Google Drive
Drive Connect can automatically upload files from Salesforce Files to Google Drive through the use of Flow. Files upload to Google Drive can automatically be linked to the record they were originally attached to and show up in the Drive Links component. Salesforce Files can also be automatically deleted from Salesforce once they are uploaded to Google Drive.
How it Works
On installation of Drive Connect the File object is created in your org which is required to automatically upload files.
When content documents are created in Salesforce a file record gets created that is used to trigger the flow. This means that once a flow is setup using the Upload to Drive operation, the flow will trigger on any object record that you upload a file to Salesforce. The file record will get deleted so you will not see any file records.
Creating the Flow
If users would like to automatically upload their files they will need to create a flow using the File object, which can be done doing the following.
- Go to Setup
- Search for Flows
- Click on New Flow
- Select Record Trigger Flow and then click Create
- On Configure Start select the File Object and set the configure trigger as A record is created
Note: The automatic upload feature can only be configured by the File custom object that is created on installation of Drive Connect.
- Click on Done
- Next go to New Action
- Search for the action Automate Drive
- Complete configuration of the action and click on Done, below are is list of some of the available options:
- Publish Results Event – if this is toggled on and Link file to record is enabled then on file upload to Google Drive the Drive Links component will automatically refresh to show all of the uploaded files
- 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
- My Drive
- Folder from Drive…
- Link file to record – if this is enabled then the uploaded Salesforce files will appear on the Drive Links component once the flow has completed
- Delete Salesforce File – if this is enabled then the uploaded Salesforce files will be deleted from the Salesforce File component once the flow has completed
Note: By default the record name merge field is in the name field, publish events is toggled on, the link to record and delete Salesforce file checkbox are enabled. There is one child operation available New Drive Shortcut
- Click on Save
- Click on Activate
- Now that your flow is setup you can now go to an object record and upload a file to Salesforce and your files will appear in the designated Google Drive location