You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varjson=JSON.parse(responseBody);if(responseCode.code>=200&&responseCode.code<300){// Variável da coleçãopm.collectionVariables.set("productId",json.data.id);// Variável globalpm.globals.set("productId",json.data.id);}
Template
var/*variável local*/=JSON.parse(responseBody);if(responseCode.code>=200&&responseCode.code<300){// Variável da coleçãopm.collectionVariables.set(/*"variável do postman"*/,/*variável local*/./*estrutura da resposta*/);// Variável globalpm.globals.set(/*"variável do postman"*/,/*variável local*/./*estrutura da resposta*/);}
Deleção de Variável
Exemplo
if(responseCode.code>=200&&responseCode.code<300){// Variável da coleçãopm.collectionVariables.unset("productId");// Variável globalpm.globals.unset("productId");}
Template
if(responseCode.code>=200&&responseCode.code<300){// Variável da coleçãopm.collectionVariables.unset(/*"variável do postman"*/);// Variável globalpm.globals.unset(/*"variável do postman"*/);}