How to parse a JSON array string in JavaScript?

filter_value_data is an array (having []), so use filter_value_data[0].Status to get the first element-object with property "Status".

It is always good to format your code in order to see the hierarchy of the structures:

var filter_value_data = [
    {
        "Status": [
            {
                "name": "Open",
                "id": "1"
            }, {
                "name": "Pending",
                "id": "2"
            }, ...
        ]
    }, {
        "Payment Status": [
            {
                "name": "Paid",
                "id": "10"
            }, ...
        ]
    }, {
        "Priority": [
            {
                "name": "Low",
                "id": "6"
            }, ...
        ]
    }
];

Browse More Popular Posts

Leave a Comment