Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

186
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!