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 part of a string
Power Automate
Answered

Remove part of a string

(0) ShareShare
ReportReport
Posted on by 102

Hi,

 

I have got an email text that contains a disclaimer that starts with "This email"...

 

I want to remove this party of the email. I have tried it using First(Split( ... but I get an error.

Categories:
I have the same question (0)
  • tom_riha Profile Picture
    10,187 Most Valuable Professional on at

    Hello @Phil_NPO ,

    you can use the replace(...) expression to replace it with '' (nothing)

    replace(SourceString, StringToReplace, ReplacementSting)
    
    example:
    replace([EmailTextDynamicContent],'This email','')

     

  • Phil_NPO Profile Picture
    102 on at

    Hi Tom,

     

    thanks for your reply. The problem is, that the text is not allways the same. The disclaimer contains a link with a result of a virus scan and this is allway different. So I only can search for the beginning of the disclaimer

  • Verified answer
    Phil_NPO Profile Picture
    102 on at

    My solution is

    first(split(triggerOutputs()?['body/body'],'--'))

    This -- is just in front of the string, which should be deleted. 

     

    I tried this before I have asked here, but I had a error at the syntax. 

  • tom_riha Profile Picture
    10,187 Most Valuable Professional on at

    What error did you get? If it's an email I'd convert it from 'HTML to Text' first (there's an action Html to text) and remove that string after it's converted to text. The final expression could look like this:

    replace([EmailTextDynamicContent],first(split([EmailTextDynamicContent],'--')),'')

     

  • Phil_NPO Profile Picture
    102 on at

    No, my problem often is the syntax (german and english using " instead of ') or something like this.

     

    It works fine with 

    first(split(triggerOutputs()?['body/body'],'--'))

     

     

    Thanks for your help!

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