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

248
Visualizações
How to save data into variable after fetching with airtable.js?

I have tried fetching data from airtable API using airtable.js

here is the code that airtable gives

var Airtable = require('airtable');
var base = new Airtable({apiKey: 'YOUR_API_KEY'}).base('app1lRj8mFkG7qy4p');

base('All Impact Organisations').find('rec3JjliAZkNmbFVX', function(err, record) {
    if (err) { console.error(err); return; }
    console.log('Retrieved', record.id);
});

and what i want is

var Airtable = require('airtable');
var base = new Airtable({apiKey: 'YOUR_API_KEY'}).base('app1lRj8mFkG7qy4p');

const result = base('All Impact Organisations').find('rec3JjliAZkNmbFVX', function(err, record) {
    if (err) { console.error(err); return; }
    else return record
});

console.log(result)

I know that is wrong code because airtable use a callback function to fetch the data, however, why I want to do that because I need to concat the result data with another record

FYI I'm using react in this problem

can somebody help me?

about 4 years ago · Santiago Gelvez
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