Im new at power apps, and i dont understand why i cant put multiple if in a single button
I'm trying to make a button with restrictions. I have two other text fields, and I want to put several restrictions, but show them all. If the fields are not filled in, show them first. Then if the fields are filled out in bad format, let them tell you. But I also want that if one is not filled out, and another is in bad format, that I inform you of both errors. Here is my code, could someone help me? Thanks
HERE THE CODE
If(
IsBlank(TextoNIF.Text);
Notify("Error: Debes rellenar el campo NIF."; NotificationType.Error);
If(
Len(TextoNIF.Text) <> 10 || !IsNumeric(Mid(TextoNIF.Text; 1; 9)) || !(IsNumeric(Mid(TextoNIF.Text; 10; 1)) && Lower(Mid(TextoNIF.Text; 10; 1)) <> Mid(TextoNIF.Text; 10; 1));
Notify("Error: El formato del campo NIF no es correcto. Debe tener 9 números seguidos de una letra."; NotificationType.Error)
)
)
// Validación del campo justificante
If( //here power apps tells me there is a problem with syntaxis, but i dont know why
IsBlank(TextoJustificante.Text);
Notify("Error: Debes rellenar el campo Nº justificante."; NotificationType.Error);
If(
Len(TextoJustificante.Text) <> 13 || !IsNumeric(TextoJustificante.Text) || Len(TextoJustificante.Text) = 0;
Notify("Error: El campo Nº justificante debe tener exactamente 13 dígitos numéricos."; NotificationType.Error)
)
)
// Resto del código si las validaciones son exitosas
If(
!IsBlank(TextoNIF.Text) && (Len(TextoNIF.Text) = 10 && IsNumeric(Mid(TextoNIF.Text; 1; 9)) && (IsNumeric(Mid(TextoNIF.Text; 10; 1)) && Lower(Mid(TextoNIF.Text; 10; 1)) <> Mid(TextoNIF.Text; 10; 1))) &&
!IsBlank(TextoJustificante.Text) && (Len(TextoJustificante.Text) = 13 && IsNumeric(TextoJustificante.Text));
Navigate(PantallaResultados; ScreenTransition.Cover)
)