I need to bulk import phone numbers into a E164 phone field

frankh_
Giga Expert

I am attempting to upload phone numbers in bulk to an E-164 formatted phone number.   All of them are North America phone numbers and they are stored in two text cells - the first one is the area code with just 3 digits:   ZZZ the second field is the number XXX-YYYY.   I don't know how to work with E164 phone number fields - how can I force it to North America and load all of these in to the phone number fields correctly for the US (all are US numbers)?

I have a transform script already built for other data that I need to operate on - but the E164 phone field is a mystery to me.

1 ACCEPTED SOLUTION

Pradeep - thank you, the answer was ridiculously simple once I saw it - all I needed to do was add '+1' to the front of the phone number and it came straight in as a US phone number (I have strict checking turned off).   Essentially the code worked like this:



target.phone = '+1' + source.u_area_code + ' ' + source.u_7digitNumber;


View solution in original post

5 REPLIES 5

sergiu_panaite
ServiceNow Employee
ServiceNow Employee

Hi Francis,



Have you checked already?



Using Phone Number Fields - ServiceNow Wiki



Regards,


I did - but that doesn't really help me with how to bring the data in.   I am sure it is simple - it is just outside the scope of my experience.   I was hoping someone had already done this.


HI Francis,



You may find below thread helpful.


Re: How to set value in "Phone Number(E164)" field via script


Pradeep - thank you, the answer was ridiculously simple once I saw it - all I needed to do was add '+1' to the front of the phone number and it came straight in as a US phone number (I have strict checking turned off).   Essentially the code worked like this:



target.phone = '+1' + source.u_area_code + ' ' + source.u_7digitNumber;