Чтобы получить всю таблицу в Excel, я запускаю этот скрипт.Вам нужно будет добавить свои данные для входа и имя таблицы.
import csv
from simple_salesforce import Salesforce
"""
Downloading the table
"""
# Logging in to SF and creating object
sf = Salesforce(
password='{{password}}', username='{{uName}}',
security_token='{{token}}',
client_id='TestingApp')
# Getting the field names
tableInfo = sf.{{tableName}}.describe()
tableFields = []
for x in tableInfo['fields']:
tableFields.append(x['name'])
hdrs = ', '.join(tableFields)
output = sf.query_all("SELECT " + hdrs + " FROM {{tableName}}")
headline = []
for key in output['records'][0]:
headline.append(key)
with open('C:\\temp\\Table.csv', 'w', newline='', encoding='utf-8') as csvfile:
writer = csv.DictWriter(csvfile, fieldnames = headline)
writer.writeheader()
for record in output['records']:
writer.writerow(record)