Set environment variables from Visualizer?

I am using the visualizer to gather a list of objects from a web service, each with a guid id. For subsequent calls to other requests I need to use that id. Currently I am copy/pasting the id into an environment variable, but I would like to be able to make this a better experience.

In my visualizer I have it listing the id and name of the objects. I can create an href or button that can trigger some javascript code. The challenge is that the pm object that seems to be available doesn’t have the environment object or other variables available.

Is it possible to set environment variables from a visualizer? If not, what is the best approach for this scenario where one call results in a list, then the goal is to manually select from the list to prepare for subsequent calls.

Thanks!

You can’t do it within the visualizer code, but one of the first things you will have done is parse the response.

You should be able to target the ID from the parsed object, and set an environment or collection variable.

The visualizer HTML is fairly basic, and although you can format it with JavaScript, you can’t interact with buttons as it doesn’t support that functionality.

That’s unfortunately what I figured. If there was only one object then this wouldn’t be a problem. However, since there is a list of objects the choice of which object to use needs to be interactive in this scenario. I suppose copy/paste is sufficient in that case.