cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Reading subject of e-mail and replacing and found characters

I wrote a Flow for our Sales team and am now expanding it. The requirement is that the Flow must read the email subject line and search for and replace any of the below characters. We're just replacing with an underscore for now. The issue is that I cannot find a way to make this work. Any thoughts? I tried some loops, creating variables and then reading an array, etc. None of these work. Thoughts?

 

 

@contains(triggerBody()?['Subject'], '.'),contains(triggerBody()?['Subject'], '@'),contains(triggerBody()?['Subject'], '`'),contains(triggerBody()?['Subject'], '='),contains(triggerBody()?['Subject'], '('),contains(triggerBody()?['Subject'], ')'),contains(triggerBody()?['Subject'], '&'),contains(triggerBody()?['Subject'], '$'),contains(triggerBody()?['Subject'], '~'),contains(triggerBody()?['Subject'], '#'),contains(triggerBody()?['Subject'], '%'),contains(triggerBody()?['Subject'], '*'),contains(triggerBody()?['Subject'], ':'),contains(triggerBody()?['Subject'], ','),contains(triggerBody()?['Subject'], '?'),contains(triggerBody()?['Subject'], '/'),contains(triggerBody()?['Subject'], '|'),contains(triggerBody()?['Subject'], ' '))

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

 

Hi @Anonymous ,

 

As suggested by abm, you could refer to the following methods to configure Flow.

135.PNG136.PNG

replace(outputs('Compose'),items('Apply_to_each'),'_')

Please take a try.

 

Best Regards,

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

3 REPLIES 3
abm
Super User III
Super User III

Hi @Anonymous 

 

Define an array with all the special characters. Then add a for each action loop to iterate each special characters. Then check via a condition contains the special character against email subject. Then under the yes condition add a replace function with underscore. You need the following actions:

1. Array

2. For Each Loop

3 If Condition

4 Compare special character from the loop vs subject 

5 Use expression replace function for underscore replacement

 

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
v-bacao-msft
Community Support
Community Support

 

Hi @Anonymous ,

 

As suggested by abm, you could refer to the following methods to configure Flow.

135.PNG136.PNG

replace(outputs('Compose'),items('Apply_to_each'),'_')

Please take a try.

 

Best Regards,

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

Anonymous
Not applicable

Thanks so much @v-bacao-msft! That got me well on the way! I found a way to make it work, but it was ugly. This is more fluid and efficient. Thanks to the both of you for your willingness to assist!

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (785)