Hi
I need an expression to remove the last character in the string in the Microsoft Flow.
Please assist.
Solved! Go to Solution.
Hi @Naresh
it is simple, use this expression:
OBS: Don't forget to change the red text to your right action name, and the bold red number(1) are the quantity of chars to remove, in you case 1
substring(outputs('Compose_3'),0,sub(length(outputs('Compose_3')),1))
Look at my flow and result
Best Regards,
Gustavo Moraes
Gustavo Moraes, o astronauta brasileiro do Flow!
Hi @Naresh
it is simple, use this expression:
OBS: Don't forget to change the red text to your right action name, and the bold red number(1) are the quantity of chars to remove, in you case 1
substring(outputs('Compose_3'),0,sub(length(outputs('Compose_3')),1))
Look at my flow and result
Best Regards,
Gustavo Moraes
Gustavo Moraes, o astronauta brasileiro do Flow!
I have an array with 10 value. I want to remove last index value of array(10th value). please guide me.
I'm trying to remove the last character of a string that is the result of using the concat function within an apply to each. It seems that this substring formula does not seem to be working inside an apply to each. I also tried the take function and to add -1 instead of subtracting. Any suggestions?
I'm assembling a tabel for an email from a SharePoint list that uses a multiselect column, so I'm using the concat function to turn the multiselected items for a single record together with a ";" in between so they can be included in the same cell within my table. Unfortunately the last item has the ";" so I'd like to remove it.
I use the Compose function to create the concat and then Set variable as the output of the Compose. I was trying to put the substring formula as the Set variable value and it did not produce an error but the the ";" was still there.
Hi I've tried this but I'm getting the following error message each time I run this. Can you please advise?
I've Initialized a variable
And created the below.
The full expression is as per below:
Hey @Lenfant,
While working with variables, you should use the variables() function instead of the output() function. Simply write variables('Teststring') and it should work!
The full expression should look like this:
substring(variables('Teststring'),0,sub(length(variables('Teststring')),1))
Let me know if this solved your issue.
Kind Regards,
Frantisek Capek
Hi Frantisek,
Yes, thats how I end up doing it. Works now. Many thanks to come back to me.
Regards