I have a POST request where i need to pass some parameters dynamically since my code is checking for a duplicate entry. I tried writing a pre request script and then setting the global variables and tried to access it in my request. It is not working. PFB, the details
Pre-request Script
postman.setGlobalVariable("firstname", (text + parseInt(Math.random()*10000)).toString()); postman.setGlobalVariable("lastname", text + parseInt(Math.random()*10000));
Body
{ "request": { "firstName":"{{firstname}}", "middleName":"mani", "lastName":"{{lastname}}" } }
Here firstName is getting passed as {{firstname}} instead of random string.