cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

ComboBox selections are removed after running Patch

I am setting up an app/form where I want the app to submit multiple items in a SP list (one for each service type requested).  I am using a forms/gallery set up with repeating tables where I am using comboboxes in my gallery.  My combobox selections are patched to a collection via a save button which then also runs "Collect" to generate a new line.  The patch and collect formulas I am using looks like:

  • Patch(ScopeCollection, ThisItem, {Scope: ScopeBox.Selected.Results, Subcat: Concat(SubCatBox.SelectedItems,Subcategory&", ")})
  • Collect(ScopeCollection, {Scope: "", Subcat: ""})

The only issue I am having is that after the combobox selections are made and save button is selected to run patch and collect, my combobox selections disappear.  The form still works and my items are correctly entered into my SP list as I want after the form is submitted (using another patch function).  However, the disappearing combobox selections make for a poor user experience when moving on to enter another service type.

 

Any support would be appreciated.  For clarity, I am new to PowerApps so forgive me if I am missing something basic.  Please also let me know if more detail is needed.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: ComboBox selections are removed after running Patch

@Matt_PA_Newby ,

Yes - looking back there is a bit of confusion over drop-downs and combo boxes (they are two different types of controls entirely).

Default applies to drop-downs and DefaultSelectedItems to combo boxes.

As noted, you simply need to bind the control to the source of the gallery and as long as it is patched with the update, it will display the required value.

 

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.

View solution in original post

10 REPLIES 10
Highlighted
Super User III
Super User III

Re: ComboBox selections are removed after running Patch

Hi @Matt_PA_Newby ,

What are the Items of your Combo Box?

Highlighted
New Member

Re: ComboBox selections are removed after running Patch

Hi @WarrenBelz ,

 

I have 2 comboboxes the first of which lists process types and the second lists subcategories (filtered depending on the result of the first box).  The source for the boxes is a separate SP list with first box using "Distinct" from one column of SP list and second box showing filtered items of a second column.  In case it matters, the first box is single selection only, while the second is multiselect (issue is the same for both though).

 

Also for clarity, I am changing the displaymode of the boxes to view after the save button is selected (which is why the box border is gone).  The issue was present before I did this though so that is not the problem.

 

I tried setting the default value of the boxes to match that of the collection that I was patching the combobox selection results to but got an error.

Highlighted
Super User III
Super User III

Re: ComboBox selections are removed after running Patch

@Matt_PA_Newby ,

I thought you meant the user no longer had selections. What you mean I believe is that the value in the box disappears when code is instigated from the gallery in which they are contained? This is a well-known issue in Power Apps.

You need to add a field to your collection (if you have not done already) to "store" the value of the drop-down (you need to Patch it there) and then "bind" the drop-down (ThisItem.FieldName) Default to this field, so when the gallery and control resets, it will take the value just patched.

 

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.

Highlighted
New Member

Re: ComboBox selections are removed after running Patch

@WarrenBelz ,

 

I am already storing the result in my collection with the "Scope" field (for 1st combobox, "ScopeBox") per above formula.  I have also tried setting the Default property of the box ot ThisItem.Scope as suggested but I get an error when I do so "This formula uses scope, which is not presently supported for evaluation."

 

I believe my formula for the patch to the collection field (ScopeBox.Selected.Result) is storing it as text.  Is this perhaps the reason for error when then trying to use the field for default property?  I am not sure how to change the patch function so that it stores it differently.

Highlighted
Super User III
Super User III

Re: ComboBox selections are removed after running Patch

@Matt_PA_Newby ,

Make the Default of the drop-down

{Result:ThisItem.Scope}

or possibly

{Result:ThisItem.Scope.Value}

 

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.

Highlighted
New Member

Re: ComboBox selections are removed after running Patch

@WarrenBelz 

 

Thanks again for the help.  That did resolve the record vs text issue (although still shows "not presently supported for evaluation") but unfortunately it has not solved the problem as the box still shows blank after running Patch.  

 

I am surprised there seems to be so little info on this error out there as this would seem to be a major problem for building apps.

Highlighted
New Member

Re: ComboBox selections are removed after running Patch

Ah! Fixed it! The only difference was that I needed to implement your solution into the "DefaultSelectedItems" property rather than the normal "Default" property.

 

Thank you again @WarrenBelz for your help.

Highlighted
Super User III
Super User III

Re: ComboBox selections are removed after running Patch

@Matt_PA_Newby ,

Yes - looking back there is a bit of confusion over drop-downs and combo boxes (they are two different types of controls entirely).

Default applies to drop-downs and DefaultSelectedItems to combo boxes.

As noted, you simply need to bind the control to the source of the gallery and as long as it is patched with the update, it will display the required value.

 

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.

View solution in original post

Highlighted
Super User III
Super User III

Re: ComboBox selections are removed after running Patch

Hi @Matt_PA_Newby ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

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,433)