Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

637
Visualizações
How can I import relational data when parsing a file in Strapi?

I’m writing a script to import bulk data entries for organizations. In Strapi, however, I have a number of relational fields for the organizations with things like “area_of_focus”, “languages”, etc. My question is, how can I import the data properly for the relational when it’s in a dropdown in the strapi admin panel? I’ve included the section of the code that maps and a screenshot of the relational data for reference.

All the data without a relation imports fine, it’s just any relational field that doesn’t work. I just have a feeling it’s how I’m calling them, but I’m unsure.

Relational Fields:

enter image description here

Mapping Code:

await Promise.all(data.map(entry => 
  strapi.query('organization').create({
    name: entry.name,
    EIN: entry.EIN,
    locations: [
      {
        streetAddress: entry.streetAddress,
        city: entry.city,
        state: entry.state,
        zipCode: entry.zipCode,
        county: entry.county,
        locationType: entry.locationType,
      }
    ],
    contact: [
      {
        firstName: entry.firstName,
        lastName: entry.lastName,
        email: entry.email,
        phone: entry.phone,
        phoneExtension: entry.phoneExtension,
      }
    ],
    description: entry.description,
    webSite: entry.webSite,
    email: entry.orgEmail,
    phone: entry.orgPhone,
    priority_area_topics: entry.priority_area_topics,
    organizationType: entry.organizationType,
    areaOfFocus: entry.organization_area_of_focus,
    localServiceArea: entry.local_service_areas,
    localServiceAreaDescription: entry.localServiceAreaDescription,
    helpDesk: entry.helpDesk,
    officeHours: entry.officeHours,
    maximumResponseTime: entry.maximumResponseTime,
    languages: entry.languages,
  })
));
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda