Xlsx file parse

Dear,

I want to parse xlsx file and save rows on a array for example and process each element on the workflow.

When i use this workflow, it get only the first Sheet, is it possible to select Sheet during reading and filter the rows which i need for example A_AGENT rows?

Thank you.

Please share your workflow

  "nodes": [
    {
      "parameters": {
        "fileSelector": "/data/doc/Doc.xlsx",
        "options": {}
      },
      "type": "n8n-nodes-base.readWriteFile",
      "typeVersion": 1,
      "position": [
        -672,
        -304
      ],
      "id": "69b5afd3-2784-4c3c-8387-f54584eb0efd",
      "name": "Read/Write Files from Disk1"
    },
    {
      "parameters": {
        "operation": "xlsx",
        "options": {}
      },
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [
        -448,
        -288
      ],
      "id": "cc0a618d-9657-43db-91be-6fee8b344b16",
      "name": "Extract from File"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        -192,
        -288
      ],
      "id": "356aec32-a198-4f60-a2a7-1c2d3e4ba2f5",
      "name": "Loop Over Items"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "94ef4430-d5d2-400d-8f35-ba0a149ff068",
              "name": "mot_cles_interdites",
              "value": "={{ $json.Mots_cles_interdites }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        80,
        -272
      ],
      "id": "d4746288-5f80-455f-b53a-d04254e5bd40",
      "name": "Edit Fields"
    }
  ],
  "connections": {
    "Read/Write Files from Disk1": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "54c34153644f41955df1b045b27e23c5aa493246a7d7e5e8ad537b7abbcf8133"
  }
}
(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:1.104.2
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):Docker
  • **Operating system:Win 10

To get data from all sheets within an Excel file using n8n, you can employ the following approach:

Read Excel File Node:

  1. Start by adding a “Read Excel File” node to your n8n workflow. Configure this node to point to your Excel file.

Get Sheet Names:

  1. After the “Read Excel File” node, you will likely need to retrieve the names of all the sheets within the workbook. The “Read Excel File” node can often provide this information in its output, or you might need a custom function or code node to extract sheet names if the direct output does not provide them easily.

Iterate Through Sheets:

  1. Use a “Split In Batches” or “Loop” node (e.g., “Item Lists” or “Code” node with a loop) to iterate over each sheet name obtained in the previous step.
    Read Each Sheet Data:

  2. Inside the loop, add another “Read Excel File” node. In this node’s configuration, dynamically set the “Sheet Name” property using an expression that refers to the current sheet name from the loop’s iteration. This ensures that each iteration reads data from a different sheet.

I try, i get only on output all datas comes from the sheet “SheetA”, no datas from “SheetB”

Hey @jamal hope all is well.

See if this helps:

My SheetA:

Things
a
b
c
d
e
f

My SheetB:

Other things
1
2
3
4
5

The output:

I get this message, i use N8N by Docker :

Try allowing the module: