I want to save the response from two API calls but not sure how to do it in Thunder client, Postman is working fine.
var jsonDataResponse = JSON.parse(responseBody);
pm.environment.set("tin", jsonDataResponse.replace(/\s/g, ''));
One. https://generator.avris.it/api/DE/tin gives something like "21 348 504 760" and then in Postman I have this
But in Thunder, I have no idea how can I do that
And I want to just the number without spaces
Two. I have this in Postman but no clue how made this in Thunder
let jsonData = JSON.parse(responseBody);
positionstring=""+jsonData.positions;
pwdstring=positionstring.replace(new RegExp(",", "g"), "");
positionstring=positionstring.replace(new RegExp(",", "g"), "\",\"");
positionstring ="\[\""+positionstring+"\"\]";
postman.setEnvironmentVariable("positions", positionstring);
postman.setEnvironmentVariable("pwd", pwdstring);
I tried the first one but only I get to save it to a tin variable with literally the function I want to replace(" ", "") when should be 21348504760