# Get Path

Get a value at a path using lodash _.get

> Canonical page: https://elysiatools.com/en/tools/get-path

- **Category:** Data Processing

- **Keywords:** get, path, lodash, object, array

## Overview

Get a value from an object or array using a property path.

**Highlights:**
- Uses lodash `_.get`
- Supports dot and bracket paths
- Optional JSON default value

**Example:**
- Input: `{"user":{"name":"Ada"}}`
- Path: `user.name`
- Result: `"Ada"`

## Inputs

- **Input** (textarea): Enter a JSON object or array
- **Path** (text): Property path to read
- **Default Value** (textarea): Optional JSON default value

## When to use

- When you need to extract a specific nested value from a large JSON response.
- When you want to safely access object properties without risking 'undefined' errors.
- When you need to provide a fallback value if a specific path does not exist in your data.

## How it works

- Paste your JSON object or array into the input field.
- Define the path to the desired property using standard dot notation (e.g., user.profile.id) or bracket notation (e.g., users\[0\].name).
- Optionally provide a default JSON value to return if the path is not found.
- Execute the tool to retrieve the specific value instantly.

## Use cases

- Extracting specific configuration settings from a nested JSON settings file.
- Parsing individual user details from a large API response array.
- Retrieving default values from a configuration object when specific keys are missing.

## Frequently asked questions

### What library does this tool use?

This tool utilizes the industry-standard lodash _.get function for robust data retrieval.

### Can I access array elements?

Yes, you can use bracket notation (e.g., items[0].price) to access specific elements within an array.

### What happens if the path does not exist?

If the path is not found, the tool will return 'undefined' unless you provide a custom default value.

### Does it support deep nesting?

Yes, the tool supports arbitrarily deep paths as long as the structure is valid JSON.

### Is the input data validated?

The tool expects valid JSON input; ensure your data is correctly formatted before processing.

## Related tools

- [Count By](https://elysiatools.com/en/tools/count-by): Count items by a derived key using lodash _.countBy
- [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
- [Sorted Index](https://elysiatools.com/en/tools/sorted-index): Find the insertion index in a sorted array using lodash _.sortedIndex

## 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
