Tag Archives: salesforce

Loading Attachments

Q: How do I bulk-load a bunch of Attachments into Salesforce?

A: I’ve used the procedure below a few times.

  1. Create an attachments.csv file (the name of the file is unimportant) with the following column headers:
    • ParentId – ID of the record to which the attachment should be associated (Make sure you input the record ID here)
    • Name – Name of the attachment 
    • ContentType – Format of the extension (e.g. .xls, .pdf, etc) 
    • OwnerID – ID for the owner of the attachment (Make sure you input your User ID here – you can locate it following the path Setup->Manage Users->Users->Click on your name — your UserID is visible as part of the url in the address bar)
    • Body – File path to the Attachment on the local machine (C:\documents and settings\schun\desktop\attachments\file.xls)
  2. Log in to the Data Loader. 
  3. Select the “Insert” command. 
  4. In the ‘Select Salesforce Object’ step, select the ‘Show all Salesforce Objects’ checkbox and then select “Attachments”. 
  5. Choose the attachments.csv file. 
  6. In the mapping step, map the following fields:
    • Parent ID 
    • Name 
    • Content Type
    • Owner ID 
    • Body – Make sure to map the Body column which you created previously with the file extension. This is how you designate the file and location of the attachments to be inserted. 
  7. Click “OK” to proceed with the insert. It may take a few minutes but the attachments should be successfully uploaded to your salesforce org.

  • I strongly recommend setting your batch size to 1 before starting
  • Gotta love that the original instructions talk about “Sforce objects”. . . how 2010
  • Thanks to the people at Google for keeping this Google Group post active, long after the original Success link went dead
  • I keep meaning to rewrite this post thoroughly and cover Content as well as Documents, but, wow, it’s been 16 years and I still haven’t gotten to it ๐Ÿ™„

Make Salesforce Usernames Always Match Email Addys

Q: “I have lots of Salesforce logins. How do I make my username always match my email address?”

A: If you use Gmail, learn the power of pluses and periods!

Gmail tolerates extra characters in the email address. Let’s take the arbitrary email address datanerd@gmail.com. Emailing any of the following addresses will reach that recipient:

In a nutshell:

  1. Gmail addresses tolerate a plus sign followed by any sequence of letters, numbers, periods, and underscores after your username and before the @ symbol.
  2. Gmail addresses tolerate periods anywhere before the @ symbol.

Armed with this knowledge, I make each of my usernames match its email address–way less mental strain that way!


Another awesome benefit of this feature is it enables easy searching of emails.

Let’s say I have an org called “NewKillerApp”. If I put +NewKillerApp in the username and email address I use for this org, searching on “+NewKillerApp” in my Gmail turns up all the emails specifically related to that org.

Here are the full details (. . . from a 2008 Google post)

Thanks to former coworker Luis Botero for reminding me of this cool feature!