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.
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.
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.
We open up DataLoader again, select Update, choose our updated Product file and the Product2 object.
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.
After finishing with the mapping, we are happy to see that our records have updated without error.
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.
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’.
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.
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