web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

How can I replace characters in subject?

(0) ShareShare
ReportReport
Posted on by 15

Hello!

 

I am working in a flow that checks the inbox every 15 minutes and stores the incoming emails into a SFTP server, the folder where the emails are stored has the same name as the subject.

 

As you know, in Windows this character '/' indicates the beginning of a new directory.

 

I have a customer that sends the emails with the character said before and when the flow is going to create the folder, it detects de slash and creates 3 or 4 more folders that it should.

 

Here is how I configured it (under the red line is the path where the email has to go to):

Rau_0-1671787318316.png

 

Now, how can I replace '/' in the subject for '-'? I tried with the replace function but it didn't work (maybe I put it wrong) and using compose but Im pretty new using Power Automate and I don't know if I'm doing something wrong. Help is appreciated! 

I have the same question (0)
  • Expiscornovus Profile Picture
    32,852 Most Valuable Professional on at
    Re: How can I replace characters in subject?

    Hi @Rau,

     

    I assume this Create File action (SFTP - SSH connector) is part of/placed within an apply to each loop? 

     

    If that is the case you could use the following expression.

     

    You can add this via the expression editor in the File Name field of the Create File action and type .eml after it:

     

    replace(item()?['subject'], '/', '-')

     

     

     

    Or directly copy paste the below into the File Name field of the Create File action

     

    @{replace(item()?['subject'], '\', '-')}.eml

     

     

     

  • Rau Profile Picture
    15 on at
    Re: How can I replace characters in subject?

    Thanks for the response @Expiscornovus I will try your solution after holidays and I'll tell you if I did it.

     

    Merry christmas and happy new year!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 722 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 461 Moderator

#3
developerAJ Profile Picture

developerAJ 283

Last 30 days Overall leaderboard