The phone format switch formats Salesforce phone numbers in your Word templates, so they appear consistently and are easy to read in customer communications, contracts and regional reports.
Syntax
{{Object.PhoneField \ PHONE:Pattern}}
{{Object.PhoneField \ PHONE:Pattern:INTERNATIONAL}}
The keyword isn't case-sensitive: PHONE: and Phone: both work.
Values
| Part | Effect |
|---|---|
# in Pattern | One digit of the phone number. Any other characters, such as ., -, (, ) and spaces, appear as typed. |
:INTERNATIONAL (optional, at the end) | Adds the international prefix, for example +1-. |
Where to add it
Add the switch after the field name inside the merge field in your Word template.
Example
Input: an account whose Phone is 1234567890.
| Format | Syntax | Output |
|---|---|---|
| Dot-separated | {{Account.Phone \ Phone:###.###.####}} | 123.456.7890 |
| Area code in brackets | {{Account.Phone \ PHONE:(###) ###-####}} | (123) 456-7890 |
| Hyphen-separated | {{Account.Phone \ PHONE:###-###-####}} | 123-456-7890 |
| International | {{Account.Phone \ PHONE:###-###-####:INTERNATIONAL}} | +1-123-456-7890 |
Works in
Word (DOCX) templates: the examples on this page are Word template fields.
Common errors
- The document shows the tag, or a blank, instead of the number. Retype the whole tag in one go, check the field's API name, and check the field has a value. See Merge fields are blank or show their tags.