Looking to run some validation where the user must enter something like "A-1234"
Coalesce(
Parent.Error,
If(
!IsBlank(DataCardValue33.Text) &&
!IsMatch(DataCardValue33.Text,Match.MultipleLetters) &&
!IsMatch(DataCardValue33.Text,Match.OptionalDigits),
"Enter Bound Book #"
),
If(
!IsBlank(DataCardValue33.Text) &&
Len(DataCardValue33.Text) <> 5,
"Example A-1234")
)
However no matter what I've tried I can't get the error message to go away when I've entered the letter, hyphen and number. I'm sure I'm missing something simple here to get this to work correctly. Any help would be greatly appreciated.
Thanks!
Solved! Go to Solution.
Hello - you could use Regex validation for this one:
If(
IsMatch(DataCardValue33.Text, "([A-Z][-])([0-9]{4})"),
"Valid Match"
"Invalid match, try A-1234 for example"
)
I was unsure if it had to be exactly 4 numbers from your example, but if you want to match between 1 and 4 numbers you could use:
If(
IsMatch(DataCardValue33.Text, "([A-Z][-])([0-9]{1,4})"),
"Valid Match"
"Invalid match, try A-1234 for example"
)
Could you give that a try and let me know how you get on?
Cheers,
Sancho
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
Hello - you could use Regex validation for this one:
If(
IsMatch(DataCardValue33.Text, "([A-Z][-])([0-9]{4})"),
"Valid Match"
"Invalid match, try A-1234 for example"
)
I was unsure if it had to be exactly 4 numbers from your example, but if you want to match between 1 and 4 numbers you could use:
If(
IsMatch(DataCardValue33.Text, "([A-Z][-])([0-9]{1,4})"),
"Valid Match"
"Invalid match, try A-1234 for example"
)
Could you give that a try and let me know how you get on?
Cheers,
Sancho
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
You read my mind on that one! Thanks' that worked perfectly! 😀
If(
IsMatch(DataCardValue33.Text, "([A-Z][-])([0-9]{1,4})"),
"Valid Match"
"Invalid match, try A-1234 for example"
)
Excellent, glad I could help 🙂
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
User | Count |
---|---|
246 | |
105 | |
82 | |
50 | |
43 |