0

I was trying to parse the following JSON but unfortunately there is no key for the array and the array is inside another array How to parse the below JSON that consist of an array inside another array without key name? I was trying to parse the following JSON but unfortunately ther is no key for the array and the array is inside another array How to parse the below json that consist of an array inside another array without key name?

    [
        [{
            "logid": "12345",
            "assignees": "",
            "creator": "XYZ",
            "activity": "asdsadsad",
            "contentid": "sadsadasd",
            "createuser": "dasd",
            "crtdate": "asdasdsadsad"
        }],
        [{
            "logid": "sadsaddasd",
            "assignees": "",
            "creator": "sadasdsad",
            "activity": "sdfsdfsdfsdf",
            "contentid": "dsfsdfdsfsd",
            "createuser": "sfsdfdsfs",
            "crtdate": "dfsdfdsfdsf"
        }],
        [{
            "logid": "sdfsdfsdfdsf",
            "assignees": "",
            "creator": "dsfsdfsdfds",
            "activity": "dsfdsfsdfdsf",
            "contentid": "4sdfsdf",
            "createuser": "sdfdsfsdf",
            "crtdate": "dsfsdfsdfsdf"
        }],
        [{
                "logid": "sdfsdfsdf",
                "assignees": "",
                "creator": "fsdfsf",
                "activity": "sdfsdfsdf",
                "contentid": "dfsdf",
                "createuser": "dsffdsf",
                "crtdate": "sdfdsfsdf"
            },
            {
                "logid": "dfsdfsdf",
                "assignees": "",
                "creator": "dsfsdfsdf",
                "activity": "dfsdfsdf",
                "content": "sdfsdfsdf",
                "contentid": "2dfsdfsdfsdf",
                "email": "sdfsdfsdf",
                "img_name": "dsfsfsdf",
                "createuser": "sdfsdfsdf",
                "crtdate": "dsfsdfsdf"
            },
            {
                "logid": "sdfsdfsdf",
                "assignees": "",
                "creator": "Nsdfsfsdfsdf",
                "activity": "dfsdfsdf",
                "content": "fdsfsdfsdf",
                "contentid": "dsfsdfdsf",
                "email": "sdfsdfsdf",
                "img_name": "sdfsdfsdf",
                "createuser": "1fdsfsdfsdf",
                "crtdate": "dfsdfsdf"
            },
            {
                "logid": "dsfsdfdsf",
                "assignees": "",
                "creator": "dfsdfsd",
                "activity": "fsdfsf",
                "contentid": "dsfsdfsdfsd",
                "createuser": "1dsfdsfdsf",
                "crtdate": "dsfsdfsdf"
            },
            {
                "logid": "last",
                "assignees": "",
                "creator": "sdfsdfsdfsdfsd",
                "activity": "dsfsdfsdfsdf",
                "contentid": "dsfsdfsdfs",
                "createuser": "dfsdfsdfsdf",
                "crtdate": "sdfsdfdsfsdfsdfsdf"
            }
        ]
    ]
AskNilesh
  • 67,701
  • 16
  • 123
  • 163

1 Answers1

0

It is not necessary to get elements using a key only. You have an array and data should be extracted like:

myArray[0][0].logid

or

myArray[0][0]['logid']

Also, in javascript, everything is an object.

YetAnotherBot
  • 1,937
  • 2
  • 25
  • 32