You need to sign in to do that
Don't have an account?
Chris Walters 9
Subtle text formatting issue with Bulk API 2.0 Insert
version 47
I've a tiny upload.csv file written on a Windoze box with Notepad++ , confirmed to be using CRLF containing two whimsical Contacts:
Name,Phone,Email
Bart Simpson,313-555-1212,haveacow@fox.com
Lisa Simpson,543-434-8474,prez@whitehouse.gov
I've crafted a python script for bulk-inserting these two and all works great right up until the very end when my status response says "JobComplete" and numberRecordsFailed': 2 and the response of calling failedResults is:
['"sf__Id","sf__Error",Email,Name,Phone\r', '"","INVALID_FIELD_FOR_INSERT_UPDATE:Unable to create/update fields: Name. Please check the security settings of this field and verify that it is read/write for your profile or permission set.:Name --","haveacow@fox.com","Bart Simpson","313-555-1212"\r', '"","INVALID_FIELD_FOR_INSERT_UPDATE:Unable to create/update fields: Name. Please check the security settings of this field and verify that it is read/write for your profile or permission set.:Name --","prez@whitehouse.gov","Lisa Simpson","543-434-8474"\r', '']
Pay close attention to the \r and all the double-quotes -- am I formatting my csv file incorrectly? I do explicitly set contentType:CSV and lineEnding: CRLF when setting up the job
Any ideas?
I've a tiny upload.csv file written on a Windoze box with Notepad++ , confirmed to be using CRLF containing two whimsical Contacts:
Name,Phone,Email
Bart Simpson,313-555-1212,haveacow@fox.com
Lisa Simpson,543-434-8474,prez@whitehouse.gov
I've crafted a python script for bulk-inserting these two and all works great right up until the very end when my status response says "JobComplete" and numberRecordsFailed': 2 and the response of calling failedResults is:
['"sf__Id","sf__Error",Email,Name,Phone\r', '"","INVALID_FIELD_FOR_INSERT_UPDATE:Unable to create/update fields: Name. Please check the security settings of this field and verify that it is read/write for your profile or permission set.:Name --","haveacow@fox.com","Bart Simpson","313-555-1212"\r', '"","INVALID_FIELD_FOR_INSERT_UPDATE:Unable to create/update fields: Name. Please check the security settings of this field and verify that it is read/write for your profile or permission set.:Name --","prez@whitehouse.gov","Lisa Simpson","543-434-8474"\r', '']
Pay close attention to the \r and all the double-quotes -- am I formatting my csv file incorrectly? I do explicitly set contentType:CSV and lineEnding: CRLF when setting up the job
Any ideas?
The simple solution is to use : dos2unix or unix2dos if you want be sure that the format of the end lines is fixed correctly for the entire file.
Download here:
https://sourceforge.net/projects/dos2unix/
set fileformat=dos and hard-saved. I tried once after set fileformat=unix and was rewarded with a bunch of
'errorMessage': 'ClientInputError : LineEnding is invalid on user data. Current LineEnding setting is CRLF'}
messages, so I do think I've got the right line breaks. And yet...
Contact.Name is really a Formula, a concatenation of Contact.firstName and Contact.lastName. And you can't insert into a Formula of course.
Changing my csv file to be:
firstName,lastName,Phone,Email
Bart,Simpson,313-555-1212,haveacow@fox.com
Lisa,Simpson,543-434-8474,prez@whitehouse.gov
did the trick
CASE CLOSED
Chris