0

Forgive me, I'm the messenger:

Our devs have copied our Demo data to their Local, and when sending to the Bulk Data API, it goes through fine.

When our Demo sends the data automatically, we're getting "InvalidBatch: Failed to parse CSV. Not expecting more text after end quote. Batch will not be retried."

Is there any functionality that would allow me to actually see the raw data of the Invalid Batch, to attempt to troubleshoot?

I tried following the advice from https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_batches_failed_records.htm?_ga=2.252677066.212016908.1697455303-242824651.1673950612 and https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_batches_get_results.htm, but kept getting an Invalid Session ID.

Pulling my hair out, we've wasted almost a week on this!

enter image description here

3
  • 1
    Recommend checking the data in your CSV. I've seen this error in the past and earlier the issue was due to the presence of " and a \ which was sending an invalid CSV to SF. Replacing these two symbols with blank spaces fixed the issue. Commented Oct 19, 2023 at 12:23
  • Update: this was it :| one of our entries had a " character in it. Good grief. Thank you! Commented Oct 20, 2023 at 13:10
  • Glad I could help. I'll post this as an answer so it can also help others Commented Oct 20, 2023 at 13:23

1 Answer 1

0

This error occurs when the data in your CSV is invalid. As you mentioned in the comments, the issue was due to the presence of " (In some cases also happens due to a \) which was sending an invalid CSV to SalesForce. Replacing these symbols with blank spaces will fix the issue.

Example: If the double quotes are being used two times it would throw an error

Description,TEXT1__c,Priority
Apple12,test,""Medium"

Notice that before Medium two double quotes were added.

If a field value contains a double quote, the double quote must be escaped by preceding it with another double quote as

"This is the ""gold"" standard" -------> Valid
"This is the "gold" standard" --------> In-valid

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .