Can anyone clarify the correct syntax for an Architect expression to strip the +1 prefix and format a phone number into (XXX) XXX-XXXX? I need this for a ServiceNow field mapping.
- Source data arrives as
+14165551234in thephoneattribute. - I tried
replace(replace(replace(phone, '+1', ''), ' ', ''), '-', '')but it leaves the raw digits. - I cannot get the substring indices right to insert the parentheses and hyphens dynamically.
What is the exact expression string?