Hi, there!!
I need an automation to do exactly what the subject of the topic says. We’ll fill the e-mail field in Table 2 from a csv import. Then we need the automation to lookup that email on Table 1, get the Name value corresponding and then fill the field Aluno in table 2.
I found a script in another post that I adapted to what I need but I’m still learning to code so I need help to fix my script. Can anyone pleeeease give me a help?
About the script: I added 2 variables - tho I don’t actually need record ID - but I followed the instructions on the other post.
Variable 1 is recordID and the value is Airtable record ID
Variable 2 is email and the value is email
Both variables are being pulled from Table 2
let config = input.config();
let table1 = base.getTable("Base de Alunos");
let table2 = base.getTable("Entregas Plataforma");
let query = await table1.selectRecordsAsync({fields: table1.fields});
let found = query.records.filter(record => record.getCellValueAsString("Nome") == config.email);
if (found) {
await table2.updateRecordAsync(config.recordID, {"Aluno": u{id: found 0].id}]})
}