Skip to content
Home » IsNumeric function in Power Apps

IsNumeric function in Power Apps

The IsNumeric function is used to check whether a given value is a number.

It returns true if the input is numeric (integer, decimal, etc.) and false if the value is not numeric (such as text or a blank).




Syntax:

IsNumeric(Value)

Value: The value or expression you want to evaluate to see if it is numeric.

Examples:

1. Following formula checks whether the value 123 is a number and returns true since 123 is a numeric value.
IsNumeric(123)
2. Following formula checks whether the string “123″ can be interpreted as numberic value and returns true.
Even though “123” is enclosed in quotation marks (indicating that it is a string), the IsNumeric function recognizes it as a valid numeric value.
IsNumeric("123")
3. Following formula checks whether the number 123.45 is a numeric value. It returns true because 123.45 is a valid numeric value (specifically a decimal), so the IsNumeric function will yield true.
4. Following formula checks whether the string “Power Apps” is a numeric value and it returns false since “Power Apps” is a string value.
IsNumeric("Power Apps")

5. The following formula checks whether an empty string (represented by “”) is considered a numeric value, and it returns false because an empty string is not a numeric value. Consequently, when the IsNumeric function evaluates “”, it returns false.

IsNumeric("")

Using of IsNumeric function to validate the Input value

You can use the IsNumeric function in conditional logic to validate the user’s input.
For example, to ensure that the value entered in a text input control TextInput1 is a number.




First, add a Text Input control and a Text Label control. Then, navigate to the Text property of the Text Label control and enter the following formula:

If(
    IsNumeric(TextInput1.Text),
    "Valid value",
    "Invalid value"
)

This checks if the text entered in TextInput1 is a number. If it is, it returns “Valid value” , otherwise it returns “Invalid value”.

Let’s run the app and enter the value “ABC” into the text box. You will see that it displays “Invalid value” on the label.

Let’s enter a different value, 123, in the text box. This time, you will see that it displays “Valid value” on the label.

 

Recommended for you..

Email validation in Power Apps

RemoveIf function in Power Apps

Text function to format date/time or numbers to text string

With function in Power Apps

Filter function in Power Apps

 

 

Loading

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SQL BI Tutorials

Subscribe now to keep reading and get access to the full archive.

Continue reading