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 / Extract text between t...
Power Automate
Unanswered

Extract text between two / symbols

(0) ShareShare
ReportReport
Posted on by 2

Hi All, 

 

I am trying to extract text from a certain position in a string. 

I need to get any text between the last two / symbols (eg 'extraction)

 

https://webaddress.com/extracttion/

 

Can anyone help?

 

Thank you!

Categories:
I have the same question (0)
  • KE_WSG Profile Picture
    2 on at

    forgive the spelling - i was in a rush!

  • Verified answer
    v-jefferni Profile Picture
    on at

    Hi @kajelliott ,

     

    Please try the expression:

    first(reverse(take(split(outputs('Compose'), '/'),sub(length(split(outputs('Compose'), '/')),1))))

    vjefferni_0-1706768822392.png

     

    Best regards,

  • Verified answer
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @kajelliott 

     

    Pls use the expression to extract the required text:

    ManishSolanki_0-1706768818482.png

    Below expression needs to bs added in the expression box as highlighted in the above screenshot:

    trim(join(take(reverse(split('https://webaddress.com/extracttion/','/')),2),''))

     

     

    Output:

    ManishSolanki_1-1706768895217.png

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • Verified answer
    Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at

    Althoughthere is already a good solution provided by @ManishSolanki (and I would go for it), I want to show another easy way:

    slice(
    	'https://webaddress.com/extracttion/',
    	add(nthINdexOf('https://webaddress.com/extracttion/', '/', -2), 1),
    	nthINdexOf('https://webaddress.com/extracttion/', '/', -1)
    )

    You can find the last positions in a string by using negative numbers as occurrence in nthIndexOf().

    nthIndexOf('<text>', '<searchText>', <occurrence>)

     

  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @Chriddle 

     

    Thanks for sharing. New learning for me 🙂

     

     

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