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 / Split String and delet...
Power Automate
Answered

Split String and delete help

(2) ShareShare
ReportReport
Posted on by 55

hi, I need to split a string in Flow at the 6th '/' and delete everything after that, keeping everying before that. 

 

e.g.  i have a string such as this  https://mysharepount.sharepoint.com/sites/SA/SalesOrders/015300%20to%20015399/015328/Folder%20for%20Sales%20Order%20S-015328%20217%20Nat%20Limited%20Remake%20for%20247%20JAR%202018%2018-SB1863.txt

 

and i want to delete everything from the word "Folder" onwards, leaving everyting before it 

 

any help would be much appreciated

 

Categories:
  • Verified answer
    v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi @StephenM,

     

    Do you want to keep everything before “Folder”?

     

    Please take the following code for a reference.

     

    In Compose, use the function lastIndexOf to return the ending position of the string.

    lastIndexOf(triggerBody()['text'],'Folder')

     

    In Compose2, use the following code to remove the characters after the “Folder”.

    substring(triggerBody()['text'],0,add(outputs('Compose'),6))

    1.PNG

     

    The Output of Compose 2 is:

    https://mysharepount.sharepoint.com/sites/SA/SalesOrders/015300%20to%20015399/015328/Folder

     

    Please take it for a reference and try it on your side.

     

    Best regards,

    Mabel Mao

  • StephenM Profile Picture
    55 on at

    Awesome. thanks !!

  • Verified answer
    GabrielStJohn Profile Picture
    Microsoft Employee on at

    Hey, @StephenM!

    Thank you for posting to the Flow Community Forum! It appears you have found a solution to your issue! If you feel as though your issue has been solved and you are satisfied with one of the previous replies, please click "Accept as Solution" so that this thread will be marked for other users to easily identify!

    Thank you for being an active member of the Flow Community!

    -Gabriel
    Flow Community Manager

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 423

#2
11manish Profile Picture

11manish 308 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 177

Last 30 days Overall leaderboard