Newer Version Available

This content describes an older version of this product. View Latest

ExternalDataSource

Represents the metadata associated with an external data source. External data sources manage connection details for integration with data and content that are stored outside your Salesforce organization.

This type extends the Metadata metadata type and inherits its fullName field.

File Suffix and Directory Location

ExternalDataSource components are stored in the dataSources directory of the corresponding package directory. ExternalDataSource components have the suffix .dataSource, and the prefix is the name of the external data source.

Version

ExternalDataSource components are available in API version 28.0 and later.

Fields

Field Name Field Type Description
apiKey string Reserved for future use.
authProvider string The authentication provider that is represented by the AuthProvider component.
certificate string If you specify a certificate, your Salesforce org supplies it when establishing each two-way SSL connection with the external system. The certificate is used for digital signatures, which verify that requests are coming from your org.
customConfiguration string A string of configuration parameters that are specific to the external data source’s type.
endpoint string The URL of the external system, or if that URL is defined in a named credential, the named credential URL. A named credential URL contains the scheme callout:, the name of the named credential, and an optional path. For example: callout:My_Named_Credential/some_path.

Corresponds to URL in the user interface.

isWritable boolean

Allows users to create, update, or delete external object records for this data source from within Salesforce. By default, external objects are read-only. Corresponds to Allow Create, Edit, and Delete in the user interface.

Writable external objects aren’t supported with the Salesforce adapter for Lightning Connect.

label string A user-friendly name for the external data source. The label is displayed in the Salesforce user interface, such as in list views.

Examples include Acme Team Marketing Site, or Acme SharePoint.

oauthRefreshToken string The OAuth refresh token. Used to obtain new access tokens for an end user when old tokens expire.
oauthScope string Specifies the scope of permissions to request for the access token. Corresponds to Scope in the user interface.
oauthToken string The access token issued by the external system.
password string The password to be used by your org to access the external system. Ensure that the credentials you use have adequate privileges to access the external system, perform searches, return data, and return information about the external system’s metadata.
principalType External​PrincipalType(enumeration of type string) Determines whether you're using one set or multiple sets of credentials to access the external system. Corresponds to Identity Type in the user interface. The valid values are:
  • Anonymous
  • PerUser
  • NamedUser
protocol Authentication​Protocol(enumeration of type string) The authentication protocol that’s required to access the external system. The valid values are:
  • NoAuthentication
  • Oauth
  • Password

For cloud-based Files Connect external systems, select Oauth 2.0. For on-premises systems, select Password Authentication.

For Simple URL data sources, select No Authentication.

repository string Used for SharePoint Online. If metadata is not accessible, use this field to create tables and default table fields.
type ExternalData​SourceType(enumeration of type string) For Lightning Connect, specifies the adapter that connects to the external system. The valid values are:
  • OData—OData 2.0 or 4.0 adapter
  • SfdcOrgSalesforce adapter
  • ApexClassIdDataSource.Provider class that defines the custom adapter created via the Apex Connector Framework

For Files Connect, specifies the data source type. The valid values are:

  • ContentHubSharepoint—SharePoint 2010 or 2013
  • ContentHubSharepointOffice365—SharePoint Online
  • ContentHubSharepointOneDrive—OneDrive for Business
  • ContentHubGDrive—Google Drive

If Chatter is enabled, you can also specify SimpleURL to access data hosted on a web server that doesn’t require authentication.

The Identity and Wrapper types are reserved for future use.

username string The username to be used by your org to access the external system. Ensure that the credentials you use have adequate privileges to access the external system, perform searches, return data, and return information about the external system’s metadata.
version string Reserved for future use.

customConfiguration for Lightning Connect—Salesforce Adapter

The following sample JSON-encoded configuration string defines parameters that apply when the external data source’s type is set to SfdcOrg.
1{"apiVersion":"32.0","environment":"CUSTOM",
2"searchEnabled":"true","timeout":"120"}
The parameters correspond to these fields in the user interface:
  • apiVersionAPI Version
  • environmentConnect to
  • searchEnabledInclude in Salesforce Searches
  • timeoutConnection Timeout

customConfiguration for Lightning Connect—OData 2.0 or 4.0 Adapter

The following sample JSON-encoded configuration string defines parameters that apply when the external data source’s type is set to OData.
1{"compatibility":"DEFAULT","noIdMapping":"false",
2"inlineCountEnabled":"true","searchEnabled":"true",
3"format":"ATOM","requestCompression":"false",
4"pagination":"SERVER","timeout":"120"}
The parameters correspond to these fields in the user interface.
  • compatibilitySpecial Compatibility
  • formatFormat
  • inlineCountEnabledRequest Row Counts
  • noIdMappingHigh Data Volume
  • paginationServer Driven Pagination
  • requestCompressionCompress Requests
  • searchEnabledInclude in Salesforce Searches
  • searchFuncCustom Query Option for Salesforce Search
  • timeoutConnection Timeout

customConfiguration for Lightning Connect—Custom Adapter

The following sample JSON-encoded configuration string defines the parameter that applies when the external data source’s type is set to the ID of a DataSource.Provider class.
1{"noIdMapping":"false"}

The noIdMapping parameter corresponds to the High Data Volume field in the user interface.

Declarative Metadata Sample Definition

The following is the definition of an external data source for Lightning Connect—OData 2.0 or 4.0 adapter.
1<?xml version="1.0" encoding="UTF-8"?>
2<ExternalDataSource xmlns="http://soap.sforce.com/2006/04/metadata">
3    <authProvider>FacebookAuth</authProvider>
4    <customConfiguration>{"compatibility":"DEFAULT",
5    "noIdMapping":"false","inlineCountEnabled":"true",
6    "searchEnabled":"true","format":"ATOM",
7    "requestCompression":"false","pagination":"SERVER",
8    "timeout":"120"}</customConfiguration>
9    <endpoint>http://myappname.herokuapp.com/DataHub.svc</endpoint>
10    <label>DataHub</label>
11    <principalType>NamedUser</principalType>
12    <protocol>Oauth</protocol>
13    <type>OData</type>
14</ExternalDataSource>