Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Populate a Combobox Based on a SharePoint List Text Column

(1) ShareShare
ReportReport
Posted on by 359
Hello,
 
I am working on improving an existing Power App that someone else made and I'm running into an issue with something I am trying to do.
 
Within the existing Power App is a Combobox of options. When an option is selected, it populates a Text datacardvalue with the selection and adds a comma at the end. Here is the Default field of the text DataCardValue:
 
Concat(vComboLLC.SelectedItems, Value & ", ")
 
The Items property of the Combobox is all manually typed values, like ["Value1", "Value2", "Value3"]
 
Supposedly the original creator had a very specific reason for setting the Power App up this way and I am not to change the field to a Choice column in SharePoint.
It will apparently break a lot of other things.
 
 
 
What I am working on is having this field (and all others within the Power App) to have a Default field where they pull in data submitted to SharePoint,
and any OnChanges patch the SharePoint list.
 
I have the patch working by giving the Combobox the OnChange value of:
 
Patch(List1,
    LookUp(Filter(List1,'Email1'=User().Email),'Email1'=User().Email),
    {
        'TextColumn1':DataCardValue25.Text
    }
    )
 
 
My question is: How do I get the Combobox to have a Default value that pulls in and selects the fields that are in the Text column within SharePoint?
I'm assuming I'll have to cut off that comma that gets added, but I'm not sure how to make the choices be selected in the Combobox. Is it even possible?
  • Verified answer
    WarrenBelz Profile Picture
    146,695 Most Valuable Professional on at
    Populate a Combobox Based on a SharePoint List Text Column
    I will provide a human-generated response - there are a couple of things that may affect the result. Firstly you can get rid of the trailing comma on the Default of the Text Input with (note comma instead of &)
    Concat(
       vComboLLC.SelectedItems, 
       Value,
       ", "
    )
    Also you do not need both Lookup and Filter on the Patch
    Patch(
       List1,
       LookUp(
          List1,
          'Email1' = User().Email
       ),
       {'TextColumn1': DataCardValue25.Text}
    )
    Now to the DefaultSelectedItems (not the Default) of the Combo Box
    Split(
        LookUp(
          List1,
          'Email1' = User().Email
       ).TextColumn1,
       ", "
    )
    All of this works perfectly on a model I created below
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • Thor_PPC Profile Picture
    359 on at
    Populate a Combobox Based on a SharePoint List Text Column
    Hello @SaiRT14,
     
    Unfortunately Setting the Default Value of the ComboBox Based on SharePoint Data that you shared doesn't seem to work. As soon as the code is input, it clears out anything that is currently selected by the user.
  • Suggested answer
    SaiRT14 Profile Picture
    1,966 Super User 2025 Season 1 on at
    Populate a Combobox Based on a SharePoint List Text Column
    1. Setting the Default Value of the ComboBox Based on SharePoint Data
    set the DefaultSelectedItems property of the ComboBox (vComboLLC in your case) to match the data stored in the SharePoint list.
    Split(LookUp(List1, 'Email1' = User().Email).TextColumn1, ", ")
     
    2. Updating the ComboBox Selections to SharePoint:
    modify the OnChange property to update the SharePoint field:
    Patch(List1,
        LookUp(Filter(List1, 'Email1' = User().Email), 'Email1' = User().Email),
        {
            'TextColumn1': Concat(vComboLLC.SelectedItems, Value & ", ")
        }
    )
     
    3. Removing the Trailing Comma (Optional):
     
    Patch(List1,
        LookUp(Filter(List1, 'Email1' = User().Email), 'Email1' = User().Email),
        {
            'TextColumn1': Left(Concat(vComboLLC.SelectedItems, Value & ", "), Len(Concat(vComboLLC.SelectedItems, Value & ", ")) - 2)
        }
    )
     
    Try and let me know.
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,695 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard