> ## Documentation Index
> Fetch the complete documentation index at: https://learn.workflow.dog/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Last N Table Rows

> Read the last N populated rows from a Google Sheets table.

The **Get Last N Table Rows** action finds the end of a table and returns up to
the requested number of final data rows as header-keyed objects.

## Inputs

| Input                       | Type           | Required | Description                                                         |
| --------------------------- | -------------- | -------- | ------------------------------------------------------------------- |
| **Third-party account**     | Google account | Yes      | Account with Sheets write access, required to locate the table end. |
| **Spreadsheet ID or URL**   | String         | Yes      | Spreadsheet containing the table.                                   |
| **Sheet Name**              | String         | Yes      | Sheet tab to read.                                                  |
| **Number of Rows**          | Number         | Yes      | Maximum rows to return; must be at least `1`.                       |
| **Header Row Number**       | Number         | No       | One-based header position. Defaults to `1`.                         |
| **Return Formatted Values** | Boolean        | No       | Return display text instead of raw values. Default `false`.         |

## Outputs

| Output   | Type                | Description                            |
| -------- | ------------------- | -------------------------------------- |
| **Rows** | List of row objects | Final table rows keyed by header text. |

The header row is excluded. If the table has fewer than N data rows, all
available rows are returned.

<Note>
  The action determines the append position using column A. Tables should have
  consistent data in their first column for reliable end-of-table detection.
</Note>
