[![enter image description here](https://i.stack.imgur.com/eW7xJ.png)](https://i.stack.imgur.com/eW7xJ.png)I am facing an issue in reading the json array from the below JSON File. I want to extract the values of "allocations" under paymentGroups[2] array.

I tried the below snippet but it didn't work as i'm getting undefined error.
data.tenderPlan.tenderPlan.paymentGroups[2].allocations.isEligible
Please suggest on how to extract all above fields. TIA

```
{
  "data": {
    "tenderPlan": {
      "__typename": "TenderPlanResponse",
      "tenderPlan": {
        "__typename": "TenderPlan",
        "id": "69d7b860-4b52-11ed-885c-3f3afe777b50",
        "contractId": "96116530-4b51-11ed-8e5d-712e60f5b60e",
        "grandTotal": {
          "__typename": "PriceDetailRow",
          "key": "DOWN_PAYMENT",
          "label": "",
          "displayValue": "$6529.00",
          "value": 6529,
          "info": {
            "__typename": "PriceDetailRowInfo",
            "title": "",
            "message": ""
          }
        },
        "authorizationAmount": {
          "__typename": "PriceDetailRow",
          "key": "DOWN_PAYMENT",
          "label": "",
          "displayValue": "",
          "value": null,
          "info": {
            "__typename": "PriceDetailRowInfo",
            "title": "",
            "message": ""
          }
        },
        "allocationStatus": [],
        "paymentGroups": [
          {
            "__typename": "TenderPlanPaymentGroup",
            "type": "CC",
            "subTotal": {
              "__typename": "PriceDetailRow",
              "key": "DOWN_PAYMENT",
              "label": "",
              "displayValue": "",
              "value": null,
              "info": {
                "__typename": "PriceDetailRowInfo",
                "title": "",
                "message": ""
              }
            },
            "selectedCount": 0,
            "allocations": [],
            "statusMessage": null
          },
          {
            "__typename": "TenderPlanPaymentGroup",
            "type": "OTHER_PAYPAL",
            "subTotal": {
              "__typename": "PriceDetailRow",
              "key": "DOWN_PAYMENT",
              "label": "",
              "displayValue": "",
              "value": null,
              "info": {
                "__typename": "PriceDetailRowInfo",
                "title": "",
                "message": ""
              }
            },
            "selectedCount": 0,
            "allocations": [
              {
                "__typename": "PayPalBaAllocation",
                "paymentHandle": "6aabe4fd-e792-4956-9d88-04567ebed53b",
                "paymentType": "PAYPAL",
                "email": "sb-zduqk20902186@personal.example.com",
                "isSelected": true,
                "lastName": "Doe",
                "firstName": "John"
              }
            ],
            "statusMessage": null
          },
          {
            "__typename": "TenderPlanPaymentGroup",
            "type": "PAYPAL_BA",
            "subTotal": {
              "__typename": "PriceDetailRow",
              "key": "DOWN_PAYMENT",
              "label": "",
              "displayValue": "",
              "value": null,
              "info": {
                "__typename": "PriceDetailRowInfo",
                "title": "",
                "message": ""
              }
            },
            "selectedCount": 0,
            "allocations": [
              {
                "__typename": "PayPalBillingCardAllocation",
                "card": {
                  "__typename": "PayPalBA",
                  "id": "6aabe4fd-e792-4956-9d88-04567ebed53b",
                  "emailAddress": "sb-zduqk20902186@personal.example.com"
                },
                "isEligible": true,
                "allocationAmount": {
                  "__typename": "Price",
                  "displayValue": "$6529.00",
                  "value": 6529
                },
                "paymentType": "PAYPAL",
                "isSelected": true,
                "canEditOrDelete": false,
                "canDeselect": true,
                "statusMessage": null
              }
            ],
            "statusMessage": null
          }
        ],
        "otcDeliveryBenefit": {
          "__typename": "PriceDetailRow",
          "key": "DOWN_PAYMENT",
          "label": "",
          "displayValue": "",
          "value": null,
          "info": {
            "__typename": "PriceDetailRowInfo",
            "title": "",
            "message": ""
          }
        },
        "otherAllowedPayments": [
          {
            "type": "PAYPAL",
            "status": null,
            "isSelected": false
          }
        ],
        "addPaymentType": true,
        "hasAmountUnallocated": false,
        "weightDebitTotal": null,
        "prescriptionDebitTotal": null
      }
    }
  }
}

```