- 10 Apr 2024
- 1 minute read
- Print
- DarkLight
- PDF
Reformatting Phone Numbers in Exports & Reports
- Updated 10 Apr 2024
- 1 minute read
- Print
- DarkLight
- PDF
Slate formats phone numbers based on each country's official formatting standards. For a USA phone number, that is +1 000-000-0000, and for a UK phone number (as an example), that might be +44 00 0000 0000 (spaces in specific segments, no hyphens).
Because of this, if you are considering reformatting a phone number, you don't need to worry about trying to format them at the time of data capture. Reformatting a phone number is a data export/reporting consideration.
To apply different formatting in a query or report:
Add exports to a query library that use a custom SQL format type or a formula type. Example formula:
(case when (@val like '+1 %') then stuff(stuff(@val, 4, 0, '('), 8, 1, ') ') else @val end)
If it's in a query library, you won't have to do this each time; you'll get the desired formatting whenever you add that export. You will still store the phone number with the official formatting, and other systems that might need a phone number fed to them might require even a different format (such as E.164, which has no spaces or hyphens), so there's no one-size-fits-all type of formatting for these.