Simple query
The simple query syntax that can be used to retrieve custom object records through the List records for a custom object API operation.
Field Existence
Check existence of a field by querying with _exists_:[FieldName].
-
Search for custom fields data where the
titlefield has non-null value (the field exists and the value of it is not null).
Field Equality
Check whether the value of a field equals to a certain value by querying with [FieldName]:[ExpectedValue]
-
Search for custom fields data with field
statusisactive. -
Search for custom fields data with field
authoridentical to phrase"john smith".
Ranges
Ranges can be specified for date and numeric fields. See the following statement syntax:
- Less than:
[FieldName]:<[Upperbound] - Less than or equal to:
[FieldName]:<=[Upperbound] - Greater than:
[FieldName]:>[Lowerbound] - Greater than or equal to:
[FieldName]:>=[Lowerbound]
Number
-
Search for custom fields data with field
ageless than5.
Date
When you query with ranges for date fields, you must use the \ (backslash) as an escape character for every colon (\:) in the date bounds as colon (:) is an operator in the query syntax.
-
Search for custom fields data with field
activeDateless than2018-01-01T00:00:00.001Z. -
Search for custom fields data with field
activeDateless than2018-01-01T00:00:00Z. -
Search for custom fields data with field
activeDateless than2018-01-01T00:00:00-08:00. -
Search for custom fields data with field
activeDateless than2018-01-01. -
Search for custom fields data with field
activeDateless than2018-01(same as2018-01-01). -
Search for custom fields data with field
activeDateless than2018(same as2018-01-01). -
Search for custom fields data with field
activeDateless than1514764800000(2018-01-01in milliseconds).
Note:
-
Range query by a number on a date field compares field values as a timestamp in milliseconds except that the number is a 4-digit number. In that case, the field values will be considered as the value of a year.
activeDate:<1will return custom fields data withactiveDateless than1970-01-01T00:00:00.001Z (0000000000001).activeDate:<2001will return custom fields data withactiveDateless than2001-01-01.
-
Range query by date only (without time) on date field with full date (with time) compares only their date part.
activeDate:>2018will not return custom fields data withactiveDatehas value2018-01-01T23:59:59Zsince their dates are equal. But it will return custom fields data withactiveDateis2018-01-02.
-
Range query by year only works the same as by the first day of that year. Range query by year-month works the same as by the first day of the month.
activeDate:>2018works the same asactiveDate:>2018-01-01.activeDate:>2018-05works the same asactiveDate:>2018-05-01.
-
Range query by full date (with time) on date field with date only (without time) will assume the time of the date field is
00:00:00.000Z.activeDate:<2018-01-01T00\:00\:00.001Zwill return custom fields data withactiveDatevalue as2018-01-01.