How set global variable in Postman

when you useing postman to cook your api,
some time you need a variable to keep for next api.

example :
api create a new data and return id,
you wanna keep this id for update,
delete api to use.

add this code at postman’s tab

//take response data
var jsonData = JSON.parse(responseBody);
//set variable
postman.setEnvironmentVariable("acy_guid", jsonData.data.acy_guid);