Salesforce Pack Documentation
Share
Explore

icon picker
SOQL

Salesforce Object Query Language (SOQL)
info

What is SOQL ?

Salesforce has its own version of SQL for running queries across its database that’s referred to as SOQL. Coda needs to use this query language in all of the lookup-type formulas.
This is used for the filter parameter. If you’re looking at Salesforce specific documentation on the web or on the Salesforce website, this is what goes in the WHERE clause. For Coda formulas, this goes in the filter parameter.
The following is a basic structure of a SOQL statement.
Name Operator 'Value'
The Name is the unique identifier for a field.
The Label is the readable version My Custom Field, but the Field Name might be My_Custom_Field__c
The Operator is the comparison used to evaluate the value against. <, >, =, etc.
The Value is what you’re trying to find in the data.
The value needs to be wrapped in single quotes ' ' for Salesforce SOQL to know it’s the value part of the clause.
Name 1 Operator 'Value 1' Logical Operator Name 2 Operator 'Value 2'
A logical operator that lets you combine multiple expressions. AND, OR, etc.
As a Coda formula, this looks like
Concatenate("My_Custom_Field__c = '",[User ID],"'")
💡 Check out the page to play with more examples
clipboard

Use SOQL, pack formulas prefixed with Lookup, when you know which objects the data resides in, and you want to:
Retrieve data from a single object or from multiple objects that are related to one another.
Count the number of records that meet specified criteria.
Sort results as part of the query.
Retrieve data from number, date, or checkbox fields.

Operator Types

1
2
3
4
Type
Salesforce Documentation
Comparison
Logical
Date
Special Chars
There are no rows in this table
Operators
0
Type
Description
Operator
Search
Comparison
11
Logical
3
Date
44
Special Chars
2
=
!=
<
<=
>
>=
LIKE
IN
NOT IN
INCLUDES
EXCLUDES
AND
OR
NOT
YESTERDAY
TODAY
TOMORROW
LAST_WEEK
THIS_WEEK
NEXT_WEEK
LAST_MONTH
THIS_MONTH
NEXT_MONTH
LAST_90_DAYS
NEXT_90_DAYS
LAST_N_DAYS:n
NEXT_N_DAYS:n
N_DAYS_AGO:n
NEXT_N_WEEKS:n
LAST_N_WEEKS:n
N_WEEKS_AGO:n
NEXT_N_MONTHS:n
LAST_N_MONTHS:n
N_MONTHS_AGO:n
THIS_QUARTER
LAST_QUARTER
NEXT_QUARTER
NEXT_N_QUARTERS:n
LAST_N_QUARTERS:n
N_QUARTERS_AGO:n
THIS_YEAR
LAST_YEAR
NEXT_YEAR
NEXT_N_YEARS:n
LAST_N_YEARS:n
N_YEARS_AGO:n
THIS_FISCAL_QUARTER
LAST_FISCAL_QUARTER
NEXT_FISCAL_QUARTER
NEXT_N_FISCAL_​QUARTERS:n
LAST_N_FISCAL_​QUARTERS:n
N_FISCAL_QUARTERS_AGO:n
THIS_FISCAL_YEAR
LAST_FISCAL_YEAR
NEXT_FISCAL_YEAR
NEXT_N_FISCAL_​YEARS:n
LAST_N_FISCAL_​YEARS:n
N_FISCAL_YEARS_AGO:n
%
_

Share
 
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.