Pages

December 30, 2019

[LogicApps/Flow] Odata operators for Odata query

[Updated on September 8, 2020]
Hi Folks,

While working on Logic apps and Flow we need to apply a different filter on Odata query to get the desired data from an Odata entity. Below are the most used operators to use in an Odata query with example. 

The operators supported in the expression language are shown in the following table.

Operator
Description
Example
Logical Operators
Eq
Equal
/Suppliers?$filter=Address/City eq 'Redmond'
Ne
Not equal
/Suppliers?$filter=Address/City ne 'London'
Gt
Greater than
/Products?$filter=Price gt 20
Ge
Greater than or equal
/Products?$filter=Price ge 10
Lt
Less than
/Products?$filter=Price lt 20
Le
Less than or equal
/Products?$filter=Price le 100
And
Logical and
/Products?$filter=Price le 200 and Price gt 3.5
Or
Logical or
/Products?$filter=Price le 3.5 or Price gt 200
Not
Logical negation
/Products?$filter=not endswith(Description,'milk')
Arithmetic Operators
Add
Addition
/Products?$filter=Price add 5 gt 10
Sub
Subtraction
/Products?$filter=Price sub 5 gt 10
Mul
Multiplication
/Products?$filter=Price mul 2 gt 2000
Div
Division
/Products?$filter=Price div 2 gt 4
Mod
Modulo
/Products?$filter=Price mod 2 eq 0
Grouping Operators
( )
Precedence grouping
/Products?$filter=(Price sub 5) gt 10

For details refer below link 


-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

This post is referring to https://www.odata.org/.


No comments:

Post a Comment

Thanks