In a Mock service, only the Initial variable is always used but I need the Current value.
Data:
Postman version 9.21.2
Use a Mock service.
GET request
Situation:
The incoming request has a field: QR
I store the value of QR via an environment variable (variable_QR) in this way:
let param = pm.request.url.query.toObject().QR;
pm.environment.set (“variable_QR”,param);
This goes well and is kept as Current value.
Then I fill the response with this variable (variable_QR)
“qr”: {{variable_qr}}
The big problem is that the Initial value comes into the response and not the Current value.
Is there a possibility/script to get the Current value in the response?
Or is it possible to update the Initial with the Current value via a script?
Or is there another solution?
I look forward to a solution.
Thanks
Victor