Skip to main content
To transform an incoming cellphone number with country code into e164 format, you can use this custom transformer. For example, let’s say, you are bringing in a raw cell phone number with country code as <Country_code> <Cellphone number>. For example, 34 679594499. By default, Zeotap CDP creates hashes of SHA256 and MD5. In this example, to transform the SHA256 hashed value into e164 format, you can use the following directives:

Directives for Data Transformation

Code
copy phone cellphone_number_e164_sha256
set-type :cellphone_number_e164_sha256 string
find-and-replace cellphone_number_e164_sha256 s/^/+/
hash cellphone_number_e164_sha256 SHA-256 true
Below are details of how each directive functions:
DirectiveDescription
copy phone cellphone_number_e164_sha256Copies the value from the phone field and assigns it to the cellphone_number_e164_sha256 field.
set-type :cellphone_number_e164_sha256 stringSets the data type of the cellphone_number_e164_sha256 field to string, ensuring it is interpreted and processed as a string data type.
find-and-replace cellphone_number_e164_sha256 s/^/+/Finds the beginning of the value in the cellphone_number_e164_sha256 field and replaces it with a plus sign (+).
hash cellphone_number_e164_sha256 SHA-256 trueHashes the value in the cellphone_number_e164_sha256 field using the SHA256 hash function, ensuring irreversible encryption for security purposes.
Last modified on February 26, 2026