---
title: "Formula - jsonPathKey: Extract Property Names from JSON"
description: The jsonPathKey Formula function returns the property names (keys), not the values, of the JSON nodes that match a JSONPath expression. Includes syntax, parameters, and Swagger and order examples.
---

# <i class="fal fa-function" aria-hidden="true"></i> Formula - JsonPathKey

The `jsonPathKey` [Formula][] function returns the property names (keys), not the values, of the JSON nodes that match a JSONPath expression.

![List the property names of the ship-to address with jsonPathKey instead of jsonPath, animated walkthrough (7.12)][2]  
*Animated walkthrough: on the JSON Order Received event of order ORD-10005 in the [Order-to-Cash demo][], [jsonPath][] with `$.shipTo.*` returns the address values; `jsonPathKey` with the same expression returns the property names `zip`, `country`, `city`, `street`, and `region`.*  

## <i class="fal fa-code" aria-hidden="true"></i> Syntax

```text
jsonPathKey('expression', content)
```

### Parameters

|Parameter|Required|Description|  
|---|---|---|  
|`'expression'`|Yes|A JSONPath expression in single quotes that selects the properties whose names you want, such as `'$.paths.*'` for every property directly under `paths`.|  
|`content`|Yes|The JSON text: [body][], [context][Context], or the result of another function (see [Formula language rules][]).|  

### Returns

The name of every property the expression selects, one value each; duplicates are collapsed. When nothing matches, nothing is returned.

To return the values of the same properties, use [jsonPath][] with the same expression.

## <i class="fal fa-list-ol" aria-hidden="true"></i> Examples

### Example 1: List the API paths in a Swagger document

#### Input

The message body is the OpenAPI 3.0.4 document that the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> [Web API][] publishes at `https://<web api>/swagger/v1/swagger.json` (shortened here):

```json
{
  "openapi": "3.0.4",
  "info": { "title": "Nodinite.WebAPICore", "version": "1.0" },
  "paths": {
    "/api/ActiveDirectoryGroups": { "get": { "tags": [ "ActiveDirectoryGroups" ] } },
    "...": {}
  }
}
```

#### Formula

```text
jsonPathKey('$.paths.*', body)
```

#### Result

```text
/api/ActiveDirectoryGroups
/api/ActiveDirectoryGroups/{id}
/api/ActiveDirectoryGroups/GetByFullName
/api/ActiveDirectoryGroups/IsNameAvailable
/api/ActiveDirectoryGroups/{id}/IsNameAvailable
/api/ActiveDirectoryGroups/{id}/Restore
...
```

![Formula jsonPathKey expression returning the API path keys of the Web API OpenAPI document in the Test Expression tab (7.12)][1]  
*Each key under `paths` is returned as its own value, in the case the routes are declared; the full 7.12 document gives 735 unique matches.*  

### Example 2: List the fields of an order

#### Input

```json
{ "order": { "id": "PO-1001", "customer": "ACME", "total": 250 } }
```

#### Formula

```text
jsonPathKey('$.order.*', body)
```

#### Result

```text
id
customer
total
```

![Formula jsonPathKey returning the property names id, customer, and total of an order in the Test Expression tab (7.12)][ex2]  
*`$.order.*` selects every property directly under `order`; `jsonPathKey` returns their names, where [jsonPath][] would return `PO-1001`, `ACME`, and `250`.*  

## <i class="fal fa-circle-info" aria-hidden="true"></i> Notes

* `jsonPathKey` takes a JSONPath expression, not a regular expression. To filter the returned names by pattern, nest the result in [regex][], for example `regex('^/api/alarms', jsonPathKey('$.paths.*', body))`.

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* <i class="fal fa-magnifying-glass-plus" aria-hidden="true"></i> [Add or manage Search Field][]  
* <i class="fal fa-flask" aria-hidden="true"></i> [Test Your Expression][]  
* <i class="fal fa-hard-drive" aria-hidden="true"></i> [Add or manage Log View][]  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* <i class="fal fa-filter" aria-hidden="true"></i> [Extract functions][Extract Group]  
* <i class="fal fa-file-csv" aria-hidden="true"></i> [csv][]  
* <i class="fal fa-sitemap" aria-hidden="true"></i> [jsonPath][]  
* <i class="fal fa-text-slash" aria-hidden="true"></i> [regex][]  
* <i class="fal fa-layer-group" aria-hidden="true"></i> [regexGroup][]  
* <i class="fal fa-database" aria-hidden="true"></i> [sqllookup][]  
* <i class="fal fa-code" aria-hidden="true"></i> [xPath][]  
* <i class="fal fa-code" aria-hidden="true"></i> [xPath2][]  
* <i class="fal fa-function" aria-hidden="true"></i> [Formula][]  
* <i class="fal fa-scroll" aria-hidden="true"></i> [Formula language rules][]  
* <i class="fal fa-puzzle-piece" aria-hidden="true"></i> [Search Field Expressions][]  
* <i class="fal fa-magnifying-glass" aria-hidden="true"></i> [JSON Path plugin][]  

[1]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Extract/JsonPathKey.png
[2]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Extract/Formula_JsonPathKey.gif

[Add or manage Log View]:https://docs.nodinite.com/administration/log-management/log-views/features/add-or-manage-log-view/
[Add or manage Search Field]:https://docs.nodinite.com/administration/log-management/search-fields/features/add-or-manage-search-field/
[body]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/source/body/
[Context]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/source/context/
[csv]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/extract/csv/
[ex2]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Extract/jsonpathkey_example2.png
[Extract Group]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/overview/#extract
[Formula]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/overview/
[Formula language rules]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/overview/#fa-scroll-formula-language-rules
[JSON Path plugin]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/json-path/
[jsonPath]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/extract/jsonpath/
[Order-to-Cash demo]:https://docs.nodinite.com/repository-model/bpms/examples/order-to-cash/generate-o2c-demo-data/
[regex]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/extract/regex/
[regexGroup]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/extract/regexgroup/
[Search Field Expressions]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/overview/
[sqllookup]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/extract/sqllookup/
[Test Your Expression]:https://docs.nodinite.com/administration/log-management/search-fields/features/add-or-manage-search-field/#test-your-expression
[Web API]:https://docs.nodinite.com/core-services/web-api/overview/
[xPath]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/extract/xpath/
[xPath2]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/extract/xpath2/