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
Solved! Go to Solution.
@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
@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
Thank you so much. It did the trick. Cheers!
Thank you so much. It eased my burden fully. Hats off!
User | Count |
---|---|
95 | |
48 | |
21 | |
19 | |
18 |
User | Count |
---|---|
137 | |
54 | |
42 | |
41 | |
30 |