Hi, everyone!
Can you please help me with adding double quotes in the environment variable that I saved from the response body?
I’m GETing that response body
And I need to save “codes” field in the variable (globals, environment doesn’t matter) with double quotes to use this String in another POST request’s body (body with JSON format). Or maybe in the POST request’s body, I can add double quotes? I mean smth like that: { “sntins”: “"” + {{GETcodes}} + “"”}
I’m setting variable simply like that:
var response = pm.response.json();
pm.environment.set(“GETcodes”, response.codes);
I also tried to save with double quotes like that:
var jsonData = JSON.parse(responseBody);
var parsedData = “”;
for(var i=0;i<jsonData.length;i++){
parsedData = parsedData +“"codes" : "” +jsonData.codes+"", ";
console.log(parsedData);
postman.setEnvironmentVariable(“parsedNamesResponse”, parsedData);
But it didn’t help(