Newer Version Available

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

ExternalDataSource

Represents the metadata associated with an external data source. Create external data sources to manage connection details for integration with data sources outside of Salesforce. It 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 Available for Lightning Connect and SharePoint 2010 and 2007. The security certificate for authentication.
customConfiguration string A custom string used for configuring the data source.
For example, the following JSON-encoded configuration string defines parameters that apply when type is set to OData.
1{"noIdMapping":"false","searchFunc":"",
2"searchEnabled":"true","format":"ATOM",
3"timeout":"120"}
The parameters correspond to these fields in the user interface:
  • noIdMappingHigh Data Volume
  • searchFuncCustom Query Option for Salesforce Search
  • searchEnabledInclude in Salesforce Searches
  • formatFormat
  • timeoutConnection Timeout
endpoint string The server URL that exposes the remote data source. Corresponds to Server URL in the user interface.
label string A user-friendly name for the data source displayed in the Salesforce user interface, such as in list views.

Examples include Acme Team Marketing Site, or Acme SharePoint.

oauthRefreshToken string The refreshed OAuth token. Used to obtain new access tokens for an existing end user during a specified period.
oauthScope string The scope of the access token as a list of space-delimited strings for permission settings that specifies access to a specific user's data. Corresponds to Scope in the user interface.
oauthToken string The access token issued by your authorization server.
password string The password to be used by Salesforce to access the external source. Ensure that the credentials you use have adequate privileges to be able to access the data source, perform searches, and return information about the external data. Depending on how you set up access, you may need to provide the administrator password.
principalType External​PrincipalType(enumeration of type string) The identity type used to authenticate to the data source outside Salesforce. Corresponds to Identity Type in the user interface. The valid values are:
  • Anonymous
  • PerUser
  • NamedUser
protocol Authentication​Protocol(enumeration of type string) The protocol required to access the data source outside Salesforce. If your External Data Source is SharePoint, select Basic Authentication.The valid values are:
  • NoAuthentication
  • Oauth
  • Password
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) The type of data source you want to connect to. The valid values are:
  • Identity
  • OData
  • SimpleURL
username string The username to be used by Salesforce to access the external data source. Ensure that the credentials you use have adequate privileges for accessing the data source, performing searches, and returning information. Depending on how you set up access, you may need to provide the administrator username.
version string The version number of the data source you’re using.

Declarative Metadata Sample Definition

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