cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate V
Advocate V

ComboBox Default Value Error for CDS Option Set

Hello

I have a CDS Entity (People) which has a couple of fields. One among them (RelationshipToChild) points to a CDS Option Set.

In the Canvas App I have an Edit Form pointing to the People Entity and a ComboBox in the Form pointing to the RelationshipToChild Option Set.

When I manually select an item in the ComboBox and then remove it, the ComboBox SelectedItems has ZERO items as expected.

But when the Form is initially loaded, even if the RelationshipToChild field has no data, the ComboBox SelectedItems property still returns ONE item with BLANK value. This seems to be a bug.

Why is this strange behaviour? Any help would be much appreciated.

 

2 REPLIES 2
Highlighted
Microsoft
Microsoft

Re: ComboBox Default Value Error for CDS Option Set

Hi @CNT ,

 

Do you mean when no item selected in a Combo Box the ComboBox.SelectedItems returns a record which is Blank?

Yes it is. And this is the default setting. Unlike the Dropdown Box, Combo Box by default contains an empty record. So when the form loaded, if the Option Set set to "No default value", while the Entity field is empty and without a DefaultSelectedItem, the Combo Box "looks" like empty too. 

30.jpg

To bypass it, if you want to use a condition that Combo Box not selected, the Blank() function would be a chiose:

31.jpg

 

Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution  to help the other members find it more.
Highlighted
Advocate V
Advocate V

Re: ComboBox Default Value Error for CDS Option Set

Hi @v-jefferni Thanks for the info. I would call it a bug rather than a default setting. Why on earth should it return a blank record when there is nothing to return? Furthermore, if you select something in the ComboBox you have 1 record (why not 2?). If you unselect what you have selected, you have 0 records (why not 1 blank record?). This inconsistent behaviour is so painful and it is nowhere documented either. hO! microsoft!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,996)