cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
NigelP
Level 8

How Do I Find Out which Item has been deleted in a ComboBox

Hi

 

I have a countries list which is the "Items" property of a combobox.

 

I select 3 countries, Barbados, Bermuda and Antigua (sorry England are in the West Indies playing Cricket). I submit my Form.  All is OK.

 

I then reload my form.

 

I then delete Bermuda from my list of Selected Contries in the ComboBox.

 

In the OnChange Event, If I look at combobox.Selected Items then I get two completely blank lines.

 

How can I find out which item was deleted from the list of selected countries. (or what are the remaining items which are still selected ?)

 

Similarily if I add a fourth country say St Lucia  combobox.SelectedItems has four entries.  Three completely blank and a fourth with St Lucia in it.  How can I find what the other 3 items are ?

 

Thanks

 

Nigel

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
NigelP
Level 8

Re: How Do I Find Out which Item has been deleted in a ComboBox

Hi @v-xida-msft

 

I have finally got it working !!

 

The clue was that Collection1 had a list of fields non of which were "Value" !

 

So a spot of judisious renaming of columns sorted it.

 

1) ClearCollect(collCountries, Countries);

2) Items property of Combobox set to RenameColumns(collCountries,"Country_x0020_Name0","Value")

3) In data table set field to display to be "Value"

 

Then it all worked.

 

Thanks for all of your help.

 

Nigel 

 

View solution in original post

7 REPLIES 7
Community Support Team
Community Support Team

Re: How Do I Find Out which Item has been deleted in a ComboBox

Hi @NigelP,

Could you please share a bit more about your issue?

Further, do you want to find out which item has been deleted from the list of selected countries within the Combo Box control?

Which column does the Combo Box connect to? A Choice type column or LookUp column in your SP list?

I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:13.JPG

Set the OnChange property of the Combo Box within the Project Type Data card to following:

ClearCollect(Collection1, DataCardValue9.SelectedItems)

Please check the attached GIF screenshot for more details:

 

If you want to find out which item has been deleted from the list of selected countries within the Combo Box control, you could consider add a Data Table control within your Edit screen, set the Items property to following:

Collection1

14.JPG

 

If the issue still exists, please consider take a try to re-create/re-generate an app based on your data source, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
NigelP
Level 8

Re: How Do I Find Out which Item has been deleted in a ComboBox

HI @v-xida-msft

Thanks for coming back to me.

 

I am actually using a Text Field . I store the selected items in a Local Variable vSelectedItems, then when the user clicks on Submit, I write the vSelectedItems out to the Text field in my list.

 

So the Onchange property looks like UpdateContext({vSelectedItems:Concat(cboCountries.SelectedItems, Country_x0020_Name & ", "));

 

Loading the ComboBox is DefaultSelectedItems = RenameColumns(split(vSelectedItems, ", "),Result, "Value")

 

Regards

 

Nigel

NigelP
Level 8

Re: How Do I Find Out which Item has been deleted in a ComboBox

Hi @v-xida-msft

 

I followed your suggestion and I got a three row blank collection.  See attachment.

 

Regards

 

Nigel

Community Support Team
Community Support Team

Re: How Do I Find Out which Item has been deleted in a ComboBox

Hi @NigelP,

Currently, I could not reproduce your issue on my side.

Please consider take a try to re-create a new app based on your SP list/other data source, then take a try with above solution I provided, check if the issue is solved.

If the issue still exists, please consider take a try to turn off/disable the "Improved app rendering (final validation)" option and "Explicit column selection" option within Advanced settings of App settings of your app, re-publish your app, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
NigelP
Level 8

Re: How Do I Find Out which Item has been deleted in a ComboBox

Hi @v-xida-msft

 

I have taken a copy of the screen and created a brand new App.

 

The OnChange property is set to ClearCollect(Collection1,cboCountries_2.SelectedItems); as you suggested.

 

I do not get a single column "Value" in Collection1 but a list of fields which is the same as my SharePoint list "Countries".

 

The collection has 3 blank rows still.  If I delete a country in the combobox, then I get two blank entries.

 

If I add a data table as you suggested with items set to Collection1.  Then when I add a country, I get the name of the country in the data table.  But I also get two blank rows.  This corresponds with what is in the collection Collection1. the new country and two blank rows.

 

I have tried the old rendering option and the new Improved Rendering Option.  Still the same.

 

The Explicit column Selection is switched off.

 

Should ComboBox "cbo_Countries_2" property DefaultSelectedItems contain the name of the countries selected in the Combo Box ?  At the moment for existing selected countries I get a blank row.

 

Thanks

 

Nigel

NigelP
Level 8

Re: How Do I Find Out which Item has been deleted in a ComboBox

Hi @v-xida-msft

 

I have finally got it working !!

 

The clue was that Collection1 had a list of fields non of which were "Value" !

 

So a spot of judisious renaming of columns sorted it.

 

1) ClearCollect(collCountries, Countries);

2) Items property of Combobox set to RenameColumns(collCountries,"Country_x0020_Name0","Value")

3) In data table set field to display to be "Value"

 

Then it all worked.

 

Thanks for all of your help.

 

Nigel 

 

View solution in original post

Community Support Team
Community Support Team

Re: How Do I Find Out which Item has been deleted in a ComboBox

Hi @NigelP,

Have you solved your problem?

If you have solved your problem, please go ahead to click "Accept as Solution" to identify this issue has been solved for other users in this forum.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (7,937)