cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
zahmed
Frequent Visitor

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
Community Support

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
Community Support

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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (6,865)