A
C
D
I
R
S
T
What is the Concat Function?
The Concat function is a text function in Power Fx used to join two or more text strings into a single text string. The syntax for the Concat function is as follows:
Concat(string1, string2, string3, …)
In this syntax, `string1` is the first string that you want to concatenate, `string2` is the second string, and `string3` is the third string (and so on). You can concatenate up to 10 strings using the Concat function.
How to Use the Concat Function in Power Apps
To use the Concat function in Power Apps, follow these steps:
1. Open the Power Apps editor and select the screen where you want to use the Concat function.
2. Add a text input control to the screen by navigating to the **Insert** tab and selecting **Text ❱ Text input**.
3. Set the **Default** property of the text input control to a string value. This value will be the first string that you want to concatenate.
4. Add another text input control to the screen.
5. Set the **Default** property of the second text input control to another string value that you want to concatenate.
6. Add a label control to the screen.
7. Set the **Text** property of the label control to the following formula:
Concat(TextInput1.Text, " ", TextInput2.Text)
In this formula, `TextInput1` is the name of the first text input control, `TextInput2` is the name of the second text input control, and `” “` is a space character that you want to concatenate between the two strings.
8. Save and preview your app.
Now, when you type a value in the first text input control and another value in the second text input control, the label control will display the concatenated string with a space character between them.
Concatenating Multiple Strings
As mentioned earlier, you can concatenate up to 10 strings using the Concat function. Here’s an example of concatenating multiple strings:
Concat("Hello ", "world", "!", " This is ", "a test ", "of the Concat function.")
In this example, we’re concatenating six different strings. The Concat function will join all these strings and return “Hello world! This is a test of the Concat function.” as the output.
Concatenating Numbers
The Concat function can also be used to concatenate numbers in Power Apps. However, before concatenating numbers, you need to convert them to text using the Text function. Here’s an example:
Concat("The total is ", Text(NumberInput1.Value), ".")
In this example, `NumberInput1` is a number input control. We’re converting the value of `NumberInput1` to text using the Text function and concatenating it with the string “The total is ” and “.” to display the total value in a label control.
The Concat function is a powerful text function in Power Fx that allows you to concatenate or join two or more strings into a single string value. It’s an essential function for creating powerful business applications in Power Apps. By following the steps outlined in this article, you can start using the Concat function in your Power Apps and take advantage of its capabilities.