1

I have the following CSV of 12 Account records.

enter image description here

As can be seen, I am deliberately setting the name to NULL for an Account record (highlighted).

I am using the following SFDX/Salesforce CLI command to update these records and was expecting the highlighted record's name to be set as NULL or atleast throw an error complaining that the Name is a required field.

sfdx force:data:bulk:upsert  -u vpy.lightninglearn@gmail.com -s Account -f ./Output/Account.csv -i Id

But the bulk API simply executes job and states that all the 12 records have been successfully processed.

The record's name which I expected to be set to NULL remains unchanged.

I am aware that we have settings in SQL Data Loader where in we indicate that the NULL values are to be allowed.

Do we have any settings like that in SFDX/Salesforce CLI ?

3

To set a field to null, you need to use the "magic" value #N/A. This instructs the bulk API that you are intentionally updating to a null value. This is outlined in the documentation.

Empty field values are ignored when you update records. To set a field value to null, use a field value of #N/A.

To be clear, this is a feature of the Bulk API, and not a feature of SFDX CLI. Any clients that use Bulk API must adhere to this rule.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.