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 Platform Community / Forums / Power Automate / Split String and delet...
Power Automate
Unanswered

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:
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

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
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard