我刚刚发现了force cli工具。如何查询2000条以上的记录?
我让它用于查询,但它只返回2000,我需要将它们全部获取。
force query select Id, Name from Custom_Object__c --format:csv > custom.csv这个文件有大约10,000条记录,而我只能获得前2000条记录。cli工具的文档没有提到太多细节,但是它比我使用的R使用RForcecom库的工具要快得多
发布于 2017-01-28 04:05:46
您所需要做的就是使用RForcecom包中的bulkQuery函数。示例:
all_leads <- "SELECT Id FROM Lead WHERE CreatedDate < TODAY"
rforcecom.bulkQuery(rforce_session, all_leads,object="Lead") -> all_leads_df为今天之前的Lead中的所有内容选择Id。我需要大约一分钟的时间来做大约700k行。
发布于 2019-09-17 08:02:22
包可以通过Bulk1.0API快速查询数百万条记录。下面是一个返回Contact对象上所有记录和字段的示例:
library(tidyverse)
library(salesforcer)
sf_auth(username, password, security_token)
# get all the fields on the Contact object (remove compound fields which
# are not queryable via the Bulk API.
# https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/compound_fields.htm
contact_fields <- sf_describe_object_fields('Contact') %>%
filter(type != 'address', !grepl('Latitude|Longitude', name))
# build the SOQL
all_soql <- sprintf("SELECT %s FROM Contact",
paste(contact_fields$name, collapse=","))
# query the records and fields
all_records <- sf_query(all_soql, "Contact", api_type="Bulk 1.0")
all_records
#> # A tibble: 2,039,230 x 58
#> Id IsDeleted MasterRecordId AccountId ...
#> <chr> <lgl> <lgl> <lgl>
#> 1 0033s00000wycyeAAA FALSE NA NA
#> 2 0033s00000wycyjAAA FALSE NA NA
#> 3 0033s00000wycyoAAA FALSE NA NA
#> # ...https://stackoverflow.com/questions/36719684
复制相似问题