Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

179
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!