# Take Items

Take the first N items using lodash _.take

> Canonical page: https://elysiatools.com/en/tools/take-items

- **Category:** Data Processing

- **Keywords:** array, take, first, count, lodash

## Overview

Take a specified number of items from the start of a JSON array.

**Highlights:**
- Uses lodash `_.take`
- Supports any array data type
- Returns the taken items as JSON

**Example:**
- Array: `[1, 2, 3, 4]`
- Count: `2`
- Result: `[1, 2]`

## Inputs

- **Array** (textarea): Enter a JSON array
- **Count** (number): Number of items to take

## When to use

- When you need to truncate a large dataset to preview only the first few entries.
- When you are processing paginated API responses and need to isolate the initial set of records.
- When you want to simplify complex JSON structures by extracting a fixed subset of items for testing or debugging.

## How it works

- Paste your JSON array into the input field.
- Specify the number of items you wish to extract in the count field.
- Click the process button to generate the resulting JSON array containing only the requested items.

## Use cases

- Extracting the top 5 trending items from a list of daily analytics data.
- Truncating long configuration lists for quick debugging sessions.
- Isolating the first record of a large dataset to verify schema structure.

## Frequently asked questions

### What happens if the count is greater than the array length?

The tool will return the entire original array without errors.

### Does this tool support nested JSON arrays?

Yes, it treats nested arrays as single elements within the parent array.

### Is the original array modified?

No, the tool processes the input and returns a new array, leaving your original data untouched.

### What is the maximum number of items I can take?

You can take up to 10,000 items as defined by the tool configuration.

### What format does the output take?

The output is returned as a clean, valid JSON array.

## Related tools

- [Count By](https://elysiatools.com/en/tools/count-by): Count items by a derived key using lodash _.countBy
- [Find Key](https://elysiatools.com/en/tools/find-key): Find the first matching key using lodash _.findKey
- [Group By](https://elysiatools.com/en/tools/group-by): Group items by a derived key using lodash _.groupBy
- [Head Item](https://elysiatools.com/en/tools/head-item): Get the first element of array using lodash _.head
- [Index Of](https://elysiatools.com/en/tools/index-of): Find the index of a value in array using lodash _.indexOf
- [Initial Items](https://elysiatools.com/en/tools/initial-items): Get all elements except the last using lodash _.initial
- [Nth Item](https://elysiatools.com/en/tools/nth-item): Get the item at a specific index using lodash _.nth
- [Remove By Predicate](https://elysiatools.com/en/tools/remove-by-predicate): Remove items that match a predicate using lodash _.remove

## Samples

- [Grafana Advanced Application Samples](https://elysiatools.com/en/samples/grafana-samples): Comprehensive Grafana samples covering advanced dashboard design, alerting configurations, data source integrations, and plugin development
- [QR Code Samples](https://elysiatools.com/en/samples/qrcode-samples): Sample QR code images for testing QR code reading and generation tools
- [D3.js Data Visualization Samples](https://elysiatools.com/en/samples/d3js-data-visualization): Comprehensive D3.js data visualization examples including charts, maps, animations, and interactive visualizations
- [Rome JavaScript Toolchain Samples](https://elysiatools.com/en/samples/rome): Rome JavaScript toolchain examples including configuration, linting, formatting, bundling, and project management
