Hi there,
That extra slash is a classic concatenation issue, and it's fixable with one expression. Here's what's happening and the cleanest way to remove it.
Where the second "/" comes from
You're ending up with // because the value now already ends in a slash, and then a separator slash is being added again when it's joined to the file name - so you get one from the path and one from the join. Your first(split(...,'/')) attempt only trims one segment, which is why a slash still slips through.
The simplest fix - collapse the double slash
Rather than trying to trim the exact right end, build the full path and then replace any // with a single /:
replace(concat(<folderpath>, '/', <filename>), '//', '/')
replace() returns the original string if the substring isn't found, so this is safe even when there's no double slash - it just normalizes the result either way.
One thing to watch out for
trimEnd() isn't available as a workflow expression function in Power Automate, so an expression built around it will error out. Also note trim() only removes leading/trailing whitespace - not a / character - so it won't strip the slash on its own.
Alternative - trim the trailing slash explicitly
If you'd rather remove the slash before joining, this pattern works with supported functions:
if(endsWith(<folderpath>, '/'), substring(<folderpath>, 0, sub(length(<folderpath>), 1)), <folderpath>)
Then concatenate with a single / separator. Either approach gives a clean single-slash path. A quick Compose action showing the raw value is handy to confirm the trailing slash before and after.
References:
Found this helpful? Please mark ✅ "Does this answer your question?" so others searching for the same issue can find it quickly. A 👍 on "Was this reply helpful?" or a ♥ Like is also much appreciated!
Raghav Mishra - LinkedIn | PowerAI Labs