sf_query(
soql,
object_name = NULL,
queryall = FALSE,
guess_types = TRUE,
api_type = c("REST", "SOAP", "Bulk 1.0", "Bulk 2.0"),
control = list(...),
...,
page_size = deprecated(),
next_records_url = NULL,
bind_using_character_cols = deprecated(),
object_name_append = FALSE,
object_name_as_col = FALSE,
verbose = FALSE
)
character
; a string defining a SOQL query
(e.g. "SELECT Id, Name FROM Account").
character
; the name of the Salesforce object that the
function is operating against (e.g. "Account", "Contact", "CustomObject__c").
logical
; indicating if the query recordset should include records
that have been deleted because of a merge or delete. Setting this argument to
TRUE
will also return information about archived Task and Event records.
It is available in API versions 29.0 and later.
logical
; indicating whether or not to use col_guess()
to try and cast the data returned in the recordset. If TRUE
then
col_guess()
is used, if FALSE
then all fields will be returned
as character. This is helpful when col_guess()
will mangle field values
in Salesforce that you'd like to preserve during translation into a tbl_df
,
like numeric looking values that must be preserved as strings ("48.0").
character
; one of "REST"
, "SOAP"
,
"Bulk 1.0"
, or "Bulk 2.0"
indicating which API to use when
making the request.
list
; a list of parameters for controlling the behavior of
the API call being used. For more information of what parameters are available
look at the documentation for sf_control
.
arguments passed to sf_control
or further downstream
to sf_query_bulk
.
numeric
; a number between 200 and 2000 indicating the number of
records per page that are returned. Speed benchmarks should be done to better
understand the speed implications of choosing high or low values of this argument.
character
(leave as NULL); a string used internally
by the function to paginate through to more records until complete
logical
; an indicator of whether to
cast the data to all character columns to ensure that bind_rows
does not fail because two paginated recordsets have differing datatypes for the
same column. Set this to TRUE
rarely, typically only when having this
set to FALSE
returns an error or you want all columns in the data to be
character.
logical
; whether to include the object type
(e.g. Account or Contact) as part of the column names (e.g. Account.Name).
logical
; whether to include the object type
(e.g. Account or Contact) as a new column.
logical
; an indicator of whether to print additional
detail for each API call, which is useful for debugging. More specifically, when
set to TRUE
the URL, header, and body will be printed for each request,
along with additional diagnostic information where available.
tbl_df
of records
Bulk API query doesn't support the following SOQL:
COUNT
ROLLUP
SUM
GROUP BY CUBE
OFFSET
Nested SOQL queries
Relationship fields
Additionally, Bulk API can't access or query compound address or compound geolocation fields.
if (FALSE) {
sf_query("SELECT Id, Account.Name, Email FROM Contact LIMIT 10")
}