tushar37
(Tushar Shingde)
February 8, 2023, 9:54am
1
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.
and also if we get sample format for same csv file that will be really gratful
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.
Update: If you want to dip deeper into the Postman Collection Runner, check out this newer post about Postman’s Collection Runner. Postman’s...
Est. reading time: 6 minutes
tushar37
(Tushar Shingde)
February 8, 2023, 10:28am
3
So do we have to declaire local variable as “value” in POSTMAN envirounment?
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.
tushar37
(Tushar Shingde)
February 8, 2023, 11:39am
5
@michaelderekjones also do I have to remove key “value from the request body” as we are passing as header trough CSV
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
"value": {{value}}
tushar37
(Tushar Shingde)
February 8, 2023, 11:50am
7
@michaelderekjones and what changes needs to be done in TEST and pre-request script tabs
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.
tushar37
(Tushar Shingde)
February 8, 2023, 12:31pm
11
@michaelderekjones I have followed the steps from above link which you have provided, but getting 500 Internal Server error. PFB
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.
tushar37
(Tushar Shingde)
February 9, 2023, 10:58am
13
Tried with below thing still getting 500 error
@michaelderekjones can you please send sample request body and csv for above example that will be really helpfull.
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.
tushar37
(Tushar Shingde)
February 9, 2023, 11:05am
15
@michaelderekjones It work this Time !
Thanks alot @michaelderekjones for help.
1 Like
tushar37
(Tushar Shingde)
February 9, 2023, 11:43am
16
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
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.
Skip down to Postman Training on the next page.
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.
For more info on variables.
tushar37
(Tushar Shingde)
February 9, 2023, 12:05pm
18
@michaelderekjones Thank for the help
system
(system)
Closed
September 14, 2023, 3:38pm
19
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.