You can filter the results of your API requests to refine the set of entities you want to obtain and limit the volume of data transferred between the backend and your application.
GoodData utilizes RSQL to define filters on the entities API. Only a subset of RSQL is supported, and we add our operators to make some queries easier.
Create a filter
Filter the API call result using URI parameter
filter as follows:
<RSQL> is the RSQL query consisting of
propertyis an attribute of the queried entity
operatoris one of the supported logical or comparison operators
argumentrepresents the filtered value in form related to comparison operator
Fetch only visualizationObjects that use a metric with the word ‘sale’ in the metrics title:
Note that this example uses the
containsic operator which is the case-insensitive variation of the
contains operator. See below for a complete list of supported operators.
Following limitations apply:
- You can filter only results of the entities APIs
/api/v1/entities/.... Declarative APIs do not support filtering.
- Ensure the filtered string is properly url encoded. For example, wrap values containing a whitespace character with single or doubles quotes and apply url encoding to the entire value.
- Queries are case-sensitive in general. There are GoodData specific operators allowing case-insensitive queries.
To filter for multiple properties at the same time, use the AND logical operator:
Example: Filter entities with specified title and tag ‘Sales’. Using the
andoperator and url encoded value:
or using the
The following subset of RSQL comparison operators is available:
Example: Filter entities having tag ‘Sales’:
Not equal to:
Example: Filter entities not having tag ‘Sales’:
Example: Filter entities having one of the specified tags ‘PreSales’ or ‘PostSales’:
Example: Filter entities which do not have at least one of the specified tags ‘PreSales’ or ‘PostSales’:
Example: Filter entities having a tag containing only substring ‘sales’:
Example: Filter entities having a tag containing a substring ‘sales’ regardless on the case sensitivity:
*to capture a group of characters
?to capture exactly one character
Example: Filter entities having a tag starting with letter P and ending with substring Sales:
Filtering via relationships
You can filter by a property from a referenced entity in case two entities are in a relationship. You have to specify the relationship property before the property you are going to filter (an extended form of the property):
Filter only visualizationObjects having relation to metrics with a title ‘quantities’:
To create a list / group of items to filter use grouping operator
() and separate items with
or - for example
(PreSales or PostSales).