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

120
Views
¿Cómo me refiero a estos datos de objetos JSON?

Quiero hacer referencia a mi base de datos de Strapi a mi interfaz Next.JS. ¿Cómo puedo hacer referencia a datos JSON si también es un objeto dentro del objeto?

Como ejemplo, para acceder al nombre, uso {activity.name} . ¿Cómo puedo acceder al nombre del providerName ?

Probé {activity.provider.providerName} pero no funciona. ¿Qué estoy haciendo mal?

 [ { "id": 1, "name": "Bowling in Mundsburg", "activityType": "Bowling", "profileType": "Basic", "adventureType": "Activity", "slug": "bowling-in-new-york", "provider": { "id": 1, "providerName": "Bowlingcenter New York", "slug": "bowlingcenter-new-york", "published_at": "2021-09-26T12:06:12.670Z", "created_at": "2021-09-26T12:04:28.585Z", "updated_at": "2021-09-26T12:06:12.690Z" }, ... ]
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

podrias intentar asi?

 const strapiRes = [ { "id": 1, "name": "Bowling in Mundsburg", "activityType": "Bowling", "profileType": "Basic", "adventureType": "Activity", "slug": "bowling-in-new-york", "provider": { "id": 1, "providerName": "Bowlingcenter New York", "slug": "bowlingcenter-new-york", "published_at": "2021-09-26T12:06:12.670Z", "created_at": "2021-09-26T12:04:28.585Z", "updated_at": "2021-09-26T12:06:12.690Z" } } ]; const whatYouAreAskingFor = strapiRes[0].provider.providerName

Además, si está haciendo un bucle, intente algo como:

 strapiRes.map(activity => activity.provider.providerName)
about 4 years ago · Juan Pablo Isaza Report
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!