Connect external folder to a record
CloudFiles widget is a lightning web component that be dragged and dropped onto any Salesforce standard or custom object. Once inserted, the user can go to the respective object and link the widget to a folder sitting in SharePoint / Google Drive / OneDrive / Box / Dropbox or even AWS S3. Once linked, users can see the contents of the folder, search, preview, edit, download, share files and do a lot more. Users can also upload files directly in Salesforce which get stored in the external storage.
CloudFiles also supports linking multiple folders or files to a Salesforce record
Further, CloudFiles provides flow actions that can automate the resource(folder or file) creation and linking process, thus providing an extra layer of automation on top.
This article explains the following -
- Setting up the widget- This section provides steps and screenshots to drag and drop the widget onto any Salesforce standard or custom object.
- Linking the widget to folder - This section shows how to link a folder to an object's widget. This can be done manually or automatically using flow actions.
- Working with linked folders- This section shows the usability of the linked folder such as upload, search, preview, edit, share and other operations right from the Salesforce record.
- Folder linking automation- This section covers the flow component used to automate the folder / file linking operation.
- Unlinking the folder - This section shows how to disconnect a linked folder or file from the widget.
Keep scrolling for more info.
You can drag and drop the folder widget onto any standard or custom Salesforce object. Simply go to the 'Edit Page' from the object page, add a new tab to your object and drag and drop the widget. These steps are shown in the video below.
Now that your widget is setup, you can start linking files or folders with your Salesforce objects. Just click the "Select folder/file" button in the widget, select the folder from any cloud storage (e.g. SharePoint, Google Drive, Box, Dropbox, AWS S3, OneDrive) and that's it. Follow the simple steps below -
- Go to the Salesforce record where you want to link the folder
- Locate the CloudFiles widget that you had added in the previous step
- Click on the "Select folder/file" button (See note below if you instead see the "Connect CloudFiles" button here)
- A dialog will open where you can select your library / folder / file that you want to link
- Select the folder or file. The contents will immediately start showing up in your widget
NOTE: If you see the "Connect CloudFiles" button instead of the "Select folder/file" button on the widget, this is because you recently installed the Salesforce app and haven't connected it to the CloudFiles account yet. Simply click the Connect button and follow on-screen instruction. Screenshots for this are shown in Step 2 here.
Here's a video that shows this in action. You can also connect multiple folders and files in this widget.
The connected folders are pretty easy and intuitive to use. You can upload files and create folders, search inside this folder and sub-folders, do actions such as edit in cloud drive, download, preview etc... on the files & folders. Explore the buttons all around the widget to know more.
In this section, we cover a small flow template that enables you to automatically link folders from external storage onto Salesforce pages. This flow template is available as part of the managed package and can be cloned and updated as per your business needs.
Before setting up the automations, please enable your external storage by following the article on Automations
For the sake of simplicity, we created a simple flow that creates a folder in SharePoint whenever an contact is created, and then links it to the folder widget of that contact.
- Create a record triggered flow.
- Set trigger conditions of new contact creation
- Use asynchronous path to add CloudFiles actions. You can also clone the Create & Attach Folder Flow template that comes pre-packaged with the app.
- Add CloudFiles folder creation action and configure parameters
- Add CloudFiles folder linking action and configure parameters
- Save and test your flow
The video below shows our final flow along with the parameters we used. You can check the details on how to configure these paramters in our article on CloudFiles Template: Create & Attach Record Folder.
You can easily get the various IDs associated to this action using the simple steps below.
- Click on App Launcher on top left. Search for the CloudFiles App.
- In the CloudFiles App, select the Content Library Tab
- Go to your cloud storage. You may need to login if you haven't done so before.
- Go to the target folder where you would like to place the created folders in.
- Click on View Metadata option from the folder list item dropdown as shown below.
- A dialog box opens up which shows all the IDs and other meta data required for automations.
These steps are shown in the GIF below -
To unlink the folder or file, either go to widget home or inside the connected folder and click on the Disconnect button as shown in the image below.
There's a plethora of articles and videos that you can refer to for more information on using CloudFiles with Salesforce. The app offers a number of Lightning web components, flow actions and other flow components, custom objects and apex support which makes document automations and sharing easy.
You can not only do auto-folder creation and connection as shown above, but you can also share these files with community as well as external users. You can enable security & collect analytics on the files. With the help of flow components, processed can be completely automated.
This article links to various sections of the knowledge base that cover these components and use-cases in Salesforce.