Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

181
Vistas
Create a custom JSON

I'm not that pro at JSON I have some knowledge but I think not that deep knowledge and I want to create a custom JSON from an array of objects. I hope you can help me.

I'm using JavaScript and NodeJS....

So I have the next data coming from my backend (array of objects):

enter image description here

and I want to create a JSON like this:

{
"items":[
    {
        "name":"extintor de agua",
        "itemData":[
            {
                "caracteristica":"item 1", "header": "Header 1", "id":12867
            },
            {
                "caracteristica":"item 2", "header": "Header 1", "id":12870
            }
        ]
    },
    {
        "name":"Extintor CO2",
        "itemData":[
            {
                "caracteristica":"item 1", "header": "Header 1", "id":12873
            },...
        ]
    }
]

}

As you can see I retrieve multiple rows for the same Entity field for example: multiple rows for "extintor the agua" and multiple rows for "extintor CO2" and so on with many more items. In the JSON you can see that I'm assigning the Entity field one time as "name" and inside that a "item Data" that contains all the values from the multiple "extintor de agua" values.

can I do that with JSON? if so how can I do it. If the problem needs more explanation I can give it I hope you can help me :)

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda