4.1.8. Native requests for OData connections

You can configure the source node with a native request instead of having to retrieve an entire table.

image81

Instead of clicking Select to select an OData collection, click Request OData image82.

image83

To create a request:

  1. Select a collection image84.

  2. Enter a list of columns, separated by commas image85. Click to add columns selected from the list on the left. Leave the text zone empty if you want to select all the columns.

  3. Enter an OData filter image86 to select a sub-set of rows. Leave the text zone empty if you want to select all the rows.

The request will be executed by the OData server itself to ensure best performance.

OData v4: Filter syntax

OData lets you use filters to extract a subset of items from a collection, e.g. Nom eq 'John'.

1 - Input attribute values

This table shows how to enter values for different types of attribute:

Type

Entry method

Character string and enumeration

Between ordinary quotation marks (e.g. ‘John’)

Date and time

OData 4: raw value (e.g. 2022-03-18T23:59:59Z or 2022-03-18T23:59:59.999Z)

Other

Raw value (e.g. 15)

2 - Comparison operators

OData v4 uses the following comparison operators:

Operators

Meaning

Example

eq

equals

Name eq 'John'

not

does not equal

Name not 'John'

gt

greater than

Age above 15

lt

less than

Age lt 15

ge

equal to or above

Age ge 15

le

equal to or below

Age le 15

3 - Arithmetic operators

Operator

Meaning

Example

Result

add

add

Price add 2 eq 10

All products at price of 8

sub

subtract

Price sub 2 eq 10

All products at price of 12

mul

multiply

Price mul 2 eq 10

All products at price of 5

div

divide

Price div 2 eq 10

All products at price of 20

mod

module

Price mod 5 eq 0

All products at price dividable by 5

4 - Functions

Function

Example

Result

contains

contains(Name, 'f')

All persons with a surname containing ‘f’

startswith

startswith(Name 'f')

All persons with a surname starting with an ‘f’

endswith

endswith(Name, 'f')

All persons with a surname ending with an ‘f’

length

length(Name) eq 5

All persons with a surname 5 characters long

year

year(DateOfBirth) eq 1990

All persons born in 1990

month

month(DateOfBirth) eq 5

All persons born in May

day

day(DateOfBirth) eq 31

All persons born on the 31st of the month

hour

hour(Registration) eq 13

All persons registered between 13:00 and 13:59

minute

minute(Registration) eq 55

All persons registered in the 55th minute of any hour

second

second(Registration) eq 55

All persons registered in the 55th second of any minute in any hour

5 - Combining filters

Filters can be combined with: and, or, not, (). For example, Name eq 'John' and (Age gt 65 or Age lt 11).

Combination

Example

and

Name eq 'John' and Age gt 65

or

Age gt 65 or Age lt 11

not

not(Name eq 'John')

( )

Name eq 'John' and (Age gt 65 or Age lt 11)