DatacloudContact SOQL Request and Response
When your Data.com Prospector or Data.com Clean contract expires, Data.com features, objects, and fields will be removed from your org. To support customers’ needs around compliance and to remain a leader in trust and privacy, Salesforce removed all contact data from the Data.com service on February 1, 2021.
For more information, see Data.com Prospector and Clean Retirement.
Use a SOQL request to search the Data.com database for contacts.
There is a 24-hour rolling quota on the number of API calls that you can make. Your organization gets 1,000 daily calls for every Data.com Prospector license purchased. For example, an organization with 10 prospector licenses has a daily limit of 10,000 Search API calls (1,000 x 10 = 10,000). Call quotas are implemented at the Salesforce organization level.
You can see how many records a query returns by using Count()
in the SELECT
clause. For details, see Count()
Used in SELECT
Clause.
When no LIMIT
is specified, queryMore() returns the entire response in 25-record chunks. You can scroll through the full set of results 25 records at a time.
A LIMIT
that’s set from 1 and 100 returns the actual number of records or the number of records equal to the LIMIT
value, whichever is fewer. This query returns only the first 75 records from a response that contains more than 1,000 records. A next page is not returned.
Specify a LIMIT
greater than or equal to the number of records in the response to scroll through large responses in 100-record chunks. For example, in a response with 1,900 records and a LIMIT
that’s set to 2,000, you can scroll through the complete response in chunks of 100 records. You can only scroll through as many records as are specified in the LIMIT
. If your LIMIT
is less than the number of records in the response, queryMore()
processes only the number of records that’s specified in the LIMIT
value.
You can also scroll through query results by using LIMIT
and OFFSET
in your SOQL statement.
-
LIMIT
: Specifies the number of results that are displayed per page. A LIMIT of 100 displays 100 records for each page of the results. -
OFFSET
: Specifies at which record the results start to display. An offset of 100 would start displaying results from the one hundred and first (101) record.
Use a LIMIT
clause in combination with OFFSET
if you need to retrieve subsequent subsets of the same result set. For example, retrieve the first 100 rows of a query using the following:
You could then retrieve the next 100 rows, 101 through 200, using the following query:
Keep incrementing the OFFSET
to scroll through all the results.
OFFSET
has a limit of 2000. Your query fails with an OFFSET
of 2001 or greater.
The maximum LIMIT
is 100. A query with a LIMIT
greater than 100 defaults to 100.
The Search API supports only one field expression clause for ORDER BY
. Entering more than one field expression clause for ORDER BY
causes an error.
We recommend that you use ORDER BY
on an appropriate field so that results are returned in a consistent order.
This example shows a SOQL response for this object.
After you submit your SOQL request by using the Data.com Search API, you get a response. This example shows a SOQL response for DatacloudContact. Each row in the table represents the requested information for a contact. The response contains the fields that you specified in the SELECT
statement.
ContactId | LastName | FirstName | Title | State | City | CompanyName | |
---|---|---|---|---|---|---|---|
1 | 13962651 | Cooney | Joe | ****** | VA | Fairfax | Zephyrus Relocation Services |
2 | 38724678 | Cooper | David | Product Sales Specialists | VA | Fairfax | Zephyrus Relocation Services |
3 | 19266707 | Cooper | David | ****** | VA | Fairfax | Zephyrus Relocation Services |
4 | 35023206 | Cooper | Gary | ****** | VA | Fairfax | Zephyrus Relocation Services |
5 | 7934165 | Cooper | Greg | ****** | VA | Fairfax | Zephyrus Relocation Services |
6 | 9547395 | Cooper | Martin | ****** | VA | Fairfax | Zephyrus Relocation Services |
7 | 8129174 | Cooper | Sheila | ****** | VA | Fairfax | Zephyrus Relocation Services |
8 | 6897227 | Cooper | Tom | ****** | VA | Fairfax | Zephyrus Relocation Services |
9 | 36158568 | Cope | John | ****** | VA | Fairfax | Zephyrus Relocation Services |
10 | 19263430 | Copenhagen | Mark | ****** | VA | Fairfax | Zephyrus Relocation Services |
11 | 9278391 | Copestake | Richard | ****** | VA | Fairfax | Zephyrus Relocation Services |
12 | 16335152 | Copere | Diana | ****** | VA | Fairfax | Zephyrus Relocation Services |
13 | 46303838 | Corbett | Ted | ****** | VA | Fairfax | Zephyrus Relocation Services |
14 | 22203066 | Corbett | Vince | ****** | VA | Fairfax | Zephyrus Relocation Services |
15 | 34429799 | Corcoran | Stella | ****** | VA | Fairfax | Zephyrus Relocation Services |
The values for some of the fields are hidden until you purchase the record. Fields that are hidden are listed in this table.
Field | Example of Hidden Value |
---|---|
Email | ******@example.com |
Phone | +***.***.**** |
Street | ****** |
Title | ******* |
ContactId | LastName | FirstName | Title | State | City | CompanyName | |
---|---|---|---|---|---|---|---|
1 | 13962651 | Cooney | Joe | Controller | VA | Fairfax | Zephyrus Relocation Services |
2 | 38724678 | Cooper | David | Product Sales Specialists | VA | Fairfax | Zephyrus Relocation Services |
3 | 19266707 | Cooper | David | Relocation Specialist | VA | Fairfax | Zephyrus Relocation Services |
4 | 35023206 | Cooper | Gary | Director Manufacturing Emtg | VA | Fairfax | Zephyrus Relocation Services |
5 | 7934165 | Cooper | Greg | Information Technology Manager | VA | Fairfax | Zephyrus Relocation Services |
6 | 9547395 | Cooper | Martin | Consulting Relocation Specialist-Enterprise | VA | Fairfax | Zephyrus Relocation Services |
7 | 8129174 | Cooper | Sheila | Channel Account Manager | VA | Fairfax | Zephyrus Relocation Services |
8 | 6897227 | Cooper | Tom | Operations Manager | VA | Fairfax | Zephyrus Relocation Services |
9 | 36158568 | Cope | John | Relocation Specialist | VA | Fairfax | Zephyrus Relocation Services |
10 | 19263430 | Copenhagen | Mark | Relocation Specialist | VA | Fairfax | Zephyrus Relocation Services |
11 | 9278391 | Copestake | Richard | Quality Program Manager | VA | Fairfax | Zephyrus Relocation Services |
12 | 16335152 | Copere | Diana | Business Pgm Manager | VA | Fairfax | Zephyrus Relocation Services |
13 | 46303838 | Corbett | Ted | Senior Director-Remote Operations Services | VA | Fairfax | Zephyrus Relocation Services |
14 | 22203066 | Corbett | Vince | Relocation Specialist | VA | Fairfax | Zephyrus Relocation Services |
15 | 34429799 | Corcoran | Stella | Channel Account Manager | VA | Fairfax | Zephyrus Relocation Services |
These logical operators are supported in SOQL queries with the DatacloudContact object.
This table lists the fields that you can use with specific logical operators to construct your SOQL query.
Field | = | != | < | <= | > | >= | LIKE | IN | NOT IN | ORDER BY |
---|---|---|---|---|---|---|---|---|---|---|
City (1,2) | √ | √ | √ | √ | ||||||
CompanyId | √ | √ | ||||||||
CompanyName (1,2) | √ | √ | √ | √ | √ | √ | ||||
ContactId | √ | √ | ||||||||
Country (2) | √ | √ | √ | |||||||
Department | √ | √ | ||||||||
Email (1) | √ | √ | √ | |||||||
FirstName (1) | √ | √ | √ | |||||||
IsInactive | √ | √ | √ | √ | ||||||
LastName (1,2) | √ | √ | √ | √ | ||||||
Level | √ | √ | ||||||||
State (2) | √ | √ | √ | |||||||
Title (1,2) | √ | √ | √ | √ | √ | √ | ||||
Zip(1) | √ | √ | √ |
1 Be aware that when you use the LIKE
operator in a query, wildcards are implicitly used.
2 ORDER BY
accepts only one field.
Here are some tips on how logical operators work with fields in DatacloudContact queries.
The Datacloud objects directly query the Data.com database cache. The queries are passed directly to Data.com. Some of the fields and logical operators for Datacloud objects execute queries differently than standard Salesforce Object Query Language (SOQL) operators and standard objects do. Query results can differ from expected. The following sections provide tips and examples about how the logical operators work with fields on the DatacloudContact Object.
The string (for example, 'Boston'
) must be enclosed in single quotation marks.
-
=
Searches for the exact string provided. For example:
The equal sign is a literal string operator. The string for this operator is passed to Data.com exactly as it is entered. Entering extraneous information can cause unpredictable responses.
-
LIKE
Automatically does a fuzzy search. Some common misspellings, inadvertent omissions, and other typographical errors can return the desired results. For example:
-
IN
Searches for the exact string provided. You can search on a comma-separated list. For example:
Wild cards are not accepted. The string enclosed in single quotation marks is treated as literal.
-
ORDER BY
Orders the results of a query by the City field. You can have only one field for
ORDER BY
. You can indicate ascending (ASC) or descending (DESC) order. If you do not specify an order, the results are returned in random order. For example:
CompanyId
is type string. The value must be enclosed in single quotation marks. Search on a single value or a comma-separated list of values.
-
=
Searches for a single numeric value or list of comma-separated values enclosed in single quotation marks. The string enclosed in single quotation marks is treated as a literal.
The equal sign is a literal string operator. The string for this operator is passed to Data.com exactly as it is entered. Entering extraneous information can cause unpredictable responses.
-
IN
Searches for a string that represents a unique number that identifies the company in the Data.com database. It must be enclosed in single quotation marks nested in parentheses. You can search on a comma-separated list.
Searches for a string that represents the name of a country. The string enclosed in single quotation marks is treated as a literal string. For example:
-
=
The equal sign is a literal string operator. The string for this operator is passed to Data.com exactly as it is entered. Entering extraneous information can cause unpredictable responses.
-
!=
Excludes the string from the search.
-
LIKE
Does a fuzzy search on the entered string.
-
IN
Searches for a string that represents the name of a company. It must be enclosed in single quotation marks nested in parentheses. You can search on a comma-separated list.
-
NOT IN
Excludes a string that represents a company name. Partial names do not need wild cards. The string you are excluding must be enclosed in single quotation marks nested in parentheses.
-
ORDER BY
You can specify ascending (ASC) or descending (DESC) order. You can specify only one
ORDER BY
field.
-
=
Searches for a string that represents a unique numeric identifier for a contact.
The equal sign is a literal string operator. The string for this operator is passed to Data.com exactly as it is entered. Entering extraneous information can cause unpredictable responses.
-
IN
Searches for a string that represents a unique numeric identifier for a contact. You can search on a comma-separated list. The string you are searching on must be enclosed in single quotation marks nested in parentheses.
-
=
Searches for a string that represents the name of a country.
The equal sign is a literal string operator. The string for this operator is passed to Data.com exactly as it is entered. Entering extraneous information can cause unpredictable responses.
-
IN
Searches for a string that represents the name of a country. It must be enclosed in single quotation marks nested in parentheses.
-
ORDER BY
You can specify ascending (ASC) or descending (DESC) order. You can specify only one
ORDER BY
field.
-
!=
Excludes the entered string from the search. A single wildcard is accepted.
The not-equal expression is a literal string operator. The string for this operator is passed to Data.com exactly as it is entered. Entering extraneous information can cause unpredictable responses.
-
LIKE
Does a fuzzy search on the entered string. All text before and after the entered string is valid.
-
NOT IN
Excludes the entered string from the search.
-
!=
Excludes the entered string from the search. A single wildcard is accepted.
-
LIKE
Does a fuzzy search on the entered string. All text before and after the entered string is valid.
-
NOT IN
Excludes the entered string from the search.
-
!=
Excludes the entered string from the search. A single wildcard is accepted.
-
LIKE
Does a fuzzy search on the entered string. All text before and after the entered string is valid.
-
NOT IN
Excludes the entered string from the search.
-
ORDER BY
Orders the results of a query by the
LastName
. You can indicate ascending (ASC) or descending (DESC) order.
-
=
A standard two-letter abbreviation that represents states or provinces in countries.
The equal sign is a literal string operator. The string for this operator is passed to Data.com exactly as it is entered. Entering extraneous information can cause unpredictable responses.
-
IN
A standard two-letter abbreviation that represents states or provinces in countries. You must enclose each state abbreviation in single quotation marks nested in parentheses. You can use a comma-separated list.
-
ORDER BY
Orders the results of a query by the
State
field. You can indicate ascending (ASC) or descending (DESC) order.
-
=
The equal sign is a literal string operator. The string for this operator is passed to Data.com exactly as it is entered. Entering extraneous information can cause unpredictable responses.
-
!=
Excludes the entered string from the search.
-
LIKE
A string that represents the human resources title of the contact. The
LIKE
operator does a fuzzy search. -
IN
A human resource designate title for the contact. You must enclose each string in single quotation marks nested in parentheses. You can use a comma-separated list.
-
NOT IN
Excludes the entered string from the search.
-
ORDER BY
Orders the results of a query by the indicated field. You can indicate ascending (ASC) or descending (DESC) order.
-
!=
Exclude a numeric string that represents a postal ZIP code area.
-
LIKE
Searches for a numeric string that represents a complete or partial postal code. Partial postal codes do not need wild cards.
-
NOT IN
Exclude a numeric string that represents a postal ZIP code area. The string you are excluding must be enclosed in single quotation marks nested in parentheses.