How autosaving a variable resulting from a response to.xlsx(.csv)

Consisting of several queries:
Search for a user using several parameters. And further
queries shown in the screenshots.

https://postman-echo.com/post
{{base_url_crm}}/prospectivesales/create/v4
{{base_url_crm}}/prospectivesales/{{ProspectiveSale_Id}}/switchstage

And perhaps other requests from a large list, which, if necessary, will be included in the Postman Collection.

As can be seen from the screenshot of the Postman Collection.
The source data is loaded in *.csv file format.

The file contains the following data as shown in the screenshot:
On the basis of which, the ProspectiveSale_Id variable will be generated, the same variable that you told me how to correctly generate and remember in the collection, using the script:

pm.globals.set('ProspectiveSale_Id', pm.response.json().ProspectiveSaleId) ;

However, now I need to not only receive this variable, but also automatically write it back to a cell of the same source file. Which is uploaded to the Postman Collection. For subsequent generation and recording of the ProspectiveSale_Id variable.

As can be seen from the screenshot of the *.csv file, also known as *.xlsx

There is a free cell (column) to record this variable received from Postman. With the same name
ProspectiveSale_Id .
All that remains is to answer the question:

How, with the help of what commands (scripts), will it be possible to write this variable into a .*csv and/or *.xlsx file?

Table data *.csv or *.xlsx and the same cell (ProspectiveSale_Id) in which you need to write the values ​​​​generated by Posman.



Short answer is that you can’t.

The Postman desktop and cloud applications have very limited access to the local file systems to read files. They can’t write back.

However, you could potentially achieve this using Newman

Using Newman as a nodejs library | Postman Learning Center

This would allow you to use the filesystem libraries alongside Newman (and will require a decent understanding of JavaScript & Node.JS).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.