Data Loader Tips – Inserting or Updating Blank Values in a Field

You may have come across the situation where you need to use Dataloader to clear or delete the value of a field. Normally, if you provide a blank value in the input file, DataLoader will ignore it and leave the field value as is.

Lets look at an example. Here we have loaded data into the Product Description field instead of the Product Code field.

Product Codes

Lets imagine, instead of 3 records we have a large number and it would be preferable to update them with DataLoader instead of manually. So the first thing we do is export the records out again using DataLoader. Below we can see the Product details exported with the Id, Name, Product Code and Product Description values.

Product Export

We think this is an easy task, just copy the values from the Product Description field to the Product Code field, as shown below. We now have moved the values and have no values in the Product Description.

Product Records Updated

We open up DataLoader again, select Update, choose our updated Product file and the Product2 object.

Product Update DataLoader

We map the Id, Product Code and Product Description fields, ignoring the Product Name field as we are not updating it, it was exported for reference purposes.

Product Update Mapping

After finishing with the mapping, we are happy to see that our records have updated without error.

DataLoader Update Message

Lets check our Product records now, after the update. Unfortunately the result is not what we were expecting. The Product Code has been updated with the new values, but the values are still in the Product Description.

Product Fields Update 1

To fix this, we need to go into DataLoader settings. In order to tell DataLoader that we do want to insert null or blank values when it finds them in the csv file, we check ‘Insert null values’. Note that you also have to uncheck ‘Use bulk api’.

DataLoader Settings Insert Null Values

After updating the DataLoader settings, we can use the same csv file and try again. After successfully updating the records, we check the Products again, and find now they are as we were expecting, with the Product Description fields cleared out.

Product Records Update 2

Note: It is probably best to go back after you have finished and uncheck the ‘Insert null values’ checkbox and check the ‘Use Bulk Api’ so that you don’t clear out values when you are not expecting to.

What Certification are you studying for now?

Focus on Force currently provides practice exams and study guides for ten certifications