Combine searches for Salesforce data with external data from Google Drive, SharePoint, OneDrive for Business, or Box. Developers can automate the process with supported SOQL or SOSL queries with the API.
Required Editions
| Available in: both Salesforce Classic and Lightning Experience |
| Files Connect for cloud-based external data sources is available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions |
| User Permissions Needed | |
|---|---|
| To create an external object and provide access to its fields: | Customize Application |
To include external data in global searches or API queries, first create a related external object. External objects behave similarly to custom objects, but map to data stored outside Salesforce in an external system like SharePoint. Each external object maps to a data table, and the object fields map to accessible table columns.
To fully configure global search, you have to
- Choose the layout for global search results
- Create an external object from an external data source
- Give users access to the external object fields
- Create a custom tab for the external object (Lightning Experience Only)
By default, Files Connect external objects use the standard search results layout for Chatter and the Files tab. If you want to display customized search layouts for these objects, complete these steps.
- From Setup, enter Files Connect Settings in the Quick Find box, and select Files Connect Settings.
- Select Use External Object Search Layout.
- Define an external data source that supports search:
- From Setup, enter External Data Sources in the Quick Find box, and select External Data Sources.
- To access the details page, click the data source name.
-
Click Validate and Sync.
If the Validate and Sync button is disabled, edit the Authentication Settings for External Systems to enable the Start Authentication Flow on Save checkbox.
-
Select the table named “items_[data source].” Then, click Sync
and create an external object that maps to the entire source.
Now deploy the object to make the data it contains available to users.
- Choose Build | Develop | External Objects.
- Click Edit next to the new external object.
- At the bottom of the page, click Deployed, and then click Save.
-
To give users access to the external object fields:
- From Setup, enter Permission Sets in the Quick Find box, and select Permission Sets.
- Click a permission set in which you enabled Files Connect.
- In the Apps section, click Object Settings.
- Click the name of the external object.
- Click Edit, and enable the necessary Read permissions (for the object itself, and all fields you want to reveal in Salesforce).
- Click Save.
-
Next, create a custom tab for the external object (Lightning Experience Only):
- From Setup, enter Tabs in the search bar, and select Tabs.
- Click New in the Custom Object Tabs section.
- In Step 1 of the setup wizard, enter the name of the custom object you created from your external data source.
- In Step 2, choose the availability and visibility of the tab to profiles. The tab doesn’t need to be visible, but it does need to be accessible. Choose either Default On or Tab Hidden.
- Complete Step 3 and click Save.
To automate search with SOQL or SOSL, review the supported queries for your data source.
SharePoint and OneDrive external objects support these standard fields and any custom fields you enable. Queries on specific fields return only documents that the external data source indexed.
| Field Name | Queryable | Sortable |
|---|---|---|
| Author | Yes | Yes |
| Comment | No | Yes |
| ContentLength | Yes | Yes |
| CreationDate | Yes | Yes |
| DisplayUrl | No | Yes |
| DownloadUrl | No | No |
| ExternalId | Yes | Yes |
| IsFolder | Yes | Yes |
| MimeType | Yes | Yes |
| Name | Yes | Yes |
| UpdateDate | Yes | Yes |
| UpdatedBy | Yes | Yes |
You can also use ParentId_c as query criteria to retrieve the list of documents in a folder. However, that field isn’t displayed in query results unless your query specifies a ParentId__c value.
Files Connect supports all standard Google Drive properties, but not custom properties. The following properties have different field names in Salesforce external objects:
| Google Property | Salesforce Field |
|---|---|
| alternateLink | DisplayUrl |
| createDate | CreationDate |
| description | Comment |
| downloadURL | contentStreamUri |
| editable | readOnly |
| fileSize | ContentLength |
| id | ExternalId |
| lastModifyingUserName | UpdatedBy |
| mimeType | MimeType |
| modifiedDate | UpdateDate |
| ownerNames | Author |
| originalFilename | contentStreamFileName |
| title | Name |
This subset of fields supports SOQL and SOSL queries. (None are sortable, reflecting limitations in the Google Drive API.)
- CreationDate
- lastViewedByMeDate
- MimeType
-
Name
Note Google Drive queries on the Name field support only one wildcard, %. Searches using this wildcard match only name prefixes. For example, the title "HelloWorld" would be returned with the query Name LIKE "Hello%" but not Name LIKE "%World". -
sharedWithMe
Note Queries on the sharedWithMe field with a value of "false" are not supported, protecting confidential data. - starred
- UpdateDate