Nfield OData supported filters
Introduction
This is the table that shows the NField supported OData filters and functions.
| OData supported comparison operators |
Filter/Action |
Example |
| eq | EQ |
Test whether a field is equal to a constant value |
SurveyId eq SurveyId |
| ne | NE |
Test whether a field is not equal to a constant value |
SurveyId ne SurveyId |
| gt | GT |
Test whether a field is greater than a constant value |
10 gt 11 |
| lt | LT |
Test whether a field is less than a constant value |
10 lt 11 |
| ge | GE |
Test whether a field is greater than or equal to a constant value |
10 ge 10 |
| le | LE |
Test whether a field is less than or equal to a constant value |
11 le 10 |
| OData Enums V3 |
Filter/Action |
Example |
| V3 Enum Casting |
V3 enum casting |
$filter=SurveyState eq '1' |
| OData Enums V4 |
Filter/Action |
Example |
| V4 Enum Casting |
We need to declare the cast implicitly |
?$filter=cast(Channel,Edm.String) eq '3' |
| OData V3 |
Filter/Action |
Example |
| Starts With |
Executes a query that filters results that begin with. |
$filter=startswith(PropertieName,+'xxxx...') |
| Date Time |
Query to filter by a given datetime |
$filter=PropertieName comparator datetime'yyyy-mm-dd' |
| Guid |
Query to filter by GUID |
$filter=PropertieName comparator guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx') |
| Order By |
Executes a query and sorts the result by the given property |
$orderby=PropertieName |
| OData V4 |
Filter/Action |
Example |
| Starts With |
Executes a query that filters results that begin with. |
$filter=startswith(PropertieName,+'xxxx...') |
| Date Time |
$filter=PropertieName comparator yyyy-mm-dd |
10 |
| Guid |
Query to filter by a given datetime |
$filter=PropertieName comparator xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| Order By |
Executes a query and sorts the result by the given property |
$orderby=PropertieName |