Both Python and salesforce are beginners.
Thank you for your cooperation.
I want to list the data retrieved by throwing a query from python to salesforce.
Eventually, I want to do csv output from the list
I'll give you the code for groping.
q=a.sf.query("SELECT AccountCode__C, ID FROM Account Limit 3000")
cnt=q ['totalSize']
with open(csv_dir, 'w', encoding='utf_8') asf:
writer=csv.writer(f, delimiter='\t', lineterminator='\n')
val = [[x['AccountCode__c', x['Id']]] for x in q['records']]]
for i in range (cnt):
line=[val[i][0], val[i][1]]
writer.writerow (line)
As you advised me, I was able to get all the items in query_all(...)
as below.
query_all(...)
includes deleted data, so if you want to omit deleted data,
Optional include_deleted=False
to exclude it.
q=a.sf.query_all("SELECT AccountCode_C, ID FROM Account Limit 3000", include_deleted=False)
© 2024 OneMinuteCode. All rights reserved.