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/delete text bet...
Power Automate
Unanswered

Remove/delete text between attribute/section in Power Automate Desktop

(0) ShareShare
ReportReport
Posted on by 4

Anyone have an idea how I can remove all the text in a file between a specific section/attribute using Power Automate Desktop?

For example:  

<Section.01>text that I need to remove</Section.01>

I have the same question (0)
  • jinivthakkar Profile Picture
    4,187 on at

    @ralphloszak Yes, I can see two actions which you can use if the file is xml, I could not find any other action to remove/extract a specific text from the file

    jinivthakkar_0-1642614456314.png

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

    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

     

  • UK_Mike Profile Picture
    on at

    Regex will pull it out.

    Unfortunately Ive yet to practice getting the middle of a string, just the start or the end at the moment.

    I think Regex is the way to go on this occasion

  • Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at

    Behold! Removing text between two text segments:

    SET Text TO $'''<Section.01>text that I need to remove</Section.01>'''
    Text.Replace Text: Text TextToFind: $'''(?<=<Section.01>).+(?=</Section.01>)''' IsRegEx: True IgnoreCase: False ReplaceWith: $'''%''%''' ActivateEscapeSequences: False Result=> Replaced

     (copy and paste the code into PAD)

  • UK_Mike Profile Picture
    on at

    Henrik !!! Where have you been lol.

    Ive just spent a half hour messing with capture groups lol.   

    Perfect code, I checked it for you 😄

  • ralphloszak Profile Picture
    4 on at

    Thanks for the code, just started using Power Automate.  Will this code work on any text between the two sections <Section.01>this text changes every day</Section.01>? Can you show me a screenshot of what this would look like in PAD?

  • UK_Mike Profile Picture
    on at

    As Henrik said, just copy and paste the text into pad and the actions will magically appear.

    Yes it will work with any text between the 2 sections.

    Go here   https://regexr.com/

    Put Henriks code in the top text box and the text you want to work on in the bottom, you can then replace the text between the sections with whatever you want and it will still work regardless.

  • ralphloszak Profile Picture
    4 on at

    WOW, ok that easy, did not expect that.  Got that  working.  What about if the text between the two sections is multiple sentences with commas, periods, and other special characters?  I think I need to change something.

  • UK_Mike Profile Picture
    on at

    Go to the web link I provided and try it out yourself, replace the inner text with whatever may come up in the future...

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!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 557

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 264 Super User 2026 Season 1

Last 30 days Overall leaderboard