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

Replace part of mail subject with current date

Hi, I have this flow and it is working fine.

Flow1.jpg

 

The Subject-Line of each mail that triggers the flow starts with '2Flow-'. How can I replace '2Flow-' with current date in international format? With international format I mean 'YY-MM-DD'. So today is written as '21-09-19'. 

 

I am new to flow. I searched the forum but found only examples with arrays and chars. 

 

5 REPLIES 5
abm
Super User
Super User

Hi @R_K 

 

Could you please clarify that you looking to replace the subject line after the trigger step (Second step) or you want the mail to trigger only subject line contains todays date yyyy-MM-dd format?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials
R_K
New Member

I want to modify each subject line. When the incoming subject line is '2Flow-This is a subject' then the outgoing subject line must be '21-09-19 This is a subject line'. Another example: When the incoming subject line is '2Flow-Demo-Subject 2' then the outgoing subject line must be '21-09-19 Demo-Subject 2'. 

 

I suspect that this change must be made between step 1 and step 2.

abm
Super User
Super User

Hi @R_K 

 

Thanks for the clarification.

 

image.png

 

The expression I used above is as follows:

 

replace(triggerOutputs()?['body/subject'],'2Flow-',concat(formatDateTime(utcNow(),'yyyy-MM-dd'),' '))

 

My Test Result:

 

image.png

 

Try the above and let me know.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials
R_K
New Member

Thank you! Your solution works perfectly.

 

I have one additional question. What would I have to modify if I want a case-insensitive solution for my problem? To replace '2Flow-' or '2flow-' or '2FlOw-' with the date? 

abm
Super User
Super User

Hi @R_K 

 

Use the expression toLower() or toUpper(). So first capture the subject line in a compose and do the toLower()/toUpper(). Then in next step do the earlier expression replace and change the '2Flow' to '2FLOW' or '2flow'. 

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

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.

Top Solution Authors
Users online (1,164)