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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Saving stored Table va...
Power Apps
Unanswered

Saving stored Table values from Combo Box

(0) ShareShare
ReportReport
Posted on by 33

Hi all,

My app has a combo box that allows users to select multiple selections.  I want them to be able to go back later and edit those selections, for example by adding additional selections.  When they return to edit, I want the combo box to retrieve the selections that were made previously, allowing the user to add new entries and then save both original selections and new selections.

Do any of you have ideas regarding the following?

 

Hopefully the following shows my problem:

 

The initial selection part works fine.  

Marcusm_0-1622681372894.png

I can save that record and then access it again.  I use DefaultSelectedItems to show the user what was selected/saved previously, and in fact the combo box does initially show the previously stored values:

Marcusm_1-1622681564897.png

But when I then add an additional selection, I run into problems.  I can select an additional item:

Marcusm_2-1622681778295.png

But then if I save the record, only "Product C" gets saved (along with the ";" delimiters from Products A and B).  And then when I bring up the record in the app, none of the previously selected items are visible.

Marcusm_3-1622682047232.png

When I then go check what is getting passed into DefaultSelectedItems, I see this:

Marcusm_4-1622682145539.png

So there are two primary problems here:  

1.  Previously selected items seem to get wiped out when the record is updated (even though the UI showed them as selected)

2.  The combo box doesn't seem to always reflect what is in the table

 

I did also try Filter(Table1, Services=Gallery1.Selected.Services) in DefaultSelectedItems.  That returns a "text" value with previously selected entries combined, which doesn't allow the user to remove individual selections, only the entire string value.

I also tried Split(Gallery1.Selected.Services, ";"), which does return a table, but doesn't display the selected items.

 

The Items field for the combo box is "Table6", which is the table in which Product A, B, C come from.

The combo box is inside an edit form.  The data card for the form has a Default value of "ThisItem.Services".

FYI, the backend data source is Excel.

 

I don't know if I'm using the wrong properties, or the wrong functions, or if I need some sort of workaround with Collections or something else to make this come together.

Do you have any suggestions?

Thanks so much...

 

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    Hi @Marcusm :

    Could you please show me the data structure of "Table6"?

    Could you please show me what the ServicesDataCard's Update Property?

    I assume Table6 is a table like:

    ID Value
    1 ProductA
    2 ProductB

    The Combo box's DefaultSelecteditems property should be:

    Filter(Table6,Value in Split(Gallery1.Selected.Services,";"))

    The ServicesDataCard's Update Property should be:

    Concat(TheComboBox.SelectItems,Value,";")

    Best Regards,

    Bof

     

    Best Regards,

    Bof

  • Marcusm Profile Picture
    33 on at

    Thanks so much @v-bofeng-msft !

    Your suggested code works for me and I'm super happy.  I'll mark it as the Solution.

     

    If I understand correctly, my fundamental mistake was in trying to Filter etc. directly on the Gallery that contained the customer record (which includes the product selection), as opposed to filtering on the table of all the products and then using 'in' with the Gallery to highlight the products that customer used.  

     

    One follow-up question:  I use Concat with this combo box in a Patch function that saves all the data on this screen.  Does your code for the Update property of the datacard override that, or is your Update property code simply intended to preserve the original selections as well as adding the new selections?

     

    Anyway, it seems to work great - thanks again!

     

  • v-bofeng-msft Profile Picture
    on at

    Hi @Marcusm :

    If you are using Patch function, then it is fine to not set Update Property.

    Best Regards,

    Bof

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard