Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6962 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

How do I fet a filter to work for phone numbers?

IE: 555-555-1212 would convert to (555) 555-1212?

I see

Let(phone = filter(theField;"0123456789");"(" & left(phone;3) & 

")" & middle(phone;4;3) & "-" & middle(phone;7;4))

But do not know how to get it to work.

Thanks

Posted

The easiest way to use this formula is to create a custom_function out of it. Then on one of your fields that you want the formatting to occur, have it set to a calculated result with 'Do not replace...' unchecked.

The calc forumla that you use would just be the custom_function applied to the field.

There are also numerous other posts in regards to phone number formatting on these forums.

Posted

Don't use a regular calculation. Use a text field with an Auto-Entered Calculation (with the "Do not replace.." option unchecked.)

Posted

Ok I must be missing something. I did it and the function does not convert. The function I am using is:

Let ( 

input = Filter (Phone ; "0123456789" ) 

;

Case ( input ;



Case ( 

Length ( input ) = 7 ; 

Replace ( input ; 4 ; 0 ; "-" ) ;



Length ( input ) = 10 ; 

Replace ( Replace ( Replace ( input ; 7 ; 0 ; "-" ) ; 4 ; 0 ; ") " ) ; 1 ; 0 ; "(" ) ;



Length (input ) = 11 and Left ( input ; 1 ) = "1" ; 

Replace ( Replace ( Replace ( Right ( input ; 10 ) ; 7 ; 0 ; "-" ) ; 4 ; 0 ; ") " ) ; 1 ; 0 ; "(" ) ;



input & TextColor ( " too few or too many digits" ; 16711680 )

)

)

)

This topic is 6962 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.