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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Replace characters in ...
Power Automate
Answered

Replace characters in email subject

(2) ShareShare
ReportReport
Posted on by 37

Hello,

I have to create a flow where at email receive with {} brackets in the subject, they have to be replaced with [] brackets but to not triger when there's {Support}. Let's say the email subject is {Hello there}, the {} brackets have to be replaced with [Hello there] but if it's {Support}, no action should be taken. I'm a newbie and I'm totaly lost and I'll be grateful for any help. Thanks in advance!

Categories:
I have the same question (0)
  • bscarlavai33 Profile Picture
    752 Super User 2026 Season 1 on at

    You most likely have to use Regex which requires a third party connector - https://learn.microsoft.com/en-us/connectors/regexmatchingip/

  • Mozo78 Profile Picture
    37 on at

    Thank you!

    Is this a way without a third party tool?

  • Mozo78 Profile Picture
    37 on at

    I put this condition but when I test it, the system says it's skipped and I don't know why:

    Screenshot_2024_14_07_16_45.png

  • Verified answer
    Sayan Profile Picture
    818 Moderator on at

    Hey @Mozo78 

    Do you want to replace the subject in the email, or do you want to take the subject, replace it, and send a new email or store the subject somewhere else?

     

    Solution for Replace subject using a variable:

     

    Sayan_0-1720970812277.png

     

    Step1:

     

    Initialize a variable with the Subject of Email.

     

    Sayan_1-1720970849172.png

    Step2:

    Initialize another variable

    Sayan_2-1720970928827.png

     

    Step 3:

    Put a condition

    Sayan_3-1720970964239.png

     

    Step 4:

     

    On the True side use this set variable

     

    Sayan_4-1720971004135.png

     

    ------------------------------------------------------------------------------------------------------------------------------

    If my suggestion helps you, please gives it a Thumbs up 👍 and Marks as a Solution ✔️. Which motivates to solve more problems.

    Thanks,

    Sayan Patra | RPA Developer

     

  • Mozo78 Profile Picture
    37 on at

    Hello,

    Subject just have to be corrected and after the {} are replaced, it have to send the mail to a certain mailbox with the corrected subject with [] brackets. If the email subject contains {Support}, it has to take no action.

  • Mozo78 Profile Picture
    37 on at

    Ah, and I just saw it - the subject will never start with { or ends with }. The brackets will be somewhere in the subject text.

  • Sayan Profile Picture
    818 Moderator on at

    Hey @Mozo78 

    Then also this whole solution will work just you need to change the condition.

     

    ------------------------------------------------------------------------------------------------------------------------------

    if my suggestion helps you, please gives it a Thumbs up 👍 and Marks as a Solution ✔️. Which motivates to solve more problems.

    Thanks,

    Sayan Patra | RPA Developer

     

    ------------------------------------------------------------------------------------------------------------------------------

     

  • Mozo78 Profile Picture
    37 on at

    Thank you very much, you're great!

    I'm talking somewhat blindly for my boss is at vacation and I can't try it in the moment, accept my sincere excuses.

    Will it work with my condition I posted earlier?

  • Sayan Profile Picture
    818 Moderator on at

    Hey @Mozo78 

    Hope the previous condition will work. When you are available just Try once. Let me know if you face any issues.

     

    ------------------------------------------------------------------------------------------------------------------------------

    Thanks,

    Sayan Patra | RPA Developer

  • Mozo78 Profile Picture
    37 on at

    Hello,

    Now I can try and it gives me this error:

     

     

     

     

    Flow save failed with code 'InvalidVariableInitialization' and message 'The variable action 'Replace_{}_with_[]' of type 'InitializeVariable' cannot be nested in an action of type 'Condition'.'.

     

     

     

     

     

    Screenshot_2024_15_07_15_18.png

     

    The condition is this:

     

    123.png

    It gives me this error even with your example:

    Screenshot_2024_15_07_15_23.png

     

    Here's a screenshot of the problematic component:

    Screenshot_2024_15_07_15_27.png

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 573

#2
Valantis Profile Picture

Valantis 407

#3
11manish Profile Picture

11manish 387

Last 30 days Overall leaderboard