New: Phone number column type on Table

Hi all! We are excited to announce the cloud launch of the phone number column type on Table!

When formatting your columns in Table, you can now choose the Phone Number type in the Format dropdown:

|450x156.34760530871327


As with our phone number input (see forum announcement about this component here), this table format is intended mainly for international phone numbers. However, we have added the ability to restrict the country the phone numbers are formatted against so that you can format local numbers as well:

Additionally, we added the following 2 options to make formatting more customizable:


We have launched this feature to 100% of cloud users, and hope to get it out to on-prem version 3.30. Please let us know in this thread if you have any comments/suggestions.

Happy building!

– Darya

6 Likes

The new phone number column on tables is super useful.

1 Like

It seems this feature always assumes the phone number has country code. E.g. if I have 408-111-2222, Retool assumes 40 is a country code. Is it possible for Retool to detect the country or not based on + sign?

Hi @Wei_Chen,

I do not believe that we currently have localization to match the location of an app user to the appropriate country code but I can ask the engineer about this!

For now, you will likely need to manually enter in country codes.

@Jack_T thanks for the reply. But what I am asking is not locale based detection. It simply checks whether the number starts with + or not. If not, Retool should assume that's a local number.

Local defaults is something I really want too.

But till then, can this workaround work for you?:

In the value field for your phone column you want to do a mini IF to check and format accordingly

{{ item.includes('+') ? item : '+44' + item.replace(/^0+/, '') }}

This checks for the presence of a 'plus' and outputs it as is if so, otherwise it removes the leading zero and adds a default country code to the front.
In my example I used the UK code of +44. But you could otherwise add some logic if it needs to be dynamic.

1 Like

@Wei_Chen Ah I understand, thank you for the clarification.

I can definitely add a feature request for that :+1:

@ferret141 Thank you for that suggestion as a work around! That ternary logic should work.