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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Remove part of a string
Power Automate
Unanswered

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,185 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,185 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard