I need to save the data I'm receiving from a json for this occasion I need to save all the data I'm getting in different variables, that is, by data I need to create a new variable that contains it ... I have more or less the idea. I suppose...
var r = "json";
var datos = (Object.values(Object.values(Object.values(r)[1])[0])[1]);
for (var i = 0; i < datos.length; i++) {
if (Object.values(datos[i])[0] == 1) {
// guardar en variables de está posición
} else if (Object.values(datos[i])[0] == 2) {
// guardar en variables de está posición
} else {
cantidadNull++;
}
}
{
"DatosEnvio": {},
"DatosEnvioJson": {
"Table1": {
"campos": ["Column1", "total"],
"datos": [{
"Column1": 1956,
"total": 1
}, {
"Column1": 1963,
"total": 2
}, {
"Column1": 1966,
"total": 1
}, {
"Column1": 1967,
"total": 2
}, {
"Column1": 1968,
"total": 1
}, {
"Column1": 1969,
"total": 3
}, {
"Column1": 1970,
"total": 2
}, {
"Column1": 1971,
"total": 2
}, {
"Column1": 1972,
"total": 3
}, {
"Column1": 1973,
"total": 3
}, {
"Column1": 1974,
"total": 1
}, {
"Column1": 1975,
"total": 2
}, {
"Column1": 1976,
"total": 1
}, {
"Column1": 1977,
"total": 8
}, {
"Column1": 1978,
"total": 2
}, {
"Column1": 1979,
"total": 8
}, {
"Column1": 1980,
"total": 6
}, {
"Column1": 1981,
"total": 9
}, {
"Column1": 1982,
"total": 8
}, {
"Column1": 1983,
"total": 3
}, {
"Column1": 1984,
"total": 3
}, {
"Column1": 1985,
"total": 7
}, {
"Column1": 1986,
"total": 6
}, {
"Column1": 1987,
"total": 4
}, {
"Column1": 1988,
"total": 8
}, {
"Column1": 1989,
"total": 15
}, {
"Column1": 1990,
"total": 8
}, {
"Column1": 1991,
"total": 4
}, {
"Column1": 1992,
"total": 9
}, {
"Column1": 1993,
"total": 6
}, {
"Column1": 1994,
"total": 8
}, {
"Column1": 1995,
"total": 4
}, {
"Column1": 1996,
"total": 4
}, {
"Column1": 1999,
"total": 1
}]
},
"Table2": {
"campos": ["bandera", "mensaje"],
"datos": [{
"bandera": 0,
"mensaje": "Se ingresaron los datos correctamente"
}]
}
},
"tablas": null,
"bandera": "0",
"mensaje": "--"
}
As always, I am infinitely grateful for your help, I love you: D