Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postman: Can i save JSON objects to environment variable so as to chain it for another request?

Tags:

json

postman

I tried using the postman.setEnvironmentVariable() method in which I can set simple numbers and string values. My question is when I tried saving an object, it saves as [object Object]. I want to know if it is possible to save a JSON object so I can use it in another Request.

like image 757
icube Avatar asked Jan 05 '17 07:01

icube


People also ask

How do you link environment with Postman collection?

To set up Postman environment variables: In the top right corner of Postman, click the environment selector and select Manage environments. Click Add to add a new environment where you'll define your OneLogin environment variables. Note: You'll need to use your API credentials to generate the access_token value.


1 Answers

You should use JSON.stringify() before setting it to environment variable.

Then after you call it in next request, use JSON.parse() to recreate the object.

Hope it helps.

like image 64
Dinesh Kumar Avatar answered Oct 17 '22 09:10

Dinesh Kumar