Map as an environmental variable

Hey everyone,

i need to pass a hashmap around as an pm.environmental variable between requests. Only one problem, once i reach the second request, the environmental variable seems to have changed to something i can’t quite recognise. I run this request twice:
image

First time, the line console.log(!pm.environment.get(‘map’).get(0)); runs just fine and returns true, since it’s not there. Once i run it again in the else statement however, the second iteration, the exact same line gives an error. I want it to return again in the second iteration.

This is the console for evidence:

The problem seems to be that the environmental variable map is no longer a map, but something else that postman has converted. How do i pass a map as an environmental variable between requests in postman?

Thank you for your help and time :slight_smile: !

I have the same issue. I guess the map saved in environment variable is retrieved as an object

Anyone have any luck with this? is it just a limitation? I also found that trying to pass them to a function in another location also causes the map to not be usable.