String concatenation function in PowerApps - Power Platform

String concatenation function in PowerApps

One comment

 14,609 total views,  34 views today

In this article, we will learn about the string concatenation function in PowerApps. Like other languages, PowerApps does provide the 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?

  • 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
  • Difference between Concat and Concatenate function 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 as first name and last name, and 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 or what we can achieve using it. As we know apart from Concatenate() function we have a similar type of function namely Concat() function, the main job of these types of functions are to join two string, however, the use of 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 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.

On the other hand, the concatenate function is used to add the two or more text type data and put them into 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 datatype and you concatenate multiple similar text datatype then use the Concat function – similarly, if you want to concatenate multiple collection types data 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 essential to know how to reset the control or clear the data entry in PowerApps on page load.

The reset 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 to true as shown below:

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

Summary: What we had here?

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
  • Difference between Concat and Concatenate function in PowerApps?
  • How to reset the control in PowerApps?

See Also

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

1 comments on “String concatenation function in PowerApps”