• Aasif Shabbir
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
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