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

# :fa-function: 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`.*  

## :fa-code: 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.

## :fa-list-ol: Examples

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

#### Input

The message body is the OpenAPI 3.0.4 document that the :Nodinite: [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`.*  

## :fa-circle-info: 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))`.

## :fa-hand-point-right: Next Steps

* :fa-magnifying-glass-plus: [Add or manage Search Field][]  
* :fa-flask: [Test Your Expression][]  
* :fa-hard-drive: [Add or manage Log View][]  

## :fa-link-horizontal: Related Topics

* :fa-filter: [Extract functions][Extract Group]  
* :fa-file-csv: [csv][]  
* :fa-sitemap: [jsonPath][]  
* :fa-text-slash: [regex][]  
* :fa-layer-group: [regexGroup][]  
* :fa-database: [sqllookup][]  
* :fa-code: [xPath][]  
* :fa-code: [xPath2][]  
* :fa-function: [Formula][]  
* :fa-scroll: [Formula language rules][]  
* :fa-puzzle-piece: [Search Field Expressions][]  
* :fa-magnifying-glass: [JSON Path plugin][]  

[1]:{ndm}/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Extract/JsonPathKey.png
[2]:{ndm}/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Extract/Formula_JsonPathKey.gif

[Add or manage Log View]:{ndr}/Administration/1.%20Log%20Management/1.%20Log%20Views/Features/Add%20or%20Manage%20Log%20View.md
[Add or manage Search Field]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Add%20or%20manage%20Search%20Field.md
[body]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Source/body.md
[Context]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Source/context.md
[csv]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Extract/csv.md
[ex2]:{ndm}/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Extract/jsonpathkey_example2.png
[Extract Group]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Overview.md#extract
[Formula]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Overview.md
[Formula language rules]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Overview.md#fa-scroll-formula-language-rules
[JSON Path plugin]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/JSON%20Path.md
[jsonPath]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Extract/jsonPath.md
[Order-to-Cash demo]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Generate-O2C-Demo-Data.md
[regex]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Extract/regex.md
[regexGroup]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Extract/regexGroup.md
[Search Field Expressions]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Overview.md
[sqllookup]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Extract/sqllookup.md
[Test Your Expression]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Add%20or%20manage%20Search%20Field.md#test-your-expression
[Web API]:{ndr}/Core%20Services/Web%20API/Overview.md
[xPath]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Extract/xPath.md
[xPath2]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Extract/xPath2.md