{"id":1318,"date":"2021-06-28T12:08:26","date_gmt":"2021-06-28T12:08:26","guid":{"rendered":"https:\/\/info.documotor.com\/?page_id=1318"},"modified":"2022-06-28T11:48:16","modified_gmt":"2022-06-28T11:48:16","slug":"jmespath-extensions","status":"publish","type":"page","link":"https:\/\/info.documotor.com\/?page_id=1318","title":{"rendered":"JMESPath Extensions"},"content":{"rendered":"\n<p>Our implementation of JMESPath supports the grammar of the official specification, but has been extended with the following concepts:<\/p>\n\n\n\n<h2>$ operator<\/h2>\n\n\n\n<p>It is possible to reference a previously defined variable in the current scope through the usage of the $ operator.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"json\" class=\"language-json\">{\n   a: 'test',\n   b: $.a\n}<\/code><\/pre>\n\n\n\n<p>results in:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"json\" class=\"language-json\">{ \"a\":\"test\", \"b\":\"test\" }<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2>@@ operator<\/h2>\n\n\n\n<p>It is possible to reference the root of input data using the pound sign. It can be both used in a data transformation as well as in underlying user functions. <\/p>\n\n\n\n<p>Example of sample data:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"json\" class=\"language-json\">{\n\t\"DocumentOptions\": {\n\t\t\"Language\": \"en-GB\",\n\t\t\"PaperSize\": \"A4\"\n\t},\n\t\"People\": [\n\t\t{\n\t\t\t\"StructuredXMLResume\": {\n\t\t\t\t\"ContactInfo\": {\n\t\t\t\t\t\"PersonName\": {\n\t\t\t\t\t\t\"FormattedName\": \"Ark Mariush\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"StructuredXMLResume\": {\n\t\t\t\t\"ContactInfo\": {\n\t\t\t\t\t\"PersonName\": {\n\t\t\t\t\t\t\"FormattedName\": \"Seb Mariusha\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"StructuredXMLResume\": {\n\t\t\t\t\"ContactInfo\": {\n\t\t\t\t\t\"PersonName\": {\n\t\t\t\t\t\t\"FormattedName\": \"Bgk Mariushe\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t]\n}<\/code><\/pre>\n\n\n\n<p>Example of <strong>@@<\/strong> usage inside a data transformation:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"json\" class=\"language-json\">{\n    Data: {\n       PeopleTransformed : People[0:3].{\n           FormattedName : if (@@.DocumentOptions.Language == 'en-GB', StructuredXMLResume.ContactInfo.PersonName.FormattedName, `null`) \n       }\n    }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Our implementation of JMESPath supports the grammar of the official specification, but has been extended with the following concepts: $ operator It is possible to reference a previously defined variable in the current scope through the usage of the $ operator. results in: @@ operator It is possible to reference the root of input data [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":127,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/1318"}],"collection":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1318"}],"version-history":[{"count":6,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/1318\/revisions"}],"predecessor-version":[{"id":2685,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/1318\/revisions\/2685"}],"up":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/127"}],"wp:attachment":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}