I have a backend API that receive the following JSON
[
{
“PKEY”: “1”
“DETAILS” [
{
“DKEY”: “1”,
“DATA”: “A”
}, {
“DKEY”: “2”,
“DATA”: “B”
}
]
}, {
“PKEY”: “2”
“DETAILS” [
{
“DKEY”: “1”,
“DATA”: “A”
}, {
“DKEY”: “2”,
“DATA”: “B”
}
]
}
I need help to format that JSON as follows:
[
{
“PKEY”: “1”
“DKEY”: “1”
“DATA”: “A”
}, {
“PKEY”: “1”
“DKEY”: “2”
“DATA”: “B”
}, {
“PKEY”: “2”
“DKEY”: “1”
“DATA”: “A”
}, {
“PKEY”: “2”
“DKEY”: “2”
“DATA”: “B”
}
]
I been trying to use the list: format as text, but however, I am unable to access the parent PKEY when I am in the each of the Details.