24,112 total views, 1 views today
In this “Phone number and email validation” article, we will learn about how to validate the phone number/mobile number and email ID in the PowerApps canvas app. Data validation is very much essential in any programming language before users submit the data – so it is recommended to validate your data on the client side before it goes through to the data source – otherwise, we will end up with the hazard of unformatted data.
We can validate any type of data in PowerApps, however, in this demo, we will only focus on the very essential data mobile numbers and email which are generally very much used in any of the data entry forms.
Phone number and email validation in PowerApps
We assume that we have a SharePoint list with the mobile number and Email ID text type column, then we will design the form step by step.
How to add form control in PowerApps Canvas App?
To add the form control in PowerApps Canvas App – click on the insert menu, then select the Edit or Display form from the forms selection dropdown list.

Then add the SharePoint data source to the form, read this article on how to connect to a SharePoint Site from the PowerApps Canvas app?
We assume that the Mobile Number & Email ID validation form is ready and which is connected to the SharePoint Contact Information list.
The next step is to make the Mobile Number & Email ID field as required, in order to do this, we need to click on the “Unlock to change properties” link from the advanced tab of the selected data card field from the form. Here we have done the mobile number and Email ID columns.

Next, make the mobile number & Email ID the required column.
Select the mobile number field and make the “Required” property “true”, follow the same for the email id column to be required.

Now verify that Mobile Number and Email ID fields are required – to do this, just run the app in preview mode and click on the submit button, then we can see the validation message “An entry is required or has an invalid value. Please correct and try again.”

In the coming section, we learn how to validate the mobile number and email id from the canvas app.
Mobile number validation in the PowerApps Canvas app
In this validation, we will show how to validate mobile numbers in PowerApps form, generally, mobile number validation it should only allow ten digits numeric values – other than a number, the validation will fail.
To validate the Mobile Number field in PowerApps, select the mobile number field, and in the “OnChange” event write the below formula:
If( Not(IsMatch(txtMobileNumberDataCardValue5.Text, "\d{10}")) && !IsBlank(txtMobileNumberDataCardValue5.Text), Notify("The Phone number you typed is not valid, please re-type again. The format is xxxxxxxxxx", NotificationType.Error); Reset(txtMobileNumberDataCardValue5) )

Email ID validation in PowerApps Canvas app
In this validation, we will show how to validate the Email ID in the PowerApps form, generally, in the Email ID validation, it should only allow the email ID in the email format, that is YourEmailID@emaildomain.com, other than this nothing will allow to entering.
To validate the Email ID field in PowerApps, select the Email ID field, and in the “OnChange” event write the below formula:
If( !IsMatch( txtEmailID_DataCardValue6.Text, Email ),Notify("The Email ID you typed is not valid, please re-type again. The format is your_email@domain.com", NotificationType.Error); Reset(txtEmailID_DataCardValue6))

Phone Number or Mobile Number validation demo
Now just run the app in preview mode and enter some alphanumeric values to the mobile number field, then we will see the validation message “The Phone number you typed is not valid, please re-type again. The format is xxxxxxxxxx” which is nothing but 10 digits numeric value.

Email ID validation demo
Similarly, let’s validate the email id.
Enter some plain text without the email id format in the Email ID field, then we will see the validation message “The Email ID you typed is not valid, please re-type again. The format is your_email@emaildomain.com”.

Successful Phone Number and Email ID validation in PowerApps
Now, format or enter the value in expected ways in the mobile number and email id field, then we cannot see any validation message – that means now the data is valid and the form is ready to submit.

Navigate to the success screen on successful form submission in PowerApps
In PowerApps submit button OnChange (click event) event, generally, we write the function SubmitForm(FormToBeSubmitted) – then we write the Navigate function to navigate to a successful screen, Navigate(ScreenTobeNavigated) – here the problem is whether the form gets successfully submitted or not, but the user will be navigated to the successful screen which is not correct.
In order to avoid this issue – we need to write the same Navigate(ScreenTobeNavigated) function but in the submit button onClick event. In the form itself, there is an “onSuccess“ property where we need to write the Navigate(SuccessfulScreen) function, in this approach the form will be navigated to the successful screen only if the form gets submitted to the data source.

Summary: What do we have here (phone number and email validation in PowerApps)?
Thus, in this article, we have learned the below with respect to validating the phone number/mobile number and Email ID:
- How to validate the phone number / mobile number in the PowerApps Canvas app.
- How to validate the email ID in the PowerApps Canvas app.
- How to use the submit form function in the PowerApps submit form button.
- How to use the PowerApps “onSuccess” event to navigate to the successful screen.
- How to use the Navigate function in the PowerApps canvas app.
- How to do the “Unlock to change properties” in the PowerApps Canvas app.
- How to use PowerApps IsMatch email?
- How to use Notify function in PowerApps?
See Also: PowerApps Tutorial
You may also like the below PowerApps articles:
- How to send email from PowerApps button click?
- How to open outlook from PowerApps step by step?
- Show or hide columns conditionally in SharePoint list form
- Create your first chatbot in PowerApps step by step
- Cascading dropdown in PowerApps using SharePoint data
- CRUD operations in PowerApps using SharePoint online list
- CRUD Operation in PowerApps Using Excel OneDrive
- Phone number and email validation in PowerApps
- Connect to a SharePoint list in PowerApps step by step
- Collection variable in PowerApps
- Understand the difference between Set and UpdateContext function
- String concatenation function in PowerApps
- 3 ways to create Power Apps – Types of Power Apps
- Overview view of PowerApps development environment in Power Platform
- Customize SharePoint List Forms Using PowerApps step by step – Office 365
- Create free development environment using Power Apps Community Plan
- Validate function in Power Apps
Buy SharePoint Online eBook
Buy the premium version of SharePoint Online & Office 365 administration eBook from here:
1 comments on “Best way phone number and email validation in PowerApps – Microsoft 365”