# Records: Pagination

> Part of the NocoDB documentation (Workflows > Scripts > Examples > Generic). Index of all pages: https://nocodb.com/llms.txt. Any docs page is available as Markdown by adding `.md` to its URL.

URL: https://nocodb.com/docs/workflows/scripts/examples/demo/records-list
Last updated: 2026-08-17

This script demonstrates how to load and display records from a selected table in NocoDB, with pagination support for large datasets.

```javascript
// Ask user to select a table
const table = await input.tableAsync('Select a table to load records from');

// Initial query with small page size
const result = await table.selectRecordsAsync({ pageSize: 50 });

// Initial log
output.text(`Loading records from "${table.name}"...`);

// Track total loaded so far
let previouslyLoaded = result.records.length;
output.text(`Loaded ${previouslyLoaded} records so far...`);

// Load all records using pagination, with progress updates
while (result.hasMoreRecords) {
  await result.loadMoreRecords();
  const newlyLoaded = result.records.length;
  const batchSize = newlyLoaded - previouslyLoaded;
  previouslyLoaded = newlyLoaded;
  output.text(`→ Loaded ${batchSize} more. Total so far: ${newlyLoaded}`);
}

// Final count
output.text(`✅ Done. Total records loaded from "${table.name}": ${result.records.length}`);
```

---

## Related pages

- [Table Operations](https://nocodb.com/docs/workflows/scripts/examples/demo/table-operations.md): Demonstrates how to check for table existence, create a table, and list all tables in the base.
- [Fields: Text-Based](https://nocodb.com/docs/workflows/scripts/examples/demo/field-text-based.md): Learn how to create and manage text-based fields in NocoDB.
- [Fields: Numerical](https://nocodb.com/docs/workflows/scripts/examples/demo/field-number-based.md): Learn how to create numerical fields for storing quantities, percentages, currency, and more.
- [Fields: Date & Time](https://nocodb.com/docs/workflows/scripts/examples/demo/field-date-time.md): Create fields to capture dates, times, and durations.
- [Fields: Select](https://nocodb.com/docs/workflows/scripts/examples/demo/field-select-based.md): Create single select and multi select fields for categorizing data.
- [Fields: System](https://nocodb.com/docs/workflows/scripts/examples/demo/field-system.md): Capture automatic audit information with system fields in NocoDB.
- [Fields: User & Collaborator](https://nocodb.com/docs/workflows/scripts/examples/demo/field-user.md): Assign or reference users directly within records.
- [Fields: Virtual & Formula](https://nocodb.com/docs/workflows/scripts/examples/demo/field-virtual.md): Add calculated or derivative data with virtual fields in NocoDB.
