Reuse dynamically generated values between request types

What is the best strategy to reuse values between requests (both in test scenarios and outside of them)?

Example being a UUID in an object I create and then later verifying that it is returned in the GET. I want to dynamically generate the UUID in the first request. I’m using faker.js for this but I’m unsure how to reuse the value that was generated the first time. Help!

I recommend utilizing dynamic variables Dynamic values - Apidog Docs. You can customize pre-processor scripts to extract the UUID value using the following script:

pm.variables.set("variable_key", pm.request.url.query.find(item => item.key == 'id').value);
console.log('check variable_key', pm.variables.get("variable_key"))


Be aware that, you need to drag the custom script after the variable substitution line.

Karan thx will test today!