View cart ( - ) | Customer Service & Support Login
Salesforce Blog
Salesforce: Insert Null Values Using Data Loader and Bulk API
December 3rd, 2009

I learned something new today and thought it should be passed on. In an earlier post I wrote about how the Data Loader will not insert null values when using the Bulk API. It turns out that the API will insert null values but you need to use the text "#N/A" as the value instead of leaving the value blank.

Install the 30-day free trial of the Birthday Reminder for Salesforce
» Stay Informed: See "All" or "My" Contact birthdays.
» Unobtrusive Design: Fits nicely inside the sidebar.
» Great Price: One payment of only $99.00 USD.
Get It Now!
Install the 30 day trial

So, in the CSV file you would normally use for the Data Loader you would enter "#N/A" for all empty cells in the file. This will ensure that the existing data in Salesforce is over-written with an empty (or null) value. Please see the illustrations below:

Instead of empty cells:
 
Populate cells with "#N/A":

I'm sure you're thinking that this will simply populate any field with the actual text "#N/A" but it doesn't. It leaves the field empty after the data is loaded.

Try it out. It should make using the Bulk API via the Data Loader even more appealing.
-greg


Greg Hacic

The Links Tab
Birthday Reminder
Home Tab Messages
Hebrew Reminders
 
Services
  • Salesforce Development
  • Salesforce Implementation
  • Salesforce Strategy
  • Salesforce Support
 
Interactive Ties is a certified AppExchange Partner of salesforce.com