I developed an Event Registration application in Power Apps a few days before. There, users need to submit their details in the form to create a new account. To avoid duplicate data and collect valid information from the user, we were required to apply validations on the Power Apps forms.
In this article, I will explain how to validate the fields in the Power Apps form before submission.
How to Validate a Power Apps Form Before Submission
Here, I will explain how to apply validations for the fields preset in the Power Apps form, like full name, email, phone number, etc. These validations will help fetch valid information from the users and avoid duplicate data.

Here, I have a SharePoint list named Event Registration Form, which stores the data entered in the Power Apps form.

This list has the following columns, along with data types.
| Column Name | Data Type |
|---|---|
| User ID | Title |
| Full Name | Single line of text |
| Password | Single line of text |
| Email Address | Single line of text |
| Phone Number | Single line of text |
| Age | Number |
| Department | Choice(IT, HR, Marketing,Sales) |
| Job Title | Single line of text |
| Company Name | Single line of text |
| Registration Date | Date & Time |
| Comments | Multiple lines of text |

Let’s see the validations for Power Apps form data validation example-wise!
Power Apps Full Name Field Validation
Look at the example below; on the full name, if I’m trying to provide special characters or numbers, an error message will be displayed. The border color of the full name field was also changed to red.

Follow the steps below to achieve this!
1. Provide the below formula in the OnChange property of the Full Name field in the Power Apps form.
If(
IsBlank(Self.Text),
UpdateContext({IsFirstNameInvalid: false}),
UpdateContext(
{
IsFirstNameInvalid: !IsMatch(
Self.Text,
"^[a-zA-Z\s]+$"
)
}
)
)
Here, IsFirstNameInvalid is the local variable name.
- It holds boolean values; if the current field(Self.text) is blank, the value is false.
- If the text contains any special characters or numbers, then it holds true value.

2. Provide the below code on the full name fields Border Color property!
If(
IsBlank(FullName_value.Text),
Parent.BorderColor,
If(
IsFirstNameInvalid,
RGBA(168, 0, 0, 1),
Parent.BorderColor
)
)
Here, FullName_value is the control name; like above, we can also take Self.Text.
- If the control is blank, then the parent border color will apply.
- if IsFirstNameInvalid value is true then reg color(RGBA(168, 0, 0, 1)) will be apply.
- Otherwise, the parent border color only applies.

3. Provide the below codes on the given proper