Hi,
I want to create a flow that looks for orders in Dynamics 365 where my custom date field (invoiceDate) contains data and is before todays date but where the status is not "Invoiced", and then send an email to the owner of said order.
This is the query in Dyn 365
My main problem is the Filter Query. I'm struggling to create a query to check the invoice date as above. This is as far as I've got
Any help would be appreciated.
Solved! Go to Solution.
Hi @wenners68
If you are planning on using Flow with Dynamics quite a lot I highly recommend the XRM Toolbox (https://www.xrmtoolbox.com/). This has a plugin tool that allows you to connect to your instance of Dynamics 365 and create the fetch xml (either using the UI or by downloading and copying from your advanced find query) for testing. Once you are happy with your query, the tool generates the filter criteria needed for Flow which you then just copy into your Flow action.
The example shown below generated the following filter criteria (which you can edit for your needs if required once you have found the logical name of your invoice date)
statecode eq 0 and actualend ne null and Microsoft.Dynamics.CRM.OlderThanXDays(PropertyName='actualend',PropertyValue=1)
On a side note, the Dynamics 365 connector that you are using is deprecated (see the last section of this post https://flow.microsoft.com/en-us/blog/nine-new-connectors-in-april-and-improved-visibility-into-trig...).
I would make use of the Common Data Service connector instead as this is the replacement and can support more data types and broader trigger scenarios.
Follow me on Twitter at @QG_LeeJHarris
Or on LinkedIn at in/leejharris
Hi @wenners68
You can simply use and and extend the query to get the data when the Invoice Date fields matches the critereia. You will have to get to know the logical name of the field here. and with the current filter query, just add -> and logicalfieldname ge ticks(addDays(utcnow(),X))
you can refer to this blog for more details on ODATA queries :
https://flow.microsoft.com/en-us/blog/advanced-flow-of-the-week-filtering-with-odata/
Hope this Helps!
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Hi @wenners68
If you are planning on using Flow with Dynamics quite a lot I highly recommend the XRM Toolbox (https://www.xrmtoolbox.com/). This has a plugin tool that allows you to connect to your instance of Dynamics 365 and create the fetch xml (either using the UI or by downloading and copying from your advanced find query) for testing. Once you are happy with your query, the tool generates the filter criteria needed for Flow which you then just copy into your Flow action.
The example shown below generated the following filter criteria (which you can edit for your needs if required once you have found the logical name of your invoice date)
statecode eq 0 and actualend ne null and Microsoft.Dynamics.CRM.OlderThanXDays(PropertyName='actualend',PropertyValue=1)
On a side note, the Dynamics 365 connector that you are using is deprecated (see the last section of this post https://flow.microsoft.com/en-us/blog/nine-new-connectors-in-april-and-improved-visibility-into-trig...).
I would make use of the Common Data Service connector instead as this is the replacement and can support more data types and broader trigger scenarios.
Follow me on Twitter at @QG_LeeJHarris
Or on LinkedIn at in/leejharris
Perfect! That's really handy and I already use XrmToolbox but had never seen that option before.
User | Count |
---|---|
88 | |
39 | |
23 | |
20 | |
16 |
User | Count |
---|---|
129 | |
50 | |
48 | |
35 | |
26 |