These notes on Files Connect and Federated Search form part of my study towards the Integration Architect certification. Please see some more articles here.

Files Connect:

Files Connect allows you to share external files, search for, and browse them right from Salesforce.

Enable Files Connect in Setup under Salesforce Files in Feature Settings:

Image of Files Connect Settings in Salesforce Setup
  • Facebook
  • Twitter
  • Gmail
  • LinkedIn
Image of Files Connect Settings in Salesforce Setup

It is possible to choose whether the file should be copied to Salesforce or simply referenced from the File Sharing options. If a reference is shared, only users with access to the external system can download them. It is also possible for links to external files to be posted in chatter by checking the checkbox named “Enable links conversion”.

Users who should access Files Connect need the Files Connect Cloud permission:

Image of Files Connect Cloud permissions
  • Facebook
  • Twitter
  • Gmail
  • LinkedIn
Image of Files Connect Cloud permissions

To access the contents of your chosen External Data Source, go to External Data Sources in Setup. For this example, I am using Files Connect to link to Google Drive.

  1. Click New External Data Source
  2. Set the External Data Source label and the Name will auto populate. 
  3. Select the type of External Data Source, and then move to set the Authentication. The Authentication Protocol for Google is OAuth 2.0.
Image of External Data Source settings in Salesforce Setup
  • Facebook
  • Twitter
  • Gmail
  • LinkedIn
Image of External Data Source settings in Salesforce Setup
  1. To set the Authentication Provider, follow these steps to set up the Google Drive Auth Provider. Note: a Google Workspace is needed.

    If you need to authenticate to an external system with a per user authentication, those credentials can be provided to Salesforce. Examples of authenticated file sources are SharePoint, OneDrive for Business, Box or Google Drive.

    If Named Principal is chosen for the Identity type, the same set of credentials are used for every user who accesses the data source. 
  2. When you are ready, validate and sync your External Data Source. You will get the option to create an external object – it is worth creating it as part of this – validate and sync process.


Searching External Data Sources:

A related external object needs to be created to include external data in API queries or global searches. 

Go to External Objects in Setup, create a new External Object. The steps are similar to setting up a custom object. 

One thing you will need to do is Select the External Data Source (that you created) and then select the Table Name to map to a table in the external system. It is possible to create the External Object during the validate and sync step for the external data source. If you have – do not modify the name of the Table Name that appears here. Check Allow Search to enable SOSL and Salesforce global searches for this eternal object. The last steps include allowing users access to your new External Object.


Federated Search API

Salesforce has a Federated Search Connector that uses the Federated Search API to connect to the External Service Provider. This API enables external data sources to be searched and data returned within Salesforce. Federated Search should only be used if the company does not have an existing search provider. Where companies manage their own external data source – the Federated Search API can still be used with developers configuring a compatible search.

The Federated Search Connector uses the HTTPS to request data from the endpoint of the search provider. The request includes OAuth tokens as a bearer token in the authorisation request header. 

The Federated Search API requires that external search providers are compliant with the OpenSearch specification.

“OpenSearch is a community-driven, open source search and analytics suite…. It consists of a search engine daemon, OpenSearch, and a visualization and user interface, OpenSearch Dashboards. OpenSearch enables people to easily ingest, secure, search, aggregate, view, and analyze data.” 

(https://www.opensearch.org)

The target of the search must be trusted when presented with a root Certification Authority certificate. To learn more about supported certificates see this knowledge article.

Each search provider must respond within 120 seconds. If it does not, a timeout message is displayed. 

To set up federated search, create an External Data Source. Set the type as Federated Search: OpenSearch.

Image of a New External Data Source in Salesforce Setup
  • Facebook
  • Twitter
  • Gmail
  • LinkedIn
Image of a New External Data Source in Salesforce Setup

Set the OpenSearchDescription URL of the external data source provider and the required TImeout (up to 120 seconds).

If authentication is required – upload the certificate to the external data source – then choose per user or Named Principal and set the authentication protocol to No Authentication. An Authenticator Provider will be required. 

If no authentication is required, use Anonymous and No Authentication.

When you are ready Validate and Sync (and set the external object).

Note that Federated Search external objects are always the parent and only supports external lookup relationships. The external object will also only have fields as defined by the external data source. Federated Search does not display records, only search results.

Share This