How to Concatenate Columns in Power Apps Combo Box?

A few weeks ago, I created a Power Apps form for event registrations that allows users to register for available events. I was required to concatenate the event title and date in a Power Apps combo box to select events in the form.

This lets users see two field details quickly within this single combo box control.

In this article, I will explain how to concatenate columns in Power Apps combo box using a collection and a SharePoint list.

Quick answer: Set the combo box Items property to AddColumns(Source, NewColumn, Title & " - " & Text(Date, "dd mmm yyyy")), then choose NewColumn as the primary text under Fields and add it to SearchFields so users can search it. Each row keeps its original columns, so you can still read values like ComboBox1.Selected.ID.

Concatenate Columns in Power Apps Combo Box

I will explain how to concatenate SharePoint list columns into Power Apps combo box control here.

I have a SharePoint list named Events Complete Details. Now, we will concatenate the Title and Event Date columns into the Power Apps combo box control.

how to concatenate sharepoint list columns into power apps combo box control

Look at the example below: the Power Apps combo box contains the combination of Title and Event Date columns.

concatenate sharepoint list columns into power apps combo box

To achieve this, follow the steps below!

1. Connect the SharePoint list with Power Apps from the Data section. Then, add a combo box control from the +Insert tab.

power apps concat columns into combobox

2. To concatenate the SharePoint list columns, provide the formula below in the Items property of the Power Apps combo box control.

SortByColumns(AddColumns('Events Complete Details', EventDetails, Title & " - " & Text('Event Date', "dd mmm yyyy")), EventDetails, SortOrder.Ascending)

Two small things in this formula: current versions of Power Apps write column names in AddColumns and SortByColumns without quotes, and Text() formats the date so it reads well. Without Text(), the date appears in the app’s default format, as in the screenshots below.

Here, EventDetails stores the Title and Event Date column values in the Power Apps combo box control.

concatenate columns in power apps combo box

3. To insert the concatenated column values into the Power Apps combo box control. Open the combo box’s Properties->Click Fields-> select Layout, and Select EventDetails for the Primary text.

power apps combo box concatenate display fields

Now, save the changes and preview the app once. The title and event date values are combined in the Power Apps combo box control.

Concatenate Collection Columns into Power Apps Combo Box

Let’s see how to concatenate Power Apps collection columns into combo box control. Refer to the example below; the combo box contains the combination of three columns.

concatenate columns into power apps combo box

Look at the Power Apps collection with the columns once.

concate sharepoint columns in power apps combo box

Follow the steps below to concatenate collection columns into the Power Apps combo box.

1. To create a Power Apps collection, provide the below formula in the OnStart property of the App object.

ClearCollect(
    colEmployeeDetails,
    {
        FirstName: "Patti",
        LastName: "Fernanz",
        Department: "Information Technology"
    },
    {
        FirstName: "Lidia",
        LastName: "Holloway",
        Department: "Human Resource"
    },
    {
        FirstName: "Johana",
        LastName: "Lorenz",
        Department: "Marketing"
    },
    {
        FirstName: "John",
        LastName: "Fernanz",
        Department: "Information Technology"
    },
    {
        FirstName: "Grady",
        LastName: "Archey",
        Department: "Sales"
    },
    {
        FirstName: "Henrita",
        LastName: "Mrunal",
        Department: "Human Resources"
    },
    {
        FirstName: "Micheal",
        LastName: "lorenz",
        Department: "Marketing"
    },
    {
        FirstName: "John",
        LastName: "Lorem",
        Department: "Research"
    }
)
power apps concatenate columns into combobox

2. Add a combo box control and provide the below formula in its Items property.

Sort(AddColumns(colEmployeeDetails,EmpDetails,Concatenate(FirstName," ",LastName ,"-",Department)),EmpDetails)

EmpDetails will store the combination of first and last names and department details.

This formula will combine the Power Apps collection columns into a combo box control.

concatenate three columns into power apps combo box

3. To fetch the values, open the combo box Properties -> Click Fields -> Select Layout -> Single -> Select EmpDetails for Primary text.

how to concatenate two columns in power apps combo box

Now, save the changes and preview the app once. The combination of collection column values will appear in the Power Apps combo box control.

Search the Combined Text in the Combo Box

The combo box only searches the columns listed in its SearchFields property. Add the new column so that typing part of an event name or a date finds the right item, and make sure IsSearchable is set to true:

["EventDetails"]

Use the Selected Item in a Form or Patch

AddColumns only adds a column for display. Every row still has its original columns, so you can read cmbEvents.Selected.ID or cmbEvents.Selected.Title and save the choice, for example with Patch:

Patch(Registrations, Defaults(Registrations), {Title: txtName.Text, EventID: cmbEvents.Selected.ID})

Delegation: Lists With More Than 500 Items

AddColumns and sorting on an added column are not delegated to SharePoint, so Power Apps works only with the first 500 items (up to 2,000 if you raise the data row limit in the app settings). For larger lists, filter first with a condition SharePoint can handle, then add the column:

AddColumns(Filter('Events Complete Details', 'Event Date' >= Today()), EventDetails, Title & " - " & Text('Event Date', "dd mmm yyyy"))

Concatenate Combo Box Selected Items in Power Apps

We have seen columns concatenated into the Power Apps combo box control. Let’s see how to concatenate the selected items in the combo box.

The example below shows that the selected combo box items are concatenated.

how to concatenate the combo box selected items in power apps

I have a SharePoint list named Expense Reports Form for the above Power Apps form. This list includes the following fields.

Column NameData Type
Employee IDTitle(Single line of text)
DateDate and time
Expense AmountNumber
Expense CategoryChoice
Email AddressSingle line of text
DescriptionMultiple lines of text
To achieve this, follow the steps below!

1. In Power Apps, add Edit Form control. Then, connect with the SharePoint list.

concatenate power apps combo box selected items
Note: Allow multiple selection for combo box control [Expense category] in the Power Apps form.

2. Add a Text label control from the +Insert tab. Provide the formula below for the Text property of the text label.

Concat(DataCardValue4.SelectedItems,Value,",")

The Concat() function will concatenate the selected items in the combo box with a comma separator.

concatenate the combo box selected items in power apps

3. Save the changes and preview the app once. The selected items are concatenated and displayed on the text label.

Frequently Asked Questions

Can I show two columns in a combo box without AddColumns?

Yes. In the classic combo box, open Fields, set the Layout to Double and pick a Primary and a Secondary text. The two values then show on two lines. Use AddColumns when you want them on one line or mixed with other text.

Why does my combined date show a time or a strange format?

The date is converted to text using the default format. Wrap it in Text(), for example Text('Event Date', "dd mmm yyyy"), to control how it looks.

How do I join fields outside a combo box?

Use the & operator, Concatenate() or string interpolation in a label or text input. See Power Apps concatenate two fields for all four methods.

This way, we can concatenate the SharePoint list and collection columns into the Power Apps combo box control.

I hope you understand how to concatenate SharePoint list and collection columns into Power Apps combo box control. You can follow this article while trying to concatenate columns into the Power Apps combo box control.

Also, you may like: