{"componentChunkName":"component---src-templates-simple-markdown-js","path":"/process-intelligence-apis/knowledge-model-api/features/filtering/","matchPath":"","result":{"data":{"markdownRemark":{"html":"<h1 style=\"position:relative;\"><a href=\"#filtering\" aria-label=\"filtering permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"filtering\"></div>Filtering</h1>\n<p>Filtering allows API consumers to only retrieve the desired records and not the whole data set. There are two ways to filter the data returned by the <code class=\"language-text\">/data</code> endpoint.</p>\n<h2 style=\"position:relative;\"><a href=\"#predefined-knowledge-model-filters\" aria-label=\"predefined knowledge model filters permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"predefined-knowledge-model-filters\"></div>Predefined Knowledge Model Filters</h2>\n<ol>\n<li>\nApply filters pre-defined in the Knowledge Model by using the \n<code class=\"language-text\">filters</code>\n query parameter. \n<br>\n\n\n<code class=\"language-text\">Filters:</code>\n A comma-separated list of filter ids.\n<code class=\"language-text\"></code>\n  \n<br>\n\n\n<br>\n\n\nNote that:\n<ul>\n<li>\nThe Celonis Platform Knowledge Model allows filters to be defined using the FILTER PQL operator as explained in the \n<a href=\"https://docs.celonis.com/en/knowledge-model---filters.html\">Celonis Platform documentation</a>\n.\n</li>\n<li>\nYou can apply multiple filters by providing multiple filter ids separated by commas or use the \n<code class=\"language-text\">filters</code>\n parameter multiple times.\n</li>\n<li>\nRemember this parameter is case sensitive. The filter ids must match the one returned by the filter schema endpoint (\n<code class=\"language-text\">/knowledge-models/{km_id}/filters</code>\n).\n</li>\n</ul>\n</li>\n</ol>\n<p>Examples:</p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"19491541296188486000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`filters=not_null_orders,delayed_orders or filters=not_null_orders&filters=delayed_orders`, `19491541296188486000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-19491541296188486000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">filters=not_null_orders,delayed_orders or filters=not_null_orders&amp;filters=delayed_orders</code></pre></div>\n      </div>\n<h2 style=\"position:relative;\"><a href=\"#ad-hoc-filter-expressions\" aria-label=\"ad hoc filter expressions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"ad-hoc-filter-expressions\"></div>Ad-hoc Filter Expressions</h2>\n<ol start=\"2\">\n<li>\nFilter expression using the \n<code class=\"language-text\">filterExpr</code>\n query parameter.\n<br>\n\n\nThis parameter allows filtering of record data using a provided value of a field through an expression.\n</li>\n</ol>\n<h3 style=\"position:relative;\"><a href=\"#legacy-filter-expressions\" aria-label=\"legacy filter expressions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"legacy-filter-expressions\"></div>Legacy Filter Expressions</h3>\n<ol>\n<li>\n<strong>First pattern <code class=\"language-text\">field operator value</code> where:</strong>\n\n* \n<code class=\"language-text\">field</code>\n is a filterable attribute, augmented attribute or flag of a record. \n<strong>This value is case-sensitive and should be equal to the attribute id.</strong>\n\n* \n<code class=\"language-text\">operator</code>\n is a comparison operator. For this pattern, it is currently supported by following operators:\n* \n<strong><code class=\"language-text\">eq(=), gt(>), lt(&lt;), ne(!=), ge(>=), le(&lt;=), is(IS) and in(IN)</code></strong>\n\n* \n<code class=\"language-text\">value</code>\n is a constant, such as a Salesforce Opportunity ID or a number/text.\n<ol start=\"2\">\n<li>\n<strong>Second pattern <code class=\"language-text\">operator(field,value)</code> where:</strong>\n<ul>\n<li>\n<code class=\"language-text\">operator</code>\n is a string search operator,similar to the LIKE in the SQL clause. For this pattern, it is currently supported by following operators:\n<ul>\n<li>\n<strong><code class=\"language-text\">startswith, endswith and contains</code></strong>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ol>\n</li>\n</ol>\n<p>   It is also possible to combine filters with <strong>logical operators <code class=\"language-text\">and, or, not</code> and parenthesis</strong>.</p>\n<ul>\n<li>\nExample of the first pattern\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"51320896119656890000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`filterExpr=field1 eq value,field2 ne value`, `51320896119656890000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-51320896119656890000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">filterExpr=field1 eq value,field2 ne value</code></pre></div>\n      </div>\n</li>\n<li>\nExample of the second pattern\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"92970160977874420000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`filterExpr=startswith(field1,value),contains(field2,value)`, `92970160977874420000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-92970160977874420000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">filterExpr=startswith(field1,value),contains(field2,value)</code></pre></div>\n      </div>\n</li>\n<li>\nExample with first pattern, second pattern and \n<code class=\"language-text\">or</code>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"92467671718428800000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`filterExpr=startswith(field1,value) or filed3 eq value,contains(field2,value) or field3 eq value`, `92467671718428800000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-92467671718428800000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">filterExpr=startswith(field1,value) or filed3 eq value,contains(field2,value) or field3 eq value</code></pre></div>\n      </div>\n</li>\n<li>\nExample with \n<code class=\"language-text\">not</code>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"44761269545743840000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`filterExpr=not startswith(field1,value) or filed3 eq value,not (contains(field2,value) or field3 eq value)`, `44761269545743840000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-44761269545743840000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">filterExpr=not startswith(field1,value) or filed3 eq value,not (contains(field2,value) or field3 eq value)</code></pre></div>\n      </div>\n</li>\n</ul>\n<p>Example:</p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"69412805865258550000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`{\n    &quot;page&quot;: 0,\n    &quot;pageSize&quot;: 100,\n    &quot;total&quot;: 1,\n    &quot;sort&quot;: [],\n    &quot;content&quot;: {\n        &quot;headers&quot;: [\n            {\n                &quot;id&quot;: &quot;description&quot;,\n                &quot;name&quot;: &quot;Description&quot;,\n                &quot;type&quot;: &quot;string&quot;,\n                &quot;aggregation&quot;: false,\n        ===>    &quot;filterable&quot;: true,  \n                &quot;sortable&quot;: true\n            }\n            {\n                &quot;id&quot;: &quot;count&quot;,\n                &quot;name&quot;: &quot;Count&quot;,\n                &quot;type&quot;: &quot;integer&quot;,\n                &quot;aggregation&quot;: true,\n        ===>    &quot;filterable&quot;: false,\n                &quot;sortable&quot;: true\n            }\n        ],\n        &quot;data&quot;: [\n            {\n                &quot;description&quot;: &quot;total&quot;\n                &quot;count&quot;: 50\n            }\n        ]\n    }\n}`, `69412805865258550000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-69412805865258550000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">{\n    \"page\": 0,\n    \"pageSize\": 100,\n    \"total\": 1,\n    \"sort\": [],\n    \"content\": {\n        \"headers\": [\n            {\n                \"id\": \"description\",\n                \"name\": \"Description\",\n                \"type\": \"string\",\n                \"aggregation\": false,\n        ===>    \"filterable\": true,  \n                \"sortable\": true\n            }\n            {\n                \"id\": \"count\",\n                \"name\": \"Count\",\n                \"type\": \"integer\",\n                \"aggregation\": true,\n        ===>    \"filterable\": false,\n                \"sortable\": true\n            }\n        ],\n        \"data\": [\n            {\n                \"description\": \"total\"\n                \"count\": 50\n            }\n        ]\n    }\n}</code></pre></div>\n      </div>\n<p>You can apply multiple filters separated by commas or use the <code class=\"language-text\">filterExpr</code> parameter multiple times separated by “&#x26;”.</p>\n<p>Examples:</p>\n<p><code class=\"language-text\">filterExpr=opportunity_id eq AA00022475H, opportunity_value gt 50000</code></p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"16398536174948796000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`filterExpr=opportunity_id eq AA00022475H& \nfilterExpr=opportunity_value gt 50000`, `16398536174948796000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-16398536174948796000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">filterExpr=opportunity_id eq AA00022475H&amp; \nfilterExpr=opportunity_value gt 50000</code></pre></div>\n      </div>\n<h3 style=\"position:relative;\"><a href=\"#new-strongly-typed-filter-expression-syntax\" aria-label=\"new strongly typed filter expression syntax permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"new-strongly-typed-filter-expression-syntax\"></div>New strongly-typed filter expression syntax</h3>\n<p>Described in detail in <a href=\"/process-intelligence-apis/knowledge-model-api/features/filtering-odata-typed/\">OData Filtering Syntax</a></p>\n<h3 style=\"position:relative;\"><a href=\"#differences-between-legacy-and-new-filter-expression-syntax\" aria-label=\"differences between legacy and new filter expression syntax permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"differences-between-legacy-and-new-filter-expression-syntax\"></div>Differences between legacy and new filter expression syntax</h3>\n<table>\n<thead>\n<tr>\n<th>New OData Syntax</th>\n<th>Legacy Syntax</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>String values should be single quoted <code class=\"language-text\">''</code></td>\n<td>String values can be unquoted</td>\n</tr>\n<tr>\n<td>Date values should be in <code class=\"language-text\">ISO-8601</code> format</td>\n<td>Date formatting follows <a href=\"https://docs.celonis.com/en/using-the-pql-editor.html#UUID-0a810432-93c4-d090-4e7b-9194784fe28e_section-idm234427867703289\">Celonis date format semantics</a></td>\n</tr>\n<tr>\n<td>Only logical operators <code class=\"language-text\">and</code>,<code class=\"language-text\">or</code>,<code class=\"language-text\">not</code></td>\n<td>Comma (<code class=\"language-text\">,</code>) can be used instead of <code class=\"language-text\">and</code> operator</td>\n</tr>\n</tbody>\n</table>","headings":[{"value":"Filtering","depth":1},{"value":"Predefined Knowledge Model Filters","depth":2},{"value":"Ad-hoc Filter Expressions","depth":2},{"value":"Legacy Filter Expressions","depth":3},{"value":"New strongly-typed filter expression syntax","depth":3},{"value":"Differences between legacy and new filter expression syntax","depth":3}]},"contentItem":{"data":{"lastModified":"2025-10-07T15:06:43.000Z","enableToc":null,"disableLastModified":null,"tocMaxDepth":null,"requestLogin":false}},"siteConfig":{"enableToc":false,"disableLastModified":false,"tocMaxDepth":4}},"pageContext":{"matchPath":"","id":"facdde5a-4d80-55a9-a219-209ad9058b84__redocly content/process-intelligence-apis/knowledge-model-api/features/filtering/","seo":{"title":"Filtering","description":null,"image":"","keywords":null,"jsonLd":null,"lang":null,"siteUrl":null},"pageId":"process-intelligence-apis/knowledge-model-api/features/filtering.md","pageBaseUrl":"/process-intelligence-apis/knowledge-model-api/features/filtering","type":"markdown","toc":{"enable":true,"maxDepth":4,"headings":[{"depth":1,"value":"Filtering","id":"filtering"},{"depth":2,"value":"Predefined Knowledge Model Filters","id":"predefined-knowledge-model-filters"},{"depth":2,"value":"Ad-hoc Filter Expressions","id":"ad-hoc-filter-expressions"},{"depth":3,"value":"Legacy Filter Expressions","id":"legacy-filter-expressions"},{"depth":3,"value":"New strongly-typed filter expression syntax","id":"new-strongly-typed-filter-expression-syntax"},{"depth":3,"value":"Differences between legacy and new filter expression syntax","id":"differences-between-legacy-and-new-filter-expression-syntax"}]},"data":{"title":""},"catalogInfo":null,"link":"/process-intelligence-apis/knowledge-model-api/features/filtering/","sidebarName":"celonis","isLanding":false,"showPrevButton":null,"showNextButton":null,"apiVersions":null,"apiVersionId":null,"isDefaultApiVersion":null}},"staticQueryHashes":["1123603147","1302185487","1344209882","1398840060","1520077861","1975142765","2667623876","2950305614","3240152602","3743992808","561138138"]}