Postman/Pre-request Script get csv file data and save as environment variable
When I do postmande run collection, I add the csv file, but I couldn’t manage to pull this data and save it to environment variables at the pre-request script stage.after that ı will use this varible from environment in my boddy section code to update data on the server.
console.log(price);
pm.environment.set(“istenenDeger”, price);
let lojistikmaliyeti = Number(price);
console.log(lojistikmaliyeti);
pm.environment.set(“Lojistik Maliyeti”, lojistikmaliyeti);
the code is as above. My first line is the part where I need to define the data I took from the csv file into the “price” object. I left the part where it pulls data from csv blank.
ı tryied pm.collectionvariables.get combination or fs library and split but ı didnt get right conclusion