web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Populating previously ...
Power Apps
Unanswered

Populating previously selected options in a combo box

(0) ShareShare
ReportReport
Posted on by 57

Hello

 

We're storing selected options from the combo box into a SharePoint list. When the user goes back in to their form we need those options to show within the combo box. Is that possible yet?

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @StuPower 

    Yes, this is all possible with the DefaultSelectedItems property of the ComboBox.  

    However, if you are using this in an EditForm, then the datacard will provide this functionality for you without having to change anything.

    If you are using the ComboBox outside of an edit form, then you will need to supply the logic to the DefaultSelectedItems property of the control.

     

    If you still have questions, please provide some more specific examples, screenshots or formulas that might be helpful in deducing your problem.

     

    I hope this is helpful for you.

  • StuPower Profile Picture
    57 on at

    @RandyHayes 

     

    Thanks

     

    So ive had a play and i can see ComboBoxes arent as easy as normal field with regards to patching

     

    i.e this won't work -

    Patch('Objective Setting_1',Defaults('Objective Setting_1'),{Links to strategy:ComboBox.SelectedItems}

    Ive found posts which use something like this

    {'Links to strategy':ForAll(ComboBox.SelectedItems,{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Value:Value})}

    But this code dosen't work either.

     

    So to over come this ive used concat and placed the values into a label and then patched the labels value into SharePoint. This part is fine for what i need.

     

    But i now can't prepopulate those values back into the combobox using "defaultselecteditems" when i select my record from a gallery as from my understanding its needs a Value and a ID?

    DefaultSelectedItems: ObjectiveRecord.'Links to strategy'

     

    Any help is greatly appreciated as documentation on this field seems very scarce

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @StuPower 

    Actually, you might be overcomplicating things for yourself a bit.  

    The first formula actually does work and works fine.

    Patch('Objective Setting_1',Defaults('Objective Setting_1'),{Links to strategy:ComboBox.SelectedItems}

    So, if that is not working for you, then I'd suggest getting to the root cause of that problem rather than create another method to work around it.  That will just bring you more grief. 

     

    If the above is not working, then there are at least two things to look at first:

    1) The definition of your column.  This is most important.  Are we looking at a Choice column (I assume) and what kind of parameters are set for it?  Does it allow multi-select?  Does it allow add-in choices?  (Are you trying to add in choices? ) Does it have any other conditions to it?

    2) The Items of your ComboBox - they should be a table of Value records...that is all you need for the above to work. Best choice is the Choices function as it was designed to give you the viable choices for a column  If you are doing anything different (such as Distinct or filter or other) you will need to pre-shape the items data into a table of Value records.

     

    Based on those two observations, you should be able to get to the root cause of why your patch statement doesn't work.

    BUT...the point being - that patch statement should work fine if the proper conditions are set up for it.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @StuPower can you review the above reply and update the thread if it was helpful? 

     

    Thank you,

     

    @Anonymous 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 883

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 477

Last 30 days Overall leaderboard