# Updating with CSV

**URL:** <https://community.postman.com/t/updating-with-csv/529>\
**Category:** Help Hub\
**Created:** [December 20, 2017, 6:28pm UTC](https://community.postman.com/t/updating-with-csv/529 "2017-12-20T18:28:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gwsleadto](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@gwsleadto](https://community.postman.com/u/gwsleadto)\
**Post date:** [December 20, 2017, 6:28pm UTC](https://community.postman.com/t/updating-with-csv/529/1 "2017-12-20T18:28:35Z")

</div>

I’m a novice here when it comes to Postman and most things development but have a hopefully quick question pertaining to using Postman to update a series of records with a csv file. All I am wanting to do is mass update a series of account records that are defined in a csv file.

I’ve read through the blog posting on this topic:  
[http://blog.getpostman.com/2014/10/28/using-csv-and-json-files-in-the-postman-collection-runner/](http://blog.getpostman.com/2014/10/28/using-csv-and-json-files-in-the-postman-collection-runner/)

My collection:  
[https://www.getpostman.com/collections/53dc7bec3a3e5b6b47cf](https://www.getpostman.com/collections/53dc7bec3a3e5b6b47cf)

And still encounter the error:  
Could not read JSON: Unexpected character (‘{’ (code 123)): was expecting double-quote to start field name\n at [Source: org.apache.catalina.connector.CoyoteInputStream@256f884d; line: 2, column: 11]; nested exception is org.codehaus.jackson.JsonParseException: Unexpected character (‘{’ (code 123)): was expecting double-quote to start field name\n at [Source: org.apache.catalina.connector.CoyoteInputStream@256f884d; line: 2, column: 11]

I assume this has to do with the body where I am referencing parameters {{Id}} and {{PaymentTerm}}.

{  
“Id”: {{Id}},  
“PaymentTerm”: {{PaymentTerm}}  
}

The Zuora REST API is specific in that I have to insert the key in the url such as:

[https://rest.apisandbox.zuora.com/v1/accounts/{{Id}](https://rest.apisandbox.zuora.com/v1/accounts/%7B%7BId%7D)}

Thoughts on how to get this to work?

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![abhinav](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/abhinav/32/8_2.png) [@abhinav](https://community.postman.com/u/abhinav)\
**Post date:** [December 20, 2017, 7:45pm UTC](https://community.postman.com/t/updating-with-csv/529/2 "2017-12-20T19:45:42Z")

</div>

When you preview the CSV file, does it show you the data properly. I’d also suggest double checking the CSV headers for the correct variable names.

---

<div class="post-metadata">

**Author:** ![gwsleadto](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@gwsleadto](https://community.postman.com/u/gwsleadto)\
**Post date:** [December 20, 2017, 8:24pm UTC](https://community.postman.com/t/updating-with-csv/529/3 "2017-12-20T20:24:48Z")

</div>

Thanks for the reply and suggestions. The preview does show the data properly. I kept it simple with two columns and two rows. Even in the console, it shows it correctly:

Request Body:"{ “Id”: 2c92c0f94d94d061014d96336fb44a2b, “PaymentTerm”: Net 30 }"

Puzzling.

---

<div class="post-metadata">

**Author:** ![abhinav](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/abhinav/32/8_2.png) [@abhinav](https://community.postman.com/u/abhinav)\
**Post date:** [December 21, 2017, 12:34am UTC](https://community.postman.com/t/updating-with-csv/529/4 "2017-12-21T00:34:35Z")

</div>

You should enclose the “Id” field in your request body with quotes. Postman does not automatically add quotes for string types.

---

<div class="post-metadata">

**Author:** ![gwsleadto](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@gwsleadto](https://community.postman.com/u/gwsleadto)\
**Post date:** [December 21, 2017, 4:46am UTC](https://community.postman.com/t/updating-with-csv/529/5 "2017-12-21T04:46:51Z")

</div>

We are closer, thank you.

I am now getting the error:

code:51500021

message:“Invalid parameter(s): ‘Id,PaymentTerm’.”

---

<div class="post-metadata">

**Author:** ![gwsleadto](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@gwsleadto](https://community.postman.com/u/gwsleadto)\
**Post date:** [December 21, 2017, 5:09am UTC](https://community.postman.com/t/updating-with-csv/529/6 "2017-12-21T05:09:46Z")

</div>

I got it to work, I needed to remove Id from the Request Body. Thanks again for the help.

Here is the blog post I created to help if any others have this issue:

[https://www.lead-to.com/blog/2017/12/20/using-postman-and-csv-data-files-to-mass-update-zuora-data](https://www.lead-to.com/blog/2017/12/20/using-postman-and-csv-data-files-to-mass-update-zuora-data)

---

<div class="post-metadata">

**Author:** ![shamasis](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/shamasis/32/53_2.png) [@shamasis](https://community.postman.com/u/shamasis)\
**Post date:** [December 22, 2017, 6:26am UTC](https://community.postman.com/t/updating-with-csv/529/7 "2017-12-22T06:26:49Z")

</div>

One info here I thought would be of help - you can use another library for parsing CSV inside script. The module “csv-parse” is available for use inside the scripts.

[https://www.npmjs.com/package/csv-parse](https://www.npmjs.com/package/csv-parse)
