The Text function in PowerApps is used to format numbers, dates, times, and text strings. It converts values to text according to a specified format. This function is useful for displaying data in a user-friendly format, such as formatting dates or numbers with currency symbols.
PowerApps – Text() function Syntax
Text(Value, Format [, Language])
- Value: The value you want to format. This can be a number, date, time, or text string.
- Format: The format string that specifies how the value should be displayed.
- Language: (Optional) The language code that specifies the language and locale to use for formatting. If not specified, the current user's language is used.
Notes:
- Invalid Formats: Ensure that the format string is valid for the type of value being formatted. Invalid formats can result in errors or unexpected results.
- Language Codes: Use the correct language codes to ensure proper formatting according to the desired locale.
Suppose you want to format a number as currency:
Text(1234.56, "[$-en-US]$#,###.00")
This formats the number as "$1,234.56".
To format a date value:
Text(Today(), "[$-en-US]dddd, mmmm dd, yyyy")
This formats the current date as "Tuesday, January 01, 2024" (depending on the actual current date).
To format a time value:
Text(Now(), "[$-en-US]hh:mm:ss AM/PM")
This formats the current time as "12:34:56 PM" (depending on the actual current time).