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 / How to delete the last...
Power Automate
Answered

How to delete the last two characters in a text

(0) ShareShare
ReportReport
Posted on by 49

Hi All,

 

I have this web scraping flow, I need to pass the data from varCity to trim the last two characters. Any suggestions on how to properly do it?

 

Actual value sample:

varCity = Los Angeles CA

 

I need to remove the CA at the end and if possible can I transfer it to Compose. I also need that CA to be passed on for usage.

 

Please help. Thank you 🙂

 

Mark_Castro_0-1594847851623.png

 

Categories:
I have the same question (0)
  • Verified answer
    abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Hi @Mark_Castro 

     

    Here it is

     

    image.png

     

     

    The expression I used above is as follows:

     

    substring(outputs('Compose'),0,sub(length(outputs('Compose')),2))
     
    Thanks
  • Mark_Castro Profile Picture
    49 on at

    Hi @abm 

     

    It worked! Thank you. 

     

    A follow-up question, what part of the syntax should I change, and what function to use? To retain the last two character I will need that value for the State. 🙂

  • Verified answer
    abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Hi @Mark_Castro 

     

    Here it is

     

    substring(outputs('Compose'),sub(length(outputs('Compose')),2), 2)
     
    Thanks

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard