# Why are specified variables not being remembered?

**URL:** <https://community.postman.com/t/why-are-specified-variables-not-being-remembered/64254>\
**Category:** Help Hub\
**Tags:** variables, collections\
**Created:** [July 18, 2024, 11:25am UTC](https://community.postman.com/t/why-are-specified-variables-not-being-remembered/64254 "2024-07-18T11:25:29Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [July 18, 2024, 1:35pm UTC](https://community.postman.com/t/why-are-specified-variables-not-being-remembered/64254/2 "2024-07-18T13:35:21Z")

</div>

Hey @spacecraft-engineer2 👋

The is down to the references that you’re making to that response data:

```auto
[
    {
        "abonentId": "2202db26-15cb-4abc-a33b-997f966e8043",
        "requisites": {
            "requisiteId": "3a44b0c9-cc36-41d9-9fa2-9578f139e9bd",
            "inn": "5534183182",
            "kpp": {
                "value": "553401001",
                "organizationKppType": 1
            },
            "clientType": 1,
            "name": "LLC Organization Name"
        },
        "accounts": []
    }
]

```

It’s an `array`, with an `object` inside it. Directly going to the `abonentId` property would result in it being _undefined_. You need to **first** specify which `object` within the `array`, you want to access.

The _Postman Console_ is your friend here, you can use this to see what would be the result if you were to reference things in certain ways.

This is an example of what you’re doing vs accessing the object first:

```auto
console.log(pm.response.json().abonentId)
console.log(pm.response.json()[0].abonentId)

```

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/9/b/9b112986bccfb7aeb0c0368f4a0f93f17b6953a6.png)

* * *

[I’ve previously shared this with you](https://community.postman.com/t/capture-the-response-body-values-as-variables/51667/6) in a different thread but this will hopefully explain again how to extract different pieces of data from a response body:

> [@Sharing tips and tricks with others in the Postman community](https://community.postman.com/t/sharing-tips-and-tricks-with-others-in-the-postman-community/5123/5):
>
> Extracting values from a JSON response I notice lots of questions from the community which all have a similar flavour - Users are having trouble extracting data from a JSON response body when the value is within an array. These are normally JavaScript related questions, more than specific Postman questions but I want to use this thread to offer more support around this problem. For these examples I’ll be using the [https://randomuser.me](https://randomuser.me) API, this returns lots of random user data, in a JSON form…

---

_[View the full topic](https://community.postman.com/t/why-are-specified-variables-not-being-remembered/64254)._
