Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
Training
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Contact


Privacy Policy



FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

 

 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

phone.format ( Phone ; Format )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 4.7  (29 votes)
  Discuss this Custom Function

Jesse Swensen,

Format a phone number with format

Sample Input:
phone.format ("5551212" ; "### (###) ###-####" );
phone.format ("55b51.2-12" ; "### (###) ###-####" );
phone.format ("8005551212" ; "### (###) ###-####" );
phone.format ("18005551212" ; "### (###) ###-####" );
Sample Output:
555-1212
555-1212
(800) 555-1212
1 (800) 555-1212


 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed

Description:

// Will format the number according to the given format.
// Fills in the format from right to left and if the number
// is longer than the format, the extra numbers will be
// prepended to the front of the formatted phone number.
// Any non-numeric characters in the phone number are ignored.

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it

Discuss:

5 most recent comments | Show all 8 comments

i get invalid parameter for "Phone"

Jared, Orlando/FL
August 18, 2015 10:32am

To Jared or anyone else, if you haven't figured it out yet, all calculations have parameters, that's the part within the parentheses... For example: Count (field), the parameter for the Count Function is "field". To simplify the above custom function, since I myself am pretty new to filemaker, and I'm not really sure about the format parameter above, let's just consider you want to make sure all phone numbers are formatted as such: (xxx)xxx-xxxx. In this case you just need one parameter "Text". I made my own custom function to mess around and prep to try and get certified ( which again only focuses on formatting like so: (xxx)xxx-xxxx.)it is as follows:

I entered the Edit Custom Function dialog, named the function "PhoneFormatting" and added a Function Parameter simply called "Text" (press green button to add) then the calculation was simply
"(" & Left(text;3) & ")" & Middle(text; 4;3) & "-" & Right(text;4)

Enter Manage database, pick the field you would like to apply custom function to, in my case the field was Cell_Phone, select Auto-enter calculation, enter PhoneFormatting (Text) and replace Text with the Cell_Phone field. You can also use "Self" if you prefer. For added security I added strict numeric data only under validation and a custom message if the user enters anything other than numeric values that stays "Please enter numbers only with no formatting."
This will not reformat populated fields, but if you're new to the game, hope that helps! :-)

Jenn, Fullerton, CA
April 07, 2016 2:44pm

Thank you for providing this code. What would be required to include an extension?

Armen, Los Angeles/CA
August 16, 2016 9:02am

I get "An operator is expected here" on the first parenthesis after phone.format

phone.format ( NewNumber ; NewFormat ) & Right ( JustNumbers ; 1 ) ;

Also phone.format flagged as no function so i added it to the list.

any advice would be greatly appreciated.

Hans, Spartanburg, SC
September 27, 2016 11:45pm

I'm not sure how to change the custom function based on the parameters for the phone number. Can someone send me a sample function that is clear where to place the parameters?

Thanks,

Dennis

dennis.littlefield@gmail.com

Dennis, Newberg
December 28, 2016 4:02pm

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
City/Location:
Comment:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 7 + 2 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. decFromHex ( hexValue )
  (Mon, Oct 16, 12:34pm)
2. MonthYearList ( startmonth ; startyear ; numbermonth ; short )
  (Mon, Oct 16, 3:38am)
3. ErrorDescription ( errorNumber )
  (Wed, Sep 27, 2:51am)
4. decodeEntities (text)
  (Wed, Sep 27, 1:22am)
5. HexidecimalToNumber ( HexidecimalValue ; counter )
  (Mon, Sep 25, 12:39pm)
6. FixedFieldConverter ( Fieldname ; f1 ; f2 ; f3 ; f4 ; f5 ; f6 ; f7 ; f8 ; f9 ; f10 ; f11 ; f12 ; f13 ; f14 ; f15 ; f16 ; f17 ; f18 ; f1
  (Fri, Sep 15, 12:34pm)
7. ShannonEntropy ( text )
  (Thu, Sep 07, 5:59am)
8. LetterCount ( text ; summary )
  (Thu, Sep 07, 5:53am)

RSS Feed of Custom Functions