How to save a value from a response into variables?

Hello! My response is {
“response”: [
{
“id”: 5127975,
“first_name”: “John”,
“last_name”: “Smith”
}
]
}

Could anyone show me a code how to save the value of last_name, first_name from the response into variables?

Thanks!:slight_smile:

Hey there!
First, I just want to welcome you to the Postman community and congratulations on your first post! :confetti_ball:

To store data returned in a response, you would have to write code in the “tests” part of a request.
Here is an example from the official postman answers workspace.

This blog post is also an excellent resource for more information :smile:

Hey, Kevin! Thanks a lot for your response! I figured it out already! :blush::+1:

Best Regards,

Oleg Kryczewski

1 Like