I am trying to validate data entries into SQL Server through a form. I have the following validation against a number entry for an icon next to the DataCardValue:
If(
IsMatch(
DataCardValue29.Text,
Digit
),
Check,
Icon.Warning
)
This works if the entry is a single digit as given below:
However when the entry has more than 1 digit, it will not work as shown below:
How can i make it work for number with one or more digits?
Best regards,
Chris
Solved! Go to Solution.
Well, I guess the issue is just whether the user input ANY value since we know it must be a number.
Put this code in the Icon property of your Icon.
If(IsBlank(TextInput_Field.Text), Icon.Check, Icon.Warning)
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Don’t bother with Regex. Just change the Format property of the Text Input to this code and it will only allow number entries
Format.Number
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Many thanks for your response, most appreciated.
The format property is already in number format, so yes right now it is only accepting number formats. However, it would be best practice to alert the user that the entry is acceptable through the icon next to the input.
Regards,
Chris
Well, I guess the issue is just whether the user input ANY value since we know it must be a number.
Put this code in the Icon property of your Icon.
If(IsBlank(TextInput_Field.Text), Icon.Check, Icon.Warning)
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Many thanks for the solution. I had to re-arrange the order of the icons as follows:
If(
IsBlank(DataCardValue29.Text),
Icon.Warning, Icon.Check
)
Best regards,
Chris
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
245 | |
122 | |
84 | |
83 | |
67 |