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
Super User

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 blog
Power 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.
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 Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (2,856)