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
  • 1,031,962
  • 187
  • 1,923
  • 1,875
Jasur Kurbanov
  • 724
  • 2
  • 9
  • 20
  • 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,807
  • 28
  • 40
no1lov3sme
  • 682
  • 1
  • 5
  • 14