Hello,
I'm not sure if this is possible but I'm trying to find a formula to populate an error message on a form when the user does not enter the right information. The information needs to be 3 letters and 3 numbers (ABC123). There are certain letters that should be used but they can be placed in any order. I would prefer that I could specify in the validation those letters but if not then just an error stating they did not enter the correct format would be better than nothing. Thanks for any information you can provide.
Solved! Go to Solution.
Thank you but I ended up figuring it out. I used this formula in the Fill property.
If(Not(IsBlank(DataCardValue9.Text)),If(IsMatch(DataCardValue9.Text, "[E,T,N]{3}\d{3}") && Len(TextFormat.Text),RGBA(0, 0, 0, 0),RGBA(255, 0, 0, 0.5)))
Put this formula in the error message for the card containing your textinput box. Change the name in the formula from TextInput1 to the name of your textinput box and limit the MaxLength property of the textinput box to 6.
If(
Len(TextInput1.Text) > 0 && !IsMatch(
Left(
TextInput1.Text,
3
),
"[a-zA-Z\s]+"// you can specify your letters here
),
"Values muat start with three letters",
Len(TextInput1.Text) = 6 && !IsNumeric(
Right(
TextInput1.Text,
3
)
),
"The final 3 values must be numbers"
)
Thank you but I ended up figuring it out. I used this formula in the Fill property.
If(Not(IsBlank(DataCardValue9.Text)),If(IsMatch(DataCardValue9.Text, "[E,T,N]{3}\d{3}") && Len(TextFormat.Text),RGBA(0, 0, 0, 0),RGBA(255, 0, 0, 0.5)))