JupyterLab Extension for INFACore

JupyterLab Extension for INFACore

Validate the United States phone number

Validate the United States phone number

You can apply this function to validate and enrich telephone numbers in the United States.
To perform this operation, select the
Validate USA Phone Number
function, and specify the data object variable. Then, enter the column name that contains the phone numbers that you want to validate.
When you run the code, the function validates if the phone number is a valid United States number and also enriches the phone number.
In the following example, the input flat file includes a column named
phnNumber
that contains the names of the Unites States phone numbers.
The following snippet is the input code when you apply the function:
import informatica.infacore as ic FF_DV = ic.get_data_source("Flat File").get_connection("DR_FlatFile").get_data_object("input.csv") dqf = ic.DataQualityFunctions() dqf.validate_usa_phone_number(FF_DV,"phnNumber")
The following snippet shows the output returned with the validation values for the phone number:
Input_Phone: string Out_Phone_w_Extension_Std: string Out_Phone_Std: string Out_Phone_Dashes: string Out_Phone_No_Spaces: string Out_Phone_Extension: string Out_Phone_Status: string Out_Phone_Status_Msg: string Out_Phone_Quality_Score: double Out_Remaining_Text: string ---- Input_Phone: [["(555) 555-1234","+15853042461","+911234567890"]] Out_Phone_w_Extension_Std: [["","(585) 304-2461",""]] Out_Phone_Std: [["","(585) 304-2461",""]] Out_Phone_Dashes: [["","585-304-2461",""]] Out_Phone_No_Spaces: [["","5853042461",""]] Out_Phone_Extension: [["","",""]] Out_Phone_Status: [["Invalid","Valid","Invalid"]] Out_Phone_Status_Msg: [["Area code invalid.","no error","Area code invalid."]] Out_Phone_Quality_Score: [[40,95,40]] Out_Remaining_Text: [["(","+1","+91"]]

0 COMMENTS

We’d like to hear from you!