Salesforce Connect Adapter
Whenever an External Object is accessed, the adapter creates a SQL query, executes the query in Snowflake via a REST API call, and translates the result back into Salesforce data types.
Salesforce Connect provides a very powerful and comprehensive integration mechanism for external datasets into Salesforce. However, External Objects do not offer identical functionality to regular Objects and Custom Objects.
To understand the differences, the following document outlines all of the considerations when using Salesforce Connect: https://help.salesforce.com/articleView?id=platform_connect_considerations.htm
The below diagram outlines how the Salesforce Connect adapter fits between Salesforce and your Snowflake data.
Example use cases are:
- Displaying a list of related records on a Salesforce object page
- Displaying the field values of individual records
- Creating reports using standard Salesforce reporting functionality
- Incorporating data from Snowflake into Salesforce Flows
- Incorporating data from Snowflake into Einstein chatbot reponses
Supported Data Types
Per the documentation, the following data types are supported by Salesforce Connect:
|Salesforce Data type||Description|
|EXTERNAL_LOOKUP_TYPE||External lookup relationship|
|INDIRECT_LOOKUP_TYPE||Indirect lookup relationship|
|STRING_LONG_TYPE||Long text area|
The following table describes the current mapping between Snowflake data types and Salesforce.
|Snowflake||Corresponding Salesforce type|
|NUMBER||NUMBER_TYPE if the precision is < 18, otherwise STRING_SHORT_TYPE|
|FLOAT||Floating point numbers are not supported by Apex, but the adapter converts them to STRING_SHORT_TYPE to allow them to be displayed.
For proper treatment as a number, the Snowflake type NUMBER should be used instead.
|VARCHAR||STRING_SHORT_TYPE if the max length is <255, otherwise STRING_LONG_TYPE|
|BOOLEAN||STRING_SHORT_TYPE. Although Salesforce has a Boolean data type, it does not permit null values. So a text type is used, with '0', '1' representing False and True.|
|DATE||Dates are not supported by Salesforce Connect, but the adapter converts to DATETIME_TYPE (at midnight) for convenience.
This makes them usable but potentially misleading.