cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
golfnutt82
Super User
Super User

I need to extrapolate the last fourteen or less characters from the end of a string but after a forward slash

If I have a URL string that looks as follows

golfnutt82_0-1632775794448.png

can I extrapolate all characters (but no longer than 14) to the right of the last forward slash.

Is this possible?



1 ACCEPTED SOLUTION

Accepted Solutions
abm
Super User
Super User

Hi @golfnutt82 

 

Here it is

 

image.png

 

Expression for the above is as follows:

 

substring(last(split(outputs('Compose'),'/')),0,14)


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

5 REPLIES 5
abm
Super User
Super User

Hi @golfnutt82 

 

Here it is

 

image.png

 

Expression for the above is as follows:

 

substring(last(split(outputs('Compose'),'/')),0,14)


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
abm
Super User
Super User

Hi @golfnutt82 

 

Here it is

 

image.png

 

Expression for the above is as follows:

 

substring(last(split(outputs('Compose'),'/')),0,14)


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

golfnutt82_0-1632779425232.png

So in the URL there is only 8 characters but I need the system to allow for up to 14 characters.
When I saw you expression I was very excited because I had not thought of using what you did!
Awesome, you did a test on your end and didnt receive an error like I show?

You didn't mentioned earlier that you could have less than 14 characters length as well.

First find the last string after the last slash

 

last(split(outputs('Compose'),'/'))
 
The above expression will give you the string
 

Then add an If condition to check the length is less than 14 by comparing the above value.

 

If its more than 14 then use the expression which I mentioned earlier substring(last(split(outputs('Compose'),'/')),0,14) else use the expression last(split(outputs('Compose'),'/'))

 

Thanks

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
abm
Super User
Super User

Hi @golfnutt82 

 

Another way to do this is as follows:

 

image.png

 

Above expressions are:

 

last(split(outputs('Compose'),'/'))
 
substring(outputs('Compose_3'),0,if(greaterOrEquals(length(outputs('Compose_3')),14),14,length(outputs('Compose_3'))))
 
Thanks


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (3,393)