September 24, 2021

It’s funny that there are two functions to perform concatenation of “stuff.” Some people get confused when thinking about using one or the other, but they serve different purposes. The “Concatenate Function” is used to aggregate a bunch of strings into only one. It’s super handy. The “Concat” function is used to do the same but with tables. You define a table, a formula, and “Concat” will return a string with the values formatted in a single string. Not as used as the previous one but equally powerful.

Usage

It follows a simple pattern.

  1. Table
  2. Formula

Example:

Table:
"Name:Manuel, type:First Name"
"Name:Teixeira, type:Middle Name"
"Name:Gomes, type: Last Name"

Concat(Table, Name & ',')

will return 

'Manuel Teixeira Gomes'

One may think that this is not very useful, but think about your data structures that have multiple information and how it could be useful to prepare the data to use in:

  1. User facing elements. For example, in Azure’s AD, the person’s name is split into multiple fields. You can generate a string with them to use in a label in your app, for example.
  2. If you want to show more information to your user, for example, their permissions, you can use this function to generate a string with all the permissions’ descriptions so that the user knows what they can do. Or provide this to an administrator that can then pick from a list of additional permissions.

Limitations

  1. Keep in mind that you may get delegable warnings when using this function. Please check my reference to see if the formula that you’re using is blocking the delegation.

Recommendations:

  1. Use this function to transform data but keep the source data intact. Don’t use parsed information in your data source; otherwise, you’ll lose flexibility in displaying the information later.
  2. Keep the formula as simple as possible, especially the second parameter, to define what you want to do to the data.
  3. Don’t nest it. It’s quite easy to find cases to nest “concat functions” but avoid it. Split into multiple steps so that you can easily debug them later. The more complex the function, the more difficult it will be to keep things working without bugs.

Localization

  1. Please note that formulas may have localization-based differences. For example, you should write “aaa” with “separating each of the arguments, but if your regional settings are set to Portugal, you should use “;” instead.

Sources:

 Concat function in PowerApps 

Back to the Power Apps Function Reference

Photo by Ridham Nagralawala on Unsplash

Manuel Gomes

I'm a Project Manager with experience in large projects and companies. I've worked in the past for companies like Bayer, Sybase (now SAP) and I'm currently working for Pestana Hotel Group.

View all posts by Manuel Gomes →

2 thoughts on “Power Apps: Concat Function

  1. Hey Manuel,

    Thanks for the article. I have a quick question. How would you use the Concat function to transform data, live a value (from a choice column) to text?

    Thanks!
    Randall

    1. Hey Randall,
      For that you need to use the concatenate function. The concat is used especially for tables.
      The concatenate is awesome because you can combine more or less all components that return a string. For your example, to get the selected value and concatenate it with a text input for example you can do:

      Concatenate(testChoice.SelectedText.Value,testText.Text)

      Is this what you’re looking for?
      Cheers
      Manuel

Leave a Reply

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

%d bloggers like this: