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 / Need help removing ext...
Power Automate
Unanswered

Need help removing extra space after text splitting

(0) ShareShare
ReportReport
Posted on by 7

Very new to power automate (so be kind lol) and trying to just make a simple flow to help with some stuff at work. I want to split the text from a standardized email template, which will eventually be directed into an excel table. I am having an issue where there seems to be extra space added after the text I want parsed (code shows the raw input is " Spar\n\n"). But the input from the email is "Spar" 

 

Please see below for the result and code: 

 

Email Template: 

 

rug: Spar

pic: xxxxxxx xxxxxxxxx

ight: xxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxx

rce: KL

 

 
First Line: first(skip(split(first(split(body('Html_to_text'),'pic')),'rug: '),1))
ZachB4_1-1680890692444.png

 

Second Line: first(skip(split(first(split(body('Html_to_text'),'ight')),'pic: '),1))
ZachB4_2-1680890741448.png

 

Third line: first(skip(split(first(split(body('Html_to_text'),'rce')),'ight: '),1))

ZachB4_3-1680890781379.png

 

Fourth Line (which is not having the issue, so no picture): first(skip(split(body('Html_to_text'),'rce: '),1))

 

Looking for any help or suggestions on how to fix this! Thanks! 

Categories:
I have the same question (0)
  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    Use trim() to remove leading and trailing whitespace.

  • ZachB4 Profile Picture
    7 on at

    Okay awesome! Question: where in the code should I apply the trim()? Sorry.. like I said. New to this lol 

  • Verified answer
    Jcook Profile Picture
    7,781 Most Valuable Professional on at

    @ZachB4 

     

    Try:

    First Line:

    trim(first(skip(split(first(split(body('Html_to_text'),'pic')),'rug: '),1)))

     

    Second Line:

    trim(first(skip(split(first(split(body('Html_to_text'),'ight')),'pic: '),1)))

     

    Third Line:

    trim(first(skip(split(first(split(body('Html_to_text'),'rce')),'ight: '),1)))

     

    Fourth Line:

    trim(first(skip(split(body('Html_to_text'),'rce: '),1)))

     

  • ZachB4 Profile Picture
    7 on at

    @Jcook @Kaif_Siddique  Thanks both! This worked! 

  • Ximbalou Profile Picture
    6 on at

    Hello @Jcook ,

    Wish you a excellent 2024.

    Not sure if you can help me, but I am trying to do something similar to this, but I am struggling.

    I want to extract the 2nd link, but I am getting the 1st one.

    Using this formula from html to text: 

    trim(first(split(last(split(body('Html_to_text'),'Invoice PDF')),']')))



    Ximbalou_0-1704187437988.png

     

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