ExternalDataSource

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

All credentials stored within this entity are encrypted under a framework that is consistent with other encryption frameworks on the platform. Salesforce encrypts your credentials by auto-creating org-specific keys. Credentials encrypted using the previous encryption scheme are migrated to the new framework.

Note

Parent Type 

This type extends Metadata and inherits its fields.

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 

Introduced in API version 28.0.

Special Access Rules 

As of Spring ’20 and later, only authenticated internal and external users can access this type.

Fields 

authProvider 

  • Type: string
  • Required: No
  • Description: The authentication provider represented by the AuthProvider component.

certificate 

  • Type: string
  • Required: No
  • Description: 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 Salesforce org.

For best performance, verify that your remote HTTPS encrypted sites have OCSP (Online Certificate Status Protocol) stapling turned on.

Tip

customConfiguration 

  • Type: string

  • Required: No

  • Description: A string of configuration parameters that are specific to the external data source’s type.

    • customConfiguration for Salesforce Connect—Cross-Org Adapter
    • customConfiguration for Salesforce Connect—OData 2.0 or 4.0 Adapter
    • customConfiguration for Salesforce Connect—Custom Adapter

customHttpHeaders 

  • Type: CustomHttpHeader[]
  • Required: No
  • Introduced: API version 43.0
  • Description: Represents custom HTTP headers used with OData 2.0 or OData 4.0 connectors.

endpoint 

  • Type: string

  • Required: No

  • Description: The URL of the external system, or if that URL is defined in a named credential, the named credential URL. Corresponds to the URL in the user interface.

    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.

    You can append a query string to a named credential URL. Use a question mark (?) as the separator between the named credential URL and the query string. For example: callout:``My_Named_Credential``/``some_path``?format=json.

externalDataSrcDescriptors 

  • Type: ExternalDataSrcDescriptor[]
  • Required: No
  • Description: Represents schema descriptors for an external data source used with the Salesforce Connect adapter for Amazon DynamoDB (available in API version 55.0 or later) or Amazon Athena (available in API version 56.0 or later).

isWritable 

  • Type: boolean

  • Required: No

  • Introduced: API version 35.0

  • Description: Allows the Lightning Platform and users in this org to create, update, and delete records for external objects associated with the external data source. The external object data is stored outside the org. By default, external objects are read-only. Corresponds to Writable External Objects in the user interface.

    However, with the cross-org adapter for Salesforce Connect, you can set this field to true only in API version 39.0 and later.

label 

  • Type: string

  • Required: Yes

  • Description: A 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.

namedCredential 

  • Type: string
  • Required: No
  • Description: Represents the definition of the referenced named credential for an external data source of the type Amazon DynamoDB or Amazon Athena.

oauthRefreshToken 

  • Type: string
  • Required: No
  • Description: The OAuth refresh token. Used to obtain a new access token for an end user when a token expires.

oauthScope 

  • Type: string
  • Required: No
  • Description: Specifies the scope of permissions to request for the access token. Corresponds to the Scope in the user interface.

oauthToken 

  • Type: string
  • Required: No
  • Description: The access token issued by the external system.

password 

  • Type: string
  • Required: No
  • Description: The password your org uses to access the external system. Make sure 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 

  • Type: ExternalPrincipalType (enumeration of type string)
  • Required: Yes
  • Description: 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.
  • Possible values:
    • Anonymous
    • NamedCustomPrincipal
    • NamedUser
    • PerUser

protocol 

  • Type: AuthenticationProtocol (enumeration of type string)

  • Required: Yes

  • Description: The authentication protocol that’s required to access the external system.

    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.

  • Possible values:

    • NoAuthentication
    • Oauth
    • Password

repository 

  • Type: string
  • Required: No
  • Description: Used for SharePoint Online. If metadata isn’t accessible, use this field to create tables and default table fields.

type 

  • Type: ExternalDataSourceType (enumeration of type string)

  • Required: Yes

  • Introduced: API version 63.0

  • Description: Required. For Salesforce Connect, specifies the adapter that connects to the external system.

    • AmazonAthena—Amazon Athena
    • AmazonDynamoDB—Amazon DynamoDB
    • OData—OData 2.0 adapter
    • OData4—OData 4.0 adapter
    • SfdcOrg—cross-org adapter
    • ApexClassId—DataSource.Provider class that defines the custom adapter created via the Apex Connector Framework

    For Files Connect, specifies the data source type.

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

    For Digital Lending Configurator, the valid value is:

    For the federated search external data source type, the valid value is:

    For Transaction Management in Revenue Cloud,

    For SalesAgreement in Manufacturing Cloud,

    These values are reserved for internal use:

  • Possible values:

    • ContentHubSharepoint — SharePoint 2010 or 2013
    • ContentHubSharepointOffice365 — SharePoint Online
    • ContentHubSharepointOneDrive — OneDrive for Business
    • ContentHubGDrive — Google Drive
    • ContenHubIsotope — Isotope
    • outgoingemail — A data source used for sending an email through a quick action.
    • AFPPAttribute — The data source name for the Application Form Product Proposal Attribute virtual object.
    • OpenSearch
    • ASPAttribute — The data source name for the Asset State Period Attribute virtual object. Available in API version 63.0 and later.
    • OIAttribute — The data source name for the Order Item Attribute virtual object. Available in API version 63.0 and later.
    • QLIAttribute — The data source name for the Quote Line Item Attribute virtual object. Available in API version 63.0 and later.
    • SAPAttribute — The data source name for the SalesAgreement Product Attribute virtual object. Available in API version 60.0 and later.
    • AssetAttribute
    • ClaimAttributeDS
    • ClaimItemAttributeDS
    • CryptoTrEnvChgLogSnp
    • CtrtGrpPlnAttr
    • CtrtGrpPlnGrpClsAttr
    • FAAttribute
    • FLAttribute
    • IAItemProdtAttr
    • Identity
    • InsPolicyAttribute
    • IPAAttribute
    • IPCAttribute
    • IPCvrBnftAttribute
    • IPPAttribute
    • SdbOvenPODataSource
    • Wrapper

username 

  • Type: string
  • Required: No
  • Description: The user name that your org uses to access the external system. Make sure 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 

  • Type: string
  • Required: No
  • Description: Reserved for future use.

CustomHttpHeader Type 

Represents a custom HTTP header used with OData 2.0 or OData 4.0 connectors.

Version 

Introduced in API version 43.0.

Fields 

description 

  • Type: string
  • Required: No
  • Description: A text description of the header field’s purpose.

headerFieldName 

  • Type: string
  • Required: Yes
  • Description: Required. Name of the header field. The name must contain at least one alphanumeric character or underscore. It can also include these characters: ! # $ % & ' * + - . ^ _ | ~`.

headerFieldValue 

  • Type: string
  • Required: Yes
  • Description: Required. A formula that resolves to the value for the header. The values in the formula must evaluate to a string. If the formula resolves to null and an empty string, the header isn’t sent.

isActive 

  • Type: boolean
  • Required: No
  • Description: Indicates whether the custom HTTP header is available to use (true) or unavailable (false).

ExternalDataSrcDescriptor Type 

Parent Type 

This type extends Metadata and inherits its fields.

Fields 

customObject 

  • Type: string
  • Required: No

descriptor 

  • Type: string
  • Required: Yes

descriptorVersion 

  • Type: string
  • Required: No

developerName 

  • Type: string
  • Required: Yes
  • Description: The unique developer name of this component. Used as an API reference and must follow Salesforce identifier rules.

externalDataSource 

  • Type: string
  • Required: Yes

subtype 

  • Type: ExternalDataSrcDescSubtype (enumeration of type string)
  • Required: Yes

systemVersion 

  • Type: int
  • Required: Yes

type 

  • Type: ExternalDataSrcDescType (enumeration of type string)
  • Required: Yes

customConfiguration for Salesforce Connect—Cross-Org Adapter 

This 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:

  • apiVersion—API Version
  • environment—Connect to
  • searchEnabled—Enable Search
  • timeout—Connection Timeout

customConfiguration for Salesforce Connect—OData 2.0 or 4.0 Adapter 

This JSON-encoded configuration string defines parameters that apply when the external data source’s type is set to OData or OData4.

1{"inlineCountEnabled":"true","csrfTokenName":"X-CSRF-Token",
2"requestCompression":"false","pagination":"CLIENT",
3"noIdMapping":"false","format":"ATOM",
4"searchFunc":"","compatibility":"DEFAULT",
5"csrfTokenEnabled":"true","timeout":"120",
6"searchEnabled":"true"}

The parameters correspond to these fields in the user interface.

  • compatibility—Special Compatibility
  • csrfTokenEnabled—Cross-Site Request Forgery (CSRF) Protection
  • csrfTokenName—Anti-CSRF Token Name
  • format—Format
  • inlineCountEnabled—Request Row Counts
  • noIdMapping—High Data Volume
  • pagination—Server Driven Pagination
  • requestCompression—Compress Requests
  • searchEnabled—Enable Search
  • searchFunc—Custom Query Option for Salesforce Search
  • timeout—Connection Timeout

Declarative Metadata Sample Definition: OData 2.0 or 4.0

The following is the definition of an external data source for Salesforce 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 <customHttpHeaders>
10 <headerFieldName>X-User</headerFieldName>
11 <headerFieldValue>$User.Username</headerFieldValue>
12 </customHttpHeaders>
13 <endpoint>http://myappname.herokuapp.com/DataHub.svc</endpoint> 
14 <label>DataHub</label>
15 <principalType>NamedUser</principalType>
16 <protocol>Oauth</protocol>
17 <type>OData</type>
18</ExternalDataSource>

customConfiguration for Salesforce Connect—Custom Adapter 

This 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.

ExternalDataSrcDescriptors for Salesforce Connect Adapter for Amazon DynamoDB and for Amazon Athena 

Represents schema descriptors for an external data source used with the Salesforce Connect adapter. The schema descriptors are for Amazon DynamoDB (available in API version 55.0 or later) or Amazon Athena (available in API version 56.0 or later).

Field NameField TypeDescription
customObjectstringIf set, the external object associated with the descriptor.
descriptorstringRequired. The descriptor document that contains the metadata information.
descriptorVersionstringIf the external system supports schema versioning for the data source, the optional descriptor document version tracks the external system’s schema version. Several descriptors with different document versions can be active.
developerNamestringRequired. The unique name of the child-level setup entity.
externalDataSourcestringRequired. The name of the external data source associated with the descriptor.
subtypeExternalDataSrcDescSubtype (enumeration of type string)Required. The subtype of the descriptor.
Values are:
  • SchemaTableMetadata— Used to cache information about the external system.
  • SchemaTableQualifiers— Used to customize the data retrieval query to the external system.
systemVersionintRequired. The version that defines the descriptor format and provides compatibility with descriptor formats between Salesforce releases.
typeExternalDataSrcDescType (enumeration of type string)Required. The type of the descriptor.
Valid value:
  • Schema

Declarative Metadata Sample Definition: Amazon DynamoDB

The following is an example of an external data source for the Salesforce Connect adapter for Amazon DynamoDB that uses ExternalDataSrcDescriptor component.

1<?xml version="1.0" encoding="UTF-8"?>
2<ExternalDataSource xmlns="http://soap.sforce.com/2006/04/metadata">
3 <customConfiguration>{"timeout":"120"}</customConfiguration>
4 <externalDataSrcDescriptors>
5 <fullName>MyQualifierName</fullName>
6 <customObject>MyExternalObject__x</customObject>
7 <descriptor>
8 {
9 "tableName": "MyDynamoDBTable",
10 "columns": {
11 "MyField": {"presence": "exists"}
12 }
13 }
14 </descriptor>
15 <developerName>MyQualifierName</developerName>
16 <externalDataSource>MyDataSource</externalDataSource>
17 <subtype>SchemaTableQualifiers</subtype>
18 <systemVersion>0</systemVersion>
19 <type>Schema</type>
20 </externalDataSrcDescriptors>
21 <isWritable>true</isWritable>
22 <label>MyDataSource</label>
23 <namedCredential>MyNamedCredential</namedCredential>
24 <principalType>Anonymous</principalType>
25 <protocol>NoAuthentication</protocol>
26 <type>AmazonDynamoDb</type>
27</ExternalDataSource>

Declarative Metadata Sample Definition: Amazon Athena

The following is an example of an external data source for the Salesforce Connect adapter for Amazon Athena that uses ExternalDataSrcDescriptor component.

1<?xml version="1.0" encoding="UTF-8"?>
2<ExternalDataSource xmlns="http://soap.sforce.com/2006/04/metadata">
3 <customConfiguration>
4 {
5 "DataCatalog": "AwsDataCatalog",
6 "timeout": "120"
7 }
8 </customConfiguration>
9 <externalDataSrcDescriptors>
10 <fullName>MyAthenaQualifierName</fullName>
11 <customObject>MyAthenaExternalObject__x</customObject>
12 <descriptor>
13 {
14 "tableName": "myathenadatabase.myathenatable",
15 "extendedQualifiers": {"workgroup": "primary"},
16 "keyColumns": ["ExternalIdComponent", "OtherExternalIdComponent"]
17 }
18 </descriptor>
19 <developerName>MyAthenaQualifierName</developerName>
20 <externalDataSource>MyAthenaDataSource</externalDataSource>
21 <subtype>SchemaTableQualifiers</subtype>
22 <systemVersion>0</systemVersion>
23 <type>Schema</type>
24 </externalDataSrcDescriptors>
25 <isWritable>false</isWritable>
26 <label>MyAthenaDataSource</label>
27 <namedCredential>MyAthenaNamedCredential</namedCredential>
28 <principalType>Anonymous</principalType>
29 <protocol>NoAuthentication</protocol>
30 <type>AmazonAthena</type>
31</ExternalDataSource>

Wildcard Support in the Manifest File 

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.