Extract from file (ODS, XLSX) reads only 2 rows

I want to extract file from ODS or XLSX, unfortunately it extracts only 2 rows, the header and first data row. What should be set in order to extract entire table from xlsx/ods ?

Share the output returned by the last node

Information on your n8n setup

  • Running n8n via Docker
  • Operating system: windows 11

Just replace your expression {{Object.keys($binary)[0]}} with data, unless you want something specifically with that file.

Usually outputs the data as a series of JSON row objects.

1 Like

It didn’t work. I changed to “data0” as You can see on the picture, and still te same, only 2 rows. I also attach the table from original file

Ahhh… just seen that actually have 11 items , you just need to split or item list to get individual rows?

The output is typically an array of items.

1 Like

I want to insert data extracted from the table to AI agent. I want to prompt agent to analyze row by row and construct text based on the whole table. The output text would be technical description

To achieve your goal in n8n—analyzing a table row by row with an AI agent and generating a technical description based on the whole table—you can follow this general approach:

1. **Extract Data from the Table**

Use the appropriate node (e.g., Google Sheets, database, or CSV node) to fetch all rows from your table.

2. **Aggregate or Format the Data**

If you want the AI agent to consider the entire table at once, aggregate the rows into a single object or string. The [Aggregation node]( Aggregate | n8n Docs ) can help you merge all rows into one item, which is useful for summarization or analysis tasks. This is a common pattern to avoid sending excessive data to the AI model and to provide a concise context for analysis. For example, you can aggregate all rows and then summarize them before sending to the AI agent, as shown in the ERP AI chatbot example: first aggregate, then summarize, then use as context for the agent’s prompt [ERP AI chatbot guide]( ERP AI Chatbot: Advanced ERP Automation with AI – n8n Blog ).

3. **Prompt the AI Agent**

Pass the aggregated data to the AI Agent node. In your prompt, instruct the agent to analyze the data and construct a technical description. For example, you might use a prompt like:

```

Analyze the following table data and generate a technical description: {{ $json.data }}

```

This approach is also used in the ERP AI chatbot, where the context is summarized and then provided to the agent for further analysis or question answering [ERP AI chatbot implementation]( ERP AI Chatbot: Advanced ERP Automation with AI – n8n Blog ).

4. **Output the Result**

The AI Agent node will return the generated technical description, which you can then use in subsequent workflow steps (e.g., update a document, send an email, etc.).

**Tips:**

- If your table is very large, consider summarizing or chunking the data before sending it to the AI agent to avoid context window limitations.

- You can use the [Window Buffer Memory node]( Simple Memory node documentation | n8n Docs ) to help the agent remember previous interactions if you want to process the table in parts.

**Example Workflow Reference:**

This pattern—aggregate table data, summarize, and then analyze with an AI agent—is demonstrated in the [ERP AI chatbot example]( ERP AI Chatbot: Advanced ERP Automation with AI – n8n Blog ).

If you need a concrete workflow template, you can adapt the ERP AI chatbot or the [AI Data Analyst Agent]( AI Data Analyst Agent and Visualization Agent for Large Spreadsheets | n8n workflow template ) to your use case.

P.S if you achieve this, you can pass the course levels as well.

We are here to help in every way so you understand, not just “fixers” . :slight_smile:

1 Like

Ok, but the question is what node should I use in my case? As you can see I used “Extract from file” node, and it reads only 2 rows. The xlsx file is saved on local disc, then it is uploaded to the workflow via chat message node → “extract from file” node.

Please share your workflow here as code… is strange whats happening in your case, or i dony fully understand.

I’m sorry for my misunderstanding, I’ve just realised what “11" items” mean. When I switched from “schema” to “table”, the whole table was shown. I’m very beginner. Thank You for Your tips, I have a lot of work to do. I’ll analyze Your tips in order to avoid stupid my stupid questions :smiley:

Glad that you understood!
Thats the way to learn :slight_smile:

Mark answer as solved so the topic will be relevant to others.

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