Skip to content
Home » Value function in Power Apps

Value function in Power Apps

TheValue() function in Power Apps is used to convert text strings into numeric values. This is particularly useful when dealing with inputs from text controls, data stored as text, or performing calculations on string representations of numbers.
Syntax:
Value(Text, Language)

Text: The string you want to convert to a numeric value.

Language (optional): A string specifying the locale (e.g., “en-US”, “fr-FR”, “de-DE”). If omitted, the app’s default language is used.




Usage of  Value function

Convert User Input to a Number

If a user enters a number into a text input, the value will be treated as text. Use the Value() function to convert it to a number for calculations.

Value(TextInput1.Text)

For example:

Value("456") // Returns 456 (as a number)
Value("-789") // Returns -789 (as a number)
Value("0") // Returns 0
Value("123.45") // Returns 123.45

Perform Calculations on Textual Data

If numeric data is stored as text in a data source, you can use the Value() function to enable calculations.

Value(ThisItem.Price) * 1.2

Ensure Proper Data TypeWhen patching or submitting data to a numeric field in a data source, convert text to a number.

Patch(Products, Defaults(Products), {Quantity: Value(txtQuantity.Text)})

Validate Input Before Conversion

Display an error message if the user enters non-numeric text.

If(IsNumeric(txtInput.Text), Value(txtInput.Text), Notify("Please enter a valid number", NotificationType.Error))

You can also use an optional language parameter to specify the locale used for parsing numbers. This is especially useful for handling numbers formatted differently in various regions (e.g., commas as thousand separators or periods as decimal separators).

Parse US-formatted Numbers

Value("1,234.56", "en-US")
Input: "1,234.56" (comma as a thousand separator, period as a decimal separator).

Output: 1234.56




Recommended for you

Power Apps Tutorial

 

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