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
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

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

Users online (1,241)