Power Apps Form validations for Required Fields

Loading

Requirement: Validations for Required Fields in Power apps Edit forms

Validations for Required fields like Name, Contact Number and Mail ID.

Validation For Name Field:

In Text property of an error message write : “Enter a valid Name”.

In Visible property of error message write below mentioned formula :

If(IsBlank(DataCardValue19.Text), false, If(IsMatch(DataCardValue19.Text, "^[A-Za-z\s]+$"),false, true)).

Only characters can be enter for a user name if a user mistakenly enters any digits, then it displays an error message is “Please enter a valid name”.

user enter the Name as alphabetical manner , It should be valid.

Validation For Contact Number :

In Text property of error message write : “The Mobile Number should be in 10-digits”.

In Visible Property of Error message write below mentioned formula :

If(IsBlank(DataCardValue21.Text), false, If(Not(Len(DataCardValue21.Text)=10) && Not(IsMatch(DataCardValue21.Text,Match.Digit)),true, false)).

If the user enters his/her mobile number less than 10-digits such as 9 or less . It displays an error message is “The Mobile Number should be 10-digits”.

We are unable to enter the characters into this field for that we have to take the column

type as Number in our SharePoint list. And it won’t allow us to enter more than 10-digits.

User enters10-digits of mobile number , It should be valid.

Validation for Mail ID :

In Text property of error message write : “Enter a valid Email ID”.

In Visible property of error message write below mentioned formula:

If(IsBlank(DataCardValue22.Text),false, If(IsMatch(DataCardValue22.Text,"^([a-zA-Z0-9._%+-])+@[a-zA-Z]+.[a-zA-Z]{3}$"),false,true)).

While entering the Email ID after the @ and after the .com, If the user entered any digits. It displays an error message is : “Enter a valid Email ID”.

User enter the correct format of Email ID . It should be valid.

Leave a Reply

Your email address will not be published. Required fields are marked *