cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Default Selected Item for ComboBox

Hi.  I have a ComboBox with the items formula 'SortByColumns(Distinct('FPC-Purchase Orders'.School,School),"Result")'.  I've read several posts about how to ensure the selected value is the default in edit mode using DefaultSelectedItems.  So, I set the DefaultSelectedItems to Filter(Distinct('FPC-Purchase Orders'.School,School),Result) but it's not keeping the selected item selected when editing the form.  Can someone please correct my formula, please!

 

Thank you for any help you can offer.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Hi@cmegow,

Could you please try the formula I provided again?

The following is my formula that the brackets "[" "]" are necessary. The ComboBox DefaultSelectedItems property needs a Table and the brackets format it to be a Table.

So please try the "[ThisItme.School]".

Best Regards,

Qi

View solution in original post

4 REPLIES 4
Highlighted
Microsoft
Microsoft

Hi@cmegow,

Based on the issue that you mentioned, do you want the ComboBox to keep the selected item when in edit mode?

Could you please share a bit more about the scenario?

Let me make it easy for you, the DefaultSelectedItems of the ComboBox expects a Table rather than a record or a value.

I have a test on my side, please take a try as below:

Set the DefaultSelectedItems property of the ComboBox as below:

 

[ThisItem.School]

 

Best Regards,

Qi

Highlighted

@v-qiaqi-msft Thanks for the suggestion.  I tried changed the DefaultSelectedItem to ThisItem.School and this is the error that I got:

 

cmegow_0-1602985907464.png

 

I do wish to have the item that is selected upon creation of the item to be the default item in the combo box when the item is edited.  So far, I have not been able to get the selected item to show up when edited.  Other thoughts?

 

Thanks again for your help!

 

Highlighted

Hi@cmegow,

Could you please try the formula I provided again?

The following is my formula that the brackets "[" "]" are necessary. The ComboBox DefaultSelectedItems property needs a Table and the brackets format it to be a Table.

So please try the "[ThisItme.School]".

Best Regards,

Qi

View solution in original post

Highlighted

@v-qiaqi-msft Thank you.  the addition of the brackets fixed the context conflict.  Much appreciated.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,052)