cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NFMynster
Frequent Visitor

ComboBox default selected items from a collection doesn't work

Hello everyone.

I'm having troubles loading defaults into a combobox, from a collection.

I have a ComboBox that's defined like this:

The SelectedItems is a collection that's collected by calling

 

ClearCollect(SelectedItems,ComboBox1.SelectedItems);SaveData(SelectedItems, "SavedSelectedItems");

So it's expected that when the SelectedItems collection isn't empty, it will have those entries selected as default.

 

However, this is only partly working.

 

The preview of the ComboBox looks fine, like this:

However, when you press it, the items aren't actually selected.

What am I doing wrong?
I uploaded a simple reproduction project and attached to this topic, if you want to try it out and see what I mean.

 

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: ComboBox default selected items from a collection doesn't work

Hi @NFMynster ,

Could you please share a bit more about your SelectedItems collection?

 

I have made a test on my side, and found that there is something issue with the value you typed within the DefaultSelectedItems property of the ComboBox.

Please take a try with the following workaround for more details:4.JPG

 

5.JPG

Set the DefaultSelectedItems property of the ComboBox to following:

ForAll(
       SelectedItems,
       {
           Value: Value
       }
)

On your side, please consider take a try to set the DefaultSelectedItems property of your ComboBox to following:

ForAll(
       SelectedItems,
       {
           Value: Value
       }
)

then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Community Support
Community Support

Re: ComboBox default selected items from a collection doesn't work

Hi @NFMynster ,

Based on the issue that you mentioned, I think you have some misunderstanding with the DefaultSelectedItems property of the ComboBox control.

 

The DefaultSelectedItems property of the ComboBox control is used to set a Default value within the ComboBox control. But the Default value just be displayed within the ComBoBox, rather than select corresponding values from the ComboBox available options and display it.

 

In other words, the Default value just be used as a Display value within the ComboBox, which would not be recognized that you selected corresponding values from the ComboBox available options.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
NFMynster
Frequent Visitor

Re: ComboBox default selected items from a collection doesn't work

Thank you.

So just to clarify is it not possible having a ComboBox that has some items selected by default?

 

 

 

Community Support
Community Support

Re: ComboBox default selected items from a collection doesn't work

Hi @NFMynster ,

Could you please share a bit more about your SelectedItems collection?

 

I have made a test on my side, and found that there is something issue with the value you typed within the DefaultSelectedItems property of the ComboBox.

Please take a try with the following workaround for more details:4.JPG

 

5.JPG

Set the DefaultSelectedItems property of the ComboBox to following:

ForAll(
       SelectedItems,
       {
           Value: Value
       }
)

On your side, please consider take a try to set the DefaultSelectedItems property of your ComboBox to following:

ForAll(
       SelectedItems,
       {
           Value: Value
       }
)

then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

infoman
Regular Visitor

Re: ComboBox default selected items from a collection doesn't work

In your DefaultSelectedItems field place an array value. i.e. Use brackets notation [fieldname]

e.g. For a collection field called 'amount' just put [amount] in the default selected field.

sasigouru
Frequent Visitor

Re: ComboBox default selected items from a collection doesn't work

@infoman Hi,

 

Can you elaborate please? I've a collection which is storing the selected items from a combobox control. That is fine. However, when i'm trying to default the selected items, it's throwing an error. I tried wrapping the column name from the collection in square brackets. But it didn't work.

 

Much appreciated if you can share more details.

 

Thanks,

Sasi.

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (7,907)