Overview
CloudFiles creates a custom object called Connected Folder(cldfs__ConnectedFolder__c) in Salesforce when you link an external folder to a Salesforce record. This includes linking a folder using automation, or manually from the record page.
This articles talks about the Connected Folder Custom Object and how it can be used in flows & apex code.
- Access Connected Folder Objects - You can access all the connected folder in the "Connected Folders" Tab in CloudFiles app
- Properties of the Object
- Parent Id(cldfs__Parent_Id__c) - Id of the Salesforce record to which the folder is connected
- Parent Type(cldfs__Parent_Type__c) - Type of the Salesforce record to which the folder is connected. Example - Account
- External Id(cldfs__ExternalId__c) - Id of the external folder. Example - SharePoint folder's Id
- Library(cldfs__Library__c) - One of sharepoint, box, dropbox, google, onedrive, cloudfiles
- Drive Id(cldfs__DriveId__c) - Id of the drive in external storage. Example - SharePoint Drive Id
The values of External Id & Drive Id can be found in CloudFiles's "Content Library" tab. To access these, select CloudFiles app from App Launcher. Click on "Content Library" tab and click "view metadata" for the desired folder
Use Cases
- Check If a record has a folder connected
Sometimes in a flow, you might want to check if the Salesforce record has an external folder connected. To do this- Use the flow element "Get Records", and query for "Connected Folder" object. You can filter on cldfs__Parent_Id__c field to match record's id
- Use a "Decision" element to check if the Connected Folder exists
- Use the flow element "Get Records", and query for "Connected Folder" object. You can filter on cldfs__Parent_Id__c field to match record's id