I also want to strip dots and commas from a $POST input value (string) and then convert it to a number and also need to edit the expression manually to work around the Field is required alert.
This expression indeed strips the commas from the string and converts it to a string: $_POST.value.replace(',', '').toNumber()
This also works as expected:
$_POST.value.replace(’.’, ‘’).toNumber()
But the combination always returns 0: $_POST.value.replace(',', '').replace('.', '').toNumber()
So, “How to strip multiple characters/words from a string” in 2021?
I’m puzzled about how you did this too and would interested in more details.
While you can user regular expressions with the Replace function in App Connect, I thought it wasn’t possible with Server Connect. In my experience it’s not possible (strangely, except for validation), and I thought this had also been confirmed in a one or two threads, like this one.
You guys are most probably working with different server models. @Emiel there was an issue with replace for nodejs indeed, so replacing characters like , or . was not working correctly.
This will be fixed in tomorrow’s update, so your expression
I was just thinking this might be the case. I'm on node js indeed.
Great there's a fix for the replace function in tomorrow's update. However, now I set it up this way, is there a downside to it or can I just as well leave it as it is now?