cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
zahmed
Level: Powered On

Creating a Flow to send all Dynamics365 Opportunities Won this month and the same month last year

Hi Guys,

 

I am trying to create a flow to send email of all opportunites won this month compared to the same month last year.

Is this possible? can someone help me with this?

 

Currently I have created a flow which is basically sending all won opportunities for past 14 days.  I want to send all opportunties won this month and the same month last year. 

 

Flow.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Creating a Flow to send all Dynamics365 Opportunities Won this month and the same month last yea

Hi @zahmed,

 

Do you want to filter the Filter query with the beginning and end of this month and the same month last year?

I did the test and could filter the record for this month, but the same month last year may not be represented by the current action and Expression.

You could try the following expression indicate the beginning and end of the month:

StartOfMonth: 

startOfMonth(utcNow())

EndOfMonth: 

adddays(concat(add(int(formatDateTime(utcNow(), 'yyyy')),if(equals(formatDateTime(utcNow(), 'MM'), '12'), 1, 0) ),'-',add(int(formatDateTime(utcNow(), 'MM')),if(equals(formatDateTime(utcNow(), 'MM'), '12'), -11, 1) ),'-01T00:00:00Z'),-1)

You could filter the output of the two Composes into the Filter Query.

Image reference:

29.PNG

As for what you want the same month last year, you could post this idea in the Flow Ideas forum, so it might be considered for future releases.

https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

Please take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: Creating a Flow to send all Dynamics365 Opportunities Won this month and the same month last yea

Hi @zahmed,

 

Do you want to filter the Filter query with the beginning and end of this month and the same month last year?

I did the test and could filter the record for this month, but the same month last year may not be represented by the current action and Expression.

You could try the following expression indicate the beginning and end of the month:

StartOfMonth: 

startOfMonth(utcNow())

EndOfMonth: 

adddays(concat(add(int(formatDateTime(utcNow(), 'yyyy')),if(equals(formatDateTime(utcNow(), 'MM'), '12'), 1, 0) ),'-',add(int(formatDateTime(utcNow(), 'MM')),if(equals(formatDateTime(utcNow(), 'MM'), '12'), -11, 1) ),'-01T00:00:00Z'),-1)

You could filter the output of the two Composes into the Filter Query.

Image reference:

29.PNG

As for what you want the same month last year, you could post this idea in the Flow Ideas forum, so it might be considered for future releases.

https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

Please take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

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 Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 100 members 3,053 guests
Please welcome our newest community members: