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

ComboBox text doesn't use after update

I All, I'm using combobox for first time in my powerapp application! I use a ComboBox called cmbSuppliers, into a DataCard, linked to a sharepoint list called "Suppliers". In that list there is a unique field called SupplierName. Using the App, the value selected on this Combobox is stored into another sharepoint list called "MainTable".  If I create a record in MainTable for the first time using submitform, the value selected in ComboBox (cmbSuppliers.Selected.SupplierName) is successfully strored into related field but, when I recall the record from the "Maintable" list, I see the text in my Combobox but I cannot use it because the value of "cmbSuppliers.selected.SupplierName" is empty. If I try to select another supplier from the combobox, the value of "cmbSuppliers.selected.supplierName" successfully change. Where am I doing wrong?? 

Mostra meno

1 ACCEPTED SOLUTION

Accepted Solutions
Delid4ve
Impactful Individual
Impactful Individual

you want an easier way to do this...

 

change to a dropdown.

Add a text input control above it.

Set the dropdown items property to (change the textinputname to the name of the textbox in your app:

If(IsBlank(TextInputName.Text) Or TextInputName.Text = "",Suppliers,Filter(Suppliers,TextInputName.Text in SupplierName))

 Set the Default property of the dropdown to (assuming this in in a form and the form is MainTable):

ThisItem.SupplierName

  

View solution in original post

8 REPLIES 8
Delid4ve
Impactful Individual
Impactful Individual

How is the field being stored in the main table? (What type of column)

Have you set the defaultselecteditems in the combobox properties?

after patching you will also need to reset the combobox - ie set the reset property as a variable then after your patch do:

Set(Variablename,true);Set(Variablename,false)

 

Hi, thanks for the response.

The field in MainTable is a single Text Field, length 255 char. 

I don't set DefaultSelectedItems! What value I must to fill in? 

In reset property of Combobox I have "false" value, which variable I must to set in this property? 

Delid4ve
Impactful Individual
Impactful Individual

If you are only storing 1 value then use a dropdown instead of a combo.

otherwise i'm assuming your storing as comma separated values?

 

you can choose any variable name you like, if you change the data then the combobox needs to be reset in order to update it with the changed values, so we set reset true, reset false to do this.

 

have a read of this thread:

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Combo-box-in-edit-forms/m-p/165630#...

and this:

https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/

 

 

 

 

I'm using ComboBox because in that list there are more than 70 supplier names and in this way, the user can search the correct supplier to retrive which his want easily. My problem is not to Update the maintable with selected Supplier Name but how can do to refer to the value in Combobox to check if the field is blank.

I don't understand how can use reset property

Think to have resolved my problem. I can check if the field is Blank using:

If(isBlank(cmbSupplier.Selected);"Error";"OK") 

 

It seems that run successfully.

Thanks for the support

Regards

Davide 

Hi @TheGallons ,

I'm very glad that you've solved your problem!

Do you have any other problems?

If you do not have any other problems, could you change your issue's status to "Answered"?

Thanks!

 

 

 

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.

I thought I had solved the problem and instead I was wrong. 

When I recall the record, I don't know how can I do to retrieve the value stored in ComboBox

 

Please see the example in attached image.

I use  cmbSupplier.Selected  in a Label Text to see the value selected in ComboBox  but seems that it doesn't work.

I also used cmbSupplier.SelectedItems.Supplier whit the same wrong result. 

 

Any suggestion will be appreciated 

Delid4ve
Impactful Individual
Impactful Individual

you want an easier way to do this...

 

change to a dropdown.

Add a text input control above it.

Set the dropdown items property to (change the textinputname to the name of the textbox in your app:

If(IsBlank(TextInputName.Text) Or TextInputName.Text = "",Suppliers,Filter(Suppliers,TextInputName.Text in SupplierName))

 Set the Default property of the dropdown to (assuming this in in a form and the form is MainTable):

ThisItem.SupplierName

  

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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