Collection variable from Postman response to update environment

Getting noticed

Collection variable from Postman response to update environment

Anyone out there have done some updates to Postman environments. I'm looking into creating org with Postman, then pull the {id} from the response to update the {organizationId} in the environement and the run create network and pull {networkId} to update network settings.


has anyone an example test code for this, I'm struggeling to update the environment variable.

Kind of a big deal
Kind of a big deal

@Kenneth : Check this out 


Cisco IT Blogs awarded in 2020 & 2021
Meraki Employee
Meraki Employee

@Kenneth  You can write test scripts within postman to achieve this. 


Here is an example to iterate the organization list from getOrganizations request and set target org id to an environment variable.  (of course, you need an environment and associate it with your requests)


const jsonData = JSON.parse(responseBody);
for (let i = 0; i < jsonData.length; i++ ){
  if (jsonData[i]['name'] === "postman-test"){
  pm.environment.set("organizationId", jsonData[i]['id']);
Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.