Using the fantastic Advanced Find feature, we are able to use some useful operators to save your time like : InFiscalYear, Last7Days…
These operators are named “Query functions” and can be used as a filter criteria in a query.
You can find the full list here : Web API Query Function Reference.
Imagine a scenario where you want to retrieve records created on the last 3 days! Basically, if you use the Advanced Find you will do something like that:
![Advanced Find using Query Function as a filter.](https://i1.wp.com/www.blog.allandecastro.com/wp-content/uploads/2019/05/advanced-find-query-functions.png?fit=1024%2C146&ssl=1)
Using an ODATA Query you can also implement it:
https://org.crm4.dynamics.com/api/data/v9.1/ava_entity?$select=ava_field&$filter=Microsoft.Dynamics.CRM.LastXDays(PropertyName=’createdon’,PropertyValue=2)
As you can imagine, you can also use it in a Flow! You just have to add this statement into the “Filter Query”:
![Flow with a Query Function filter](https://www.blog.allandecastro.com/wp-content/uploads/2019/05/flowQueryFunction-1.png)
Then you can test your flow and see records retrieved:
![](https://www.blog.allandecastro.com/wp-content/uploads/2019/05/queryFunctionFlowexecuted.png)
Leave a Reply