Traditionally, Microsoft SharePoint list data is filtered using CAML query. But when querying the same SharePoint list data from Microsoft flow, CAML query will not work because Microsoft flow was built on top of Logic apps. So, to query the SharePoint list data in Microsoft Flow,
OData filter expressions need to be used instead of CAML query.
It took me a while to find the right expression to make my query pull the right data. In the below table, I have summarized the most frequently used ones.
Definition | OData URI | CAML |
And | and | And |
Or | or | Or |
Less than | lt | Lt |
Greater than | gt | Gt |
Greater than or equal to | ge | Geq |
Less than or equal to | le | Leq |
Not Equal | ne | Neq |
Startswith | Startswith | BeginsWith |
The following use cases are implemented using OData URI in Microsoft flow.
- Get list items based on condition.
- Pick approver level based on the value (i.e., £1000-£25000: Level 1 Approver, £25001-£50000 Level 2 Approver, £50001-£100000 Level 3 Approver).
I hope this quick tip will save some developers' precious time and get cracking wit the flow. Drop a comment if you need any help.