[SalesForce] Setting field value to Null when using Bulk API

I am trying to create a Data Load Tool similar to Data Loader which will upload the data from a CSV file to Salesforce. This tool is built using java and using "Bulk API". While this tool works fine, it is only creating problems when I try to insert null values through CSV.

I checked the "Bulk API Developer Guide" and it is mentioned that "Empty field values are ignored when you update records. To set a field value to null, use a field value of #N/A."

I wanted to know that is there any alternate way in which i can set the field values to "null" without having to set them to "#N/A" in CSV? Something similar to Data Loader, where blank fields are treated as "null" when we enable "Insert Null Values".

Best Answer

Since this hasn't been responded to after having been posted for several weeks, it would appear that no one has a timely suggestion for you.

My suggestion would be pre-process your CSV files using a script that scans them for field entries containing blank values and inserts a "#N/A" if it finds one. You could do that separately or as part of some kind of "front end" processing by your Utility Tool. You may have some other way of doing that via Java, but I'd think a simple Bat file or VB Script would do the job for you without requiring much work on your part to create it.

Related Topic