Hi Subhajit,
When I'm asking for a phone number to be input, I use a Collect Input block, and set the Input Data Name as Task.collectedANI, then in the Success path, I have a Decision block, set as an Expression, with the line:
Length(ToString(ToPhoneNumber(Task.collectedANI)))==11
This will then check and see if the number of digits collected is 11 and if it is then it will route down the Yes path.
You could also do a Decision block that says:
left(ToPhoneNumber(Task.collectedANI).subscriberNumber,1)=="3"
OR
left(ToPhoneNumber(Task.collectedANI).subscriberNumber,1)=="8"
This will see if the number they entered starts with a 3 or 8 (premium numbers for instance), and route accordingly, or you could have it as:
left(ToPhoneNumber(Task.collectedANI).subscriberNumber,1)=="7"
to ensure it is a mobile number etc.
These are just some ideas you could try out.
The IsNotSetOrEmpty is checking to see if Flow.CustomerPhoneNumber has had anything entered. This would only be Yes if the customer did not enter any digits
The ToPhoneNumber is converting the value to a phone number, so your 123456 is already being converted to a phone number, which will be why your validity is true.
------------------------------
Martin Boyle
x
------------------------------
Original Message:
Sent: 10-20-2025 08:03
From: Subhajit Podder
Subject: How to validate customer's entered number is a proper phone number?
Scenario: We've an use case, where we're asking customer to enter his/her phone number. After the input we want to validate whether it is a valid phone number. Because, customer can enter any digits and we cannot confirm whether it's a proper phone number or not.
Approach: I thought to check whether it is in E.164 format to ensure the validity of the number. For that I am using this expression - !IsNotSetOrEmpty(ToPhoneNumber(Append("+", Flow.CustomerPhoneNumber)).e164). But, this check is true even if I am giving 123456 as input. I thought to use the isTel property of Phone Number data type to ensure the validity but It was not always true.
Please suggest a way to ensure the validity of a phone number entered by customer in architect.
Regards,
Subhajit Podder
#ArchitectandDesign
------------------------------
Subhajit Podder
NA
------------------------------