cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Crimbo
New Member

DataCard Validation for a number entry

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:

Screenshot 2020-06-25 at 23.27.11.png

 

However when the entry has more than 1 digit, it will not work as shown below:

 

Screenshot 2020-06-25 at 23.27.26.png

 

 

How can i make it work for number with one or more digits?

 

Best regards,

Chris

1 ACCEPTED SOLUTION

Accepted Solutions

@Crimbo 

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."

View solution in original post

4 REPLIES 4
mdevaney
Super User
Super User

@Crimbo 

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

@Crimbo 

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."

View solution in original post

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

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,146)