How to Find the Right Airtable Record When the Text Is Not an Exact Match
You receive an email. The subject line of that email gets logged automatically in your Google Sheet. It could look like “From John Smith regarding Project A” or something similar.
You already have a record for John Smith inside Airtable. The subject line in Google Sheets contains the name, but it also contains extra text. The two values do not match perfectly, but the subject line still includes the name you need.
Now you want an automation that reacts when a new row appears in your Google Sheet. You want your Airtable automation to locate the correct Airtable record based on the name inside that text.

You set up your automation, and the trigger fires correctly when the Google Sheets row is created. Everything looks fine until you reach the Find Record step.
This is where you hit a wall.
The Find Record action forces you to structure the condition in only one direction. You can compare “Airtable field contains Google Sheets value.” You cannot flip that around.
You cannot say “Google Sheets value contains Airtable field.” The first part of the condition must always be an Airtable field, and this prevents you from searching the way you actually need.
When your subject line contains an Airtable value as part of a larger string, the built-in Find Record action cannot detect it. The logic does not work in reverse.
What You Need to Do Instead
To solve this, you need a scripting step inside your automation.
A script gives you complete control over the comparison. You decide exactly how the match should work.
You can check whether the Airtable name appears anywhere inside the subject line. You can also add fuzzy matching if the text is not exact. The script lets you build the comparison logic in the way your workflow needs.
How You Set Up the Script
The script receives three inputs. The first is the subject line from Google Sheets. The second is the table that holds your records. The third is the field that contains the name you want to match.
The script loads your records, converts the names to lowercase, and checks whether the subject line contains any of those names.
If it finds a match, it saves that record and returns the ID to your automation. If there is no match, it returns an empty value.
Here is the full script you can copy into your automation.
let { googleSheetsNameValue, airtableDataTableId, airtableDataNameField } =
input.config();
let query = await base.getTable(airtableDataTableId).selectRecordsAsync({
fields: [airtableDataNameField],
});
let matchedRecord = null;
for (let record of query.records) {
let name = (
record.getCellValueAsString(airtableDataNameField) || ""
).toLowerCase();
if (name && googleSheetsNameValue.toLowerCase().includes(name)) {
matchedRecord = record;
break;
}
}
if (matchedRecord) {
output.set("recordId", matchedRecord.id);
} else {
output.set("recordId", "");
}
This gives you a reliable, repeatable way to connect incoming emails with the right Airtable records, even when the subject line contains extra text.