I am trying to have AirTable take an ID number (from column a) and pull first and last names into columns b and c. I would like to use a second table as the reference sheet that would only hold this information (ID, First Name, Last Name).
I have done something similar to this in Google Sheets by using a second sheet in the file to reference this information and then I have the following script running:
function onOpen(event) {
var FirstNameInsert = SpreadsheetApp.getActiveSheet().getRange(‘B2:B2000’);
var LastNameInsert = SpreadsheetApp.getActiveSheet().getRange(‘C2:C2000’);
var FirstNameFormula = “=vlookup(A2:A20000,‘Active Students’!A:C,2,false)”;
var LastNameFormula = “=vlookup(A2:A20000,‘Active Students’!A:C,3,false)”;
var FirstNameCheckCell = SpreadsheetApp.getActiveSheet().getRange(‘firstname’).getValue;
var LastNameCheckCell = SpreadsheetApp.getActiveSheet().getRange(‘lastname’).getValue;
if ( FirstNameCheckCell != FirstNameFormula ) {
FirstNameInsert.setValue(FirstNameFormula) // This will enter the formula in column B row 2 - 1000
}
if ( LastNameCheckCell != LastNameFormula ) {
LastNameInsert.setValue(LastNameFormula) // This will enter the formula in column C 2 - 1000
}
var sheet = SpreadsheetApp.getActiveSheet()
var timezone = “GMT-7”;
var timestamp_format = “MM-dd-yyyy hh:mm a”;
var date = Utilities.formatDate(new Date, timezone, timestamp_format)
var Timestamp = SpreadsheetApp.getActiveSheet().getRange(‘timestamp’).getValue
if ( date <= Timestamp ) {
sheet.sort(4, false);
}
}
However, I can not figure out how to do it in Airtable. Any suggestions or help is appreciated.