sf_query_result_bulk_v1: Retrieve the results of a Bulk 1.0 query

View source: R/bulk-query.R

sf_query_result_bulk_v1R Documentation

Retrieve the results of a Bulk 1.0 query

Description

This function returns the row-level recordset of a Bulk 1.0 query which has already been submitted to Bulk API Job and has Completed state

Usage

sf_query_result_bulk_v1(
  job_id,
  batch_id = NULL,
  result_id = NULL,
  guess_types = TRUE,
  bind_using_character_cols = deprecated(),
  api_type = c("Bulk 1.0"),
  verbose = FALSE
)

Arguments

job_id

character; the Salesforce Id assigned to a submitted job as returned by sf_create_job_bulk. It will start with "750".

batch_id

character; the Salesforce Id assigned to a submitted batch as returned by sf_create_batches_bulk. It will start with "751".

result_id

character; a string returned from sf_batch_details_bulk when a query has completed and specifies how to get the recordset

guess_types

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").

bind_using_character_cols

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.

api_type

character; one of "REST", "SOAP", "Bulk 1.0", or "Bulk 2.0" indicating which API to use when making the request.

verbose

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.

Value

tbl_df, formatted by Salesforce, containing query results

References

Bulk 1.0 documentation

Examples

## Not run: 
my_query <- "SELECT Id, Name FROM Account LIMIT 1000"
job_info <- sf_create_job_bulk(operation = 'query', object = 'Account', api_type="Bulk 1.0")
query_info <- sf_submit_query_bulk(job_id = job_info$id, soql = my_query, api_type="Bulk 1.0")
result <- sf_batch_details_bulk(job_id = query_info$jobId,
                                batch_id = query_info$id)
recordset <- sf_query_result_bulk(job_id = query_info$jobId,
                                  batch_id = query_info$id,
                                  result_id = result$result)
sf_close_job_bulk(job_info$id, api_type="Bulk 1.0")

## End(Not run)

salesforcer documentation built on March 18, 2022, 6:26 p.m.