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

# Path selector

The path selector is based on JSON Path. It can be used to select and filter data from the source entity.
This is available as input for [array](./property-types#path-input) and for the [dynamic property type](./property-types#dynamic) to map data from the source entity.

For dynamic mapping, the selector should result in a property value (single token).
When using `$path` for the array input the result is expected to be a list of property values (multiple tokens).

Mapping all source entity properties:

```json theme={null}
"product": {
	"*": "p"
}
```

Consider, that you want the entire list of product features:

```json theme={null}
"features": {
	"*": "p.features"
}
```

If you only want the `name` of the features:

```json theme={null}
"tabs": {
  "type": "array",
  "input": {
    "$path": "p.features[*]"
  },
  "var": "feature",
  "items": {
    "type": "string",
    "value": "{item.name}"
  }
}
```

If you want all features with its `display` property equals true:

```json theme={null}
"tabs": {
  "type": "array",
  "input": {
    "$path": "p.features[?(@.display==true)]"
  },
  "var": "feature",
  "items": {
    "type": "string",
    "value": "{item.name}"
  }
}
```

You can combine dynamic mapping and arrays:

```json theme={null}
"tabs": {
  "type": "array",
  "input": {
    "$path": "p.features[?(@.display==true)]"
  },
  "var": "feature",
  "items": {
    "type": "object",
    "feature": {
      "*": "{feature}"
    }
  }
}
```

If you want the feature with its `id` property equals to a dynamic value:

```json theme={null}
"tabs": {
  "type": "array",
  "input": {
    "$path": "p.features[?(@.id=='{p.primaryFeatureId}')]"
  },
  "var": "feature",
  "items": {
    "type": "string",
    "value": "{item.name}"
  }
}
```
