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