Concat, Concatenate and Split function in Power Apps

1. Concat Function in Power Apps

The Concat function concatenates the result of a formula applied across all the records of a table, resulting in a single string. Use this function to summarize the strings of a table, just as the Sum function does for numbers. The string is separated by the separator.

The Concat function is used to dynamically generate an HTML table to be used in the creation of a PDF document with the help of Power Automate.

Power Apps Syntax Concat( Table, Formula [, separator])

The function has the following parameters:

Example:Step 1: In a sharepoint list, we have a column called Email, of type Single line of text.

Concat Function in Power Apps

Step 2: Add this data source in the power apps and add a Text label control in Power Apps Studio.
Step 3: Set the following formula on the Text property of a label control.

Power Apps Formula

Concat('Site Users', Email,"; ")

Evaluates the expression Email for each record of ‘Site Users’ List and concatenates the results together into a single text string separated by "; ".

Here, to refer the current record, name of the field is enough, no need to use ThisRecord.

Concat Function in Power Apps

We can use that single string that contains the values of the Email column separated by a semicolon. We can use this formula for the To: argument in the Office365.SendEmail function to send a single email to all of those addresses.

2. Split function in Power Apps

The Split function splits a text string into a table of substrings. Use the Split function to break up comma-delimited lists, dates that use a slash between date parts, to break a word into the individual characters, and in other situations where you need a well-defined delimiter.

Power Apps Syntax Split(Text, Separator)

Example:Step 1: In a sharepoint list, we have a column called Company, of type Single line of text.

Split function in Power Apps

Step 2: Add this data source in the power apps and add a Dropdown control in Power Apps Studio.
Step 3: Set the following formula on the Items property of the dropdown control.

Power Apps Formula

Split(LookUp('Site Users', Title="1").Company,",")
Split function in Power Apps

It is shown that the split function returns a table.

Split function in Power Apps

Also, in the dropdown control all values are loaded.

Split function in Power Apps

Step 4: Take another dropdown control, and set its Items property to the following Power Apps Formula.

Power Apps Formula

Split("India,America,Australia",",")

The above formula creates a single column table with three records.

Split function in Power Apps

The table is created with the column Value.

Split function in Power Apps

The values are loaded in the dropdown control.

Split function in Power Apps

Step 5: Add another dropdown control, and set its Items property to the following Power Apps Formula.

Power Apps Formula

Split("India,America,Australia","")

Note: Using a zero length or blank separator results in each character being broken out individually.

Split function in Power Apps

The values are loaded in the dropdown control.

Split function in Power Apps

3. Concatenate functions in Power Apps

The Concatenate function is used to combine a mix of individual strings and a single-column table of strings. When we use this function with individual strings, it's equivalent to using the & operator.

Fields of the record currently being processed are available within the formula. Use the ThisRecord operator or simply reference fields by name as you would any other value. The As operator can also be used to name the record being processed which can help make your formula easier to understand and make nested records accessible. For more information, see the examples below and working with record scope. Use the Split or MatchAll function to split a string into a table of substrings.

Power Apps Syntax Concatenate( String1 [, String2, ...] )

Example:Step 1: Add a Text label control and set its Text property of a Label control to the following formula.

Power Apps Formula

Concatenate("Ashish"," ","Goel")
Concatenate functions in Power Apps

Step 2: We can achieve the same functionality using the & operator instead of Concatenate function. Add another Text label and set its Text property to the following formula.

Power Apps Formula

"Ashish" & " " & "Goel"
Concatenate functions in Power Apps

Step 3: Concatenate with a single-column table

Set the following formula to the Items property of the dropdown control.

Power Apps Formula

Concatenate("Email: ", 'Site Users'.Email, ", Company: ", 'Site Users'.Company)

The above function returns a single column table, with a Value column.

Concatenate functions in Power Apps

For each record in the 'Site Users' List, concatenates the string "Email: ", the email of the 'Site Users', the string ", Company: " and the company of the 'Site Users'.

Concatenate functions in Power Apps