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

187
Visualizações
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 à 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