Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Perform Phone number and email validatio

Avishek1
8 - Asteroid

Dear Expert,

 

Can you please help me with validation of a phone number and email column.

Phone number column need to be validated with 10 digit and email column to be validated cell value should have @ and .(dot) in entry

6 REPLIES 6
Kenda
16 - Nebula
16 - Nebula

Hey @Avishek1 

 

Here are two formulas to create new fields that should help you out...

 

To check the phone number field:

iif(IsNumber([Phone]) && Length(tostring([Phone]))=10, "Valid", "Invalid")

This first ensures the value is a number then it also checks that the length of the value is 10, if so, the new field will say valid. Otherwise it will say invalid.

 

To check the email field:

iif(Contains([Email], "@") && Contains([Email], "."), "Valid", "Invalid")

 This checks to see if the email field contains both an @ and a period. If so, the new field will say valid. Otherwise it will say invalid.

 

Hope this helps!

BogdanCalacean
7 - Meteor

Hi again,

 

I suggest using a Formula tool with some slight improvements to @Kenda`s Email validation formula.

 

You can find below a solution for this.

 

Bogdan,

apathetichell
19 - Altair

Quick question - how is your phone number field formatted? is it something like

(xxx)xxx-xxxx

xxxxxxxxxx

+1xxxxxxxxxx

xxx.xxx.xxxx

 

Or some combination? Does it have extensions?

 

If it's not xxxxxxxxxx - ie exactly 10 numbers you'll have to make some adjustments

BogdanCalacean
7 - Meteor

Let`s help the fellow. Did some changes to the short workflow to reflect the possibilities highlighted by @apathetichell as well.

 

Avishek1
8 - Asteroid

@BogdanCalacean  this workflow  is only working when the Phone is of Integer data type , however for me the data type is v_string and it is not working there

apathetichell
19 - Altair

It would really help if you post some samples of your phone number data so we can try to understand what your data looks like. As I've noted - phone numbers can be set up multiple ways.

 

If it's just an issue with string vs number you can modify @BogdanCalacean and @Kenda's work. For @BogdanCalacean's just change the first part of the formula tool to:

iif(IsNumber(tonumber([Phone])) && Length([Phone])=10, "Valid", "Invalid")

 

 

Labels
Top Solution Authors