0

With regards to this trailhead: Use Bulk API

I have completed the example provided in the explanation part, but when I came to the actual challenge, I was stumbled.

In the example, it says:

For this example, we’re adding a set of records with only four accounts. Usually, you use Bulk API to add thousands or millions of records, but the principle is the same. Copy the following CSV text into the request body.

"Name"
"Sample Bulk API Account 1"
"Sample Bulk API Account 2"
"Sample Bulk API Account 3"
"Sample Bulk API Account 4"

Actual challenge has a CSV file with 500 records which are needed to be inserted to complete it. This seems pretty easy initially. But does it mean that I need to copy all the records from CSV and paste them in the request body within quotation marks(for each record)? If this is the case, I can do it. No problem. But what if we have a million records that are needed to be inserted? Do I need to format them with quotes around them?

1 Answer 1

1

The quotation marks are a part of CSV format - they delimit columns if commas or other special characters are included in the field values. They shouldn't actually be required with the sample data shown there, but they don't do any harm either.

While you should not have to "munge" the supplied sample data in that way for the Trailhead challenge, if you ever need to, you can use an application like LibreOffice to force quotation of all CSV field values.

6
  • Thank you for the explanation. Copy/Paste just worked as expected. One simple question: Do you think Bulk API is recommended for mass update? Looks like, we might have multiple columns in a CSV which may/may not be appropriate if we do the copy/paste. Suggestions? Commented May 21, 2018 at 20:14
  • Yes, Bulk API is appropriate for mass updates if the data volume is significant. You'd only include the columns you wish to update (plus Id, of course).
    – David Reed
    Commented May 21, 2018 at 20:16
  • If I have 10-15 columns in my CSV, will Copy/paste that data into the request body would mess the format and throw errors while inserting? Commented May 21, 2018 at 20:26
  • I don't see why it would if the format is valid.
    – David Reed
    Commented May 21, 2018 at 20:27
  • I mean, copy/pasting multiple columns into that area would make the columns to overlap and have the data clumsy-up? Commented May 21, 2018 at 20:29

You must log in to answer this question.

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