The pm.environment.name method is returning undefined

I have postman collections with environment and have scripts which are checking the postman environment name to do some manipulation.

From the past release the “pm.environment.name” is coming up as undefined though I can get the variables and their values and it’s id.

Can you check what could be the issue here.

Hey @dcpanda18usa :waving_hand:

Welcome to the Postman Community! :postman:

Which version are you using?

Are you using this in a script in Local or Cloud View?

Is the Environment set as Active?

If would help if you could share some screenshots of what you can see on you’re side.

I am using the new GIT feature of the postman and thus using local version. I am using version 12.4.1

The environment is been selected and I can get all it’s values using script hence it seems it’s active.

1 Like

I wonder if it’s related, but I just installed Postman for Mac 12.4.0 and it no longer shows the environment name (just an icon) in the top right of the app, which is a HUGE loss. After initial install, it was blank and didn’t even show an environment icon. Related? Either way this needs to be fixed.

Not related and it’s just the minified version of the switcher. It’s likely due to the amount of tabs you have open.

You can resize that section to whatever you like. ↔️