| sf_retrieve {salesforcer} | R Documentation | 
Retrieve Records By Id
Description
![[Stable]](../help/figures/lifecycle-stable.svg) 
Retrieves one or more new records to your organization’s data.
Usage
sf_retrieve(
  ids,
  fields,
  object_name,
  api_type = c("REST", "SOAP", "Bulk 1.0", "Bulk 2.0"),
  guess_types = TRUE,
  control = list(...),
  ...,
  verbose = FALSE
)
Arguments
| ids | vector,matrix,data.frame, ortbl_df; if not a vector, there must be a column called Id (case
insensitive) that can be passed in the request.
 | 
| fields | character; one or more strings indicating the fields to be returned
on the records
 | 
| object_name | character; the name of the Salesforce object that the
function is operating against (e.g. "Account", "Contact", "CustomObject__c").
 | 
| api_type | character; one of"REST","SOAP","Bulk 1.0", or"Bulk 2.0"indicating which API to use when
making the request.
 | 
| guess_types | logical; indicating whether or not to usecol_guess()to try and cast the data returned in the recordset. IfTRUEthencol_guess()is used, ifFALSEthen all fields will be returned
as character. This is helpful whencol_guess()will mangle field values
in Salesforce that you'd like to preserve during translation into atbl_df,
like numeric looking values that must be preserved as strings ("48.0").
 | 
| control | 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 forsf_control.
 | 
| ... | arguments passed to sf_control | 
| verbose | logical; an indicator of whether to print additional
detail for each API call, which is useful for debugging. More specifically, when
set toTRUEthe URL, header, and body will be printed for each request,
along with additional diagnostic information where available.
 | 
Value
tibble
Examples
## Not run: 
n <- 3
new_contacts <- tibble(FirstName = rep("Test", n),
                       LastName = paste0("Contact", 1:n))
new_contacts_result <- sf_create(new_contacts, object_name="Contact")
retrieved_records <- sf_retrieve(ids=new_contacts_result$id,
                                 fields=c("LastName"),
                                 object_name="Contact")
## End(Not run)
[Package 
salesforcer version 1.0.1 
Index]