Concat Power Apps: How to use it and the differences with Concatenate

The Power Apps Concatenate and Concat functions are two extremely specific functions of the Microsoft low-code development environment and give users the ability to combine or concatenate the values of multiple strings into a single string. In this article, we'll dive into what they are and how to use them, along with examples of insertions, combinable functions, and a real use case within a business app.

What you'll find in this article

  • What are Concat and Concatenate by Power Apps
  • Concat Power Apps: What's the difference with Concatenate?
  • Power Apps Concatenate and Concat Syntax and Parameters
  • Power Apps Concat and Concatenate: examples of use
  • Concat Power Apps: combinable functions
  • How to use Concatenate by Power Apps in a purchasing management app
Concat Power Apps: How to use it and the differences with Concatenate

What are Concat and Concatenate by Power Apps

The functions Concatenate and Concat of Microsoft Power Apps are two of the most particular functions that a developer can use to manipulate and visualize their data in an application created within the low-code development environment of Microsoft Power Platform.

Both are used to combine or concatenate the values of multiple strings into a single string, useful when you need to combine text from different sources or create a string composed of variable parts.

These are generally functions used in extremely specific scenarios that we will take a look at in the following paragraphs to get a clearer idea of how they operate and how these functions are used within our business apps.

Concat Power Apps: What's the difference with Concatenate?

Before going into more detail about what their inclusion in their apps offers, let's first take a look at what sets them apart.

The very similar name and the use in similar contexts can in fact cause confusion in novice users who may not understand the difference between the two and even confuse them with two different implementations of the same function, running the risk of running into frustrating errors and malfunctions.

The Concatenate function concatenates a combination of individual strings and a table of strings to a single column. When using this function with individual strings, it is equivalent to using the & (ampersand) operator, however the Concatenate function may be clearer and more readable in some contexts, especially when concatenating many strings. In essence, Concatenate does a classic concatenation of the parameters that are provided to it.

The Concat function concatenates the result of a formula applied to all the records in a table, thus obtaining a single string. The summarization of the records of a table in a single string takes place in a manner similar to that of the Sum function with numbers.

Using Concatenate and Concat, it is possible to combine data from different sources, appropriately formatted for reporting, simplifying the process of analyzing and presenting information.

With these two functions, it is also possible to automate text generation, allowing companies to save time and reduce the need for human intervention to create composite strings or format data, personalize interactions with customers (including, for example, the customer's name in messages or automatically generated documents) and create personalized messages for the latter or their employees.

With the use of Concatenate and Concat, companies can therefore significantly reduce human errors in generating composite strings or adding dynamic text to documents, improving the overall efficiency of their business processes.

Power Apps Concatenate and Concat Syntax and Parameters

Let's now look at the syntax and parameters of the two functions in more detail.

The basic syntax of the Concatenate function is as follows:

Concatenate ([Value1], [Value2],...)

Concatenate, as you can see, has an extremely simple syntax. The parameters [Value 1], [Value 2], etc., simply represent the strings that you want to concatenate. For example, if you have three text variables Text1, Text2, and Text3, you can merge them using the Concatenate function like this:

Concatenate (Text1, Text2, Text3)

In addition, you can also concatenate string literals directly into the function, as shown below:

Concatenate ('First', 'Second', 'Third')

The result of both examples will be a single string containing the combination of all the strings provided as arguments to the Concatenate function. It's important to note that the function will return an empty string if all the arguments provided are empty or null.

Concat, on the other hand, as we have already seen, is used to concatenate values from a table. The basic syntax that we will find in the Power Apps function bar should look like this:

Concat (Table, Formula (or Column Name), [Separator])

The parameters are respectively:

  • Tabla: the table from which we are going to retrieve the strings that interest us. This is a required parameter.
  • Formula (or column name): parameter that selects the column whose strings we are interested in merging. This parameter is also required.
  • Separator: element that will be inserted between the items retrieved from the table in order to separate them and facilitate their visualization. This parameter is optional.

For example, if we have a table called Table1 with a text column called Text Column, it is possible to concatenate all the values in this column using the Concat function like this:

Concat (Table 1, Text column, “, “)

This will return a single string containing all the values of the Text column separated by commas and spaces.

Power Apps Concat and Concatenate: examples of use

As we have already mentioned before, Concatenate and Concat are two functions with extremely specific uses that can be used by business app developers in a moderate variety of different scenarios. Below we immediately see what some examples of situations may be in which the two functions can be useful to us.

Creating composite strings

We can use Concatenate to combine multiple strings into a single string that has fixed elements combined with the dynamic elements that interest us.

Suppose we need to create a personalized greeting message for our app that includes the user's name, we can concatenate the text 'Hi' with the name entered by the user.

Concatenate ('Hi', Username)

The result of the function that will be returned to us will be 'Hi, Username'

Formatting value lists

If you have a series of values that you want to display as a list separated by commas or other separators, the Concat function may be useful to us instead.

For example, if we have a table of products and we want to display all the product names separated by commas, we can set up the Concat function with the following syntax:

Concat (Products table, Product Name, “, “)

The result of the function will be a single string in which we will have the names of all the products in the “Products Table” table separated by a comma and a space.

URL construction

Concatenate can also be useful if we need to build dynamic URLs for our pages, combining parts of a fixed URL with variable values.

If, for example, we are working on a website and we want to build the URL of a user profile page based on the ID of that specific user, we can do it using Concatenate with the following syntax:

Concatenate (” https://www.example.com/profile?id =”, UserID)

Manipulation of tabular data

Instead, suppose we have a table with columns containing parts of a larger string, Concatenate can help us merge these parts into a single string.

As an example, let's take a table with columns for the first name, last name and suffix, we can concatenate these columns to obtain all the full names using Concat with a syntax similar to that shown below:

Concat (Customers table, First Name, "“, Last Name)

The result will, as always, be a single string that in this case will return all the full names that we wanted to obtain.

Dynamic text generation

Concatenate can be used to generate dynamic text based on conditions or user data. If, for example, we were developing an application for taking surveys and we wanted to display a different message based on the answers provided by the users, we could concatenate parts of text based on the conditions as in the function presented below:

If (Vote <= 4, Concatenate (“Thanks for voting “, Vote, “!”) , “We're sorry that you're not happy.”)

Concat Power Apps: combinable functions

The functions Concatenate and Concat in Microsoft Power Apps they can be combined with other types of functions to manipulate and process data in a more complex way than their individual use. Now let's see what are some of the most common combinations.

Filter

The function Filter is used to filter the data in a table based on a specified condition. It is often combined with Concat and Concatenate to concatenate only values that meet certain conditions.

For example, we can use Filter to select only the names of the products that have a certain quantity available, and then later use Concat to merge these names into a single string. Here's what the syntax of this particular function might look like:

Concat (Filter (Products table, Available Quantity > 0), Product Name, “, “)

We will then obtain a single string containing the names of the products with an available quantity greater than zero, separated by commas.

SortByColumns

The function SortByColumns is used to sort the data in a table based on the values of one or more columns. Can we combine SortByColumns with Concat to combine the values of the ordered columns into a string.

Let's imagine we have to sort a table of products in alphabetical order, we could later use Concat to concatenate these names into a single string. An example of possible syntax might be this:

Concat (SortByColumns (Products Table, “Product Name”, Ascending), Product Name, “,”)

Once this operation is done, we will obtain a single string containing the names of the products concatenated in alphabetical order, separated by commas.

AddColumns

The function AddColumns In Power Apps it is mainly used to add new columns to an existing table, but it can also be used to concatenate strings into a new column using the function Concat.

We might want to add a column to a table that contains the concatenation of values from two existing columns. To do this, we just need to use the Concat function in combination with Addcolumns with this syntax:

AddColumns (Table, 'New Column', Concat (Column 1, ','))

The function will create a new column in the table Tabla containing the concatenation of all the values in the column Column 1, separated by commas.

ForAll

The function ForAll is used to perform a previously set action for each item in a table. You can combine ForAll with Concat and Concatenate to iterate through a table and then concatenate the values of a column into a single string.

An example of its use could be the possibility of using ForAll in combination with Concat to concatenate the names of all the products in a table of products. The syntax of this function would look like this:

Concat (ForAll (Products Table, Product Name), Result, “, “)

After performing this operation, we will get a single string that contains all the names of the products in the table Products table, separated by commas.

Are you looking for Power Apps experts?

Dev4Side Software specializes in creating business apps with Power Apps, drastically reducing internal application development and maintenance processes.

Operating vertically across the entire Microsoft Power Platform ecosystem, we have developed extensive expertise in Power Apps, which allows us to offer custom-designed and fully integrated solutions within your Microsoft 365 tenant.

Contact us to transform business information into concrete actions.

How to use Concatenate by Power Apps in a purchasing management app

Now that we have given a more detailed overview of both functions and the ways in which they operate, let's now see how to implement them in a real development scenario in order to better understand their use and functionality in practice.

For this example, we'll use Concatenate, available in Power Apps of Microsoft Power Platform, and we're going to insert it into the environment of an app for managing purchases. Let's take a look at the necessary steps.

1. Creating the user interface

In Microsoft Power Apps, let's start creating a new app and choose the appropriate layout for our user interface.

Once inside the Power Apps Studio environment, we use the available controls to design a data entry form that includes fields for the product name, quantity, price and shipping address. In this regard, we can use text controls, text boxes or any other type of control considered appropriate for each data to be collected.

A screenshot of a computerDescription automatically generated

After designing the user interface, we create the variables necessary to store the order details entered by users. We then use the Power Apps variables panel to create the following variables:

  • Product name: A text-type variable that will store the name of the product ordered by the user.
  • quantity: A numerical variable that will store the quantity of products ordered.
  • Prix: A numerical variable that will store the unit price of the product.
  • Shipment Address/: A text-type variable that will store the shipping address provided by the user.
A screenshot of a computerDescription automatically generated

We then associate each variable with the respective user interface control, so that the data entered by the users is correctly assigned to the variables.

A screenshot of a computerDescription automatically generated

2. Implementation of the Concatenate function

After collecting the order data through the user interface and having stored them in the variables created, we can proceed with the use of the function Concatenate to combine this data into an order confirmation message.

Let's identify where we want to display the confirmation message, for example under the data entry form. Let's use a text control to display the confirmation message and configure it to show the text generated by the Concatenate function.

A screenshot of a computer

Within the text control formula, we use the Concatenate function combining the values of the variables created with the fixed text that we want to include in the confirmation message.

A screenshot of a computerDescription automatically generated

For example, we can use the following formula to create a confirmation message that includes the product name, quantity, price, and shipping address:

Concatenate (“Thanks for your order! You ordered “, Quantity,” “, ProductName,” at the price of “, Price,” each. The order will be shipped to the following address: “, Address/Shipping)

This formula concatenates static text (“Thanks for your order! You ordered “) with the values of the variables quantity, Product name, Prix and Shipment Address/.

3. Visualizing data in our Power App

Once the previous steps have been completed, it will be necessary to ensure that the confirmation message is correctly displayed to the users of the application.

In this example, we used a text control, so let's make sure it's sized appropriately to display the entire confirmation message without cutting it.

A screenshot of a computerDescription automatically generated

If, on the other hand, we have used a label, we check that it is placed visibly and legibly for users.

A screenshot of a computerDescription automatically generated

Let's verify that the text control or label is linked to the formula that we created, so that the confirmation message is displayed correctly.

Before distributing the application to end users, it is important to test the user interface to ensure that the confirmation message is displayed correctly. We then run a simulation of the application and enter some test data to verify that the confirmation message is generated correctly.

A screenshot of a computer screenDescription automatically generated

Let's make sure that all the details of the order are included in the confirmation message and that they are displayed in the desired format.

We might consider adding more details about the order, improving text formatting, or adding visual elements as we like to make the result more aesthetically pleasing.

Once these steps have been completed, we can be sure that the order confirmation message is correctly displayed and distribute our application with the confidence that it works without any type of error.

Conclusions

Finally, as we observed in the previous paragraphs, the use of the Concat and Concatenate functions in Microsoft Power Apps allows us to automate text generation, personalize interactions with customers and create personalized messages for employees and customers, saving time and drastically reducing the need for manual interventions for formatting data.

Depending on our needs, these Concatenate and Concat can also be applied to keep our code neater and cleaner and, in combination with other functions, they can allow us to use more specifically for our specific data manipulation needs.

FAQ on Concat in Power Apps

What is "Concat" in Power Apps?

Concat in Power Apps is a function used to concatenate or merge values from a table into a single string. It applies a formula to each record in a table and combines the results into a single text string.

How does Concat Power Apps differ from Concatenate?

Concat Power Apps concatenates the result of a formula applied to all records in a table, while Concatenate merges individual strings or values directly.

Can I combine Concat Power Apps with other functions?

Yes, Concat Power Apps can be combined with functions like Filter, SortByColumns, and AddColumns to manipulate data more effectively.

How can I create a dynamic URL using Concat Power Apps?

You can use the Concatenate function in Power Apps to build dynamic URLs by combining static URL parts with variable values, such as user IDs or query parameters.

How is Concat Power Apps used in business apps?

Concat Power Apps is used to automate text generation, personalize messages, and efficiently manage and display data in business apps, reducing manual intervention.

Get in touch with the team

Modern Work

The Modern Work team effectively and swiftly addresses IT needs, primarily focusing on software development. The technical staff is well-trained in implementing software projects using Microsoft technology stacks and is skilled in managing both agile and long-term projects.