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

Newbie: Need Help!

Hi everyone, I'm a beginner in Power Automate and still trying to learn.

 

I currently have 10 scheduled flows with monthly recurrence for each respective due date which would send an email to specific user for her to action. However, I recently learned that these emails should not arrive on the due date itself but instead a couple of business days before the due date. I won't pretend that I'm up to something because I have no idea how to update the current flows I have.

 

Here's an example of what I was able to configure:

 

Credit Card Reconciliation.jpg

This sends a simple email reminder every 18th of the month. I need to change it to send the email reminder 14 business day before the 18th of every month.

 

Please help and thank you in advance!

7 REPLIES 7
annajhaveri
Super User
Super User

@Marky_  you can update the recurrence trigger start time to trigger on 14th of every month

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.
Marky_
Frequent Visitor

Thanks @annajhaveri! However, the goal I'm trying to achieve is to send the email reminder 14 business days before the 18 of every month.

 

For example, the due date next month is June 18th and so the email reminder needs to be sent out 14 business days before that in which is June 1st. Now, I can update the recurrence's trigger start time to the 1st of every month but that wouldn't necessarily meet the condition of "14 business days before the 18 of every month" given that if we apply the same logic for July, as an example, the email reminder needs to be sent out on June 29th since July 18th falls on a Sunday.

 

I hope that make sense and thank you for taking time in help me out.

@Marky_  so it is based on your data if I understand it correctly you will need to get the data and compare the date in your data. Where is your data stored, SharePoint or somewhere else? what you can do here, configure the flow to run daily, then in flow you can calculate today + 14 days date, which will give you the date after 14 days, then using that date, query data from your data source which have due date equals to that date, which will give you records for which you need to send the notification.  

 

Here is reference on how to calculate business days to add to a date https://powerofpowerplatform.com/calculating-working-days-in-power-automate-flow/

 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.
Marky_
Frequent Visitor

Hi @annajhaveri I'm not storing any data anywhere. The due date is constant, every 18 of every month. Also, I need to configure the flow to calculate 18 minus 14 business days (excluding weekends) not + 14 days

@Marky_  sorry for misunderstand your requirements, i think the requirement will be achievable by making the flow to run daily using recurrence trigger, then calculating difference in days between today and 18th of the month, and if that difference is 14 days, check that in condition and send the email, you can add actions as described below to get the difference between today and 18th of the month.

 

1. Add compose action and configure below expression in the action using Dynamic Content ->  Expression and rename the action to "Get 18th of the Month"

concat(formatDateTime(utcNow(),'MM'),'/18/',formatDateTime(utcNow(),'yyyy'),' 00:00:00')

This expression will give you 18th date of the current month

 

2. Again add Compose action and configure below expression in the action using Dynamic Content ->  Expression. Rename the action to "Compose - Get Difference in days"

div(sub(ticks(outputs('Get_18th_of_the_Month')),ticks(formatDateTime(utcNow(),'yyy-MM-dd'))),864000000000)

This expression will calculate difference between 18th of the month and today's date in days.

Then you can add condition action and use output of "Compose - Get Difference in days" on left of condition, select "Equal to" in the dropdown and specify 14 in the right side of condition as shown in below screenshot. Then in yes branch of action add sent email action.

 

Screenshot of the flow with action

annajhaveri_0-1620990981779.png

 

 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.
Marky_
Frequent Visitor

No worries @annajhaveri . Thank you for this!

 

Just want to confirm though, is the calculation excluding weekend?

@Marky_  no this is calculating all days, if you just need working days, then thats a little more work to be done, i would suggest you refer to this post https://ryanmaclean365.com/2019/12/12/calculate-working-days-in-a-time-period-using-power-automate/ on how to do it, as the blog has detailed instructions step by step to calculate the difference in terms of working days.

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,466)