cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
illmatic
Helper III
Helper III

split string -- fourth instance of character

I'm having a bit of issue using the split function to isolate the site URL from an item URL that I obtain through a trigger from a document library.   Initially, I was splitting on the "_" as the URL that I previously retrieved had " _layouts" in it.  Apparently, '_layouts' isn't included in the item URL for image and pdf files.   Is there a way to split based on "/" but at a specific interval/instance of the "/"?

 

Here is the itemURL:  

 
I would like to split so that it captures the following:
https://contoso.sharepoint.com/sites/Program/Project

Thanks for all and any help!
1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User III
Super User III

Try this:

join(take(split(outputs('URL'), '/'),6), '/')

2021-02-12_17-26-52.png

View solution in original post

2 REPLIES 2
Paulie78
Super User III
Super User III

Try this:

join(take(split(outputs('URL'), '/'),6), '/')

2021-02-12_17-26-52.png

View solution in original post

Thank you!  This worked perfectly.

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Automate User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (35,497)