How to Use the Filter
The Filter enables users to filter a dataset based on a human-readable filter string. This tool allows for dynamic and complex filtering by specifying conditions and logical operators like and
and or
.
Here’s a guide on how to use this function, focusing on fields like displayName
, version
, publisher
, platform
, deviceCount
, sizeInByte
, id
, and application_url
.
Filter String Format
The filter string should consist of conditions and logical operators (and
, or
).
Conditions
A condition specifies:
Field: The name of the field in the dataset you want to filter (e.g.,
displayName
,platform
).Operator: The comparison or matching operator (e.g.,
eq
,gt
,contains
).Value: The value you want to compare, enclosed in single (
'
) or double ("
) quotes.
Example Condition:
platform eq 'iOS'
Logical Operators
and
: Combines multiple conditions where all conditions must be true.or
: Combines multiple conditions where at least one condition must be true.
Note: You can use either and
or or
in a single filter but not both at the same time.
Supported Operators
Operator | Description | Example |
---|---|---|
| Field is equal to the value |
|
| Field is not equal to the value |
|
| Field is greater than the value |
|
| Field is less than the value |
|
| Field is greater than or equal to the value |
|
| Field is less than or equal to the value |
|
| The field contains the value (for strings) |
|
| The field starts with the value (for strings) |
|
| The field ends with the value (for strings) |
|
Logical Operators
and: Combines multiple conditions where all conditions must be true.
or: Combines multiple conditions where at least one condition must be true.
Note: You can use either and or or in a single filter but not both at the same time.
Supported Operators
Operator | Description | Example |
---|---|---|
eq | Field is equal to the value | platform eq 'iOS' |
ne | Field is not equal to the value | publisher ne 'Microsoft' |
gt | Field is greater than the value | deviceCount gt 10 |
lt | Field is less than the value | sizeInByte lt 500000 |
ge | Field is greater than or equal to the value | deviceCount ge 20 |
le | Field is less than or equal to the value | sizeInByte le 1000000 |
contains | The field contains the value (for strings) | displayName contains 'App' |
startsWith | The field starts with the value (for strings) | publisher startsWith 'Apple' |
endsWith | The field ends with the value (for strings) | application_url endsWith '.com' |
Examples
Find Applications Published by "Apple":
publisher eq 'Apple'
Find Applications with Device Count Greater Than 50:
deviceCount gt 50
Find Applications for iOS and Published by Microsoft:
platform eq 'iOS' and publisher eq 'Microsoft'
Find Applications Hosted on .com
URLs:
application_url endsWith '.com'
Find Applications Larger Than 1MB or Running on Android:
sizeInByte gt 1000000 or platform eq 'Android'
Key Rules
Case Sensitivity:
Field names and string comparisons are case-sensitive. Ensure your field names and values match the case in the dataset.
Quotes:
Use single (
'
) or double ("
) quotes to enclose values.
Logical Operators:
You cannot mix
and
andor
in the same filter.
Empty Filter String:
If the filter string is empty or
null
, the function returns the original dataset.