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

176
Views
run script when records created and define a let for a unique person

I need to know how i ask to run script when new record is created and define if name in:

var response = await fetch('https://api.agify.io/?name='+name);

is equal to Prénom used from table else only change records only for this person.

I give you a screen of my table

// query for every record in "trombinoscope"

let table = base.getTable("test");
let view = table.getView("Donnée brut");
let query = await view.selectRecordsAsync
(
    {
    sorts: 
        [
        // sort by "Prénom" in ascending order...
        {field: "Prénom"},
        ]
    }
);

let records = query.records;
// print ID & "Prénom" from each record:
for (let record of query.records) 
{
    let name = (record.getCellValueAsString('Prénom')) ;
    var response = await fetch('https://api.agify.io/?name='+name) ;

    var agifyage = ((await response.json()).age);
    
    let records = query.records;
    for (let i=0 ; i<records.length ; i++)
    {
      await table.updateRecordsAsync(
      [
        {
        id: records[i].id ,
        fields: 
            {
             "Age estimé" : agifyage ,
            },
        },
      ]);
    }
   }

table used to get inforamtion

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!