• negan
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi Everyone,

Need to do a  bulk update in Salesforce. I've found the below code here and plan to use it. Please refer below. 

import csv
from salesforce_bulk import SalesforceBulk
from salesforce_bulk import CsvDictsAdapter

bulk = SalesforceBulk(username=username, password=password)
job = bulk.create_insert_job("bulk_up", contentType='CSV', concurrency='Parallel')
reader = csv.DictReader(open('bulk_up.csv'))
disbursals = []
for row in reader:
    disbursals.append(row)

csv_iter = CsvDictsAdapter(iter(disbursals))
batch = bulk.post_bulk_batch(job, csv_iter)
bulk.wait_for_batch(job, batch)
bulk.close_job(job)
print("Done. Data Uploaded.")

However, upon running it, i encountered an error below. I very new to python so please bare with me. I already installed the salesforce bulk package(pip install salesforce-bulk).
ImportError: cannot import name 'SalesforceBulk'

Also, please advise on where should i save the csv file that i'll be updating in salesforce. Many thanks!
  • April 05, 2017
  • Like
  • 0
I know there are some docs where its explained that but.
I have a csv for an custom object with 10000 records.
I want to upload this data to my org using bulk api.
I know there are tools are dataloader.io and apex data loader. but i want it as custom tool in python.
Thanks.
I know there are some docs where its explained that but.
I have a csv for an custom object with 10000 records.
I want to upload this data to my org using bulk api.
I know there are tools are dataloader.io and apex data loader. but i want it as custom tool in python.
Thanks.