Validate Phone Number Pattern in Flow Builder

Validate Phone Number Pattern in Flow Builder

While creating a screen flow along with the phone field which accepts only valid formats for access to the flow for further process.

Create a Screen Flow

  • Create a phone field in the screen flow.
  • We can use the below mentioned pattern for assiging the phone field in flow,
^(\+\d{1,2})?(\s)?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$
  • Create another screen to show Result and assign the phone value field as default value.

Note: Valid Phone Number Format

+91 1234567890
+911234567890
+91 (123) 456-7890
123-456-7890
(123) 456-7890
123 456 7890
1234567890
123.456.7890

  • Run the flow along with testing whether the phone field is working or not by using the mentioned valid format in the flow. 

 For the first time, we can assign the wrong format to the phone field.

  •  Use the correct pattern in phone field and click on check pattern button in the flow

Result: