Component: OData URI Parser
Introduction
The OData URI Parser component parses a URI that follows the OData format into smaller components and then composes the DataSourceApiQuery object.
Features
"CwODataUriParser Build DataSourceApiQuery From OData Query String" server rule to parse
This component provides a server rule named "CwODataUriParser Build DataSourceApiQuery From OData Query String". The rule receives a few parameters and outputs a corresponding DataSourceApiQuery object. Here is the list of required parameters:
- DataSourceName [
string]: The name of the data source that the rule builds the query for - QueryString [
IDictionary<string, IEnumerable<string>>]: Parameters from the query URI - WhitelistSelectFields [
IEnumerable<string>]: A list of fields that can be selected. If it contains a "*" element, the rule allows selecting all fields
The QueryString parameter can contain:
- $select: List of fields to get. Example: Name,Type
- $filter: Filter string to query. Example:
Name eq 'John' and Type eq 'type1'. Do not use double quotes for values - $orderby: String that represents single or multiple order-by statements. If the clause has the "desc" keyword, the data is sorted by the specified field in descending order. Example: Name,Type desc. In this example, the data is sorted by Name in ascending order and then by Type in descending order
- $top: The maximum number of records that can be retrieved. The default value is 100
- $skip: The number of records to skip. The default value is 0
Currently, the component only supports a small set of operators in the filter parameter:
| Operator | Description | Example |
|---|---|---|
| eq | Equal | City eq 'Redmond' |
| ne | Not equal | City ne 'London' |
| gt | Greater than | Price gt 20 |
| ge | Greater than or equal | Price ge 10 |
| lt | Less than | Price lt 20 |
| le | Less than or equal | Price le 100 |
| and | Logical and | Price le 200 and Price gt 3.5 |
| or | Logical or | Price le 100 or Price gt 150 |
Installation
Requirements
- Casewhere 2.6.0 or later.
Setup
Import product: Casewhere OData URI Parser
Dependencies
- Plugin: Query Filter String Parser
Releases
1.0.0 - 14/07/2022
Changelog
- "CwODataUriParser Build DataSourceApiQuery From OData Query String" server rule
- Test workflows
Download (login required): OData URI Parser v1.0.0