How to Concatenate Power Apps Combo Box Value With a Custom Value?

We built a Power Apps form from the SharePoint list a few days back. This list contains a choice field that allows multiple selections, and now, in the Power Apps form, we’re required to update choice field values along with the custom value that we entered in the Datacard to the SharePoint list choice field.

In this article, I will explain how to concatenate Power Apps Combo box value with a custom value with a simple scenario.

Concatenate Power Apps Combo Box Value With a Custom Value

Look at the example below. When submitting the Expense Report Form in the Power Apps application, I selected two items from the combo box and then searched for one item after clicking the submit button. You can see the choice values and the search term are stored in the SharePoint list.

powerapps concat combobox selecteditems with custom values

Here is the SharePoint list, i.e., Expense Report Form that stores employee expense reports and has a choice field [Expense Category] that allows multiple selections.

powerapps combobox selecteditems to text

To achieve this, follow the below steps!

1. Add the SharePoint list to the Power Apps application and add Edit form control. Then, provide the SharePoint list name below on its DataSource property.

'Expense Report Form'
powerapps add custom value to dropdown

2. Provide this code on the Update property of the choice field (Expense Category)’s data card.

{
    Value: If(
        IsEmpty(DCV_ExpenseCategory.SelectedItems),
        DCV_ExpenseCategory.SearchText,
        Concat(
            DCV_ExpenseCategory.SelectedItems,
            Value,
            ","
        ) & If(
            !IsBlank(DCV_ExpenseCategory.SearchText),
            "," & DCV_ExpenseCategory.SearchText
        )
    )
}

To store combo box values in the SharePoint list choice field, we need to use {Value: } format.

  • IsEmpty(): Functions return a boolean value false if the user hasn’t selected any item from the DCV_ExpenseCategory combo box.
  • If it is empty, then DCV_ExpenseCategory.SearchText value will be stored to the SharePoint list choice field.
  • If it is not empty, the Concat() functions combine the selected item and search text with the comma separator.
powerapps concatenate custom value and choice value to dropdown

3. To submit the data to the SharePoint list, add a button control and provide the below code in its OnSelect property.

SubmitForm(Frm_Expense)

SubmitForm() function submits the Power Apps form data to the SharePoint list. Frm_Expense is the form name.

powerapps concat combobox selecteditems and custom values to sharepoint list choice field

4. Now save the changes and preview the app; try to select the Items in the choice field data card and search for an item, then save the changes by clicking the save button. Like in the image below, the values will be stored in the SharePoint list.

power apps combo box selected items and search text with custom values

5. If you are taking a text input control for custom values within that choice field data card, change the code below in the Update property of the data card.

{
    Value: If(
        IsEmpty(DCV_ExpenseCategory.SelectedItems),
        txt_ExpenseCategory.Text,
        Concat(
            DCV_ExpenseCategory.SelectedItems,
            Value,
            ","
        ) & If(
            !IsBlank(txt_ExpenseCategory.Text),
            "," & txt_ExpenseCategory.Text
        )
    )
}

This code checks whether the combo box values selected values are empty or not; if yes, it stores the text put control txt_ExpenseCategory value to the SharePoint list choice field.
if not it combines the combo box selected items and text input text.

powerapps concatenate combobox custom values and choice values from sharepoint list

Save changes and preview the app. Now, try to provide custom values on text input control and select choice values from the DataCardValue. Then, submit the data to the SharePoint list, and you’ll see both data stored in the SharePoint list choice file, as shown below.

power apps concatenate combo box values with text values

I hope you understand how to store both custom and choice values from the Power Apps form to the SharePoint list choice field. Follow this article if you’re trying to save custom values along with choice values to the SharePoint list choice field.

Also, you may like:

>
Power Platform Tutorial

FREE Power Platform Tutorial PDF

Download 120 Page FREE PDF on Microsoft Power Platform Tutorial. Learn Now…