Where are you getting that error. In Postman or in the response?
Have you checked the console log to see what was sent?
Is the body showing the quotes as you would expect?
It appears to work for me using Postman Echo.
Request Body
Console Log
It looks formatted correctly to me.
You might be able to create a pre-request script that updates the body as a workaround.
For example…
const body = JSON.parse(pm.request.body.raw);
body.appDate = data.APPDATE;
// you can reference the information in the current iteration by the data object.
pm.request.body.raw = body;
console.log(pm.request.body.raw);
I originally had the following but all this did is put an extra set of quotes around the value.
body.appDate = JSON.stringify(data.APPDATE);
You have two choices here, you can either define the entire body in the pre-request script or retrieve the current body like in the example above.
If you do pull the current body. It has to be valid JSON. You can’t have a variable that is not in a string, as that would not be valid JSON at runtime (as it hasn’t replaced the variable with a value yet) and the JSON.parse(pm.request.body.raw) line will fail instead.
Therefore you can do something like.
{
"appDate": ""
}
Your probably better off defining the whole body in the pre-request script and leaving it blank in the body of the request. (Still need to set it to JSON\RAW though).
Although I’m not sure this is needed, as all this does is set the body with single quotes.
Can you post a raw copy of the first couple of lines of the CSV file using Notepad (not Excel).
So I can see if it has any quotes around it or not that might mess up the formatting\import.
This is what my test CSV looks like (I also wanted to test a text field and an integer, so added a few columns).