If I understand your query correctly, you are wanting to set “data” (that is a response of one request) as a collection variable and then pass it to another request in the same collection, is that correct?
If so, you can do something like:
data = pm.response.json().data // get "data" property from response object
pm.collectionVariables.set('data', data) // set as a collection var named 'data'
Then you can access the ‘data’ variable by {{data}} or pm.collectionVariables.get('data') if in scripts.
For details about how to use collection variables in scripts, please refer to:
Hope this helps!
Let me know if you have further questions
and copied {{data}} under body section of the request that takes data as an input but I get an error in the 2nd request. data as an input is not recognized.
{“responseStatus”:“FAILURE”,“errors”:[{“type”:“INVALID_DATA”,“message”:“Invalid request body content”}]}
Any thoughts why that might be happening wrong?
Also I dont see any value inside data variable under environment.