Calculation to strip a phone number

Comments

8 comments

  • Rainer Grabowski

    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. 

    0
    Comment actions Permalink
  • Patrick Jackson

    Thank you so much Ranier.  You helped get me past my brick wall!!

     

    Thanks again!

    0
    Comment actions Permalink
  • Gus H.

    Hi Ranier. How about getting a just the numbers, no brackets, no space? Just 3003357321. Thanks as always. Gus.

    0
    Comment actions Permalink
  • Rainer Grabowski

    Hi Gus,

    this removes everything except numbers in a calculation:

    @yourField.replace(/[^0-9]/g,"")

    Rainer

    0
    Comment actions Permalink
  • Gus H.

    Thanks Rainer, but I'm getting commas. Did I do sth wrong here? :-( 

    0
    Comment actions Permalink
  • Rainer Grabowski

    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-Calculations

    Delete 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

     

    1
    Comment actions Permalink
  • Gus H.

    Right on the spot. Another Rainer gem. Thank you, thank you, thank you. You are a life saver.🙏

    0
    Comment actions Permalink
  • Jesus Perez

    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?

     

    2
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk