Ading & removing spaces from a text field

Hi there,

Looking for a way to add and remove spaces from a given text, Bubble doesn’t make this easy, I can do it as a JavaScript action, but I have these workflows in the backend workflow.

Here’s what I have: I do a POST to an API and get back parameters I need, one of them outputs “SupplyDefenseMaterial” which I need to be “Supply Defense Material”.
I do this with a find and replace, then a regex to look for any capital letters and then replace with " $&", which is a space plus that capital letter. See image

That one works fine, but the problem is when I get texts like:
“TIDorInvoice”. which is “TID or Invoice”
With the solution I have above, it outputs “T I Dor Invoice”, which is obviously incorrect. Any way to have this corrected?

Thanks!
Pedro C

Hey Pedro,
It seems that there is specific rule on how the letters are sent. So would be harder to create dynamic expression for this, you mentioned that you can writhe a javacript code for this, you can run a server side javascript using toolbox plugin.

Didn’t know this was possible thanks!

1 Like