Handling multiple records inside a Gmail message

I’m trying to process an email that comes in from a human.

The email will include

First Name

Last Name

Resignation Date

Commissions Earned 2025

Commissions Earned 2024

Commissions Earned 2023

(Something like that)

The Information Extractor node has no problem processing that and it write it to my Google sheet just fine.

But sometimes the human email will include multiple records in one email. For example:

First Name1

Last Name1

Resignation Date3

Commissions Earned 2025

Commissions Earned 2024

Commissions Earned 2023

First Name2

Last Name2

Resignation Date3

Commissions Earned 2025

Commissions Earned 2024

Commissions Earned 2023

First Name3

Last Name3

Resignation Date3

Commissions Earned 2025

Commissions Earned 2024

Commissions Earned 2023

I’ve written my prompt inside the Information Extractor to look for multiple records and asked it to iterate through them all..but it’s still only pulling the first record.

How do I get the output to have multiple records?

And then my second question after that would be…can my Google Sheet (update a record) do more than one record at a time?

How do I handle something like this?

Dear @tracyselena How’s everything going on with you !

Answer 1: Yes, Google sheet process more than 1 output at a time.

Answer 2: for the code node related problem you are facing, can you please share your workflow, here so that we can have a look on it.

That way we are going to solve it easily…

Thank you so much for your reply.

MY n8n is self-hosted so I can’t share. When I try it says I have to upgrade.
Is there another way to share it? screenrecording?

here is example on how to shere

1 Like

Oh thanks so much for that!

**** start of code ****

{
“nodes”: [
{
“parameters”: {
“text”: “=This email contains resignation and GCI/CCI information for one or more real estate agents\n\nSeparate this text into the following fields. \n\nFirst name\nLast name\nResignation Date\nGCI (sometimes called GCC) for each year going back as far as 2018. \n\nIf you cannot find any GCI (or GCC) mumbers for a particular year, consider it $0.\n\nIf there is a "Pending" amount, add it to the same GCI/CCI line that it’s on so it’s added together as one amount for that year.\n\nGet each GCI for each year separately. And if is are more than one agent referred to in this email than iterate the output for each agent.\n{{ $json.text }}”,
“attributes”: {
“attributes”: [
{
“name”: “First Name”,
“description”: “First Name”,
“required”: true
},
{
“name”: “Last Name”,
“description”: “Last Name”,
“required”: true
},
{
“name”: “Date of Resignation”,
“type”: “date”,
“description”: “Date of resignation”,
“required”: true
},
{
“name”: “=2018”,
“type”: “number”,
“description”: "=GCI for 2018 "
},
{
“name”: “2019”,
“type”: “number”,
“description”: "=GCI for 2019 "
},
{
“name”: “2020”,
“type”: “number”,
“description”: "=GCI for 2020 "
},
{
“name”: “2021”,
“type”: “number”,
“description”: "=GCI for 2021 "
},
{
“name”: “2022”,
“type”: “number”,
“description”: "=GCI for 2022 "
},
{
“name”: “2023”,
“type”: “number”,
“description”: "=GCI for 2023 "
},
{
“name”: “2024”,
“type”: “number”,
“description”: "=GCI for 2024 "
},
{
“name”: “2025”,
“type”: “number”,
“description”: "=GCI for 2025 "
}
]
},
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.informationExtractor”,
“typeVersion”: 1.2,
“position”: [
200,
-240
],
“id”: “6431e2dd-c820-47bf-b7d3-dc1d2ae28953”,
“name”: “Information Extractor”
},
{
“parameters”: {
“modelName”: “models/gemini-1.5-flash”,
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatGoogleGemini”,
“typeVersion”: 1,
“position”: [
220,
-20
],
“id”: “ed7d2056-dbb5-4305-a672-440f3dca2368”,
“name”: “Google Gemini Chat Model1”,
“credentials”: {
“googlePalmApi”: {
“id”: “m6aKxfgIdnMw8Ebo”,
“name”: “Google Gemini(PaLM) @royallepagesignature.com
}
}
},
{
“parameters”: {
“operation”: “update”,
“documentId”: {
“__rl”: true,
“value”: “1zGtZAGwAfOMCiINyAvpvpE13pF2jF_EMcQrhZ9iuXrQ”,
“mode”: “list”,
“cachedResultName”: “HIRING AND TERMINATIONS”,
“cachedResultUrl”: “HIRING AND TERMINATIONS - Google Sheets
},
“sheetName”: {
“__rl”: true,
“value”: 1032133326,
“mode”: “list”,
“cachedResultName”: “TERMINATIONS”,
“cachedResultUrl”: “HIRING AND TERMINATIONS - Google Sheets
},
“columns”: {
“mappingMode”: “defineBelow”,
“value”: {
“2018”: “={{ $json.output[‘2018’] }}”,
“2019”: “={{ $json.output[‘2019’] }}”,
“2020”: “={{ $json.output[‘2020’] }}”,
“2021”: “={{ $json.output[‘2021’] }}”,
“2022”: “={{ $json.output[‘2022’] }}”,
“2023”: “={{ $json.output[‘2023’] }}”,
“2024”: “={{ $json.output[‘2024’] }}”,
“2025”: “={{ $json.output[‘2025’] }}”,
“Last Name”: “={{ $json.output[‘Last Name’] }}”
},
“matchingColumns”: [
“Last Name”
],
“schema”: [
{
“id”: “First Name”,
“displayName”: “First Name”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “Last Name”,
“displayName”: “Last Name”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true,
“removed”: false
},
{
“id”: “Office Location”,
“displayName”: “Office Location”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “Dismissed Date”,
“displayName”: “Dismissed Date”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “Income Level”,
“displayName”: “Income Level”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “Destination Brokerage”,
“displayName”: “Destination Brokerage”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “Hired Date”,
“displayName”: “Hired Date”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “Experience Level”,
“displayName”: “Experience Level”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “# of days with us”,
“displayName”: “# of days with us”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “Dismissed Year”,
“displayName”: “Dismissed Year”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “2016”,
“displayName”: “2016”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “2017”,
“displayName”: “2017”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “2018”,
“displayName”: “2018”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “2019”,
“displayName”: “2019”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “2020”,
“displayName”: “2020”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “2021”,
“displayName”: “2021”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “2022”,
“displayName”: “2022”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “2023”,
“displayName”: “2023”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “2024”,
“displayName”: “2024”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “2025”,
“displayName”: “2025”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “2026”,
“displayName”: “2026”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “2027”,
“displayName”: “2027”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “2028”,
“displayName”: “2028”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “2029”,
“displayName”: “2029”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “2030”,
“displayName”: “2030”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true
},
{
“id”: “Email”,
“displayName”: “Email”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true,
“removed”: false
},
{
“id”: “row_number”,
“displayName”: “row_number”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true,
“readOnly”: true,
“removed”: true
}
],
“attemptToConvertTypes”: false,
“convertFieldsToString”: false
},
“options”: {}
},
“type”: “n8n-nodes-base.googleSheets”,
“typeVersion”: 4.6,
“position”: [
560,
-240
],
“id”: “50e7b779-e030-44f0-97ec-03efa7f07633”,
“name”: “Update row in sheet”,
“credentials”: {
“googleSheetsOAuth2Api”: {
“id”: “EZjebqtazNFWNkSH”,
“name”: “Google Sheets [email protected]
}
}
},
{
“parameters”: {
“operation”: “get”,
“messageId”: “={{ $json.id }}”,
“simple”: false,
“options”: {}
},
“type”: “n8n-nodes-base.gmail”,
“typeVersion”: 2.1,
“position”: [
0,
-240
],
“id”: “d7784259-74a7-4dc0-9bf6-ace900fb2aa9”,
“name”: “Get a message”,
“webhookId”: “af2112ff-927b-4fc6-ad20-4104825ec4e9”,
“credentials”: {
“gmailOAuth2”: {
“id”: “3LzrQPUcybINzx7N”,
“name”: “Gmail [email protected]
}
}
},
{
“parameters”: {
“pollTimes”: {
“item”: [
{
“mode”: “everyMinute”
}
]
},
“filters”: {
“labelIds”: [
“Label_4186100697789055196”
]
}
},
“type”: “n8n-nodes-base.gmailTrigger”,
“typeVersion”: 1.2,
“position”: [
-200,
-240
],
“id”: “e6f74e5e-3ad0-4136-8990-573e15650784”,
“name”: “Gmail Trigger - Look for Resignations Spreadsheet Label”,
“credentials”: {
“gmailOAuth2”: {
“id”: “3LzrQPUcybINzx7N”,
“name”: “Gmail [email protected]
}
}
}
],
“connections”: {
“Information Extractor”: {
“main”: [
[
{
“node”: “Update row in sheet”,
“type”: “main”,
“index”: 0
}
]
]
},
“Google Gemini Chat Model1”: {
“ai_languageModel”: [
[
{
“node”: “Information Extractor”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“Get a message”: {
“main”: [
[
{
“node”: “Information Extractor”,
“type”: “main”,
“index”: 0
}
]
]
},
“Gmail Trigger - Look for Resignations Spreadsheet Label”: {
“main”: [
[
{
“node”: “Get a message”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “219068e8b4b51e95b4b60f60ac86cb03e8934f37aab774ec211dd5ebdec2f814”
}
}

**** end of code ****

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.