String concatenation function in PowerApps - Power Platform

String concatenation function in PowerApps: best way to work with – Microsoft 365

2 comments

Loading

In this article, we will learn about the string concatenation function in PowerApps. PowerApps, like other programming languages, has a string concatenation function. It is similar to the Excel formula; if you are good with Excel formulas, the PowerApps function will be easier to handle.

What you will learn from this tutorial (string concatenation function in PowerApps)?

  • What is the string Concatenate function in PowerApps?
  • Design the Canvas app for full name calculation based on the first name and last name – Demo
  • Concat and Concatenate function in PowerApps
  • When to use Concat() function in PowerApps
  • What difference between Concat and Concatenate functions in PowerApps?
  • How to reset the control in PowerApps?

What is the string Concatenate function in PowerApps?

In simple, the string concatenate function is used to join two or more strings.

In this demo, we will just add two text inputs control first name and last name, and the full name will be auto-calculated in the read-only label control.

Now, let’s get started with the creation of a canvas app for the string concatenation function demo in PowerApps.

We assume you know how to create a canvas app in PowerApps (in case you don’t know please refer to this article – 3 ways to create Power Apps – Types of Power Apps).

Name the canvas app appropriately, then click on the “Create” button.

Create Canvas App for string concatenation function in PowerApps
Create Canvas App for string concatenation function in PowerApps

Design the Canvas app for full name calculation based on the first name and last name

Add the First Name label and input text.

Add the Last Name label and input text.

Add the Full Name label.

String concatenation function in PowerApps - First Name, Last Name and Full Name
String concatenation function in PowerApps – First Name, Last Name, and Full Name

In this demo, we will show how to calculate full names based on the first name and last input.

Now put the cursor on the full name label (lblFullName), and select the “Text” function, in the function selection dropdown list, or you can update the “lblFullName” “Text” property from the advanced tab configuration where we need to add the below formula:

Concatenate(txtFirstName.Text," ", txtLastName.Text)

Notes:

  • Concatenate function takes multiple text parameters and displays the sum of those texts.
  • In the above example, we have added First Name and Last Name, and in-between space.

And now run the app in preview mode or publish the app.

If you have published the app, open the published app link, wherein if we pass the First Name and Last Name as parameters, the full name will be calculated automatically, please see the below example – where we have added “First Name” as “Global” and “Last Name” as “SharePoint Diary” and finally, in the “lblFullName” we could see the result as “Global SharePoint Diary”.

String concatenation function in PowerApps - Demo
String concatenation function in PowerApps – Demo

The string concatenation formula is in excel and PowerApps is the same.

Concat and Concatenate function in PowerApps

In the previous demo, we have seen what is Concatenate() function in PowerApps is or what we can achieve using it. As we know apart from Concatenate() function we have a similar type of function namely the Concat() function, the main job of these types of functions are to join two string, however, the use of the Concat() function has a different purpose.

When to use Concat() function in PowerApps?

When we plan to store data from the table or collection into a single column in SharePoint or SQL Database, then we use the Concat() function. For example – let’s say you have a gallery or data table control in PowerApps which is bound to a collection and for these collections you want to concatenate, then use the Concat() function.

Difference between Concat and concatenate in PowerApps

As we have learned in the previous section, the concat function is used to add two or more collection items or data and put them into a single text column.

The concatenate function, on the other hand, is used to combine two or more text-type data and place them in a similar text-type data.

The only difference between these two is the source data type you are handling during your app development. If you are dealing just with the text data type and you concatenate multiple similar text data types, then use the Concat function. Similarly, if you want to concatenate multiple collection types and want to store a single column with the type of (textbox), then use the Concat function.

Syntax of Concat and Concatenate function

Concat( Table, Formula )

Table - Required. Table to operate on.
Formula - Required. Formula to apply across the records of the table.
Concatenate( String1 [, String2, ...] )

String(s) - Required. Mix of individual strings or a single-column table of strings.

How to reset the control in PowerApps?

It is very important to know how to reset the control or clear the data entry in PowerApps on page load.

The reset property is one of the properties of the control. In this section, we will learn how to reset or clear the data entry using the reset property.

Select your control from the design pane; here, for example, we have selected the first name textbox control.

Go to the “Advanced” tab from the right-side panel. There we will find the “Reset” Boolean property; by default, this will be false; make it true as shown below:

How to reset the control in PowerApps?
How to reset the control in PowerApps?

Summary: What do we have here (string concatenation function in PowerApps)?

Thus, in this article, we have learned the below with respect to the string concatenation function in PowerApps:

  • What is the string Concatenate function in PowerApps?
  • Design the Canvas app for full name calculation based on the first name and last name – Demo
  • Concat and Concatenate function in PowerApps
  • When to use Concat() function in PowerApps
  • What difference between Concat and Concatenate functions in PowerApps?
  • How to reset the control in PowerApps?

See Also: PowerApps Tutorial

You may also like the below PowerApps articles:

Buy the premium version of SharePoint Online & Office 365 administration eBook from here:


Buy SharePoint Online & Office 365 Administration eBook

About Post Author

2 comments on “String concatenation function in PowerApps: best way to work with – Microsoft 365”

Do you have a better solution or question on this topic? Please leave a comment