---
keyword: [Extend, PMD Scripting, Scripts]
nav: wcp_docs
parent_url: /wcp_docs/
title: JSONPath Support in PMD Scripting
layout: subsection
---

## <a id="section_1"></a>Supported JSON Paths

This table lists the JSON paths that PMD scripting supports.

<table><thead><tr><th>Description</th><th>Examples</th></tr></thead><tbody><tr><td>Simple field matches in dot or subscript notation.</td><td><ul><li><code>$.data[0].descriptor</code>
</li><li><code>$['data'][0]['descriptor']</code>
</li></ul></td></tr><tr><td>Recursive field matches.</td><td><ul><li><code>$..primarySupervisoryOrganization.descriptor</code>
</li></ul></td></tr><tr><td>Multiple fields match.</td><td><ul><li><code>$.data[0]['descriptor', 'primaryWorkEmail']</code>
</li></ul></td></tr><tr><td>Recursive multifield matches.</td><td><ul><li><code>$..primarySupervisoryOrganization.descriptor</code>
</li></ul></td></tr><tr><td>Single and multiple array indices.</td><td><ul><li><code>$.data[0].descriptor</code>
</li><li><code>$.data[0,1].descriptor</code>
</li></ul></td></tr><tr><td>Recursive array indexes and ranges.</td><td><ul><li><code>$..[0,1].descriptor</code>
</li><li><code>$.data[0:3].descriptor</code>
</li></ul></td></tr><tr><td>WildCard matches for fields, arrays, and filters.</td><td><ul><li><code>$.*.*.descriptor</code>
</li></ul></td></tr><tr><td>Array index ranges (slices).</td><td><ul><li><code>$.array[*]</code>
</li><li><code>$.array[1:4]</code>
</li><li><code>$.array[1:]</code>
</li><li><code>$.array[:4]</code>
</li></ul></td></tr><tr><td>Array range accessors where the step parameter isn't equal to 1.</td><td><ul><li><code>$.data[0:3:2].descriptor</code>
</li></ul></td></tr><tr><td>Comparison filters and/or Has filters.</td><td><ul><li><code>$.data[?(@.id=='1da8b422311b4929bfa4520f7f0b4e83')]['descriptor']</code>
</li></ul></td></tr><tr><td>Filters with regex comparison operator.</td><td><ul><li><code>$.foo[?(@bar ~= ^baz.*)]</code>
</li></ul></td></tr><tr><td>Array at simple JSON path.</td><td><ul><li><code>$.data</code>
</li></ul></td></tr></tbody></table><br/>

## <a id="section_2"></a>Not Supported JSON Paths

This table lists the JSON paths that PMD scripting doesn't support.

<table><thead><tr><th>Description</th><th>Examples</th></tr></thead><tbody><tr><td>Filters that refer to root.</td><td><code>$.foo[?($.bar == 'baz')]</code></td></tr><tr><td>Filters with a comparison operator in which one side isn't a value and both are subqueries.</td><td><code>$.foo.bar[?(@['foo'] < @['baz'])]</code></td></tr><tr><td>Recursive filters.</td><td><code>$..[?($.bar == 'baz')]</code></td></tr><tr><td>Filter tokens followed by filter tokens.</td><td><code>$.foo[?(@bar =='foo')][?(@foo =='bar')]</code></td></tr><tr><td>Recursive paths that end with all matches.</td><td><ul><li><code>$.foo..*</code>
</li><li><code>$.foo..[*]</code>
</li></ul></td></tr><tr><td>Negative array accessors.</td><td><code>$.foo[-1]</code></td></tr></tbody></table><br/>

### Related Information

[query (source, jsonPath)](/wcp_docs/GUID-f8bc6e28-2b28-4871-87d6-d4dbc1c33a2d-enHYPHENus.html)

[query (source, jsonPath, resultsAsList)](/wcp_docs/GUID-5277e55b-4f98-4a44-9da9-1b37c46b8226-enHYPHENus.html)

