Newer Version Available

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

CdpQuery Class

Get Salesforce Customer Data Platform (CDP) metadata and query Salesforce CDP data.

Namespace

ConnectApi

CdpQuery Methods

The following are methods for CdpQuery. All methods are static.

getAllMetadata()

Get all Salesforce CDP metadata, including Calculated Insights, Engagement, Profile, and other objects, as well as their relationships to other objects.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryMetadataOutput getAllMetadata()

getInsightsMetadata()

Get Salesforce CDP Insight metadata, including Calculated Insight objects, their dimensions and measures.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryMetadataOutput getInsightsMetadata()

getInsightsMetadata(ciName)

Get metadata for a Salesforce CDP Calculated Insight object. Metadata includes dimensions and measures.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryMetadataOutput getInsightsMetadata(String ciName)

Parameters

ciName
Type: String
Name of the Calculated Insight object, for example, IndividualChildrenCount__cio.

getProfileMetadata()

Get Salesforce CDP metadata for data model objects in the profile category, including Individual, Contact Point Email, Unified Individual, and Contact Point Address objects. Metadata includes the objects, their fields, and category.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryMetadataOutput getProfileMetadata()

getProfileMetadata(dataModelName)

Get Salesforce CDP metadata for a data model object in the profile category, such as Individual, Contact Point Email, Unified Individual, and Contact Point Address. Metadata includes the list of fields, data types, and indexes available for lookup.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryMetadataOutput getProfileMetadata(String dataModelName)

Parameters

dataModelName
Type: String
Name of the data model object, for example, UnifiedIndividual__dlm.

queryANSISql(input)

Synchronously query Salesforce CDP data across data model, lake, unified, and linked objects. This query returns up to 4,999 rows.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput queryANSISql(ConnectApi.CdpQueryInput input)

Parameters

input
Type: ConnectApi.CdpQueryInput
A ConnectApi.CdpQueryInput body with the SQL query.

Return Value

Type: ConnectApi.CdpQueryOutput

queryCalculatedInsights(ciName, dimensions, measures, orderby, filters, batchSize, offset)

Query a Salesforce CDP Calculated Insight object.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput queryCalculatedInsights(String ciName, String dimensions, String measures, String orderby, String filters, Integer batchSize, Integer offset)

Parameters

ciName
Type: String
Name of the Calculated Insight object, for example, IndividualChildrenCount__cio.
dimensions
Type: String
Comma-separated list of up to 10 dimensions, such as GenderId__c, to project. If unspecified, this parameter includes all of the available dimensions.
measures
Type: String
Comma-separated list of up to 5 measures, such as TotalSales__c, to project. If unspecified, this parameter includes all of the available measures.
orderby
Type: String
Sort order for the result set, such as GenderId__c ASC,​Occupation__c DESC. If unspecified, items are returned in the order they are retrieved.
filters
Type: String
Filter the result set to a more narrow scope or specific type, such as [GenderId__c=Male,​FirstName__c=Angel].
batchSize
Type: Integer
Number of items to return. Values are from 1–4,999. If unspecified, the default value is 4999.
offset
Type: Integer
Number of rows to skip before returning results. If unspecified, no rows are skipped.

Return Value

Type: ConnectApi.CdpQueryOutput

queryProfileApi(dataModelName, filters, fields, batchSize, offset, orderby)

Query a Salesforce CDP Profile data model object using filters.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput queryProfileApi(String dataModelName, String filters, String fields, Integer batchSize, Integer offset, String orderby)

Parameters

dataModelName
Type: String
Name of the data model object, for example, UnifiedIndividual__dlm.
filters
Type: String
Comma-separated list of equality expressions within square brackets, for example, [FirstName__c=DON].
fields
Type: String
Comma-separated list of up to 50 field names that you want to include in the result, for example, Id__c,FirstName__c,​GenderId__c,Occupation__c. If unspecified, an arbitrary set of fields is returned.
batchSize
Type: Integer
Number of items to return. Values are from 1–4,999. If unspecified, the default value is 100.
offset
Type: Integer
Number of rows to skip before returning results. If unspecified, no rows are skipped.
orderby
Type: String
Sort order for the result set, such as GenderId__c ASC,​Occupation__c DESC. If unspecified, items are returned in the order they are retrieved.

Return Value

Type: ConnectApi.CdpQueryOutput

queryProfileApi(dataModelName, id, searchKey, filters, fields, batchSize, offset, orderby)

Query a Salesforce CDP Profile data model object using filters and a search key.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput queryProfileApi(String dataModelName, String id, String searchKey, String filters, String fields, Integer batchSize, Integer offset, String orderby)

Parameters

dataModelName
Type: String
Name of the data model object, for example, UnifiedIndividual__dlm.
id
Type: String
Value of the primary or secondary key field, for example, John. If unspecified, defaults to the value of the primary key field.
searchKey
Type: String
If a field other than the primary key is used, name of the key field, for example, FirstName__c.
filters
Type: String
Comma-separated list of equality expressions within square brackets, for example, [FirstName__c=DON].
fields
Type: String
Comma-separated list of up to 50 field names that you want to include in the result, for example, Id__c,FirstName__c,​GenderId__c,Occupation__c. If unspecified, an arbitrary set of fields is returned.
batchSize
Type: Integer
Number of items to return. Values are from 1–4,999. If unspecified, the default value is 100.
offset
Type: Integer
Number of rows to skip before returning results. If unspecified, no rows are skipped.
orderby
Type: String
Sort order for the result set, such as GenderId__c ASC,​Occupation__c DESC. If unspecified, items are returned in the order they are retrieved.

Return Value

Type: ConnectApi.CdpQueryOutput

queryProfileApi(dataModelName, id, childDataModelName, searchKey, filters, fields, batchSize, offset, orderby)

Query a Salesforce CDP Profile data model object and a child object using filters and a search key.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput queryProfileApi(String dataModelName, String id, String childDataModelName, String searchKey, String filters, String fields, Integer batchSize, Integer offset, String orderby)

Parameters

dataModelName
Type: String
Name of the data model object, for example, UnifiedIndividual__dlm.
id
Type: String
Value of the primary or secondary key field, for example, John. If unspecified, defaults to the value of the primary key field.
childDataModelName
Type: String
Name of the child data model object, for example, UnifiedContactPointEmail__dlm.
searchKey
Type: String
If a field other than the primary key is used, name of the key field, for example, FirstName__c.
filters
Type: String
Comma-separated list of equality expressions within square brackets, for example, [FirstName__c=DON]. Filters are applied to the parent object only.
fields
Type: String
Comma-separated list of child object field names that you want to include in the result, for example, Id__c,EmailAddress__c. If unspecified, the first 10 alphabetically sorted fields are returned.
batchSize
Type: Integer
Number of items to return. Values are from 1–4,999. If unspecified, the default value is 100.
offset
Type: Integer
Number of rows to skip before returning results. If unspecified, no rows are skipped.
orderby
Type: String
Sort order for the result set, such as GenderId__c ASC,​Occupation__c DESC. If unspecified, items are returned in the order they are retrieved.

Return Value

Type: ConnectApi.CdpQueryOutput

queryProfileApi(dataModelName, id, ciName, searchKey, dimensions, measures, filters, fields, batchSize, offset, orderby)

Query a Salesforce CDP Profile data model object and a Calculated Insight object using filters and a search key.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput queryProfileApi(String dataModelName, String id, String ciName, String searchKey, String dimensions, String measures, String filters, String fields, Integer batchSize, Integer offset, String orderby)

Parameters

dataModelName
Type: String
Name of the data model object, for example, UnifiedIndividual__dlm.
id
Type: String
Value of the primary or secondary key field, for example, John. If unspecified, defaults to the value of the primary key field.
ciName
Type: String
Name of the Calculated Insight object, for example, IndividualChildrenCount__cio.
searchKey
Type: String
If a field other than the primary key is used, name of the key field, for example, FirstName__c.
dimensions
Type: String
Comma-separated list of up to 10 dimensions, such as GenderId__c, to project. If unspecified, this parameter includes all of the available dimensions.
measures
Type: String
Comma-separated list of up to 5 measures, such as TotalSales__c, to project. If unspecified, this parameter includes all of the available measures.
filters
Type: String
Comma-separated list of equality expressions within square brackets, for example, [FirstName__c=DON].
fields
Type: String
Comma-separated list of up to 50 field names that you want to include in the result, for example, Id__c,FirstName__c,​GenderId__c,Occupation__c. If unspecified, an arbitrary set of fields is returned.
batchSize
Type: Integer
Number of items to return. Values are from 1–4,999. If unspecified, the default value is 100.
offset
Type: Integer
Number of rows to skip before returning results. If unspecified, no rows are skipped.
orderby
Type: String
Sort order for the result set, such as GenderId__c ASC,​Occupation__c DESC. If unspecified, items are returned in the order they are retrieved.

Return Value

Type: ConnectApi.CdpQueryOutput