cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Amanstv
New Member

Weekly recurring mail with dynamic date and day

Hi All,

 

I have created a recurring flow for sending out my weekly reports which triggers on every Monday of the week for the coming Wednesday and Thursday. I want to have somewhat like this as the subject line with changing date and day automatically. Here is the subject line for reference - Weekly Report (9th and 10th June). I want the date and day formatted like this and recurring in nature whenever the flow triggers on Monday. Any help would be highly appreciated.

 

best,

AS

1 ACCEPTED SOLUTION

Accepted Solutions
annajhaveri
Community Champion
Community Champion

@Amanstv  please follow below steps to create subject link dynamically like Weekly Report (9th and 10th June) when you flow runs every Monday

 

1. Add Compose action, name it as "Get Wednesday Date" and configure below expression

int(formatDateTime(addDays(utcNow(),2),'dd'))

 

2. Add Compose action, name it as "Get Thursday Date" and configure below expression

int(formatDateTime(addDays(utcNow(), 3), 'dd'))

 

3. Add Compose action, name it as "Get Wednesday Date Ordinal" and configure below expression

if(endsWith(string(outputs('Get_Wednesday_Date')),'12'),formatNumber(outputs('Get_Wednesday_Date'), '#th'),if(endsWith(string(outputs('Get_Wednesday_Date')),'13'),formatNumber(outputs('Get_Wednesday_Date'), '#th'),if(endsWith(string(outputs('Get_Wednesday_Date')),'1'),formatNumber(outputs('Get_Wednesday_Date'), '#st'),if(endsWith(string(outputs('Get_Wednesday_Date')),'2'),formatNumber(outputs('Get_Wednesday_Date'), '#nd'),if(endsWith(string(outputs('Get_Wednesday_Date')),'3'),formatNumber(outputs('Get_Wednesday_Date'), '#rd'),formatNumber(outputs('Get_Wednesday_Date'), '#th'))))))

 

4. Add Compose action, name it as "Get Thursday Date Ordinal" and configure below expression

if(endsWith(string(outputs('Get_Thursday_Date')),'12'),formatNumber(outputs('Get_Thursday_Date'), '#th'),if(endsWith(string(outputs('Get_Thursday_Date')),'13'),formatNumber(outputs('Get_Thursday_Date'), '#th'),if(endsWith(string(outputs('Get_Thursday_Date')),'1'),formatNumber(outputs('Get_Thursday_Date'), '#st'),if(endsWith(string(outputs('Get_Thursday_Date')),'2'),formatNumber(outputs('Get_Thursday_Date'), '#nd'),if(endsWith(string(outputs('Get_Thursday_Date')),'3'),formatNumber(outputs('Get_Thursday_Date'), '#rd'),formatNumber(outputs('Get_Thursday_Date'), '#th'))))))

 

5. Add Compose action, name it as "Get Month" and configure below expression

formatDateTime(addDays(utcNow(),2),'MMMM')

 

6. Add Compose action, name it as "Combine Date for subject" and configure below expression. The output of this action is the subject line you need. so use output of this action in the email action

concat('Weekly Report (',outputs('Get_Wednesday_Date_Ordinal') ,' and ', outputs('Get_Thursday_Date_Ordinal'), ' ', outputs('Get_Month') ,')')

 

Full flow screenshot

annajhaveri_0-1623233627229.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.

View solution in original post

3 REPLIES 3
annajhaveri
Community Champion
Community Champion

@Amanstv  please follow below steps to create subject link dynamically like Weekly Report (9th and 10th June) when you flow runs every Monday

 

1. Add Compose action, name it as "Get Wednesday Date" and configure below expression

int(formatDateTime(addDays(utcNow(),2),'dd'))

 

2. Add Compose action, name it as "Get Thursday Date" and configure below expression

int(formatDateTime(addDays(utcNow(), 3), 'dd'))

 

3. Add Compose action, name it as "Get Wednesday Date Ordinal" and configure below expression

if(endsWith(string(outputs('Get_Wednesday_Date')),'12'),formatNumber(outputs('Get_Wednesday_Date'), '#th'),if(endsWith(string(outputs('Get_Wednesday_Date')),'13'),formatNumber(outputs('Get_Wednesday_Date'), '#th'),if(endsWith(string(outputs('Get_Wednesday_Date')),'1'),formatNumber(outputs('Get_Wednesday_Date'), '#st'),if(endsWith(string(outputs('Get_Wednesday_Date')),'2'),formatNumber(outputs('Get_Wednesday_Date'), '#nd'),if(endsWith(string(outputs('Get_Wednesday_Date')),'3'),formatNumber(outputs('Get_Wednesday_Date'), '#rd'),formatNumber(outputs('Get_Wednesday_Date'), '#th'))))))

 

4. Add Compose action, name it as "Get Thursday Date Ordinal" and configure below expression

if(endsWith(string(outputs('Get_Thursday_Date')),'12'),formatNumber(outputs('Get_Thursday_Date'), '#th'),if(endsWith(string(outputs('Get_Thursday_Date')),'13'),formatNumber(outputs('Get_Thursday_Date'), '#th'),if(endsWith(string(outputs('Get_Thursday_Date')),'1'),formatNumber(outputs('Get_Thursday_Date'), '#st'),if(endsWith(string(outputs('Get_Thursday_Date')),'2'),formatNumber(outputs('Get_Thursday_Date'), '#nd'),if(endsWith(string(outputs('Get_Thursday_Date')),'3'),formatNumber(outputs('Get_Thursday_Date'), '#rd'),formatNumber(outputs('Get_Thursday_Date'), '#th'))))))

 

5. Add Compose action, name it as "Get Month" and configure below expression

formatDateTime(addDays(utcNow(),2),'MMMM')

 

6. Add Compose action, name it as "Combine Date for subject" and configure below expression. The output of this action is the subject line you need. so use output of this action in the email action

concat('Weekly Report (',outputs('Get_Wednesday_Date_Ordinal') ,' and ', outputs('Get_Thursday_Date_Ordinal'), ' ', outputs('Get_Month') ,')')

 

Full flow screenshot

annajhaveri_0-1623233627229.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.
Amanstv
New Member

Thank you so much. It did the trick. Cheers!

Thank you so much. It eased my burden fully. Hats off!

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (6,033)