cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wenners68
New Member

Recurrence Flow - Send An Email action for outstanding orders

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

Capture.PNG

 

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

Capture2.PNG

 

Any help would be appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
LeeHarris
Solution Sage
Solution Sage

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)

 

XrmToolBox_2019-06-25_15-46-38.png

 

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.

 


Did I answer your question? Mark my post as a solution!

Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

View solution in original post

3 REPLIES 3

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!

LeeHarris
Solution Sage
Solution Sage

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)

 

XrmToolBox_2019-06-25_15-46-38.png

 

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.

 


Did I answer your question? Mark my post as a solution!

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. 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (1,417)