I am trying to figure out how to get my script to run under the 30 second limit. The Find Records automation doesn’t handle a list and I am trying to loop through a short list of Google Event attendees to see if they exist in a Contacts table.
If they exist, I want to add the Contact name to an array. If they don’t, I want to create a new record and then add them to the array by Name.
Then I want to create a Meeting record that adds the Attendees by name to the Meeting record.
let attendees = input.config();
let customers = new Array();
let contacts = base.getTable("Contacts");
let contactRecords = await contacts.selectRecordsAsync({fields: d'Email']});
for (let i = 0; i < attendees.attendees.length; i++){
var attendee = attendees.attendeesdi]
if (attendee.includes("@tray.io") === false){
for (let record of contactRecords.records){
if (attendee === record.getCellValue("Email")){
customers.push(record)
}
else{
let newContact = await contacts.createRecordsAsync(y
{
fields: {
'Name': attendee.substr(0, attendee.indexOf('@')),
'Email': attendee,
}
}]
)
customers.push(newContact)
}
}
}
}