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 / I need to extrapolate ...
Power Automate
Answered

I need to extrapolate the last fourteen or less characters from the end of a string but after a forward slash

(0) ShareShare
ReportReport
Posted on by 1,362

If I have a URL string that looks as follows

golfnutt82_0-1632775794448.png

can I extrapolate all characters (but no longer than 14) to the right of the last forward slash.

Is this possible?



Categories:
  • abm abm Profile Picture
    33,004 Most Valuable Professional on at

    Hi @golfnutt82 

     

    Here it is

     

    image.png

     

    Expression for the above is as follows:

     

    substring(last(split(outputs('Compose'),'/')),0,14)
  • Verified answer
    abm abm Profile Picture
    33,004 Most Valuable Professional on at

    Hi @golfnutt82 

     

    Here it is

     

    image.png

     

    Expression for the above is as follows:

     

    substring(last(split(outputs('Compose'),'/')),0,14)
  • golfnutt82 Profile Picture
    1,362 on at

    golfnutt82_0-1632779425232.png

    So in the URL there is only 8 characters but I need the system to allow for up to 14 characters.
    When I saw you expression I was very excited because I had not thought of using what you did!
    Awesome, you did a test on your end and didnt receive an error like I show?

  • abm abm Profile Picture
    33,004 Most Valuable Professional on at

    You didn't mentioned earlier that you could have less than 14 characters length as well.

    First find the last string after the last slash

     

    last(split(outputs('Compose'),'/'))
     
    The above expression will give you the string
     

    Then add an If condition to check the length is less than 14 by comparing the above value.

     

    If its more than 14 then use the expression which I mentioned earlier substring(last(split(outputs('Compose'),'/')),0,14) else use the expression last(split(outputs('Compose'),'/'))

     

    Thanks

     

  • abm abm Profile Picture
    33,004 Most Valuable Professional on at

    Hi @golfnutt82 

     

    Another way to do this is as follows:

     

    image.png

     

    Above expressions are:

     

    last(split(outputs('Compose'),'/'))
     
    substring(outputs('Compose_3'),0,if(greaterOrEquals(length(outputs('Compose_3')),14),14,length(outputs('Compose_3'))))
     
    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

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
11manish Profile Picture

11manish 231 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 217 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 170

Last 30 days Overall leaderboard