web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Recurrence Flow - Send An Email action for outstanding orders

(0) ShareShare
ReportReport
Posted on by 5

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.

I have the same question (0)
  • yashag2255 Profile Picture
    24,695 Super User 2024 Season 1 on at
    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!

  • Verified answer
    LeeHarris Profile Picture
    1,026 on at
    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-trigger-failures/).

    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.

     

  • monty270311 Profile Picture
    5 on at
    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. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 691 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 431 Moderator

#3
developerAJ Profile Picture

developerAJ 266

Last 30 days Overall leaderboard