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 / Remove text between pa...
Power Automate
Unanswered

Remove text between parenthesis

(0) ShareShare
ReportReport
Posted on by 3

I'm trying to remove text between parenthesis as well as the parenthesis
i can remove the parenthesis but still couldn't remove what's between them cause the text is variable it can be anything.
i receive an email that contains each time something different but all i have to do is remove the text between the parenthesis and leave the body of the mail as it is and then the forward it.
Something like this

Asma2406_0-1701336831523.png
Any ideas please ??😔

Categories:
  • Rhiassuring Profile Picture
    8,692 Moderator on at

    This will be exactly what you want, except instead of @ you will use ( and instead of | you will use )

     

    https://powerusers.microsoft.com/t5/Building-Flows/extract-s-string-between-two-characters/m-p/81139/highlight/true#M8072

     

    Basically, you follow these steps:

     

    1) Get the index of the (, turn that number into an integer, and add 1.

    2) Do the same for the ), except, don't add 1.

    3) Subtract the index of ) from the index of (.

    4) Get substring of your text using output from Step 1, output from Step 3.

  • Asma2406 Profile Picture
    3 on at

    It worked but only for the first text between parethesis, for the rest ( the mail contains so many words between parenthesis) didn't work on them.

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    Oh, I see. 

    In that case.. 🤔
    You could split on"("

    That'll give you an array of everything that has starts with a ( - but it won't include it.

    Then all you'll need to do, for each item in that array, is Steps 2 - 4, and consider that Step 1 will always be either 1 or 0 (I can't remember right now - I think 0?) 

  • Chriddle Profile Picture
    8,729 Super User 2026 Season 2 on at

    This works for simple cases only (e.g. no nested parenthesis):

    Chriddle_0-1701427120190.png

    Select

    From:

    split(outputs('Compose'), '(')

    Map:

    last(split(item(), ')'))

    Compose:

    join(body('Select'), '')

     

    Output:

    Lorem dolor sadipscing elitr, sed diam nonumy ut labore et dolore magna aliquyam erat.

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 424

#2
11manish Profile Picture

11manish 328 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard