Reputation: 431
I am writing some python code to set some dates to null. According to the documentation, anything that needs to be set to null, will have to contain #N/A on the csv its picking up the data from. However this does not seem to work for date fields. I get the following error:
SalesforceMalformedRequest: Malformed request https://na131.salesforce.com/services/async/38.0/job/7504O00000LKUpIQAX/batch/7514O00000SWAzPQAX/result. Response content: {'exceptionCode': 'InvalidBatch', 'exceptionMessage': 'Records not processed'}
I made sure the field shows up as nillable on workbench as well.
How can I set an existing date to null? Any help is appreciated
Upvotes: 1
Views: 1886
Reputation: 2759
simple_salesforce
does not use the CSV-format Bulk API (even if the underlying data is sourced from a CSV file). See bulk.py
:
payload = {
'operation': operation,
'object': object_name,
'contentType': 'JSON'
}
In the JSON version of the Bulk API, fields to be nulled must be set to null
in JSON:
To specify a null value in JSON, set the field value to null. For example,
"description" : null
Do so in Python by setting the relevant property to None
.
Upvotes: 2