Newbie Question: Data not transfered from mail to Google Doc

My first workflow: Data from Mail into a Google sheet

Execution runs as succeeded, but not data entries in Google sheet.

Tried to find error with n8n AI Assistan/ChatGPT/Gemini → unsuccessful

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @Roland_Luthi ,

I’d be happy to help, but with just the screenshot, it’s a bit difficult to identify the exact issue. Could you please share the workflow JSON here so I can take a closer look?

Here’s how you can do that:

  1. First, run the workflow on your end.
  2. Open the Email Trigger node. On the right-hand side, where you see the incoming data, click the pin icon to pin that data to the node.
    (This helps us test with the exact data that’s causing the issue.)
  3. Select all the nodes in your workflow and press Ctrl + C to copy them.
  4. Come back here, click the </> icon in the message box (to format the code properly), and paste the copied workflow JSON.

Once I have that, I’ll be able to give you more specific guidance.

This is the output from Email Trigger

const mailText = items[0].json.textPlain || ‘’;

const lines = mailText.split(‘\n’).map(line => line.trim()).filter(line => line.length > 0);

const data = {};

// Liste aller erwarteten Felder als Schlüssel mit Default ‘’
const expectedFields = [
“Datum”, “Zeit”, “Vorname”, “Nachname”, “Institution”, “Wer bist du?”,
“E-Mail für Bestätigung, Fragen & Updates”, “Telefonnummer (Fragen und Notfälle)”,
“Wieviele Personen meldest du an?”, “Wann kommst du?”, “Möchtest du mit Tixi-Taxi kommen?”,
“Bist du mind. 20 Jahre alt?”, “Wenn du/ihr mit Tixi-Taxi kommen möchtet, brauchen wir die Adresse. SONST NICHT”,
“Falls du mehrere Personen anmeldet, bitte die Vor-und Nachname, Notfall-Telefonnummer bei Bedarf und ob Betreuer oder Ehrengast”,
“Besondere Bedürfnisse oder wichtige Informationen, die das Hilfe-Team wissen muss.”,
“Seiten URL”, “Benutzer Agent”, “Remote IP”
];

// Alle Felder initialisieren
expectedFields.forEach(field => {
data[field] = ‘’;
});

// Mailtext parsen
lines.forEach(line => {
const match = line.match(/^([^:]+):\s*(.*)$/);
if (match) {
const key = match[1].trim();
const value = match[2].trim();
if (expectedFields.includes(key)) {
data[key] = value;
}
}
});

// Meta-Daten aus der Mail ergänzen, falls vorhanden
if(items[0].json[‘Datum’]) data[‘Datum’] = items[0].json[‘Datum’];
if(items[0].json[‘Zeit’]) data[‘Zeit’] = items[0].json[‘Zeit’];
if(items[0].json[‘Seiten URL’]) data[‘Seiten URL’] = items[0].json[‘Seiten URL’];
if(items[0].json[‘Benutzer Agent’]) data[‘Benutzer Agent’] = items[0].json[‘Benutzer Agent’];
if(items[0].json[‘Remote IP’]) data[‘Remote IP’] = items[0].json[‘Remote IP’];

return [{ json: data }];

This is the output from Email Trigger

const mailText = items[0].json.textPlain || ‘’;

const lines = mailText.split(‘\n’).map(line => line.trim()).filter(line => line.length > 0);

const data = {};

// Liste aller erwarteten Felder als Schlüssel mit Default ‘’
const expectedFields = [
“Datum”, “Zeit”, “Vorname”, “Nachname”, “Institution”, “Wer bist du?”,
“E-Mail für Bestätigung, Fragen & Updates”, “Telefonnummer (Fragen und Notfälle)”,
“Wieviele Personen meldest du an?”, “Wann kommst du?”, “Möchtest du mit Tixi-Taxi kommen?”,
“Bist du mind. 20 Jahre alt?”, “Wenn du/ihr mit Tixi-Taxi kommen möchtet, brauchen wir die Adresse. SONST NICHT”,
“Falls du mehrere Personen anmeldet, bitte die Vor-und Nachname, Notfall-Telefonnummer bei Bedarf und ob Betreuer oder Ehrengast”,
“Besondere Bedürfnisse oder wichtige Informationen, die das Hilfe-Team wissen muss.”,
“Seiten URL”, “Benutzer Agent”, “Remote IP”
];

// Alle Felder initialisieren
expectedFields.forEach(field => {
data[field] = ‘’;
});

// Mailtext parsen
lines.forEach(line => {
const match = line.match(/^([^:]+):\s*(.*)$/);
if (match) {
const key = match[1].trim();
const value = match[2].trim();
if (expectedFields.includes(key)) {
data[key] = value;
}
}
});

// Meta-Daten aus der Mail ergänzen, falls vorhanden
if(items[0].json[‘Datum’]) data[‘Datum’] = items[0].json[‘Datum’];
if(items[0].json[‘Zeit’]) data[‘Zeit’] = items[0].json[‘Zeit’];
if(items[0].json[‘Seiten URL’]) data[‘Seiten URL’] = items[0].json[‘Seiten URL’];
if(items[0].json[‘Benutzer Agent’]) data[‘Benutzer Agent’] = items[0].json[‘Benutzer Agent’];
if(items[0].json[‘Remote IP’]) data[‘Remote IP’] = items[0].json[‘Remote IP’];

return [{ json: data }];