Postman does not have direct access to the local filesystem to export results as CSV files.
There are a few workarounds available, which you can search the forum for, as the question has been asked a few times.
What info does ServiceNow require as you have a lot of info in that warranty variable, and I’m guessing that ServiceNow only needs some of it.
What you probably need is a folder with two requests in.
The first request should retrieve the warranty info for a particular device from the DELL portal.
The tests tab for that request should pull out the appropriate warranty info.
You would then save this info to a variable. This should be in the appropriate format for Service?Now. An object or similar.
The second request should post the selected warranty info to ServiceNow using the saved variable as the body.
Test it with one request\device until you get it working, before you try and loop through 2000 entries. (And don’t loop through 2000 entries straight away. Try 1, then 10, then 50, then 100 before you do large batches).
Do you not have a test instance of ServiceNow? I would have thought that you should have a PROD and TEST instance at a minimum so you can try these integrations out without fear of breaking production.
I’m not sure this is the correct tool for this type of task though.
Personally I would use PowerShell and invoke-webrequest. PowerShell can manipulate and loop though CSV files natively.
As you’ve mentioned you are not sure what you are doing, can I suggest a visit to the Postman Learning Centre in the first instance.
Overview | Postman Learning Center
Have a look at the Postman Training links in the Other Resources section.
Other resources | Postman Learning Center
I would recommend the “Galaxy APIs 101” course to start with as it gets you used to the client interface. Then the “Galaxy Testing and Automation” course which shows you how to write assertions and target elements in the response.
Some comments in relation to the code you did write.
const responseJson = pm.response.json(); // fine
requestName: ${request.name || request.url}-${Date.now()} // what is this doing?
let response = pm.response.json(), // you already did this on the first line
warrantyinfo = JSON.stringify(response); // why are you now turning the response back into a string?
pm.collectionVariables.set(“WarrantyInfo”, warrantyinfo); // are you sure you want all of the warranty info, or just the details that are needed by ServiceNow?