Go with the Flow – How to Set Date Based Alerts with Microsoft Flow

Home|Dynamics 365|Go with the Flow – How to Set Date Based Alerts with Microsoft Flow

With the release of Dynamics 365 (D365) for Operations, one of the most often requested missing features was alerts.  Flow is often mentioned as a replacement and triggers for D365 for Operations—coming in the near future—will provide a wealth of functionality compared to the alerts of Ax 2012.

That said, they can take a bit more work to get things going, like a past due date alert for a purchase order line.

Let’s take an example. I want to send an email message to my team for every purchase order line that is more than 5 days late per our requested receipt date.

First things first – you’ll need to sign up for Flow.

Once you’ve done that, click on “My flows” and “Create from blank.”

setting a date-based alert in Dynamics 365 for Operations

In the flow designer, give the flow a name.

setting a date-based alert in Dynamics 365 for Operations

Then from the services and triggers list, select “Schedule.” This will allow us to run our flow on a recurring basis, such as on a nightly basis.

setting a date-based alert in Dynamics 365 for Operations

Specify the frequency and interval, and use the advanced options to pick a specific start time if necessary.

setting a date-based alert in Dynamics 365 for Operations

Next, we will get records from D365. Click “New step” and select “Dynamics 365 for Operations – Get records.”

setting a date-based alert in Dynamics 365 for Operations

 

You’ll be asked to sign in if you have not used this action before. Once signed in, select the D365 instance you want to connect to, and then select the entity “PurchaseOrderLines.”

setting a date-based alert in Dynamics 365 for Operations

Click “Show advanced options” and enter a filter.

setting a date-based alert in Dynamics 365 for Operations

Our filter for this example will have two parts: selecting only open lines and then filtering on the requested delivery date.

The purchase order status field is an enum and requires a little extra work to filter on. The format required is the following:  FieldName eq Microsoft.Dyanmics.DataEntities.Enum’Value’

This then equates to: PurchaseOrderLineStatus eq Microsoft.Dynamics.DataEntities.PurchStatus’Backorder’

The ‘eq’ is the expression for equality (see the full list here – https://msdn.microsoft.com/en-us/library/hh169248(v=nav.90).aspx).

The date field is a little tricky. Something not immediately obvious with Flow is that you can use a lot of the same functionality as LogicApps even though it is not exposed on the designer. So to calculate our date (today – 5) we can make two LogicApp API calls.

The utcnow function will return the date and time as of when the Flow is executed.  We pass one parameter—the format of the date we want returned to us.

We pass the result of the utcnow function call to adddays, which will add, or subtract, the specified number of days to the date it is given. And again, we pass a date format: RequestedDeliveryDate lt @{adddays(utcnow(‘yyyy-MM-dd’), -5, ‘yyyy-MM-dd’)}

The “lt” expression gives us a “less than” condition. Enclosing the above in @{ …} tells Flow that these are function calls to be executed.

So our complete filter expression looks like this:

PurchaseOrderLineStatus eq Microsoft.Dynamics.DataEntities.PurchStatus’Backorder’ and RequestedDeliveryDate lt @{adddays(utcnow(‘yyyy-MM-dd’), -5, ‘yyyy-MM-dd’)}

Next, we add an email action. I’m using o365, but there a multiple methods to send an email. You could also send a text message using Twillio, tweet, etc.

setting a date-based alert in Dynamics 365 for Operations

Click in one of the fields and notice the dynamic content displayed on the right-hand side. Click “See more” to reveal all fields from our entity.

Note what happens when you click on a field. Our send action is automatically embedded within a “Apply to each” loop, which will iterate over all the records we select from D365, and send one email for per past due purchase order line.

setting a date-based alert in Dynamics 365 for Operations

Compose your subject and body using the dynamics content, mixed with plain text, save, and run!

setting a date-based alert in Dynamics 365 for Operations

 

When you run the flow manually, or from the info icon on the “My flows” page, you can view the execution history, and trouble shoot any errors.

setting a date-based alert in Dynamics 365 for Operations

Useful References

By | 2017-03-22T19:58:36+00:00 March 22nd, 2017|Dynamics 365|

About the Author:

Rob Dowsett
Rob has been working in the Microsoft Dynamics channel for over 13 years, currently as Solution Architect for Dynamics 365 Enterprise at Sikich. Throughout his career, Rob helped build a thriving Dynamics AX practice with a team of over 20 and gained multiple Microsoft President Club awards.
Fast-Forward Your Research
PGlmcmFtZSB3aWR0aD0iNDAwIiBoZWlnaHQ9IjIyNSIgc3JjPSIvL3d3dy55b3V0dWJlLmNvbS9lbWJlZC96NGY4QzR4aF9sdz9hdXRvcGxheT0wIiBmcmFtZWJvcmRlcj0iMCIgYWxsb3dmdWxsc2NyZWVuPjwvaWZyYW1lPg==
Use Technology to Your ADVANTAGE
Before it DISRUPTS Your Business
Now, more than ever, companies need to leverage technologies to stay relevant in a connected business world.
Stay Informed with Technology Insights
PGlmcmFtZSBzcmM9Imh0dHA6Ly93ZWIuc2lraWNoLmNvbS9zaWtpY2hjb20tYWNoYmcvcGFnZXMvcWt2amZteWZlZXd1bHN4ZXh4ZXZ3Lmh0bWwiIGFsbG93dHJhbnNwYXJlbmN5PSJ0cnVlIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxNTBweCIgdHlwZT0idGV4dC9odG1sIiBmcmFtZWJvcmRlcj0iMCIgc3R5bGU9ImJvcmRlcjowIj48L2lmcmFtZT4=
Inc Magazine
Crains
AccountingToday
Gain knowledge from experts who have been covered in publications such as...
Turbocharge Your ENERGY Company
Before it Runs Out of GAS
Access insights from experts who have been featured in the following publications...
Stay Informed with Executive Level Insights
PGlmcmFtZSBzcmM9Imh0dHA6Ly93ZWIuc2lraWNoLmNvbS9zaWtpY2hjb20tYWNoYmcvcGFnZXMvcWt2amZteWZlZXd1bHN4ZXh4ZXZ3Lmh0bWwiIGFsbG93dHJhbnNwYXJlbmN5PSJ0cnVlIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxNTBweCIgdHlwZT0idGV4dC9odG1sIiBmcmFtZWJvcmRlcj0iMCIgc3R5bGU9ImJvcmRlcjowIj48L2lmcmFtZT4=
There are tectonic shifts happening in the Energy industry as a direct result from new technology. Companies who can't harness that power will be running on fumes.
DISCOVER the Impact New TECHNOLOGY
Can Have for YOUR ORGANIZATION
Our Experts Will Help Guide You Through Your Technology Challenges
PGlmcmFtZSBzdHlsZT0iYm9yZGVyOiAwOyIgc3JjPSJodHRwOi8vd2ViLnNpa2ljaC5jb20vc2lraWNoY29tLWFjaGJnL3BhZ2VzL3N2dmJzeHhlZXd1bHN4ZXh4ZXZ3Lmh0bWwiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjMzN3B4IiBmcmFtZWJvcmRlcj0iMCI+PC9pZnJhbWU+
Inc Magazine
Crains
AccountingToday
Our experts have been covered in publications such as...
Don't Lose EFFICIENCY on Complexity
Solve Challenges with TECHNOLOGY
Access insights from experts who have been featured in the following publications...
Stay Informed with Executive Level Insights
PGlmcmFtZSBzcmM9Imh0dHA6Ly93ZWIuc2lraWNoLmNvbS9zaWtpY2hjb20tYWNoYmcvcGFnZXMvcWt2amZteWZlZXd1bHN4ZXh4ZXZ3Lmh0bWwiIGFsbG93dHJhbnNwYXJlbmN5PSJ0cnVlIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxNTBweCIgdHlwZT0idGV4dC9odG1sIiBmcmFtZWJvcmRlcj0iMCIgc3R5bGU9ImJvcmRlcjowIj48L2lmcmFtZT4=
Managing a family office can be a challenge with the myriad of tasks that need to be executed perfectly. Assist your efforts with systems that will expand your capabilities.
COMPETE with Global Competition
Start deploying SMARTER Technology
Access insights from experts who have been featured in the following publications...
Stay Informed with Executive Level Insights
PGlmcmFtZSBzcmM9Imh0dHA6Ly93ZWIuc2lraWNoLmNvbS9zaWtpY2hjb20tYWNoYmcvcGFnZXMvcWt2amZteWZlZXd1bHN4ZXh4ZXZ3Lmh0bWwiIGFsbG93dHJhbnNwYXJlbmN5PSJ0cnVlIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxNTBweCIgdHlwZT0idGV4dC9odG1sIiBmcmFtZWJvcmRlcj0iMCIgc3R5bGU9ImJvcmRlcjowIj48L2lmcmFtZT4=
Manufacturing is going through a once in a century transformation. Keep up-to-date on the Internet of Things, 3D printing and other emerging tech systems.
Be EXTRAORDINARY
Modernize Your SYSTEMS
Access insights from experts who have been featured in the following publications...
Stay Informed with Executive Level Insights
PGlmcmFtZSBzcmM9Imh0dHA6Ly93ZWIuc2lraWNoLmNvbS9zaWtpY2hjb20tYWNoYmcvcGFnZXMvcWt2amZteWZlZXd1bHN4ZXh4ZXZ3Lmh0bWwiIGFsbG93dHJhbnNwYXJlbmN5PSJ0cnVlIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxNTBweCIgdHlwZT0idGV4dC9odG1sIiBmcmFtZWJvcmRlcj0iMCIgc3R5bGU9ImJvcmRlcjowIj48L2lmcmFtZT4=
Offering clients the level of service they need to do what counts starts with a solid technology stack. Modernize your operations with new insights.
POSITION Your Company for 2016
OR LOSE to Advanced Competition
Access insights from experts who have been featured in the following publications...
Stay Informed with Executive Level Insights
PGlmcmFtZSBzcmM9Imh0dHA6Ly93ZWIuc2lraWNoLmNvbS9zaWtpY2hjb20tYWNoYmcvcGFnZXMvcWt2amZteWZlZXd1bHN4ZXh4ZXZ3Lmh0bWwiIGFsbG93dHJhbnNwYXJlbmN5PSJ0cnVlIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxNTBweCIgdHlwZT0idGV4dC9odG1sIiBmcmFtZWJvcmRlcj0iMCIgc3R5bGU9ImJvcmRlcjowIj48L2lmcmFtZT4=
Boost customer satisfaction, increase margins and gain knowledge to implement intelligent systems to leapfrog others in your industry.
START Solving Your Complex Challenges TODAY
Work with experts who have been featured in the following publications...

How can we help you?

Our team, with decades of experience, will help your company discover the right technology to fit your specific needs.
PGlmcmFtZSBzdHlsZT0iYm9yZGVyOiAwOyIgc3JjPSJodHRwOi8vd2ViLnNpa2ljaC5jb20vc2lraWNoY29tLWFjaGJnL3BhZ2VzL3N2dmJzeHhlZXd1bHN4ZXh4ZXZ3Lmh0bWwiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjMzN3B4IiBmcmFtZWJvcmRlcj0iMCI+PC9pZnJhbWU+
Review your current systems. Schedule a demo. Bounce ideas off experts. Discover new technical methods. Augment your existing systems. Contact us.
LEAD AS A DIGITAL CFO
Organizations need executives that can meet the needs of a digital world. Stay informed about trends as they happen.
PGlmcmFtZSBzdHlsZT0iYm9yZGVyOiAwOyIgc3JjPSJodHRwOi8vd2ViLnNpa2ljaC5jb20vc2lraWNoY29tLWFjaGJnL3BhZ2VzL2l3M2xqbnl3ZWV3dWxzeGV4eGV2dy5odG1sIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIzMzciIGZyYW1lYm9yZGVyPSIwIj48L2lmcmFtZT4=
Inc Magazine
Crains
AccountingToday
Learn from experts who have been covered in publications such as...
LEAD AS A TRANSFORMATIONAL CIO
Organizations need executives that can meet the needs of a digital world. Stay informed about trends as they happen.
PGlmcmFtZSBzdHlsZT0iYm9yZGVyOiAwOyIgc3JjPSJodHRwOi8vd2ViLnNpa2ljaC5jb20vc2lraWNoY29tLWFjaGJnL3BhZ2VzL2l3M2xqbnl3ZWV3dWxzeGV4eGV2dy5odG1sIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIzMzciIGZyYW1lYm9yZGVyPSIwIj48L2lmcmFtZT4=
Inc Magazine
Crains
AccountingToday
Learn from experts who have been covered in publications such as...
Dynamics AX is now...
Dynamics 365 Enterprise Edition
Dynamics 365 is operations, sales and marketing all in one package.
PGlmcmFtZSBzcmM9Imh0dHA6Ly93ZWIuc2lraWNoLmNvbS9zaWtpY2hjb20tYWNoYmcvcGFnZXMvcWt2amZteWZlZXd1bHN4ZXh4ZXZ3Lmh0bWwiIGFsbG93dHJhbnNwYXJlbmN5PSJ0cnVlIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxNTBweCIgdHlwZT0idGV4dC9odG1sIiBmcmFtZWJvcmRlcj0iMCIgc3R5bGU9ImJvcmRlcjowIj48L2lmcmFtZT4=
Short on time? No problem. Sign up for our insights to get information about Microsoft Dynamics delivered to you.
Dynamics GP is now...
Dynamics 365 Business Edition
Dynamics 365 provides unprecedented scalability for growing, modern organizations.
PGlmcmFtZSBzcmM9Imh0dHA6Ly93ZWIuc2lraWNoLmNvbS9zaWtpY2hjb20tYWNoYmcvcGFnZXMvcWt2amZteWZlZXd1bHN4ZXh4ZXZ3Lmh0bWwiIGFsbG93dHJhbnNwYXJlbmN5PSJ0cnVlIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxNTBweCIgdHlwZT0idGV4dC9odG1sIiBmcmFtZWJvcmRlcj0iMCIgc3R5bGU9ImJvcmRlcjowIj48L2lmcmFtZT4=
Short on time? No problem. Sign up for our insights to get information about Microsoft Dynamics delivered to you.
Looking for more Cloud ERP information?
Discover a resource center full of tools, calculators and over 40 articles that will help you decide when Cloud ERP is right for you.
PGlmcmFtZSBzcmM9Imh0dHA6Ly93ZWIuc2lraWNoLmNvbS9zaWtpY2hjb20tYWNoYmcvcGFnZXMvcmpqZnEwZmllZWV1cWN4ZXh4ZXZ3Lmh0bWwiIGFsbG93dHJhbnNwYXJlbmN5PSJ0cnVlIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIyMDBweCIgdHlwZT0idGV4dC9odG1sIiBmcmFtZWJvcmRlcj0iMCIgc3R5bGU9ImJvcmRlcjowIj48L2lmcmFtZT4=
Receive every white paper as they are published
All you need to do is leave your email address
Bonus: Get a $500 white paper on the future of ERP systems
How to Use the Comparison Tool
PGlmcmFtZSB3aWR0aD0iNjQwIiBoZWlnaHQ9IjM2MCIgc3JjPSJodHRwczovL3d3dy55b3V0dWJlLmNvbS9lbWJlZC81aUg0ckQtdjZ2bz9yZWw9MCIgZnJhbWVib3JkZXI9IjAiIGFsbG93ZnVsbHNjcmVlbj48L2lmcmFtZT4=