Calculation to strip a phone number
Hello,
Can someone give me a very quick calculation that will strip the (300) 335 7321 number from this string? I want to place it into a new field called PHONE. The current field of the string is NAME.
Missed call from (300) 335 7321 to your Vumber (420) 586 6284(Postcards)
-
Hi Patrick,
in a Podio Calculation field you can get it by
@NAME.split("from ").pop().split(" to ").shift()
But you can't put it in another Phone field (it's only shown in the calculation field) , you would need the extension Globiflow for putting the number into the Phone field.
Rainer.
-
Hi Gus,
the commas are the 1000 separators cause your calculation field is number typ but you need to show is as text:
Calculations will output data in one of three different types: Number, Date, or Text. The output type is determined the first time you create your calculation field. This is important to note, since the output type cannot be changed. If you try to change from one output type to another, you will see an error that says "The type of result changed from [X] to [Y]." To fix this, you simply need to delete the calculation field and recreate it to get a new output type.
https://help.podio.com/hc/en-us/articles/201019358-CalculationsDelete the calculation field, create a new one and make it text type by entering:
//@call.replace(/[^0-9]/g,"")
"ABC"Then save the template (it's text type now), open it, remove // and "ABC", save again. If the Preview shows any error notification - ignore it.
Rainer
-
Rainer Grabowski I'm trying to use your "number to text" calc workaround, but Podio isn't letting me save the item despite errors. Has the calc workaround changed?
Please sign in to leave a comment.
Comments
8 comments