cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
wenners68
Level: Power Up

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
Super User
Super User

Re: Recurrence Flow - Send An Email action for outstanding orders

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!

Proud to be a Flownaut!


View solution in original post

3 REPLIES 3
Dual Super User
Dual Super User

Re: Recurrence Flow - Send An Email action for outstanding orders

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!

Super User
Super User

Re: Recurrence Flow - Send An Email action for outstanding orders

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!

Proud to be a Flownaut!


View solution in original post

wenners68
Level: Power Up

Re: Recurrence Flow - Send An Email action for outstanding orders

Perfect! That's really handy and I already use XrmToolbox but had never seen that option before. 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (7,334)