function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Aasif ShabbirAasif Shabbir 

Unable to Upload test data to my SFDC dev instance via simple_salesforce.

Hi folks:

Im trying to upload a bunch of test opportunities to an account in our dev instance but Im not able to get any data to appear. Im using the python lib simple_salesforce (https://github.com/simple-salesforce/simple-salesforce) via the following code. The lib works great for querying data but I haven't had much success uploading opportunities. 
 
def generateTestData(sf_handle):
    load_data = pd.read_csv('qordata 10 opportunities.csv')
    bulk_data = []
    for row in load_data.itertuples():
        d = row._asdict()
        del d['Index']
        bulk_data.append(d)
    try:
        sf_handle.bulk.Opportunity.upsert(bulk_data,external_id_field='Name')
    except ValueError:
        print("We have a problem")
I have this csv file of opportunities that I want to add to the existing account Qordata but nothing gets added. 
User-added image

Any guidance would be much appreciated. 

thanks,
-aasif
 
Naveen KNNaveen KN
I see accountId in the data is not the salesforce id format, can you get any sample account id from your dev instance, update the data and try to insert the opportunities?