Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

124
Views
How i read multiple array from json with javascript and put the value in a grid?

how i read all the "Value" from this json with javascript ? This json have multiple array inside and i need to put the value in a grid like dxDataGrid devextreme component.

{
    "result": [
    {
    "DATA": [
    {
    "NAME": "Value1",
    "DESCRIPTION": "Value2",
    "DATA": [
    {
    "NAME2": "Value3",
    "DATA2": [
    {
    "NAME3": "Value4"
    }
    ]
    }
    ]
    },
    {
    "NAME": "Value5",
    "DESCRIPTION": "Value6",
    "DATA": [
    {
    "NAME2": "Value7",
    "DATA2": [
    {
    "NAME4": "Value8"
    }
    ]
    }
    ]
    },
    ]
    }
    ]
}

Thanks.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can try using for in loop for traversing through a json object like this:

    var data = JSON.parse('
{
  "result": [
    {
      "DATA": [
        {
          "NAME": "Value1",
          "DESCRIPTION": "Value2",
          "DATA": [
            {
              "NAME2": "Value3",
              "DATA2": [
                {
                  "NAME3": "Value4"
                }
              ]
            }
          ]
        },
        {
          "NAME": "Value5",
          "DESCRIPTION": "Value6",
          "DATA": [
            {
              "NAME2": "Value7",
              "DATA2": [
                {
                  "NAME4": "Value8"
                }
              ]
            }
          ]
        },
        
      ]
    }
  ]
}')

for (var event in data) {
    var dataCopy = data[event];
    for (data in dataCopy) {
        var mainData = dataCopy[data];
        for (key in mainData) {
            if (key.match(/name|value/)) {
                alert('key : ' + key + ':: value : ' + mainData[key])
            }
        }
    }
}​

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!