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 word from compo...
Power Automate
Answered

Remove word from compose output

(1) ShareShare
ReportReport
Posted on by

Hello,

 

I have a flow where I have split the text from the body of an email, and for the most part it is successful. My issue is that for certain output of those variables, it includes text I do not want in the output. For example, my weight variable will comeback as "250 lbs" where as I need it to come back at "250". Another word I have to delete is "inches". Can anyone help me with this? I have attached a ss of my flow for reference. 

 

macdonal_T_0-1720444860358.png

 

Categories:
  • Verified answer
    creativeopinion Profile Picture
    10,508 Moderator on at

    @macdonal_T You will need to use the replace() function. The replace() function takes three parameters:

    replace([text string], [old text], [new text])

    In the demo below, I'm using a Compose action to store a string. 

    creativeopinion_0-1720448927091.png

    Add another Compose action. Insert an expression and the replace() function.

    creativeopinion_1-1720448945926.png

    For the first parameter, click on the dynamic content tab and insert the dynamic content that contains your string. In my case it's the Compose action. 

    creativeopinion_2-1720448989607.png

    Add a comma, and in between single quotes enter the old text. In your case, it's lbs. Add another comma and single quotes.

    creativeopinion_3-1720449031200.png

     

    Run a test. Review the outputs. Tip: To get rid of the extra spaces add a space before and after the lbs text.

    creativeopinion_4-1720449167543.png

     

     

    Wrap the existing expression in another replace() function. Not sure what it means to wrap a function? Check out this section of my tutorial: 

    7 Functions You Need to Know | ⚡️Expression Essentials: Part 1⚡️

     

    In this section, I'll cover how to get dynamic content with an expression when the dynamic content you need isn't listed in the dynamic content menu.

     

    In the full tutorial I cover 7 functions you need to know when getting started with expressions.

    1️⃣ empty()

    2️⃣ coalesce()

    3️⃣ equals()

    4️⃣ if()

    5️⃣ concat()

    6️⃣ length()

    7️⃣ split()

     

    I cover how to use these functions in expressions and I’ll also cover common mistakes when it comes to writing expressions and show you a few tips and tricks along the way.

     

    As a beginner or even an intermediate flow builder—expressions can seem a bit complex at first, I’m going to try to simplify it for you. If you want to level up your flows by writing expressions—keep watching!

     

    IN THIS VIDEO:

    ✅ What is an Expression?

    ✅ What is a Function?

    ✅ What Does Wrapping a Function Mean?

    ✅ How Do I Insert an Expression?

    ✅ How to Use a Compose action

    ✅ How to Navigate the Expression Builder with Arrow Keys

    ✅ How to use the Expression Tooltip

    ✅ Common Mistakes When Writing Expressions

    ✅ How to differentiate a null from an empty string

    ✅ How to Get Dynamic Content When it’s Not Listed

    ✅ How to Use a Get Item Action to Verify Dynamic Content Output

    ✅ How to Convert Strings to Lower Case

     

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution ✅.
    Consider giving me a 👍 if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram

     

     

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 430

#2
11manish Profile Picture

11manish 341 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 282

Last 30 days Overall leaderboard