Explore data products from Salesforce Data Cloud¶
This topic describes how to list available Salesforce data products, mount them as catalog-linked databases, and query the shared data in Snowflake.
Before performing the steps in this topic:
- The Zerocopy Connector must be in
CONNECTEDstate. See Set up the Salesforce Data Cloud Zerocopy Connector. - Your Salesforce administrator must have created and linked at least one Data Share to the connector. See Set up Salesforce Data Cloud for Zero-Copy.
List shared data products¶
After your Salesforce administrator links a Data Share to the Snowflake V2 Data Share Target, call SYSTEM$ZEROCOPY_CONNECTOR_LIST_SHARES to see what’s available:
The function returns a JSON array. Each element represents one shared data product. The name field is the value you pass as SHARE_NAME or SHARE_NAME_FILTER when creating a catalog-linked database.
The status field indicates whether the data share is available to mount or already mounted:
| Status | Description |
|---|---|
UNMOUNTED | Shared by Salesforce Data Cloud. No catalog-linked database has been created yet. |
MOUNTED | A catalog-linked database exists for this share. |
To parse the output into a tabular format:
Create a catalog-linked database¶
Mounting a share creates a catalog-linked database that contains the shared data as queryable schemas. Snowflake automatically creates views on top of them.
You can mount using the Snowsight UI or SQL.
Using Snowsight¶
- In Snowsight, navigate to Ingestion » Zero-Copy.
- Select the Available connectors tab and click your Salesforce connector.
- On the Catalog linked databases tab, click Mount all data shares.
The catalog-linked database is created immediately.
Using SQL¶
To confirm the database was created:
Explore the data¶
Data model overview¶
When you mount a share, each data share appears as a schema within the catalog-linked database. Within each schema, Salesforce data objects are exposed as views.
Discover schemas and views¶
Note
Views are created shortly after the catalog-linked database is mounted. If SHOW VIEWS returns no results immediately, wait for 1 minute and try again.
Query the data¶
Query Salesforce data via the views in each schema. The view names are determined by what your Salesforce administrator included in the Data Share.
Replace my_sfdc_db, my_share_schema, and the view names with the actual values returned by SHOW SCHEMAS and SHOW VIEWS in your environment.
Create table as select (CTAS)¶
To persist query results as a native Snowflake table for use in dashboards, ML models, or data sharing:
Drop a catalog-linked database¶
All catalog-linked databases must be dropped before you can disconnect or drop the connector.
Catalog-linked databases do not support UNDROP.