Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

193
Vistas
API Post to Airtable causing creation of duplicates

i have created a script to push new kids from one system into Airtable, i have been able to create the payload and a function to push the payload to Airtable API, it works, however it creates duplicate entries as well. I have double-checked the payload and i don't see any duplicates.

This is the script that finds the users to create

for (let user1 of modStuArray) {
      if (user1.status === 'enrolled' || user1.status === 'admitted') {
          const foundUser = !atToCompare.find(user2 => user2.oa_id === user1.oa_id);
          if (foundUser) {
              newUsers.records.push({
              
                  fields: {
                      ...user1
                  },
              });
          }
      }
 
      postAt('app38098wehf','Students',newUsers)
  }

This is the function to post payload into AT

function postAt (baseId, tableName, payload){
  var options = 
      {
        method: 'POST',
        headers: {
          'Authorization' : 'Bearer ' + atToken,
          'Content-Type'  : 'application/json',
          "Accept": "application/json"
        },
        payload : JSON.stringify(payload),
        //muteHttpExceptions : true,
        //followRedirects: true
      };
  var response = UrlFetchApp.fetch('https://api.airtable.com/v0/' + baseId + "/" + encodeURIComponent(tableName),    
  options).getContentText();
  return(response);
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda