cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Vladope
Regular Visitor

Combo Box Data Card Does Not Show SQL Saved Results

Help please! Too long trying already!

 

I have a combo in an edit form, embedded in a datacard, for single select, and I manage to update the SQL table in the back.

 

The problem is that: once the record is updated, the entry disappears from the box, and when I reopen the form, the recorded entry does not show.

 

The VendorID is a text field.

 

 

Card: VendorID 

DataCardDefault: ThisItem.VendorID

DataCardUpdate: ComboBox4.Selected.VendorID

 

ComboBox4

ComboDefault: Parent.Default (.... this formula is not accepted and gives error)

 

What to do?

 

Thanks!

Your help highy appreciated!

 

(

Picture 1: ComboSelected- OK

Picture 2: Record in text field SQL- updated OK- Gallery shows correctly

Picture 3: Edit form is empty, immediately after submit, and empty on reopen- NOT OK)

 

Capture.JPGIn Gallery OKIn Gallery OKNot OK recorded text does not showNot OK recorded text does not show

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @Vladope ,

Do you mean that you use a combo box to update a text field , could update successfully but could only display successfully?

Could you tell me what is your combo box's Items.

Please notice that:

The combo box's DefaultSelectedItems should be a record or a table, but ThisItem.VendorID is just a text.

 

I assume that your combo box's Items is all the VendorID  value in the sql table.

If so, try to set like this:

Card: VendorID 

DataCardDefault: ThisItem.VendorID

DataCardUpdate: ComboBox4.Selected.Result

 

ComboBox4 

ComboBox4 Items: Distinct(sqltable,VendorID)

ComboBox4 DefaultSelectedItems: {Result:  Parent.Default}

 

//Parent.Default represents ThisItem.VendorID. This is just a text, not a record.

The result that Distinct function return is a table with Result column, so you need to set the combo box's DefaultSelectedItems to a record with Result column name.

You need to set the combo box's default selected items by settings its DefaultSelectedItems property.

 

 

Best regards,

 

Community Support Team _ Phoebe Liu
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

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @Vladope ,

I have had similar issues with Combo Boxes added and have a different workaround, however I will ask another question - does it really need to be a Combo Box when you have a single selection and are writing this value back. One thing you have not given is the Items property of the control.

I generally use a drop-down in these circumstances as they can have the Default set to Parent.Default

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

v-yutliu-msft
Community Support
Community Support

Hi @Vladope ,

Do you mean that you use a combo box to update a text field , could update successfully but could only display successfully?

Could you tell me what is your combo box's Items.

Please notice that:

The combo box's DefaultSelectedItems should be a record or a table, but ThisItem.VendorID is just a text.

 

I assume that your combo box's Items is all the VendorID  value in the sql table.

If so, try to set like this:

Card: VendorID 

DataCardDefault: ThisItem.VendorID

DataCardUpdate: ComboBox4.Selected.Result

 

ComboBox4 

ComboBox4 Items: Distinct(sqltable,VendorID)

ComboBox4 DefaultSelectedItems: {Result:  Parent.Default}

 

//Parent.Default represents ThisItem.VendorID. This is just a text, not a record.

The result that Distinct function return is a table with Result column, so you need to set the combo box's DefaultSelectedItems to a record with Result column name.

You need to set the combo box's default selected items by settings its DefaultSelectedItems property.

 

 

Best regards,

 

Community Support Team _ Phoebe Liu
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

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,108)