# Has Path

Check if a path exists using lodash _.has

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

- **Category:** Data Processing

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

## Overview

Check if a property path exists on an object or array.

**Highlights:**
- Uses lodash `_.has`
- Checks own properties only
- Returns true or false

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

## Inputs

- **Input** (textarea): Enter a JSON object or array
- **Path** (text): Property path to check

## When to use

- Validating the presence of nested keys in complex JSON data structures.
- Checking if specific configuration settings or fields exist before processing data.
- Debugging API responses to ensure required properties are present.

## How it works

- Paste your JSON object or array into the input field.
- Enter the dot-notation path you wish to verify (e.g., user.profile.id).
- Click the check button to receive a true or false result based on whether the property exists as an own property of the object.

## Use cases

- Verifying API response schemas during development.
- Filtering data objects that contain specific nested attributes.
- Ensuring configuration files contain all required keys before application startup.

## Frequently asked questions

### What does this tool check for?

It checks if a specific property path exists as an own property of the provided JSON object or array.

### Does it check inherited properties?

No, it specifically uses lodash _.has, which only checks for own properties of the object.

### What format should the path be in?

Use standard dot notation, such as 'data.items[0].name'.

### Can I check arrays?

Yes, you can check for indices or properties within arrays using the same path syntax.

### What is the output?

The tool returns a simple boolean value: true if the path exists, and false if it does not.

## Related tools

- [Has In Path](https://elysiatools.com/en/tools/has-in-path): Check if a path exists using lodash _.hasIn
- [Assign Object](https://elysiatools.com/en/tools/assign-object): Assign source properties to a target object using lodash _.assign
- [Count By](https://elysiatools.com/en/tools/count-by): Count items by a derived key using lodash _.countBy
- [From Pairs](https://elysiatools.com/en/tools/from-pairs): Convert array of key-value pairs to object using lodash _.fromPairs
- [Get Path](https://elysiatools.com/en/tools/get-path): Get a value at a path using lodash _.get
- [Group By](https://elysiatools.com/en/tools/group-by): Group items by a derived key using lodash _.groupBy
- [Index Of](https://elysiatools.com/en/tools/index-of): Find the index of a value in array using lodash _.indexOf
- [Nth Item](https://elysiatools.com/en/tools/nth-item): Get the item at a specific index using lodash _.nth

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