web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
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

 

I have the same question (0)
  • Verified answer
    v-yamao-msft Profile Picture
    on at
    Re: Split String and delete help

    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
    Re: Split String and delete help

    Awesome. thanks !!

  • Verified answer
    GabrielStJohn Profile Picture
    on at
    Re: Split String and delete help

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 691 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 431 Moderator

#3
developerAJ Profile Picture

developerAJ 266

Last 30 days Overall leaderboard