Software Venture Consulting

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

Free Web Tools
Free FileMaker Tools

Personal Pages

Shopping Cart
Shopping Cart


Free Newsletter


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:  

  Average rating: 4.5  (30 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:
(800) 555-1212
1 (800) 555-1212

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


// 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 Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it


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?



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:
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 5 + 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. HexUUIDToNum_cf (_uuid)
  (Sat, Jun 16, 1:55pm)
2. httpResponseCode ( responseHeaders )
  (Tue, Jun 12, 10:40pm)
3. FindDuplicateCharacters ( string )
  (Fri, Jun 08, 5:01pm)
4. FieldRepetitionLast ( field ; maxRepetition )
  (Wed, Jun 06, 6:05pm)
5. CountModifiedRecords ( NameTimestampField ; StartTimestamp ; EndTimestamp )
  (Mon, May 28, 8:23am)
6. JSONArrayLength ( JSONArrayStr )
  (Fri, May 25, 7:46am)
7. interpolation (y1; y2; y3; x1; x2; x3; x1y1; x2y1; x1y2; x2y2; rnd)
  (Sat, May 19, 3:55am)
8. @JSONFormatElements ( json )
  (Tue, May 15, 3:31am)

RSS Feed of Custom Functions