cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
StephenM
Level: Powered On

Split String and delete help

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%20...

 

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

 

any help would be much appreciated

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

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

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Administrator
Administrator

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

-Gabriel
Microsoft Power Automate Community Manager
Are YOU a member of your local Power Automate User Group?
Fill out This Form to claim your Community User Group Member Badge!

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

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

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

StephenM
Level: Powered On

Re: Split String and delete help

Awesome. thanks !!

Administrator
Administrator

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

-Gabriel
Microsoft Power Automate Community Manager
Are YOU a member of your local Power Automate User Group?
Fill out This Form to claim your Community User Group Member Badge!

View solution in original post

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,627)