Problem Description
I have an Airtable script that runs when new records get added to my “Registrations” table. The script is supposed to send user data (full name, email address, and company info) to my n8n webhook endpoint. After that, n8n should trigger a welcome email through Brevo.
Current Script Code
let hookEndpoint = "https://myapp.n8n.cloud/webhook/registration";
// Retrieve configuration
let inputConfig = input.config();
let currentRecordId = inputConfig.recordId;
// Access table and record data
let registrationTable = base.getTable("Registrations");
let currentRecord = await registrationTable.selectRecordAsync(currentRecordId);
if (currentRecord) {
let fullName = currentRecord.getCellValue("Full Name");
let emailAddress = currentRecord.getCellValue("Email Address");
let companyName = currentRecord.getCellValue("Company");
if (!emailAddress || !emailAddress.includes("@")) {
output.set("error", "Email validation failed");
} else {
let dataPacket = { FullName: fullName, EmailAddress: emailAddress, Company: companyName };
await fetch(hookEndpoint, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(dataPacket),
});
output.set("dataPacket", dataPacket);
}
} else {
output.set("error", "Could not find record with ID: " + currentRecordId);
}
What’s Going Wrong
The email field only shows up as a single character in n8n (like “j” instead of “[email protected]”). The name and company fields come through as null values every time, even though I can see the correct data in Airtable.
What I’ve Already Checked
- The record ID variable is working fine
- Field names are spelled exactly right
- Test runs in Airtable show all the correct data
- The payload looks perfect when I check it in Airtable logs
Has anyone run into this weird data truncation problem before? Could this be some kind of encoding issue between Airtable and n8n? Any ideas for fixing this would be awesome!