# Help with Data Driven Tests

**URL:** <https://community.postman.com/t/help-with-data-driven-tests/43711>\
**Category:** Help Hub\
**Tags:** documentation, tests, variables, json\
**Created:** [February 8, 2023, 9:54am UTC](https://community.postman.com/t/help-with-data-driven-tests/43711 "2023-02-08T09:54:25Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![tushar37](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tushar37](https://community.postman.com/u/tushar37)\
**Post date:** [February 8, 2023, 9:54am UTC](https://community.postman.com/t/help-with-data-driven-tests/43711/1 "2023-02-08T09:54:25Z")

</div>

Hi Postman community can anyone help me with one issue, we want to post only one value with the help of csv file and other keys and values for same request we have used variables, we just have to POST one key value with the help of external CSV file

Please find below attachments, and guide us through just how to put “value” with help of csv file.

 ![reqst](https://us1.discourse-cdn.com/getpostman/original/3X/f/c/fcf0133321927b530f920f47b03e43fc05761952.png)

and also if we get sample format for same csv file that will be really gratful

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [February 8, 2023, 10:08am UTC](https://community.postman.com/t/help-with-data-driven-tests/43711/2 "2023-02-08T10:08:12Z")

</div>

The CSV file needs a single column with a header.

You reference the data by the header name.

So if you call the header “value”, then you would just reference it in the body using {{value}}, same as any other variable.

This is covered in the following Postman Blog.

> **[Using CSV and JSON Data Files in the Postman Collection Runner | Postman Blog](https://blog.postman.com/using-csv-and-json-files-in-the-postman-collection-runner/)**
>
> Update: If you want to dip deeper into the Postman Collection Runner, check out this newer post about Postman’s Collection Runner. Postman’s...

---

<div class="post-metadata">

**Author:** ![tushar37](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tushar37](https://community.postman.com/u/tushar37)\
**Post date:** [February 8, 2023, 10:28am UTC](https://community.postman.com/t/help-with-data-driven-tests/43711/3 "2023-02-08T10:28:15Z")

</div>

So do we have to declaire local variable as “value” in POSTMAN envirounment?

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [February 8, 2023, 11:17am UTC](https://community.postman.com/t/help-with-data-driven-tests/43711/4 "2023-02-08T11:17:16Z")

</div>

You don’t have to declare value, as its coming from the CSV file, not an environment variable.

It still uses the curly brackets in the body.

---

<div class="post-metadata">

**Author:** ![tushar37](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tushar37](https://community.postman.com/u/tushar37)\
**Post date:** [February 8, 2023, 11:39am UTC](https://community.postman.com/t/help-with-data-driven-tests/43711/5 "2023-02-08T11:39:55Z")

</div>

@michaelderekjones also do I have to remove key “value from the request body” as we are passing as header trough CSV

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [February 8, 2023, 11:47am UTC](https://community.postman.com/t/help-with-data-driven-tests/43711/6 "2023-02-08T11:47:46Z")

</div>

No, the key name needs to stay in the body.

It’s just the value that you are parameterising from the CSV file.

It should be

```auto
"value": {{value}}

```

---

<div class="post-metadata">

**Author:** ![tushar37](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tushar37](https://community.postman.com/u/tushar37)\
**Post date:** [February 8, 2023, 11:50am UTC](https://community.postman.com/t/help-with-data-driven-tests/43711/7 "2023-02-08T11:50:41Z")

</div>

@michaelderekjones and what changes needs to be done in TEST and pre-request script tabs

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [February 8, 2023, 12:00pm UTC](https://community.postman.com/t/help-with-data-driven-tests/43711/8 "2023-02-08T12:00:25Z")

</div>

You don’t need to put anything in the pre-request script or the tests tab.

You just need to update the body of the request and parameterise the value.

The same concept as you’ve got for timestamp. The only difference is that its pulling it from the CSV file.

Have you tried going through the example that is provided in the link.

It should help understand the concept.

---

<div class="post-metadata">

**Author:** ![tushar37](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tushar37](https://community.postman.com/u/tushar37)\
**Post date:** [February 8, 2023, 12:31pm UTC](https://community.postman.com/t/help-with-data-driven-tests/43711/11 "2023-02-08T12:31:29Z")

</div>

@michaelderekjones I have followed the steps from above link which you have provided, but getting 500 Internal Server error. PFB

 ![err1](https://us1.discourse-cdn.com/getpostman/original/3X/3/8/38fffc9ae1addf12d71a635ba9f2820f31b8fe5f.png)  
 ![csv](https://us1.discourse-cdn.com/getpostman/original/3X/0/e/0ef83fa3123c5e6890b46258461b78ca2ed7fae1.png)  
 ![req1](https://us1.discourse-cdn.com/getpostman/original/3X/a/9/a9c3ec62d65a1a455beef80cf0feb5c34d62cb9e.png)

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [February 8, 2023, 12:39pm UTC](https://community.postman.com/t/help-with-data-driven-tests/43711/12 "2023-02-08T12:39:40Z")

</div>

If you have three values, you need to separate them into three columns.

Your initial post said you want to post one key value.

It looks like you need three different values. So same as you’ve done for the timestamp.

Follow the same naming convention, so value0, value1 and value2.

Then change the variables in the body to match {{value0}}, {{value1}}, etc.

---

<div class="post-metadata">

**Author:** ![tushar37](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tushar37](https://community.postman.com/u/tushar37)\
**Post date:** [February 9, 2023, 10:58am UTC](https://community.postman.com/t/help-with-data-driven-tests/43711/13 "2023-02-09T10:58:19Z")

</div>

Tried with below thing still getting 500 error

 ![errr](https://us1.discourse-cdn.com/getpostman/original/3X/0/f/0f0eb6b29c04bafda81a123e0a50996f821a7b62.png)

![csss](https://us1.discourse-cdn.com/getpostman/original/3X/1/7/173b9023f69a55b2bd6633f2421254eab2291ff3.png)

@michaelderekjones can you please send sample request body and csv for above example that will be really helpfull.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [February 9, 2023, 11:01am UTC](https://community.postman.com/t/help-with-data-driven-tests/43711/14 "2023-02-09T11:01:25Z")

</div>

Your CSV file needs to have the data in three separate columns, not a single column.

Your variables in your body need to match those column headers.

![image](https://us1.discourse-cdn.com/getpostman/original/3X/f/3/f3cc881415a8ef752a1b276b18e5cb04f8dcb676.png)

---

<div class="post-metadata">

**Author:** ![tushar37](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tushar37](https://community.postman.com/u/tushar37)\
**Post date:** [February 9, 2023, 11:05am UTC](https://community.postman.com/t/help-with-data-driven-tests/43711/15 "2023-02-09T11:05:11Z")

</div>

@michaelderekjones It work this Time ! 👍🏻  
Thanks alot @michaelderekjones for help. 👍🏻

---

<div class="post-metadata">

**Author:** ![tushar37](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tushar37](https://community.postman.com/u/tushar37)\
**Post date:** [February 9, 2023, 11:43am UTC](https://community.postman.com/t/help-with-data-driven-tests/43711/16 "2023-02-09T11:43:49Z")

</div>

Hi @michaelderekjones can you please guide me, can I insert uuid in in request URL though same CSV file which I have use for values, as I have to POST data for multiple ID’s

 ![URL](https://us1.discourse-cdn.com/getpostman/original/2X/d/d03a7cbeea270bc0648315e3666d4e149cb29d06.png)

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [February 9, 2023, 12:02pm UTC](https://community.postman.com/t/help-with-data-driven-tests/43711/17 "2023-02-09T12:02:39Z")

</div>

I really think you need to re-read the CSV import instructions and follow the small tutorial they have.

It shows how to parameterize parts of the URL.

But yes, just create a header in the CSV file called UUID, and replace that part of the URL with {{UUID}}

Same process as we’ve used to target the other elements.

I would also suggest that you go through the Postman Learning Centre first which can be accessed on the Postman home page.

Those courses explain the basic concepts that I recommend you learn first. Including how to use variables.

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/8/d/8dcf19933ad8a29294d855176aba5d20044d8b28.png)

Skip down to Postman Training on the next page.

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/9/c/9c83b640601d13efd516b5bde45670c5fc988f78.png)

From here, I recommend the Galaxy APIs 101, and Galaxy Testing and Automation as this covered all of the basics for me. This will include storing environment variables.

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/d/7/d79bc6fd4da3a12a0892c7de03455f232b64b321.png)

For more info on variables.

### [Using variables | Postman Learning Center](https://learning.postman.com/docs/sending-requests/variables/)

---

<div class="post-metadata">

**Author:** ![tushar37](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tushar37](https://community.postman.com/u/tushar37)\
**Post date:** [February 9, 2023, 12:05pm UTC](https://community.postman.com/t/help-with-data-driven-tests/43711/18 "2023-02-09T12:05:31Z")

</div>

@michaelderekjones Thank for the help 👍🏻

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [September 14, 2023, 3:38pm UTC](https://community.postman.com/t/help-with-data-driven-tests/43711/19 "2023-09-14T15:38:50Z")

</div>

Closed on September 14, 2023, 3:38pm UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
