0

This is JSON. I want to get value of 'localId'. How to do this ?

"orderGroupByBin": [
{
  "buyerBin": "7401",
  "buyerCompanyName": {
    "nameRu": "Привет"", 
  },
  "orderGroupByAccount": [
    {
      "internalAccountId": 4523642387,
      "localId": 85352311765,
    }
  ]
}]
T.J. Crowder
  • 959,406
  • 173
  • 1,780
  • 1,769
Jasur Kurbanov
  • 594
  • 1
  • 6
  • 18
  • If `x` is the outermost object (you've only shown the contents of it), then `x.orderGroupByBin[0].orderGroupByAccount[0].localId`. Of course, I don't have any way of knowing whether they'll always be the first entries in their respective arrays... – T.J. Crowder Nov 19 '19 at 10:24

1 Answers1

0

If your variable is called object you can simply access it through

object.orderGroupByBin[0].orderGroupByAccount[0].localId
mvreijn
  • 2,652
  • 25
  • 40
no1lov3sme
  • 600
  • 1
  • 5
  • 14