Data from API call not returning to Postman

596 0
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

I used the API template code provided by Airtable, which includes a console.log of my data. That data is consoled just fine for me, but its not being returned to Postman (from where I made the call).

The request in Postman takes up to one minute before timing out, with the “ERR: socket hang up” error.

So I can only assume that I’m not properly returning the data in my function, but I’m at a loss, having tried returning it in every variation. Below is my function:

(The return is inside the .forEach method, but I’ve also put it within the page function, and also wrapped the whole await base in a variable which I then returned at the end of the getStudent function. I also treid async/awaiting it).

var Airtable = require('airtable');
const { API_KEY } = process.env;
var base = new Airtable({ apiKey: API_KEY }).base('app8ZbcPx7dkpOnP0');

const minifyRecord = (record: any) => {
  return {
    fields: record.fields,

export function getStudent() {
  const name = 'Jenny';
    .select({ filterByFormula: `{Name} = "${name}"` })
      function page(records: any, fetchNextPage: any) {
        records.forEach(function (record: any) {
          console.log('Retrieved', minifyRecord(record));
          return minifyRecord(record);
      function done(err: any) {
        if (err) {
0 Replies 0