Files Connect
Files Connect is a Salesforce service that connects Salesforce orgs to external file repositories. This allows users to create and reference external files from Salesforce, such as in Chatter posts and the standard Files tab, and uses less storage than hosting files directly inside Salesforce. When Files Connect is enabled with Komodo Publications Planning, users can also initiate document creation and collaboration user flows from inside Salesforce to the external file repositories. This page provides guidance on how to set up and configure Files Connect with Komodo Publications Planning and how to use Files Connect documents within Komodo Publications Planning. For more information about Files Connect, visit Salesforce's documentation on Salesforce Files Connect.
Warning
While Salesforce's Files Connect service can be used with many different external file repositories, like Google Drive, Box, Sharepoint, One Drive, and more, the Komodo Publications Planning product currently only supports a Files Connect integration with Google Drive.
Additionally, the default Files Connect integration uses Google Drive as an external data source and has a file size limit of 6MB when saving files from Komodo Publications Planning to Google Drive, creating snapshots of external documents, and creating package files for external documents. Customers can purchase the premium Files Connect integration to use Google Drive as an external service and increase the file size limit to 75MB for files that are saved to Google Drive and 2GB for snapshots and package files. Customers must make sure to follow all of the setup and configuration steps below, including step 7. (Premium) Enable the premium Files Connect integration, to use the premium integration.
Setup and configuration
To set up and configure the Files Connect service inside a Salesforce org that has Komodo Publications Planning installed:
1. Create an OAuth consent screen in the Google Cloud console
2. Create an authentication provider in Salesforce
3. Enable Files Connect in Salesforce
4. Grant permission to use Files Connect in Salesforce
5. Define an external data source for Google Drive in Salesforce
6. Grant permission to use Google Drive as an external data source in Salesforce
7. (Premium) Enable the premium Files Connect integration
1. Create an OAuth consent screen in the Google Cloud console
To create a consent screen for users to authenticate to Google Drive from Komodo Publications Planning, complete the following steps. For more information, visit Salesforce's documentation on how to Create an Authentication Provider for Google Drive.
Navigate to the Google Cloud console and log in with your Google work profile.
In the header, click Select a project. A modal will appear.
In the top right corner, click New Project. The New Project page will open.
Enter a project name, confirm that the organization and location for the project are correct, and click Create.
Select the project. For example, in the notification that indicates the project has been created, click Select Project.
Click the hamburger menu icon to open the left sidebar.
Hover on APIs & Services and select Library to open the API Library page.
Search for and select Google Drive API. The Google Drive API product details page will open.
Click Enable to open the Google Drive API service details page.
From the left sidebar, click OAuth consent screen. The OAuth Overview page will open.
In the middle of the screen, click Get started. The Project configuration page will open.
Complete the form:
Under App Information, enter a name for the application and the email address of a support member and click Next.
Under Audience, select Internal and click Next.
Under Contact Information, enter the email address of a developer and click Next.
Under Finish, agree to Google's User Data Policy and click Continue.
Click Create. The OAuth Overview page will open again.
Under Metrics, click Create OAuth client. The Create OAuth client ID page will open.
In the Application Type dropdown, select Web Application.
Update the name of the OAuth 2.0 client as needed and click Create. The "OAuth client created" pop-up will appear.
Click OK.
Click the name of the OAuth 2.0 client to view and save its details, including the client ID and client secret. You may want to leave this page open as a reference when completing step 2e below.
2. Create an authentication provider in Salesforce
To create an authentication provider for Google Drive in your Salesforce org, complete the following steps. For more information, visit the same Salesforce documentation on how to Create an Authentication Provider for Google Drive.
Log into your Salesforce org.
In Setup, search for and select Auth. Providers.
Click New.
In the Provider Type dropdown, select Open ID Connect. Additional fields will appear.
Enter the following details:
Name
Enter a name for the provider that should appear in the Salesforce org. For example,
Google Drive
.URL suffix
Enter the suffix that should appear at the end of the authentication URL path. For example, in the URL path
https://login.salesforce.com/services/authcallback/00Dx00000000001/MyGoogleProvider
, the suffix isMyGoogleProvider
.Consumer Key
Enter the client ID from step 1t above.
Consumer Secret
Enter the client secret from step 1t above.
Authorize Endpoint URL
Enter the following:
https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=force
Token Endpoint URL
Enter the following:
https://accounts.google.com/o/oauth2/token
Default Scopes
Enter the following:
openid email profile https://www.googleapis.com/auth/drive
Click Save. The Auth. Providers page will open again and show the newly created authentication provider.
Click the name of the authentication provider to open its details page.
Under the Salesforce Configuration section, copy the Callback URL value.
Navigate back to the OAuth 2.0 client credentials details page in the Google Cloud console from step 1t.
Under the Authorized redirect URIs section, click + Add URI, paste the Callback URL, and click Save.
3. Enable Files Connect in Salesforce
To enable the Files Connect service in your Salesforce org, complete the following steps. For more information, visit Salesforce's documentation on how to Enable Salesforce Files Connect for Your Organization.
Navigate back to your Salesforce org.
In Setup, search for and select Files Connect.
Check the Enable Files Connect checkbox.
Set File Sharing to Reference.
Click Save.
4. Grant permission to use Files Connect in Salesforce
To grant admins and/or users permission to configure and use the Files Connect service in the Salesforce org, respectively, create a new permission set or modify an existing permission set to include the Files Connect Cloud system permission. For more information, visit Salesforce's documentation on how to Let Users and Administrators Access Files Connect Data Sources.
Warning
You must be granted the permission set with the Files Connect Cloud system permission to complete the next setup and configuration steps.
5. Define an external data source for Google Drive in Salesforce
To define Google Drive as an external data source for your Salesforce org:
In Setup, search for and select External Data Sources.
Click New External Data Source.
Enter a name for the external data source. This will appear as the label on the button in the Files Connect component. For example, if you set the name to
Google Drive
, the button to authenticate to the external service will be "Connect to Google Drive" while the button to select a file from the external service will be "Select from Google Drive".In the Type dropdown, select Files Connect: Google Drive.
Set the Identity Type to Per User.
Set the Authentication Protocol to OAuth 2.0. Additional fields will appear.
Set the Authentication Provider to the authentication provider created in step 2.
Leave the Scope field empty.
Check the Start Authentication Flow on Save checkbox.
Click Save.
Complete the Google authentication flow to enable the external data source.
Note
If the authentication flow fails, double check that you have completed step 2.
The Administration Authentication Status will appear as
Authenticated
.
6. Grant permission to use Google Drive as an external data source in Salesforce
To grant admins and/or users permission to use Google Drive as an external data source in the Salesforce org:
User authentication
After the Files Connect service is set up and configured with the Komodo Publications Planning product, every user must authenticate to Google Drive to create or reference files in the external data source. Users can initiate the authentication flow by clicking Connect to Google Drive anywhere in Komodo Publications Planning where the Files Connect component is available, such as:
the Files Connect tab in the New Document wizard;
the Files Connect tab in the New Package File wizard.
Once the authentication flow is complete, a Finish Authorization modal will appear in the Salesforce org and the Connect to Google Drive button will change to a Select from Google Drive button.
Note
The label on the Connect to Google Drive and Select from Google Drive buttons are driven by setup and configuration step 5c above as well as the CM_Authorize_File_Repository and CM_Select_From_File_Repository custom labels.
Possible error messages
If a user encounters the following error message(s) when trying to authenticate or use the Files Connect integration, you should check that the integration was configured properly, that the user has the required permission set, and that the values on the Default MCM Global Setting metadata record have been set appropriately.
Error message | Possible reason(s) |
---|---|
|
|
|
|
User flows
After a user authenticates to Google Drive, the user can then initiate the following user flows with the Files Connect service.
Create a new external document
Users can upload documents in Komodo Publications Planning to Google Drive. If the document is not yet linked to a file in Google Drive, users can select a location or folder in Google Drive to upload the new document; if the document is already linked to a file in Google Drive, users can either replace it or create a new file. If a document has multiple versions with different Google Drive references, Komodo Publications Planning uses the last document version for operations such as creating a snapshot of the document.
Warning
The link between the Document record and the source file in Google Drive should never be broken, and users who perform actions that may break the link will see warning messages. For example, if a document has multiple versions and a user attempts to delete the version of the document that is linked to a Google Drive file, then a Confirm External Source Replacement pop-up will appear. For more information about document versions and snapshots with the Files Connect service, reference the Create a snapshot of an external document section below.
Create a new file
To create an external document that references a new Google Drive file:
Navigate to the Documents tab and click New Document. The New Document wizard will open.
Select Files Connect for where the file should be hosted. A Files Connect box will appear with the available file services that have been configured (e.g., Google Drive).
Click Select from Google Drive. The Select from Google Drive wizard will open.
Select My Drive or any available Google Drive folder.
Click New. A dropdown will open a list of file types that can be created.
Select the type of file to be created. Only the following Microsoft 365 and Google Drive file types are available. A wizard will open.
Table 145. Files Connect typesFile type
Microsoft 365
Google Drive
Document
Microsoft Word
Google Docs
Spreadsheet
Microsoft Excel
Google Sheets
Presentation
Microsoft PowerPoint
Google Slides
File Upload
N/A - all Microsoft 365, text, and image files are supported as long as the file extension exists as a Content Type (
mvn__CT_Content_Type__mdt
) metadata recordSelect whether the file should be created with Microsoft 365 or Google Drive, enter a name (and description) for the file, and click Create. The New Document wizard will appear again, and the Title field will be automatically populated with the file name.
Note
If the file is created with Microsoft 365, the new file will use the template in the corresponding static resource. For more information, reference the Configure Microsoft 365 file templates section below. However, if the file is created with Google Drive, the new file will be blank.
Warning
If you have the default Files Connect integration, users can only create external files in Google Drive that are up to 6MB in size. If you have purchased and enabled the premium Files Connect integration, users can create external files in Google Drive that are up to 75MB in size.
Complete the remaining fields and progress through the rest of the New Document wizard. The new Document record will be created, and the document's details page will open.
Note
If the file extension that appears in the final screen of the New Document wizard is ".undefined", then snapshots cannot be created for the external document. For more information, reference the Create a snapshot of an external document section below.
Use an existing file
To create an external document that references an existing Google Drive file:
Navigate to the Documents tab and click New Document. The New Document wizard will open.
Select Files Connect to indicate where the file should be hosted. A Files Connect box will appear with the available file services that have been configured (e.g., Google Drive).
Click Select from Google Drive. The Select from Google Drive wizard will open.
Select the Google Drive folder where the file exists or can be found.
Select the file that should be created as a document in Komodo Publications Planning.
Click Select. The New Document wizard will appear again, and the Title and Description fields will be automatically populated with the file name and description.
Complete the remaining fields and progress through the rest of the New Document wizard. The new Document record will be created, and the document's details page will open with a preview of the file's existing content.
Configure Microsoft 365 file templates
When a user creates a new Microsoft 365 file in Google Drive through the Files Connect service in Komodo Publications Planning, the file is generated with a Microsoft 365 template that is stored as a static resource and defined on the MCM Global Setting (mvn__CM_Global_Setting__mdt
) custom metadata type. As a result, the static resource for every Microsoft 365 file type and the configuration on the MCM Global Setting custom metadata type are required for documents to be created as new Microsoft 365 files in Google Drive. Komodo Publications Planning ships with several static resources that act as empty Microsoft 365 file templates, but you can add and configure your own templates as well.
To create a new template for a Microsoft 365 file type:
Upload the Microsoft 365 file template as a static resource. The static resource must be either a .docx, .pptx, or .xlsx, file.
Navigate to the MCM Global Setting (
mvn__CM_Global_Setting__mdt
) custom metadata type.Edit the Default (
PP_Default
) metadata record and update the MCM Global Setting field that corresponds to the type of file that was uploaded as a static resource:Static resource file type
MCM Global Setting field
.docx
Files Connect Word Template (
mvn__CM_Files_Connect_Word_Template__c
).pptx
Files Connect PowerPoint Template (
mvn__CM_Files_Connect_PowerPoint_Template__c
).xlsx
Files Connect Excel Template (
mvn__CM_Files_Connect_Excel_Template__c
)
View an external document
To view an external document, users can open the file directly from the MCM - Document Version File Details (cmDocumentVersionFileDetails
) component. When users click Open in the File Details component, a new browser tab is launched that opens the file in Google Drive. Users can also preview the file directly on the Document record's details page, but the file preview is an image of the first page of the file and may not be available for every external document.
Edit an external document
Unlike how users can check out regular Document records and files that are hosted inside Komodo Publications Planning, users cannot check out external documents and the Check Out Document option on the Document record's details page is disabled (i.e., greyed out). However, users can still make edits to and collaborate on the external documents by opening the file in Google Drive the same way users would to view the file. Any changes made to the file in Google Drive will be reflected in the file preview on the Document record's details page when available.
Start a workflow with an external document
Users can start workflows and complete tasks with external documents the same way as with other documents in Komodo Publications Planning. However, external documents cannot be sent as attachments in emails and will be removed from the Attachments table in the Start Workflow modal.
Create a snapshot of an external document
If users want to track changes that are made to external documents at different points in time, users can create manual and automatic snapshots. All snapshots will increment minor versions of the external documents.
Warning
Snapshots can be created for external files in Google Drive but not for Google Drive file types; the Create Snapshot button will be disabled (i.e., greyed out) for any external file of a Google Drive file type. Additionally, if you have the default Files Connect integration, snapshots can only be created for external files that are up to 6MB in size. If you have purchased and enabled the premium Files Connect integration, snapshots can be created for external files that are up to 2GB in size.
Create a manual snapshot
To create a manual snapshot of an external document:
Navigate to the document's details page.
Click Create Snapshot. The New Snapshot Version modal will open.
Note
If the Create Snapshot button is disabled, make sure you have edit access to the Document record and that the external document is the latest version of the Document record. If the Create Snapshot button is replaced with the New External Version button, this is because the file is stored in Komodo Publications Planning, and instead of taking a snapshot, you can create a new document version. For more information, reference the (Premium) Create a new external document version section above.
(Optional) Check the Save snapshot to current document version checkbox. This is unchecked (i.e., equals
false
) by default and can be configured via the Snapshot file to current version (CM_Files_Connect_Snapshot_To_Current__c
) field on the Default (PP_Default
) MCM Global Setting (mvn__CM_Global_Setting__mdt
) metadata record.When checked, the latest contents of the external file will be retrieved and stored inside the current Document Version record while the link to the external file will be referenced in a new Document Version record. The new Document Version record will therefore maintain the connection between the Document record and the external file, store the latest version of the external file, and increment a minor version of the document. (For example, Version 0.1 will now reference the downloaded copy of the external file while Version 0.2 will reference the actual external file.) When unchecked, the link to the external file will remain on the current Document Version record while the latest contents of the external file will be retrieved and stored inside a new Document Version record. The new Document Version record will therefore still increment a minor version of the document but will lose the reference to the external file such that snapshots can no longer be created for the external document. (For example, Version 0.1 will continue to reference the actual external file while Version 0.2 will reference the downloaded copy of the external file.)
Enter a reason for creating a snapshot.
Click Save.
Create automated snapshots
To configure automated snapshots to be taken when an external document enters a specific state:
Navigate to the Document State Entry Action (
mvn__CM_Document_State_Entry_Action__mdt
) custom metadata type.Edit an existing metadata record or create a new metadata record.
Set the Document State field to the state that the external document must enter to trigger the automated snapshot.
Set the Type field to New Snapshot Version.
Click Save.
When an automated snapshot is created, the latest contents of the external file will be saved in either the current Document Version record or a new Document Version record based on the Snapshot file to current version (CM_Files_Connect_Snapshot_To_Current__c
) field on the Default (PP_Default
) MCM Global Setting (mvn__CM_Global_Setting__mdt
) metadata record.
When checked, the latest contents of the external file will be retrieved and stored inside the current Document Version record while the link to the external file will be referenced in a new Document Version record. The new Document Version record will therefore maintain the connection between the Document record and the external file, store the latest version of the external file, and increment a minor version of the document. (For example, Version 0.1 will now reference the downloaded copy of the external file while Version 0.2 will reference the actual external file.) When unchecked, the link to the external file will remain on the current Document Version record while the latest contents of the external file will be retrieved and stored inside a new Document Version record. The new Document Version record will therefore still increment a minor version of the document but will lose the reference to the external file such that snapshots can no longer be created for the external document. (For example, Version 0.1 will continue to reference the actual external file while Version 0.2 will reference the downloaded copy of the external file.)
Warning
If you configure two Document State Entry Action metadata records for the same document state but one is for a new snapshot version while the other is for a new major version, an automated snapshot will create two versions of the external document. To avoid this, do not configure two document state entry actions for the same document state.
Configure snapshot notifications and audit logs
You can configure notifications to be sent and audit logs to be created whenever a manual or automated snapshot is created. To configure snapshot notifications and audit logs:
Navigate to the Document System Event Notification (
mvn__CM_Document_System_Event_Notification__mdt
) custom metadata type.Click New.
On the System Event Configuration field, search for and select Document New Version Snapshot (
CM_Document_New_Version_Snapshot
). The Create Document Audit Log checkbox on the related Document New Version Snapshot (CM_Document_New_Version_Snapshot
) System Event (mvn__SE_System_Event__mdt
) metadata record is set totrue
by default.Click Save.
Create a package file for an external document
Similar to typical Document records and files hosted inside Komodo Publications Planning, external documents can also have one or more package files. Package files for external documents can themselves be created through the Files Connect service. However, package files for external documents retrieve and contain the actual contents of the external files while external documents only link out to the external files. As a result, package files that are created from the Files Connect service can only be created from existing Microsoft 365 files in Google Drive and cannot be created with new files or with files of Google Drive file types.
Warning
If you have the default Files Connect integration, package files can only be created with external files in Google Drive that are up to 6MB in size. If you have purchased and enabled the premium Files Connect integration, package files can be created with external files that are up to 2GB in size.
To create a package file for an external document:
Navigate to the document's details page.
On the MCM - Document Version Package Files (
cmDocumentVersionPackageFiles
) component, click New. The New Package File wizard will open.Click the Files Connect tab.
Click Select from Google Drive. The Select from Google Drive wizard will open.
Select the Google Drive folder where the file exists or can be found.
Select the Microsoft 365 file that should be created as a package file for the document.
Click Select. The New Package File wizard will appear again.
Click Save. The package file will be created and added to the Package Files component.
External documents and files in the Collaborator Portal
Any external documents or files that are created in the Salesforce instance of Komodo Publications Planning will appear in the My Publications tab in the Collaborator Portal. However, Collaborator Portal users will only be able to view the documents' metadata and cannot open or view the actual files. Additionally, only the package files for the external documents can be downloaded; the document files themselves cannot be downloaded, and users who try to click the Pub and
Pub & Package Files buttons will be thrown the following error message: "You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary."
To enable Collaborator Portal users to open, download, and/or view the files, a snapshot of the external file must be created in the Salesforce org so that a local version of the file is created and stored in Komodo Publications Planning.