I’m currently formatting a phone number to basically remove anything but numbers via a Set. This works fine, but I’m wanting to expand upon this and I’m wondering if it’s something I can do via Set or will I need to do this via a Function. I’m doing this:
{{$json["phonenumber"].replace(/\D/g,'')}}
But I want to be able to also add +1 to the beginning of the number and remove any leading 1s in the string (to then replace with +1). I’ve seen several ways of doing this via Javascript, but most of them involve a function of some sort and I’m hoping to keep this within Set. Thank you.
I’m passing undefined in the false condition which actually removes the property, but you could pass an empty string like ‘’ instead to have the property come through empty.