Better is to go to the Update property of the Datacard:
If(Len(TextInput.Text)>=12,
TextInput.Text
)
Normally, the Update property will just carry your Datacard's textbox's value. If you put a conditional on it that basically says "you can update this property if this condition is true", it will automatically throw an error condition if it sees a false value, or condition that is not met. This will cause the error message to show. In the Error Message field's "Text" property for the Datacard, you can include this custom message:
If(Not(IsBlank(Parent.Error)), "Please enter a number 12 digits long.")
The field must be a required field (set the property to true in the Advanced settings, as well as on the list).
The only thing is, is that this message will be the same message that appears when they submit and leave it blank, too, so you can't make it overly specific - unless you put in some extra conditional logic, like:
If(Not(IsBlank(Parent.Error)), If (Not(IsBlank(txtMyField.Text)), "Please enter a number 12 digits long.", "Please fill in a number."))
But either will prevent submission if the condition is not met and give the red border around the field and red error message on submission like we all like when an issue meeting a validation condition occurs.